mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Fixed: Windowed resolution resetting when closing from login/outgame views.
--HG-- branch : develop
This commit is contained in:
parent
109725fc9e
commit
0f5ec6c0b4
2 changed files with 18 additions and 5 deletions
|
@ -2043,13 +2043,9 @@ void CClientConfig::release ()
|
||||||
// Are we in window mode ?
|
// Are we in window mode ?
|
||||||
if (ClientCfg.Windowed /* && !isWindowMaximized() */)
|
if (ClientCfg.Windowed /* && !isWindowMaximized() */)
|
||||||
{
|
{
|
||||||
// Save windows position
|
// Save windows position. width/height are saved when leaving ingame.
|
||||||
writeInt("PositionX", x);
|
writeInt("PositionX", x);
|
||||||
writeInt("PositionY", y);
|
writeInt("PositionY", y);
|
||||||
|
|
||||||
// Save windows size
|
|
||||||
writeInt("Width", std::max((sint)width, 800));
|
|
||||||
writeInt("Height", std::max((sint)height, 600));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,6 +132,19 @@ extern void selectTipsOfTheDay (uint tips);
|
||||||
// FUNCTIONS //
|
// FUNCTIONS //
|
||||||
///////////////
|
///////////////
|
||||||
|
|
||||||
|
// ***************************************************************************
|
||||||
|
// Saving ingame resolution when in windowed mode
|
||||||
|
static void saveIngameResolution()
|
||||||
|
{
|
||||||
|
if (ClientCfg.Windowed)
|
||||||
|
{
|
||||||
|
uint32 width, height;
|
||||||
|
Driver->getWindowSize(width, height);
|
||||||
|
ClientCfg.writeInt("Width", std::max((sint)width, 800));
|
||||||
|
ClientCfg.writeInt("Height", std::max((sint)height, 600));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
// 3D element release, called from both releaseMainLoopReselect() and releaseMainLoop()
|
// 3D element release, called from both releaseMainLoopReselect() and releaseMainLoop()
|
||||||
static void releaseMainLoopScenes()
|
static void releaseMainLoopScenes()
|
||||||
|
@ -209,6 +222,8 @@ void releaseMainLoopReselect()
|
||||||
{
|
{
|
||||||
ProgressBar.release();
|
ProgressBar.release();
|
||||||
|
|
||||||
|
saveIngameResolution();
|
||||||
|
|
||||||
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
||||||
|
|
||||||
// save keys loaded and interface cfg (not done in releaseMainLoop() because done at end of mainLoop()...)
|
// save keys loaded and interface cfg (not done in releaseMainLoop() because done at end of mainLoop()...)
|
||||||
|
@ -364,6 +379,8 @@ void releaseMainLoop(bool closeConnection)
|
||||||
{
|
{
|
||||||
ProgressBar.release();
|
ProgressBar.release();
|
||||||
|
|
||||||
|
saveIngameResolution();
|
||||||
|
|
||||||
// Release R2 editor if applicable
|
// Release R2 editor if applicable
|
||||||
R2::getEditor().autoConfigRelease(IsInRingSession);
|
R2::getEditor().autoConfigRelease(IsInRingSession);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue