void DrawHighScores() { int i; int w; int h; HighScore* s; ClearMScreen(); CA_CacheScreen(BACKGROUND_SCREENPIC); DrawMenuTitle("HIGH SCORES"); if (playstate != ex_title) { DrawInstructions(IT_HIGHSCORES); } fontnumber = 2; SETFONTCOLOR(ENABLED_TEXT_COLOR, TERM_BACK_COLOR); ShadowPrint("NAME", 86, 60); ShadowPrint("SCORE", 175, 60); ShadowPrint("MISSION", 247, 53); ShadowPrint("RATIO", 254, 60); for (i = 0, s = Scores.data(); i < MaxScores; i++, s++) { SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR - 1, TERM_BACK_COLOR); // // name // if (*s->name) { ShadowPrint(s->name, 45, static_cast<int16_t>(68 + (SCORE_Y_SPACING * i))); } // // score // std::string buffer; if (s->score > 9999999) { SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR + 1, TERM_BACK_COLOR); } buffer = std::to_string(s->score); ::USL_MeasureString(buffer.c_str(), &w, &h); ::ShadowPrint(buffer.c_str(), static_cast<int16_t>(205 - w), static_cast<int16_t>(68 + (SCORE_Y_SPACING * i))); // 235 // // mission ratio // buffer = std::to_string(s->ratio); USL_MeasureString(buffer.c_str(), &w, &h); ShadowPrint(buffer.c_str(), static_cast<int16_t>(272 - w), static_cast<int16_t>(68 + (SCORE_Y_SPACING * i))); } VW_UpdateScreen(); }
void EndScreen (int palette, int screen) { CA_CacheScreen (screen); VW_UpdateScreen (); CA_CacheGrChunk (palette); VL_FadeIn(0,255,grsegs[palette],30); UNCACHEGRCHUNK (palette); IN_ClearKeysDown (); IN_Ack (); VW_FadeOut (); }
void EndScreen (int palette, int screen) { SDL_Color pal[256]; CA_CacheScreen (screen); VW_UpdateScreen (); CA_CacheGrChunk (palette); VL_ConvertPalette(grsegs[palette], pal, 256); VL_FadeIn (0, 255, pal, 30); UNCACHEGRCHUNK (palette); IN_ClearKeysDown (); IN_Ack (); VW_FadeOut (); }
void EndSpear(void) { EndScreen (END1PALETTE, ENDSCREEN11PIC); CA_CacheScreen (ENDSCREEN3PIC); VW_UpdateScreen (); CA_CacheGrChunk (END3PALETTE); VL_FadeIn(0,255,grsegs[END3PALETTE],30); UNCACHEGRCHUNK (END3PALETTE); fontnumber = 0; fontcolor = 0xd0; WindowX = 0; WindowW = 320; PrintX = 0; PrintY = 180; US_CPrint (STR_ENDGAME1"\n"); US_CPrint (STR_ENDGAME2); VW_UpdateScreen (); IN_StartAck (); TimeCount = 0; while (!IN_CheckAck () && TimeCount < 700); PrintX = 0; PrintY = 180; VWB_Bar(0,180,320,20,0); US_CPrint (STR_ENDGAME3"\n"); US_CPrint (STR_ENDGAME4); VW_UpdateScreen (); IN_StartAck (); TimeCount = 0; while (!IN_CheckAck () && TimeCount < 700); VW_FadeOut (); EndScreen (END4PALETTE, ENDSCREEN4PIC); EndScreen (END5PALETTE, ENDSCREEN5PIC); EndScreen (END6PALETTE, ENDSCREEN6PIC); EndScreen (END7PALETTE, ENDSCREEN7PIC); EndScreen (END8PALETTE, ENDSCREEN8PIC); EndScreen (END9PALETTE, ENDSCREEN9PIC); EndScreen (END2PALETTE, ENDSCREEN12PIC); MainMenu[savegame].active = 0; }
void EndSpear (void) { SDL_Color pal[256]; EndScreen (END1PALETTE, ENDSCREEN11PIC); CA_CacheScreen (ENDSCREEN3PIC); VW_UpdateScreen (); CA_CacheGrChunk (END3PALETTE); VL_ConvertPalette(grsegs[END3PALETTE], pal, 256); VL_FadeIn (0, 255, pal, 30); UNCACHEGRCHUNK (END3PALETTE); fontnumber = 0; fontcolor = 0xd0; WindowX = 0; WindowW = 320; PrintX = 0; PrintY = 180; US_CPrint (STR_ENDGAME1 "\n"); US_CPrint (STR_ENDGAME2); VW_UpdateScreen (); IN_UserInput(700); PrintX = 0; PrintY = 180; VWB_Bar (0, 180, 320, 20, 0); US_CPrint (STR_ENDGAME3 "\n"); US_CPrint (STR_ENDGAME4); VW_UpdateScreen (); IN_UserInput(700); VW_FadeOut (); EndScreen (END4PALETTE, ENDSCREEN4PIC); EndScreen (END5PALETTE, ENDSCREEN5PIC); EndScreen (END6PALETTE, ENDSCREEN6PIC); EndScreen (END7PALETTE, ENDSCREEN7PIC); EndScreen (END8PALETTE, ENDSCREEN8PIC); EndScreen (END9PALETTE, ENDSCREEN9PIC); EndScreen (END2PALETTE, ENDSCREEN12PIC); MainMenu[savegame].active = 0; }
void ShowArticle (char *article) #endif { #ifdef JAPAN int snames[10] = { H_HELP1PIC, H_HELP2PIC, H_HELP3PIC, H_HELP4PIC, H_HELP5PIC, H_HELP6PIC, H_HELP7PIC, H_HELP8PIC, H_HELP9PIC, H_HELP10PIC}; int enames[14] = { 0,0, #ifndef JAPDEMO C_ENDGAME1APIC, C_ENDGAME1BPIC, C_ENDGAME2APIC, C_ENDGAME2BPIC, C_ENDGAME3APIC, C_ENDGAME3BPIC, C_ENDGAME4APIC, C_ENDGAME4BPIC, C_ENDGAME5APIC, C_ENDGAME5BPIC, C_ENDGAME6APIC, C_ENDGAME6BPIC #endif }; #endif unsigned oldfontnumber; unsigned temp; boolean newpage,firstpage; #ifdef JAPAN pagenum = 1; if (!which) numpages = 10; else numpages = 2; #else text = article; oldfontnumber = fontnumber; fontnumber = 0; CA_MarkGrChunk(STARTFONT); VWB_Bar (0,0,320,200,BACKCOLOR); CacheLayoutGraphics (); #endif newpage = True; firstpage = True; do { if (newpage) { newpage = False; #ifdef JAPAN if (!which) CA_CacheScreen(snames[pagenum - 1]); else CA_CacheScreen(enames[which*2 + pagenum - 1]); #else PageLayout (True); #endif VW_UpdateScreen (); if (firstpage) { VL_FadeIn(0,255,&gamepal,10); // VW_FadeIn () firstpage = False; } } LastScan = 0; while (!LastScan) ; switch (LastScan) { case sc_UpArrow: case sc_PgUp: case sc_LeftArrow: if (pagenum>1) { #ifndef JAPAN BackPage (); BackPage (); #else pagenum--; #endif newpage = True; } break; case sc_Enter: case sc_DownArrow: case sc_PgDn: case sc_RightArrow: // the text allready points at next page if (pagenum<numpages) { newpage = True; #ifdef JAPAN pagenum++; #endif } break; } #ifndef SPEAR if (Keyboard[sc_Tab] && Keyboard[sc_P] && MS_CheckParm("goobers")) PicturePause(); #endif } while (LastScan != sc_Escape); IN_ClearKeysDown (); fontnumber = oldfontnumber; }
void DrawHighScores(void) { char buffer[16],*str; word i, w,h; HighScore *s; ClearMScreen(); CA_CacheScreen (BACKGROUND_SCREENPIC); DrawMenuTitle("HIGH SCORES"); if (playstate != ex_title) DrawInstructions(IT_HIGHSCORES); fontnumber=2; SETFONTCOLOR(ENABLED_TEXT_COLOR,TERM_BACK_COLOR); ShadowPrint("NAME",86,60); // ShadowPrint("MISSION",150,60); ShadowPrint("SCORE",175,60); ShadowPrint("MISSION",247,53); ShadowPrint("RATIO",254,60); for (i = 0,s = Scores;i < MaxScores;i++,s++) { SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR-1,TERM_BACK_COLOR); // // name // if (*s->name) ShadowPrint(s->name,45,68 + (SCORE_Y_SPACING * i)); #if 0 // // mission // ltoa(s->episode+1,buffer,10); ShadowPrint(buffer,165,68 + (SCORE_Y_SPACING * i)); #endif // // score // if (s->score > 9999999) SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR+1,TERM_BACK_COLOR); ltoa(s->score,buffer,10); USL_MeasureString(buffer,&w,&h); ShadowPrint(buffer,205 - w,68 + (SCORE_Y_SPACING * i)); // 235 // // mission ratio // ltoa(s->ratio,buffer,10); USL_MeasureString(buffer,&w,&h); ShadowPrint(buffer,272-w,68 + (SCORE_Y_SPACING * i)); } VW_UpdateScreen (); }
static int DemoLoop(unsigned id) { static int LastDemo = 0; switch (id) { case JE_NONE: /* check for launch from ted */ if (param_tedlevel != -1) { param_nowait = true; EnableEndGameMenuItem(); NewGame(param_difficulty,0); gamestate.episode = 0; gamestate.mapon = param_tedlevel; #ifndef SPEAR gamestate.episode = param_tedlevel/10; gamestate.mapon %= 10; #endif return JE_LOOP2; } /* main game cycle */ #ifndef DEMOTEST #ifndef UPLOAD #ifndef GOODTIMES #ifndef SPEAR #ifndef JAPAN if (!param_nowait) NonShareware(); #endif #else #ifndef GOODTIMES #ifndef SPEARDEMO extern void CopyProtection(void); if(!param_goodtimes) CopyProtection(); #endif #endif #endif #endif #endif StartCPMusic(INTROSONG); #ifndef JAPAN if (!param_nowait) PG13 (); #endif #endif return JE_LOOP; case JE_LOOP: while (!param_nowait) { #ifndef DEMOTEST #ifdef SPEAR LR_Color pal[256]; /* title page */ CA_CacheGrChunk (TITLEPALETTE); VL_ConvertPalette(grsegs[TITLEPALETTE], pal, 256); CA_CacheGrChunk (TITLE1PIC); VWB_DrawPic (0,0,TITLE1PIC); UNCACHEGRCHUNK (TITLE1PIC); CA_CacheGrChunk (TITLE2PIC); VWB_DrawPic (0,80,TITLE2PIC); UNCACHEGRCHUNK (TITLE2PIC); VW_UpdateScreen (); VL_FadeIn(0,255,pal,30); UNCACHEGRCHUNK (TITLEPALETTE); #else CA_CacheScreen (TITLEPIC); VW_UpdateScreen (); VW_FadeIn(); #endif if (IN_UserInput(TickBase*15)) break; VW_FadeOut(); /* credits page */ CA_CacheScreen (CREDITSPIC); VW_UpdateScreen(); VW_FadeIn (); if (IN_UserInput(TickBase*10)) break; VW_FadeOut (); DrawHighScores (); VW_UpdateScreen (); VW_FadeIn (); if (IN_UserInput(TickBase*10)) break; #endif /* demo */ #ifndef SPEARDEMO PlayDemo (LastDemo++%4); #else PlayDemo (0); #endif if (playstate == EX_ABORT) return JE_QUIT; VW_FadeOut(); if(screenHeight % 200 != 0) VL_ClearScreen(0); StartCPMusic(INTROSONG); } VW_FadeOut (); #ifdef DEBUGKEYS if (Keyboard[sc_Tab] && param_debugmode) RecordDemo (); else #endif US_ControlPanel (0); if (startgame || loadedgame) return JE_LOOP2; break; case JE_LOOP2: id = GameLoop(); if (param_tedlevel == -1 && id == -1) { if(!param_nowait) { VW_FadeOut(); StartCPMusic(INTROSONG); } } break; } return JE_LOOP2; }
static bool ShowImage(IntermissionAction *image, bool drawonly) { if(!image->Music.IsEmpty()) StartCPMusic(image->Music); if(!image->Palette.IsEmpty()) { if(image->Palette.CompareNoCase("$GamePalette") == 0) VL_ReadPalette(gameinfo.GamePalette); else VL_ReadPalette(image->Palette); } static FTextureID background; static bool tileBackground = false; static IntermissionAction::BackgroundType type = IntermissionAction::NORMAL; // High Scores and such need special handling if(image->Type != IntermissionAction::UNSET) { type = image->Type; } if(type == IntermissionAction::NORMAL && image->Background.isValid()) { background = image->Background; tileBackground = image->BackgroundTile; } intermissionMapLoaded = false; switch(type) { default: if(!tileBackground) CA_CacheScreen(TexMan(background)); else VWB_DrawFill(TexMan(background), 0, 0, screenWidth, screenHeight); break; case IntermissionAction::HIGHSCORES: DrawHighScores(); break; case IntermissionAction::TITLEPAGE: background = TexMan.CheckForTexture(gameinfo.TitlePage, FTexture::TEX_Any); if(!gameinfo.TitlePalette.IsEmpty()) VL_ReadPalette(gameinfo.TitlePalette); CA_CacheScreen(TexMan(background)); break; case IntermissionAction::LOADMAP: if(image->MapName.IsNotEmpty()) { strncpy(gamestate.mapname, image->MapName, 8); StartTravel(); SetupGameLevel(); FinishTravel(); // Drop weapon players[0].SetPSprite(NULL, player_t::ps_weapon); PreloadGraphics(true); gamestate.victoryflag = true; } intermissionMapLoaded = true; ThreeDRefresh(); ClearStatusbar(); break; } for(unsigned int i = 0;i < image->Draw.Size();++i) { VWB_DrawGraphic(TexMan(image->Draw[i].Image), image->Draw[i].X, image->Draw[i].Y); } if(!drawonly) { VW_UpdateScreen(); return WaitIntermission(image->Time); } return false; }
//------------------------------------------------------------------------ // PreDemo() //------------------------------------------------------------------------ void PreDemo() { #if !SKIP_TITLE_AND_CREDITS #if TECH_SUPPORT_VERSION fontnumber=4; SETFONTCOLOR(0,15*3); CenterWindow (26,7); US_Print(EnterBetaCode); VW_UpdateScreen(); CA_LoadAllSounds(); PM_CheckMainMem(); SD_PlaySound(INFORMDEATH2SND); // Nooooo! IN_UserInput(TickBase*20); ClearMemory(); #elif BETA_TEST boolean param=false; for (i=1; i<g_argc; i++) switch (US_CheckParm(g_argv[i],MainStrs)) { case 13: param=true; break; } if (!param) { char buffer[15] = {0}; fontnumber=4; CenterWindow (26,7); US_Print(EnterBetaCode); VW_UpdateScreen(); SETFONTCOLOR(0,15*3); US_LineInput(24*8,92,buffer,buffer,true,14,100); if (_fstricmp(buffer,bc_buffer)) Quit("Bad beta code!"); } #endif #if GAME_VERSION == SHAREWARE_VERSION #if IN_DEVELOPMENT || GEORGE_CHEAT if (!MS_CheckParm("nochex")) #endif { #if (!SKIP_CHECKSUMS) // CheckValidity("MAPTEMP.",MAPTEMP_CHECKSUM,"LEVELS"); CheckValidity("MAPTEMP.",MAPTEMP_CHECKSUM); #endif } #else #if (!SKIP_CHECKSUMS) if (ChecksumFile("FILE_ID.DIZ",0) != DIZFILE_CHECKSUM) gamestate.flags |= GS_BAD_DIZ_FILE; #endif #endif VL_SetPaletteIntensity(0,255,vgapal,0); if (!(gamestate.flags & GS_NOWAIT)) { #if (0) // GAME_VERSION != SHAREWARE_VERSION //--------------------- // Anti-piracy screen //--------------------- // Cache pic // CA_CacheScreen(PIRACYPIC); // Cache and set palette. AND Fade it in! // CA_CacheGrChunk(PIRACYPALETTE); VL_SetPalette (0,256,grsegs[PIRACYPALETTE]); VL_SetPaletteIntensity(0,255,grsegs[PIRACYPALETTE],0); VW_UpdateScreen(); VL_FadeOut (0, 255, 0, 0, 25, 20); VL_FadeIn(0,255,grsegs[PIRACYPALETTE],30); // Wait a little // IN_UserInput(TickBase*20); // Free palette // UNCACHEGRCHUNK(PIRACYPALETTE); VL_FadeOut (0, 255, 0, 0, 25, 20); VW_FadeOut(); // Cleanup screen for upcoming SetPalette call // { Uint16 old_bufferofs=bufferofs; bufferofs=displayofs; VL_Bar(0,0,320,200,0); bufferofs=old_bufferofs; } #endif //--------------------- // Apogee presents //--------------------- // ISG --> this fixes intro timing IN_UserInput(TickBase*1); // Cache pic // CA_CacheScreen(APOGEEPIC); // Load and start music // CA_CacheAudioChunk(STARTMUSIC+APOGFNFM_MUS); ::SD_StartMusic(APOGFNFM_MUS); // Cache and set palette. AND Fade it in! // CA_CacheGrChunk(APOGEEPALETTE); VL_SetPalette (0,256,static_cast<const Uint8*>(grsegs[APOGEEPALETTE])); VL_SetPaletteIntensity(0,255,static_cast<const Uint8*>(grsegs[APOGEEPALETTE]),0); VW_UpdateScreen(); VL_FadeOut (0, 255, 25, 29, 53, 20); VL_FadeIn(0,255,static_cast<const Uint8*>(grsegs[APOGEEPALETTE]),30); // Wait for end of fanfare // if (MusicMode==smm_AdLib) { IN_StartAck(); while ((!sqPlayedOnce) && (!IN_CheckAck())); } else IN_UserInput(TickBase*6); SD_MusicOff(); // Free palette and music. AND Restore palette // UNCACHEGRCHUNK(APOGEEPALETTE); delete [] audiosegs[STARTMUSIC + APOGFNFM_MUS]; audiosegs[STARTMUSIC + APOGFNFM_MUS] = NULL; // Do A Blue Flash! VL_FadeOut (0, 255, 25, 29, 53, 20); VL_FadeOut (0, 255, 0, 0, 0, 30); //--------------------- // JAM logo intro //--------------------- // Load and start music // CA_CacheAudioChunk(STARTMUSIC+TITLE_LOOP_MUSIC); ::SD_StartMusic(TITLE_LOOP_MUSIC); // Show JAM logo // if (!DoMovie(mv_intro,0)) MAIN_ERROR(PREDEMO_NOJAM); if (PowerBall) { Sint16 i; for (i=0;i<60 && (!DebugOk);i++) { VL_WaitVBL(1); // BBi ::in_handle_events(); if (Keyboard[sc_left_shift] && Keyboard[sc_right_shift]) { CA_LoadAllSounds(); SD_MusicOff(); ::sd_play_player_sound(SHOOTDOORSND, bstone::AC_ITEM); SD_WaitSoundDone(); ClearMemory(); DebugOk = 1; CA_CacheAudioChunk(STARTMUSIC+TITLE_LOOP_MUSIC); ::SD_StartMusic(TITLE_LOOP_MUSIC); } } } //--------------------- // PC-13 //--------------------- VL_Bar(0,0,320,200,0x14); CacheDrawPic(0,64,PC13PIC); VW_UpdateScreen(); VW_FadeIn(); IN_UserInput(TickBase*2); // Do A Red Flash! VL_FadeOut (0, 255, 39, 0, 0, 20); VW_FadeOut(); } #endif // SKIP_TITLE_AND_CREDITS }
static void DemoLoop() { int LastDemo = 0; // // check for launch from ted // if (param_tedlevel != -1) { param_nowait = true; EnableEndGameMenuItem(); NewGame(param_difficulty,0); #ifndef SPEAR gamestate.episode = param_tedlevel/10; gamestate.mapon = param_tedlevel%10; #else gamestate.episode = 0; gamestate.mapon = param_tedlevel; #endif GameLoop(); Quit (NULL); } // // main game cycle // #ifndef DEMOTEST #ifndef UPLOAD #ifndef GOODTIMES #ifndef SPEAR #ifndef JAPAN if (!param_nowait) NonShareware(); #endif #else #ifndef GOODTIMES #ifndef SPEARDEMO extern void CopyProtection(void); if(!param_goodtimes) CopyProtection(); #endif #endif #endif #endif #endif StartCPMusic(INTROSONG); #ifndef JAPAN if (!param_nowait) PG13 (); #endif #endif while (1) { while (!param_nowait) { // // title page // #ifndef DEMOTEST #ifdef SPEAR SDL_Color pal[256]; CA_CacheGrChunk (TITLEPALETTE); VL_ConvertPalette(grsegs[TITLEPALETTE], pal, 256); CA_CacheGrChunk (TITLE1PIC); VWB_DrawPic (0,0,TITLE1PIC); UNCACHEGRCHUNK (TITLE1PIC); CA_CacheGrChunk (TITLE2PIC); VWB_DrawPic (0,80,TITLE2PIC); UNCACHEGRCHUNK (TITLE2PIC); VW_UpdateScreen (); VL_FadeIn(0,255,pal,30); UNCACHEGRCHUNK (TITLEPALETTE); #else CA_CacheScreen (TITLEPIC); VW_UpdateScreen (); VW_FadeIn(); #endif if (IN_UserInput(TickBase*15)) break; VW_FadeOut(); // // credits page // CA_CacheScreen (CREDITSPIC); VW_UpdateScreen(); VW_FadeIn (); if (IN_UserInput(TickBase*10)) break; VW_FadeOut (); // // high scores // DrawHighScores (); VW_UpdateScreen (); VW_FadeIn (); if (IN_UserInput(TickBase*10)) break; #endif // // demo // #ifndef SPEARDEMO PlayDemo (LastDemo++%4); #else PlayDemo (0); #endif if (playstate == ex_abort) break; VW_FadeOut(); if(screenHeight % 200 != 0) VL_ClearScreen(0); StartCPMusic(INTROSONG); } VW_FadeOut (); #ifdef DEBUGKEYS if (Keyboard[sc_Tab] && param_debugmode) RecordDemo (); else US_ControlPanel (0); #else US_ControlPanel (0); #endif if (startgame || loadedgame) { GameLoop (); if(!param_nowait) { VW_FadeOut(); StartCPMusic(INTROSONG); } } } }