Refact GameData, add better error handling for SM verboseness.
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@
|
||||
//#define SMEXT_ENABLE_GAMEHELPERS
|
||||
//#define SMEXT_ENABLE_TIMERSYS
|
||||
//#define SMEXT_ENABLE_THREADER
|
||||
//#define SMEXT_ENABLE_LIBSYS
|
||||
#define SMEXT_ENABLE_LIBSYS
|
||||
//#define SMEXT_ENABLE_MENUS
|
||||
//#define SMEXT_ENABLE_ADTFACTORY
|
||||
//#define SMEXT_ENABLE_PLUGINSYS
|
||||
|
||||
+14
-8
@@ -20,26 +20,32 @@
|
||||
|
||||
SteamWorksGameData::SteamWorksGameData()
|
||||
{
|
||||
char buffer[1];
|
||||
pGameConf = NULL;
|
||||
gameconfs->LoadGameConfigFile("steamworks", &pGameConf, buffer, sizeof(buffer));
|
||||
char buffer[PLATFORM_MAX_PATH];
|
||||
this->pGameConf = NULL;
|
||||
|
||||
/* LoadGameConfigFile will verbosely error out, we need to check this since it's optional. */
|
||||
smutils->BuildPath(Path_SM, buffer, sizeof(buffer), "gamedata/steamworks.txt");
|
||||
if (libsys->PathExists(buffer) && libsys->IsPathFile(buffer))
|
||||
{
|
||||
gameconfs->LoadGameConfigFile("steamworks", &this->pGameConf, buffer, sizeof(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
SteamWorksGameData::~SteamWorksGameData()
|
||||
{
|
||||
if (pGameConf != NULL)
|
||||
if (this->pGameConf != NULL)
|
||||
{
|
||||
gameconfs->CloseGameConfigFile(pGameConf);
|
||||
pGameConf = NULL;
|
||||
gameconfs->CloseGameConfigFile(this->pGameConf);
|
||||
this->pGameConf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool SteamWorksGameData::HasGameData(void) const
|
||||
{
|
||||
return (pGameConf != NULL);
|
||||
return (this->pGameConf != NULL);
|
||||
}
|
||||
|
||||
IGameConfig *SteamWorksGameData::GetGameData(void) const
|
||||
{
|
||||
return pGameConf;
|
||||
return this->pGameConf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user