mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
don't save windowPos if it's -32000
This commit is contained in:
parent
5114d902da
commit
25627134e7
@ -6,8 +6,7 @@
|
|||||||
#include "opengl.h"
|
#include "opengl.h"
|
||||||
#include "render_d3d9.h"
|
#include "render_d3d9.h"
|
||||||
|
|
||||||
char SettingsIniPath[MAX_PATH];
|
static char SettingsIniPath[MAX_PATH];
|
||||||
|
|
||||||
static char ProcessFileName[96];
|
static char ProcessFileName[96];
|
||||||
|
|
||||||
static BOOL GetBool(LPCSTR key, BOOL defaultValue);
|
static BOOL GetBool(LPCSTR key, BOOL defaultValue);
|
||||||
@ -28,7 +27,7 @@ void Settings_Load()
|
|||||||
|
|
||||||
//get process filename
|
//get process filename
|
||||||
char ProcessFilePath[MAX_PATH] = { 0 };
|
char ProcessFilePath[MAX_PATH] = { 0 };
|
||||||
GetModuleFileNameA(NULL, ProcessFilePath, MAX_PATH);
|
GetModuleFileNameA(NULL, ProcessFilePath, MAX_PATH);
|
||||||
_splitpath(ProcessFilePath, NULL, NULL, ProcessFileName, NULL);
|
_splitpath(ProcessFilePath, NULL, NULL, ProcessFileName, NULL);
|
||||||
|
|
||||||
//load settings from ini
|
//load settings from ini
|
||||||
@ -122,11 +121,18 @@ void Settings_Load()
|
|||||||
void Settings_SaveWindowPos(int x, int y)
|
void Settings_SaveWindowPos(int x, int y)
|
||||||
{
|
{
|
||||||
char buf[16];
|
char buf[16];
|
||||||
sprintf(buf, "%d", x);
|
|
||||||
WritePrivateProfileString(ProcessFileName, "posX", buf, SettingsIniPath);
|
|
||||||
|
|
||||||
sprintf(buf, "%d", y);
|
if (x != -32000)
|
||||||
WritePrivateProfileString(ProcessFileName, "posY", buf, SettingsIniPath);
|
{
|
||||||
|
sprintf(buf, "%d", x);
|
||||||
|
WritePrivateProfileString(ProcessFileName, "posX", buf, SettingsIniPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (y != -32000)
|
||||||
|
{
|
||||||
|
sprintf(buf, "%d", y);
|
||||||
|
WritePrivateProfileString(ProcessFileName, "posY", buf, SettingsIniPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CreateSettingsIni()
|
static void CreateSettingsIni()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user