mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-15 13:33:36 +02:00
Merge pull request #3201 from Alexander-Wilms/fix-huge-texture-crash
Fix broken intro and crash when resizing window
This commit is contained in:
commit
c068c92c92
@ -145,7 +145,7 @@ void InputHandler::preprocessEvent(const SDL_Event & ev)
|
||||
Settings full = settings.write["video"]["fullscreen"];
|
||||
full->Bool() = !full->Bool();
|
||||
|
||||
GH.onScreenResize();
|
||||
GH.onScreenResize(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -163,7 +163,7 @@ void InputHandler::preprocessEvent(const SDL_Event & ev)
|
||||
#ifndef VCMI_IOS
|
||||
{
|
||||
boost::mutex::scoped_lock interfaceLock(GH.interfaceMutex);
|
||||
GH.onScreenResize();
|
||||
GH.onScreenResize(false);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
@ -251,8 +251,11 @@ void CGuiHandler::setStatusbar(std::shared_ptr<IStatusBar> newStatusBar)
|
||||
currentStatusBar = newStatusBar;
|
||||
}
|
||||
|
||||
void CGuiHandler::onScreenResize()
|
||||
void CGuiHandler::onScreenResize(bool resolutionChanged)
|
||||
{
|
||||
screenHandler().onScreenResize();
|
||||
if(resolutionChanged)
|
||||
{
|
||||
screenHandler().onScreenResize();
|
||||
}
|
||||
windows().onScreenResize();
|
||||
}
|
||||
|
@ -92,8 +92,8 @@ public:
|
||||
void init();
|
||||
void renderFrame();
|
||||
|
||||
/// called whenever user selects different resolution, requiring to center/resize all windows
|
||||
void onScreenResize();
|
||||
/// called whenever SDL_WINDOWEVENT_RESTORED is reported or the user selects a different resolution, requiring to center/resize all windows
|
||||
void onScreenResize(bool resolutionChanged);
|
||||
|
||||
void handleEvents(); //takes events from queue and calls interested objects
|
||||
void fakeMouseMove();
|
||||
|
@ -317,7 +317,7 @@ void GeneralOptionsTab::setGameResolution(int index)
|
||||
widget<CLabel>("resolutionLabel")->setText(resolutionToLabelString(resolution.x, resolution.y));
|
||||
|
||||
GH.dispatchMainThread([](){
|
||||
GH.onScreenResize();
|
||||
GH.onScreenResize(true);
|
||||
});
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ void GeneralOptionsTab::setFullscreenMode(bool on, bool exclusive)
|
||||
updateResolutionSelector();
|
||||
|
||||
GH.dispatchMainThread([](){
|
||||
GH.onScreenResize();
|
||||
GH.onScreenResize(true);
|
||||
});
|
||||
}
|
||||
|
||||
@ -400,7 +400,7 @@ void GeneralOptionsTab::setGameScaling(int index)
|
||||
widget<CLabel>("scalingLabel")->setText(scalingToLabelString(scaling));
|
||||
|
||||
GH.dispatchMainThread([](){
|
||||
GH.onScreenResize();
|
||||
GH.onScreenResize(true);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user