mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-27 09:16:18 +00:00
Changed: Save CameraDistance and FPV not only if in Windowed mode
This commit is contained in:
parent
8a8f2afada
commit
973320762d
1 changed files with 33 additions and 25 deletions
|
@ -32,6 +32,8 @@
|
||||||
#include "view.h" // For the cameraDistance funtion
|
#include "view.h" // For the cameraDistance funtion
|
||||||
#include "user_entity.h"
|
#include "user_entity.h"
|
||||||
#include "interface_v3/interface_element.h" //for convertColor function
|
#include "interface_v3/interface_element.h" //for convertColor function
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
// 3D Interface.
|
// 3D Interface.
|
||||||
#include "nel/3d/u_driver.h"
|
#include "nel/3d/u_driver.h"
|
||||||
#include "nel/3d/u_scene.h"
|
#include "nel/3d/u_scene.h"
|
||||||
|
@ -2042,9 +2044,6 @@ void CClientConfig::release ()
|
||||||
{
|
{
|
||||||
// Do we have to save the cfg file ?
|
// Do we have to save the cfg file ?
|
||||||
if (ClientCfg.SaveConfig)
|
if (ClientCfg.SaveConfig)
|
||||||
{
|
|
||||||
// Are we in window mode ?
|
|
||||||
if (ClientCfg.Windowed)
|
|
||||||
{
|
{
|
||||||
// Driver still alive ?
|
// Driver still alive ?
|
||||||
if (Driver && Driver->isActive ())
|
if (Driver && Driver->isActive ())
|
||||||
|
@ -2058,23 +2057,33 @@ void CClientConfig::release ()
|
||||||
// Save values
|
// Save values
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CConfigFile::CVar *varPtr = ClientCfg.ConfigFile.getVarPtr ("PositionX");
|
CConfigFile::CVar *varPtr = NULL;
|
||||||
|
|
||||||
|
// Are we in window mode ?
|
||||||
|
if (ClientCfg.Windowed && !isWindowMaximized())
|
||||||
|
{
|
||||||
|
// Save windows position
|
||||||
|
varPtr = ClientCfg.ConfigFile.getVarPtr ("PositionX");
|
||||||
if (varPtr)
|
if (varPtr)
|
||||||
varPtr->forceAsInt (x);
|
varPtr->forceAsInt (x);
|
||||||
varPtr = ClientCfg.ConfigFile.getVarPtr ("PositionY");
|
varPtr = ClientCfg.ConfigFile.getVarPtr ("PositionY");
|
||||||
if (varPtr)
|
if (varPtr)
|
||||||
varPtr->forceAsInt (y);
|
varPtr->forceAsInt (y);
|
||||||
|
|
||||||
|
// Save windows size
|
||||||
varPtr = ClientCfg.ConfigFile.getVarPtr ("Width");
|
varPtr = ClientCfg.ConfigFile.getVarPtr ("Width");
|
||||||
if (varPtr)
|
if (varPtr)
|
||||||
varPtr->forceAsInt (std::max((int)width, 800));
|
varPtr->forceAsInt (std::max((int)width, 800));
|
||||||
varPtr = ClientCfg.ConfigFile.getVarPtr ("Height");
|
varPtr = ClientCfg.ConfigFile.getVarPtr ("Height");
|
||||||
if (varPtr)
|
if (varPtr)
|
||||||
varPtr->forceAsInt (std::max((int)height, 600));
|
varPtr->forceAsInt (std::max((int)height, 600));
|
||||||
|
}
|
||||||
|
|
||||||
// Save if in FPV or TPV.
|
// Save if in FPV or TPV.
|
||||||
varPtr = ClientCfg.ConfigFile.getVarPtr("FPV");
|
varPtr = ClientCfg.ConfigFile.getVarPtr("FPV");
|
||||||
if(varPtr)
|
if(varPtr)
|
||||||
varPtr->forceAsInt((sint)ClientCfg.FPV);
|
varPtr->forceAsInt((sint)ClientCfg.FPV);
|
||||||
|
|
||||||
// Save the camera distance
|
// Save the camera distance
|
||||||
varPtr = ClientCfg.ConfigFile.getVarPtr("CameraDistance");
|
varPtr = ClientCfg.ConfigFile.getVarPtr("CameraDistance");
|
||||||
if(varPtr)
|
if(varPtr)
|
||||||
|
@ -2085,7 +2094,6 @@ void CClientConfig::release ()
|
||||||
nlwarning ("Error while set config file variables : %s", e.what ());
|
nlwarning ("Error while set config file variables : %s", e.what ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Save it
|
// Save it
|
||||||
ClientCfg.ConfigFile.save ();
|
ClientCfg.ConfigFile.save ();
|
||||||
|
|
Loading…
Reference in a new issue