void DreamsEngine::start() { // Global for the legacy refkeen code. gDreamsEngine = this; gpRenderLock = SDL_CreateSemaphore(1); gKeenFiles.setupFilenames(7); setScreenMode(3); dreamsengine_datapath = const_cast<char*>(mDataPath.c_str()); // This function extracts the embedded files. TODO: We should integrate that to our existing system // Load the Resources loadResources(); //RefKeen_Patch_id_ca(); //RefKeen_Patch_id_us(); RefKeen_Patch_id_rf(); setupObjOffset(); // TODO: This seems to be the exe with main cycle. We need to break it into draw and logic routines. //InitGame(); //DemoLoop(); //kdreams_exe_main(); mpScene.reset( new DreamsDosIntro ); gGameState = INTRO_TEXT; mpScene->start(); }
bool DreamsEngine::start() { CExeFile &ExeFile = gKeenFiles.exeFile; //mLoader.setPermilage(10); // Patch the EXE-File-Data directly in the memory. CPatcher Patcher(ExeFile, gBehaviorEngine.mPatchFname); Patcher.process(); //mLoader.setPermilage(50); extractEmbeddedFilesIntoMemory(g_be_gamever_kdreamse113); // Global for the legacy refkeen code. gDreamsEngine = this; //gpRenderLock = SDL_CreateSemaphore(1); gKeenFiles.setupFilenames(7); setScreenMode(3); dreamsengine_datapath = const_cast<char*>(mDataPath.c_str()); // This function extracts the embedded files. TODO: We should integrate that to our existing system // Load the Resources loadResources(); //RefKeen_Patch_id_ca(); //RefKeen_Patch_id_us(); RefKeen_Patch_id_rf(); setupObjOffset(); mpScene.reset( new DreamsDosIntro ); gGameStateChange = GSS_INTRO_TEXT; mpScene->start(); return true; }
// gameVer should be BE_GAMEVER_LAST if no specific version is desired void BE_Cross_SelectGameInstallation(int gameVerVal) { if (gameVerVal == BE_GAMEVER_LAST) { if (!g_be_gameinstallations_num) { BE_ST_ExitWithErrorMsg("BE_Cross_SelectGameInstallation: No compatible game installation found!"); } g_be_selectedGameInstallation = &g_be_gameinstallations[0]; } else { int gameInstNum; for (gameInstNum = 0; gameInstNum < g_be_gameinstallations_num; ++gameInstNum) { if (g_be_gameinstallations[gameInstNum].verId == gameVerVal) { break; } } if (gameInstNum == g_be_gameinstallations_num) { char errorBuffer[80]; BE_Cross_safeandfastcstringcopy_2strs(errorBuffer, errorBuffer+sizeof(errorBuffer), "BE_Cross_SelectGameInstallation: Can't find game installation: ", refkeen_gamever_strs[gameVerVal]); BE_ST_ExitWithErrorMsg(errorBuffer); } g_be_selectedGameInstallation = &g_be_gameinstallations[gameInstNum]; } refkeen_current_gamever = g_be_selectedGameInstallation->verId; //extern void RefKeen_Patch_id_ca(void); //RefKeen_Patch_id_ca(); extern void RefKeen_Patch_id_us(void); RefKeen_Patch_id_us(); #ifdef REFKEEN_VER_KDREAMS extern void RefKeen_Patch_id_rf(void); RefKeen_Patch_id_rf(); //extern void RefKeen_Patch_kd_play(void); //RefKeen_Patch_kd_play(); #endif #ifdef REFKEEN_VER_CAT3D extern void RefKeen_Patch_c3_game(void); RefKeen_Patch_c3_game(); extern void RefKeen_Patch_c3_play(void); RefKeen_Patch_c3_play(); #endif #ifdef REFKEEN_VER_CATABYSS extern void RefKeen_Patch_c4_main(void); RefKeen_Patch_c4_main(); extern void RefKeen_Patch_c4_play(void); RefKeen_Patch_c4_play(); extern void RefKeen_Patch_gelib(void); RefKeen_Patch_gelib(); #endif #ifdef REFKEEN_VER_CATADVENTURES extern void RefKeen_Patch_intro(void); RefKeen_Patch_intro(); #endif /*extern void RefKeen_FillObjStatesWithDOSPointers(void); RefKeen_FillObjStatesWithDOSPointers(); // Saved games compatibility*/ }