Another authentic struct name

This commit is contained in:
Clownacy 2020-08-11 00:09:17 +01:00
parent a2ecd75271
commit e41d4472ec
3 changed files with 10 additions and 10 deletions

View file

@ -10,10 +10,10 @@
const char* const gConfigName = "Config.dat";
const char* const gProof = "DOUKUTSU20041206";
BOOL LoadConfigData(CONFIG *conf)
BOOL LoadConfigData(CONFIGDATA *conf)
{
// Clear old configuration data
memset(conf, 0, sizeof(CONFIG));
memset(conf, 0, sizeof(CONFIGDATA));
// Get path
char path[MAX_PATH];
@ -25,7 +25,7 @@ BOOL LoadConfigData(CONFIG *conf)
return FALSE;
// 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
fclose(fp);
@ -33,17 +33,17 @@ BOOL LoadConfigData(CONFIG *conf)
// Check if version is not correct, and return if it failed
if (fread_result != 1 || strcmp(conf->proof, gProof))
{
memset(conf, 0, sizeof(CONFIG));
memset(conf, 0, sizeof(CONFIGDATA));
return FALSE;
}
return TRUE;
}
void DefaultConfigData(CONFIG *conf)
void DefaultConfigData(CONFIGDATA *conf)
{
// Clear old configuration data
memset(conf, 0, sizeof(CONFIG));
memset(conf, 0, sizeof(CONFIGDATA));
// Fun fact: The Linux port added this line:
// conf->display_mode = 1;

View file

@ -2,7 +2,7 @@
#include "WindowsWrapper.h"
struct CONFIG
struct CONFIGDATA
{
char proof[0x20];
char font_name[0x40];
@ -17,5 +17,5 @@ struct CONFIG
extern const char* const gConfigName;
extern const char* const gProof;
BOOL LoadConfigData(CONFIG *conf);
void DefaultConfigData(CONFIG *conf);
BOOL LoadConfigData(CONFIGDATA *conf);
void DefaultConfigData(CONFIGDATA *conf);

View file

@ -125,7 +125,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
strcpy(gDataPath, gModulePath);
strcat(gDataPath, "\\data");
CONFIG conf;
CONFIGDATA conf;
if (!LoadConfigData(&conf))
DefaultConfigData(&conf);