void DreamsIntro::render() { if(mStep == 1) { VW_ScreenToScreen (64*200,0,40,200); } else if(mStep == 2) { VW_ScreenToScreen (64*200,0,40,200); } else { displayofs = 0; VWB_Bar(0,0,320,200,FIRSTCOLOR); US_DisplayHighScores(-1); } }
// REFKEEN - Rename different versions of DemoLoop for multi-ver support void DemoLoop_Old (void) { const id0_char_t *s; //id0_word_t move; //id0_longword_t lasttime; WindowRec mywin; #if FRILLS // // check for launch from ted // if (tedlevel) { NewGame(); gamestate.mapon = tedlevelnum; GameLoop(); TEDDeath(); } #endif // // demo loop // // REFKEEN - Alternative controllers support BE_ST_AltControlScheme_Push(); BE_ST_AltControlScheme_PrepareControllerMapping(&g_ingame_altcontrol_mapping_demoloop); US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame); restartgame = gd_Continue; while (true) { // Load the Title map gamestate.mapon = 20; // title map number loadedgame = false; SetupGameLevel(true); while (!restartgame && !loadedgame) { VW_InitDoubleBuffer(); IN_ClearKeysDown(); while (true) { // Display the Title map RF_NewPosition((5 * TILEGLOBAL) + (TILEGLOBAL / 2), (TILEGLOBAL * 2) + (TILEGLOBAL / 2) + (TILEGLOBAL / 4)); RF_ForceRefresh(); RF_Refresh(); RF_Refresh(); if (Wait(TickBase * 2)) break; mywin.x = (16 * 13) + 4; mywin.y = 0; mywin.w = 16 * 7; mywin.h = 200; mywin.px = mywin.x + 0; mywin.py = mywin.y + 10; s = "Game\n" "John Carmack\n" "\n" "Utilities\n" "John Romero\n" "\n" "Interface/Sound\n" "Jason Blochowiak\n" "\n" "Creative Director\n" "Tom Hall\n" "\n" "Art\n" "Adrian Carmack\n"; if (ShowText((9 * TILEGLOBAL) - (PIXGLOBAL * 2),&mywin,s)) break; mywin.x = 4; mywin.y = 0; mywin.w = 16 * 7; mywin.h = 200; mywin.px = mywin.x + 0; mywin.py = mywin.y + 10; if (refkeen_current_gamever == BE_GAMEVER_KDREAMSC105) s = "\n" "\"Keen Dreams\"\n" "Copyright 1991-93\n" "Softdisk, Inc.\n" "\n" "\n" "\n" "\n" "Commander Keen\n" "Copyright 1990-91\n" "Id Software, Inc.\n" "\n" "Press F1 for Help\n" "SPACE to Start\n"; else s = "Gamer's Edge\n" "\"Keen Dreams\"\n" "Copyright 1991\n" "Softdisk, Inc.\n" "\n" "Subscriptions\n" "1-800-831-2694\n" "\n" "Commander Keen\n" "Copyright 1990-91\n" "Id Software, Inc.\n" "\n" "Press F1 for Help\n" "SPACE to Start\n"; if (ShowText((2 * TILEGLOBAL) + (PIXGLOBAL * 2),&mywin,s)) break; if (MoveTitleTo((5 * TILEGLOBAL) + (TILEGLOBAL / 2))) break; if (Wait(TickBase * 3)) break; VWB_Bar(0,0,320,200,FIRSTCOLOR); US_DisplayHighScores(-1); if (IN_UserInput(TickBase * 8,false)) break; } US_ControlPanel (); } if (!loadedgame) NewGame(); GameLoop(); } // REFKEEN - Alternative controllers support BE_ST_AltControlScheme_Pop(); }
void DemoLoop_New (void) { //id0_char_t *s; //id0_word_t move; //id0_longword_t lasttime; // REFKEEN - Add FakeCGA shape for 2015 port const id0_char_t *FileName0; struct Shape FileShape0; const id0_char_t *FileName1; struct Shape FileShape1; // REFKEEN - CREDITS is now a variable, set based on version //#if CREDITS const id0_char_t *FileName2; struct Shape FileShape2; // REFKEEN - Add second credits shape for 2015 port const id0_char_t *FileName3; struct Shape FileShape3; //#endif //struct ffblk ffblk; //WindowRec mywin; id0_int_t bufsave = bufferofs; id0_int_t dissave = displayofs; #if FRILLS // // check for launch from ted // if (tedlevel) { NewGame(); gamestate.mapon = tedlevelnum; GameLoop(); TEDDeath(); } #endif // // demo loop // // REFKEEN - Alternative controllers support BE_ST_AltControlScheme_Push(); BE_ST_AltControlScheme_PrepareControllerMapping(&g_ingame_altcontrol_mapping_demoloop); US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame); restartgame = gd_Continue; BE_FILE_T handle = BE_Cross_open_readonly_for_reading("KDREAMS.CMP"); //int handle = open("KDREAMS.CMP" ,O_BINARY | O_RDONLY); if (!BE_Cross_IsFileValid(handle)) //if (handle == -1) Quit("Couldn't find KDREAMS.CMP"); BE_Cross_close(handle); #if 0 if (findfirst("KDREAMS.CMP", &ffblk, 0) == -1) Quit("Couldn't find KDREAMS.CMP"); #endif while (true) { loadedgame = false; if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015) { FileName0 = "TITLECGA.LBM"; if (LoadLIBShape("KDREAMS.CMP", FileName0, &FileShape0)) Quit("Can't load TITLE SCREEN"); } FileName1 = "TITLESCR.LBM"; if (LoadLIBShape("KDREAMS.CMP", FileName1, &FileShape1)) Quit("Can't load TITLE SCREEN"); if (CREDITS) { // REFKEEN - Instead of loading just "CREDITS.LBM" // (which never happened with the original EXEs in practice), // load "CREDITS1.LBM" and "CREDITS2.LBM", as available // in the 2015 release FileName2 = "CREDITS1.LBM"; if (LoadLIBShape("KDREAMS.CMP", FileName2, &FileShape2)) Quit("Can't load CREDITS SCREEN 1"); if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015) FileName3 = "CREDITS2.LBM"; if (LoadLIBShape("KDREAMS.CMP", FileName3, &FileShape3)) Quit("Can't load CREDITS SCREEN 3"); } while (!restartgame && !loadedgame) { VW_InitDoubleBuffer(); IN_ClearKeysDown(); while (true) { // REFKEEN - We're in an EGA-only function anyway, // so use EGA versions of VW functions... VW_SetScreen_EGA(0, 0); MoveGfxDst(0, 200); UnpackEGAShapeToScreen(fakecgamode ? &FileShape0 : &FileShape1, 0, 0); VW_ScreenToScreen_EGA (64*200,0,40,200); if (IN_UserInput(CREDITS ? (TickBase * 8) : (TickBase * 4), false)) break; // REFKEEN - Patch for 2015 port if (!fakecgamode) { if (CREDITS) { // REFKEEN - Show two credits screens // as present in the 2015 release MoveGfxDst(0, 200); UnpackEGAShapeToScreen(&FileShape2, 0, 0); VW_ScreenToScreen_EGA (64*200,0,40,200); if (IN_UserInput(TickBase * 7, false)) break; MoveGfxDst(0, 200); UnpackEGAShapeToScreen(&FileShape3, 0, 0); VW_ScreenToScreen_EGA (64*200,0,40,200); if (IN_UserInput(TickBase * 7, false)) break; } else { MoveGfxDst(0, 200); UnpackEGAShapeToScreen(&FileShape1, 0, 0); VW_ScreenToScreen_EGA (64*200,0,40,200); if (IN_UserInput(TickBase * 3, false)) break; } } displayofs = 0; VWB_Bar(0,0,320,200,FIRSTCOLOR); US_DisplayHighScores(-1); if (IN_UserInput(TickBase * 6, false)) break; } bufferofs = bufsave; displayofs = dissave; VW_FixRefreshBuffer(); US_ControlPanel (); } if (!loadedgame) NewGame(); if (refkeen_current_gamever == BE_GAMEVER_KDREAMS2015) FreeShape(&FileShape0); FreeShape(&FileShape1); if (CREDITS) { // REFKEEN - Free two credits screens as present in the 2015 release FreeShape(&FileShape2); FreeShape(&FileShape3); } GameLoop(); } // REFKEEN - Alternative controllers support BE_ST_AltControlScheme_Pop(); }
void DemoLoop (void) { //id0_char_t *s; //id0_word_t move; //id0_longword_t lasttime; const id0_char_t *FileName1; struct Shape FileShape1; #if CREDITS const id0_char_t *FileName2; struct Shape FileShape2; #endif //struct ffblk ffblk; //WindowRec mywin; id0_int_t bufsave = bufferofs; id0_int_t dissave = displayofs; #if FRILLS // // check for launch from ted // if (tedlevel) { NewGame(); gamestate.mapon = tedlevelnum; GameLoop(); TEDDeath(); } #endif // // demo loop // US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame); restartgame = gd_Continue; BE_FILE_T handle = BE_Cross_open_for_reading("KDREAMS.CMP"); //int handle = open("KDREAMS.CMP" ,O_BINARY | O_RDONLY); if (!BE_Cross_IsFileValid(handle)) //if (handle == -1) Quit("Couldn't find KDREAMS.CMP"); BE_Cross_close(handle); #if 0 if (findfirst("KDREAMS.CMP", &ffblk, 0) == -1) Quit("Couldn't find KDREAMS.CMP"); #endif while (true) { loadedgame = false; FileName1 = "TITLESCR.LBM"; if (LoadLIBShape("KDREAMS.CMP", FileName1, &FileShape1)) Quit("Can't load TITLE SCREEN"); #if CREDITS FileName2 = "CREDITS.LBM"; if (LoadLIBShape("KDREAMS.CMP", FileName2, &FileShape2)) Quit("Can't load CREDITS SCREEN"); #endif while (!restartgame && !loadedgame) { VW_InitDoubleBuffer(); IN_ClearKeysDown(); while (true) { VW_SetScreen(0, 0); MoveGfxDst(0, 200); UnpackEGAShapeToScreen(&FileShape1, 0, 0); VW_ScreenToScreen (64*200,0,40,200); #if CREDITS if (IN_UserInput(TickBase * 8, false)) break; #else if (IN_UserInput(TickBase * 4, false)) break; #endif #if CREDITS MoveGfxDst(0, 200); UnpackEGAShapeToScreen(&FileShape2, 0, 0); VW_ScreenToScreen (64*200,0,40,200); if (IN_UserInput(TickBase * 7, false)) break; #else MoveGfxDst(0, 200); UnpackEGAShapeToScreen(&FileShape1, 0, 0); VW_ScreenToScreen (64*200,0,40,200); if (IN_UserInput(TickBase * 3, false)) break; #endif displayofs = 0; VWB_Bar(0,0,320,200,FIRSTCOLOR); US_DisplayHighScores(-1); if (IN_UserInput(TickBase * 6, false)) break; } bufferofs = bufsave; displayofs = dissave; VW_FixRefreshBuffer(); US_ControlPanel (); } if (!loadedgame) NewGame(); FreeShape(&FileShape1); #if CREDITS FreeShape(&FileShape2); #endif GameLoop(); } }