Another authentic struct name
This commit is contained in:
parent
a2ecd75271
commit
e41d4472ec
3 changed files with 10 additions and 10 deletions
|
@ -10,10 +10,10 @@
|
||||||
const char* const gConfigName = "Config.dat";
|
const char* const gConfigName = "Config.dat";
|
||||||
const char* const gProof = "DOUKUTSU20041206";
|
const char* const gProof = "DOUKUTSU20041206";
|
||||||
|
|
||||||
BOOL LoadConfigData(CONFIG *conf)
|
BOOL LoadConfigData(CONFIGDATA *conf)
|
||||||
{
|
{
|
||||||
// Clear old configuration data
|
// Clear old configuration data
|
||||||
memset(conf, 0, sizeof(CONFIG));
|
memset(conf, 0, sizeof(CONFIGDATA));
|
||||||
|
|
||||||
// Get path
|
// Get path
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
@ -25,7 +25,7 @@ BOOL LoadConfigData(CONFIG *conf)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// Read data
|
// Read data
|
||||||
size_t fread_result = fread(conf, sizeof(CONFIG), 1, fp); // Not the original name
|
size_t fread_result = fread(conf, sizeof(CONFIGDATA), 1, fp); // Not the original name
|
||||||
|
|
||||||
// Close file
|
// Close file
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
@ -33,17 +33,17 @@ BOOL LoadConfigData(CONFIG *conf)
|
||||||
// Check if version is not correct, and return if it failed
|
// Check if version is not correct, and return if it failed
|
||||||
if (fread_result != 1 || strcmp(conf->proof, gProof))
|
if (fread_result != 1 || strcmp(conf->proof, gProof))
|
||||||
{
|
{
|
||||||
memset(conf, 0, sizeof(CONFIG));
|
memset(conf, 0, sizeof(CONFIGDATA));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultConfigData(CONFIG *conf)
|
void DefaultConfigData(CONFIGDATA *conf)
|
||||||
{
|
{
|
||||||
// Clear old configuration data
|
// Clear old configuration data
|
||||||
memset(conf, 0, sizeof(CONFIG));
|
memset(conf, 0, sizeof(CONFIGDATA));
|
||||||
|
|
||||||
// Fun fact: The Linux port added this line:
|
// Fun fact: The Linux port added this line:
|
||||||
// conf->display_mode = 1;
|
// conf->display_mode = 1;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
struct CONFIG
|
struct CONFIGDATA
|
||||||
{
|
{
|
||||||
char proof[0x20];
|
char proof[0x20];
|
||||||
char font_name[0x40];
|
char font_name[0x40];
|
||||||
|
@ -17,5 +17,5 @@ struct CONFIG
|
||||||
extern const char* const gConfigName;
|
extern const char* const gConfigName;
|
||||||
extern const char* const gProof;
|
extern const char* const gProof;
|
||||||
|
|
||||||
BOOL LoadConfigData(CONFIG *conf);
|
BOOL LoadConfigData(CONFIGDATA *conf);
|
||||||
void DefaultConfigData(CONFIG *conf);
|
void DefaultConfigData(CONFIGDATA *conf);
|
||||||
|
|
|
@ -125,7 +125,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
strcpy(gDataPath, gModulePath);
|
strcpy(gDataPath, gModulePath);
|
||||||
strcat(gDataPath, "\\data");
|
strcat(gDataPath, "\\data");
|
||||||
|
|
||||||
CONFIG conf;
|
CONFIGDATA conf;
|
||||||
if (!LoadConfigData(&conf))
|
if (!LoadConfigData(&conf))
|
||||||
DefaultConfigData(&conf);
|
DefaultConfigData(&conf);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue