bool TitleImagesLoad(void) { if (!AnimationLoad(&TitleAnim, "data/graphics/anim.png", 169, 40, 12)) { return false; } if (!AnimationLoad( &GameOverAnim, "data/graphics/gameover.png", 131, 40, 3)) { return false; } for (int i = 0; i < MAX_PLAYERS; i++) { char buf[256]; #ifdef __GCW0__ sprintf(buf, "data/graphics/gcw%d.png", i); #else sprintf(buf, "data/graphics/keyboard%d.png", i); #endif ControlTexes[i] = LoadTex(buf); if (ControlTexes[i].T == NULL) { return false; } } #ifdef __GCW0__ ControlTex0Analog = LoadTex("data/graphics/gcw0analog.png"); if (ControlTex0Analog.T == NULL) return false; ControlTex0G = LoadTex("data/graphics/gcw0g.png"); if (ControlTex0G.T == NULL) return false; #endif return true; }
int main(int argc, char* args[]) { int _SysCt = 0; struct PakFile _Pak; struct System _Systems[] = { {"Main", HeraldInit, HeraldDestroy}, {"Lua", InitLuaSystem, QuitLuaCore}, {"Video", VideoInit, VideoQuit}, {NULL, NULL, NULL} }; g_Log.Level = ELOG_ALL; LogSetFile("Log.txt"); #ifdef DEBUG chdir("data"); CreatePak("graphics"); chdir(".."); #endif ResourceManagementInit(1); RsrMgrConstruct(&_Pak, "data/graphics.pak"); for(_SysCt = 0; _Systems[_SysCt].Name != NULL; ++_SysCt) { Log(ELOG_INFO, "Initializing %s system.", _Systems[_SysCt].Name); if(_Systems[_SysCt].Init() == 0) { Log(ELOG_INFO, "System %s could not be loaded.", _Systems[_SysCt].Name); goto quit; } } AnimationLoad(g_LuaState, "data/anim/test.lua"); WorldInit(300); CoSchedule(MainCoro); quit: ResourceManagementQuit(); WorldQuit(); IMG_Quit(); for(_SysCt = _SysCt - 1;_SysCt >= 0; --_SysCt) { Log(ELOG_INFO, "Quitting %s system.", _Systems[_SysCt].Name); _Systems[_SysCt].Quit(); } return 0; }