void Write(int x,int y,char *string) { int alpha[]={L_NUM0PIC,L_NUM1PIC,L_NUM2PIC,L_NUM3PIC,L_NUM4PIC,L_NUM5PIC, L_NUM6PIC,L_NUM7PIC,L_NUM8PIC,L_NUM9PIC,L_COLONPIC,0,0,0,0,0,0,L_APIC,L_BPIC, L_CPIC,L_DPIC,L_EPIC,L_FPIC,L_GPIC,L_HPIC,L_IPIC,L_JPIC,L_KPIC, L_LPIC,L_MPIC,L_NPIC,L_OPIC,L_PPIC,L_QPIC,L_RPIC,L_SPIC,L_TPIC, L_UPIC,L_VPIC,L_WPIC,L_XPIC,L_YPIC,L_ZPIC}; int i,ox,nx,ny; char ch; ox=nx=x*8; ny=y*8; for (i=0;i<strlen(string);i++) if (string[i]=='\n') { nx=ox; ny+=16; } else { ch=string[i]; if (ch>='a') ch-=('a'-'A'); ch-='0'; switch(string[i]) { case '!': VWB_DrawPic(nx,ny,L_EXPOINTPIC); nx+=8; continue; case '\'': VWB_DrawPic(nx,ny,L_APOSTROPHEPIC); nx+=8; continue; case ' ': break; case 0x3a: // ':' VWB_DrawPic(nx,ny,L_COLONPIC); nx+=8; continue; case '%': VWB_DrawPic(nx,ny,L_PERCENTPIC); break; default: VWB_DrawPic(nx,ny,alpha[ch]); } nx+=16; } }
void DrawPlayScreen (void) { int i,j,p,m; unsigned temp; VW_FadeOut (); temp = bufferofs; CA_CacheGrChunk (STATUSBARPIC); for (i=0;i<3;i++) { bufferofs = screenloc[i]; DrawPlayBorder (); VWB_DrawPic (0,200-STATUSLINES,STATUSBARPIC); } bufferofs = temp; UNCACHEGRCHUNK (STATUSBARPIC); DrawFace (); DrawHealth (); DrawLives (); DrawLevel (); DrawAmmo (); DrawKeys (); DrawWeapon (); DrawScore (); }
static void DiskFlopAnim(int x,int y) { static int8_t which=0; if (!x && !y) return; VWB_DrawPic(x,y,C_DISKLOADING1PIC+which); VW_UpdateScreen(); which^=1; }
// // Breathe Mr. BJ!!! // void BJ_Breathe() { static int which=0,max=10; int pics[2]={L_GUYPIC,L_GUY2PIC}; if (get_TimeCount() > max) { which^=1; VWB_DrawPic(0,16,pics[which]); VW_UpdateScreen(); set_TimeCount(0); max=35; } }
// // Breathe Mr. BJ!!! // void BJ_Breathe(void) { static int which=0,max=10; int pics[2]={L_GUYPIC,L_GUY2PIC}; if (TimeCount>max) { which^=1; VWB_DrawPic(0,16,pics[which]); VW_UpdateScreen(); TimeCount=0; max=35; } }
void PG13 (void) { VW_FadeOut(); VWB_Bar(0,0,320,200,0x82); // background CA_CacheGrChunk (PG13PIC); VWB_DrawPic (216,110,PG13PIC); VW_UpdateScreen (); UNCACHEGRCHUNK (PG13PIC); VW_FadeIn(); IN_UserInput(TickBase*7); VW_FadeOut (); }
// // Breathe Mr. BJ!!! // void BJ_Breathe (void) { static int which = 0, max = 10; int pics[2] = { L_GUYPIC, L_GUY2PIC }; //SDL_Delay(5); if ((int32_t) GetTimeCount () - lastBreathTime > max) { which ^= 1; VWB_DrawPic (0, 16, pics[which]); VW_UpdateScreen (); lastBreathTime = GetTimeCount(); max = 35; } }
void TimedPicCommand() { ParseTimedCommand(); // // update the screen, and wait for time delay // VW_UpdateScreen(); // // wait for time // set_TimeCount(0); while (get_TimeCount() < picdelay) ; // // draw pic // VWB_DrawPic(picx&~7, picy, picnum); }
void TimedPicCommand (void) { int delay; ParseTimedCommand (); // // update the screen, and wait for time delay // VW_UpdateScreen (); // // wait for time // delay = ticcount; while (ticcount < (delay+picdelay)) ; // // draw pic // Pic = (pic_t *) W_CacheLumpNum (GFX_STRT+(picnum-1), PU_CACHE); VWB_DrawPic (picx & ~7, picy, Pic); }
void Victory (void) { #ifndef SPEARDEMO long sec; int i,min,kr,sr,tr,x; char tempstr[8]; #define RATIOX 6 #define RATIOY 14 #define TIMEX 14 #define TIMEY 8 #ifdef SPEAR StartCPMusic (XTHEEND_MUS); CA_CacheGrChunk(BJCOLLAPSE1PIC); CA_CacheGrChunk(BJCOLLAPSE2PIC); CA_CacheGrChunk(BJCOLLAPSE3PIC); CA_CacheGrChunk(BJCOLLAPSE4PIC); VWB_Bar(0,0,320,200,VIEWCOLOR); VWB_DrawPic (124,44,BJCOLLAPSE1PIC); VW_UpdateScreen (); VW_FadeIn (); VW_WaitVBL(2*70); VWB_DrawPic (124,44,BJCOLLAPSE2PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE3PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE4PIC); VW_UpdateScreen (); VW_WaitVBL(3*70); UNCACHEGRCHUNK(BJCOLLAPSE1PIC); UNCACHEGRCHUNK(BJCOLLAPSE2PIC); UNCACHEGRCHUNK(BJCOLLAPSE3PIC); UNCACHEGRCHUNK(BJCOLLAPSE4PIC); VL_FadeOut (0,255,0,17,17,5); #endif StartCPMusic (URAHERO_MUS); ClearSplitVWB (); CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); CA_CacheGrChunk(STARTFONT); #ifndef SPEAR CA_CacheGrChunk(C_TIMECODEPIC); #endif VWB_Bar (0,0,320,200-STATUSLINES,127); #ifdef JAPAN #ifndef JAPDEMO CA_CacheGrChunk(C_ENDRATIOSPIC); VWB_DrawPic(0,0,C_ENDRATIOSPIC); UNCACHEGRCHUNK(C_ENDRATIOSPIC); #endif #else Write(18,2,STR_YOUWIN); Write(TIMEX,TIMEY-2,STR_TOTALTIME); Write(12,RATIOY-2,"averages"); #ifdef SPANISH Write(RATIOX+2, RATIOY, STR_RATKILL); Write(RATIOX+2, RATIOY+2, STR_RATSECRET); Write(RATIOX+2, RATIOY+4,STR_RATTREASURE); #else Write(RATIOX+8,RATIOY, STR_RATKILL); Write(RATIOX+4,RATIOY+2, STR_RATSECRET); Write(RATIOX, RATIOY+4,STR_RATTREASURE); #endif #endif #ifndef JAPDEMO VWB_DrawPic (8,4,L_BJWINSPIC); #endif #ifndef SPEAR for (kr = sr = tr = sec = i = 0;i < 8;i++) #else for (kr = sr = tr = sec = i = 0;i < 20;i++) #endif { sec += LevelRatios[i].time; kr += LevelRatios[i].kill; sr += LevelRatios[i].secret; tr += LevelRatios[i].treasure; } #ifndef SPEAR kr /= 8; sr /= 8; tr /= 8; #else kr /= 14; sr /= 14; tr /= 14; #endif min = sec/60; sec %= 60; if (min > 99) min = sec = 99; i = TIMEX*8+1; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min%10)); i += 2*8; Write(i/8,TIMEY,":"); i += 1*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec%10)); VW_UpdateScreen (); itoa(kr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY,tempstr); itoa(sr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+2,tempstr); itoa(tr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+4,tempstr); #ifndef SPANISH #ifndef UPLOAD #ifndef SPEAR // // TOTAL TIME VERIFICATION CODE // if (gamestate.difficulty>=gd_medium) { VWB_DrawPic (30*8,TIMEY*8,C_TIMECODEPIC); fontnumber = 0; fontcolor = READHCOLOR; PrintX = 30*8-3; PrintY = TIMEY*8+8; PrintX+=4; tempstr[0] = (((min/10)^(min%10))^0xa)+'A'; tempstr[1] = (((sec/10)^(sec%10))^0xa)+'A'; tempstr[2] = (tempstr[0]^tempstr[1])+'A'; tempstr[3] = 0; US_Print(tempstr); } #endif #endif #endif fontnumber = 1; VW_UpdateScreen (); VW_FadeIn (); IN_Ack(); #ifndef SPEAR if (Keyboard[sc_P] && MS_CheckParm("goobers")) PicturePause(); #endif VW_FadeOut (); #ifndef SPEAR UNCACHEGRCHUNK(C_TIMECODEPIC); #endif UnCacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); #ifndef SPEAR EndText(); #else EndSpear(); #endif #endif // SPEARDEMO }
void PageLayout (boolean shownumber) { int i,oldfontcolor; char ch; oldfontcolor = fontcolor; fontcolor = 0; // // clear the screen // VWB_Bar (0,0,320,200,BACKCOLOR); VWB_DrawPic (0,0,H_TOPWINDOWPIC); VWB_DrawPic (0,8,H_LEFTWINDOWPIC); VWB_DrawPic (312,8,H_RIGHTWINDOWPIC); VWB_DrawPic (8,176,H_BOTTOMINFOPIC); for (i=0;i<TEXTROWS;i++) { leftmargin[i] = LEFTMARGIN; rightmargin[i] = SCREENPIXWIDTH-RIGHTMARGIN; } px = LEFTMARGIN; py = TOPMARGIN; rowon = 0; layoutdone = False; // // make sure we are starting layout text (^P first command) // while (*text <= 32) text++; if (*text != '^' || toupper(*++text) != 'P') Quit ("PageLayout: Text not headed with ^P"); while (*text++ != '\n') ; // // process text stream // do { ch = *text; if (ch == '^') HandleCommand (); else if (ch == 9) { px = (px+8)&0xf8; text++; } else if (ch <= 32) HandleCtrls (); else HandleWord (); } while (!layoutdone); pagenum++; if (shownumber) { #ifdef SPANISH strcpy (str,"Hoja "); itoa (pagenum,str2,10); strcat (str,str2); strcat (str," de "); py = 183; px = 208; #else strcpy (str,"pg "); _itoa (pagenum,str2,10); strcat (str,str2); strcat (str," of "); py = 183; px = 213; #endif _itoa (numpages,str2,10); strcat (str,str2); fontcolor = 0x4f; //12^BACKCOLOR; VWB_DrawPropString (str); } fontcolor = oldfontcolor; }
void HandleCommand (void) { int i,margin,top,bottom; int picwidth,picheight,picmid; switch (toupper(*++text)) { case 'B': picy=ParseNumber(); picx=ParseNumber(); picwidth=ParseNumber(); picheight=ParseNumber(); VWB_Bar(picx,picy,picwidth,picheight,BACKCOLOR); RipToEOL(); break; case ';': // comment RipToEOL(); break; case 'P': // ^P is start of next page, ^E is end of file case 'E': layoutdone = True; text--; // back up to the '^' break; case 'C': // ^c<hex digit> changes text color i = toupper(*++text); if (i>='0' && i<='9') fontcolor = i-'0'; else if (i>='A' && i<='F') fontcolor = i-'A'+10; fontcolor *= 16; i = toupper(*++text); if (i>='0' && i<='9') fontcolor += i-'0'; else if (i>='A' && i<='F') fontcolor += i-'A'+10; text++; break; case '>': px = 160; text++; break; case 'L': py=ParseNumber(); rowon = (py-TOPMARGIN)/FONTHEIGHT; py = TOPMARGIN+rowon*FONTHEIGHT; px=ParseNumber(); while (*text++ != '\n') // scan to end of line ; break; case 'T': // ^Tyyy,xxx,ppp,ttt waits ttt tics, then draws pic TimedPicCommand (); break; case 'G': // ^Gyyy,xxx,ppp draws graphic ParsePicCommand (); VWB_DrawPic (picx&~7,picy,picnum); picwidth = pictable[picnum-STARTPICS].width; picheight = pictable[picnum-STARTPICS].height; // // adjust margins // picmid = picx + picwidth/2; if (picmid > SCREENMID) margin = picx-PICMARGIN; // new right margin else margin = picx+picwidth+PICMARGIN; // new left margin top = (picy-TOPMARGIN)/FONTHEIGHT; if (top<0) top = 0; bottom = (picy+picheight-TOPMARGIN)/FONTHEIGHT; if (bottom>=TEXTROWS) bottom = TEXTROWS-1; for (i=top;i<=bottom;i++) if (picmid > SCREENMID) rightmargin[i] = margin; else leftmargin[i] = margin; // // adjust this line if needed // if (px < leftmargin[rowon]) px = leftmargin[rowon]; break; } }
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; }
void Victory() { #ifndef SPEARDEMO long sec; int i,min,kr,sr,tr,x; char tempstr[8]; #define RATIOX 6 #define RATIOY 14 #define TIMEX 14 #define TIMEY 8 #ifdef SPEAR StartCPMusic(XTHEEND_MUS); CA_CacheGrChunk(BJCOLLAPSE1PIC); CA_CacheGrChunk(BJCOLLAPSE2PIC); CA_CacheGrChunk(BJCOLLAPSE3PIC); CA_CacheGrChunk(BJCOLLAPSE4PIC); VW_Bar(0,0,320,200,VIEWCOLOR); VWB_DrawPic (124,44,BJCOLLAPSE1PIC); VW_UpdateScreen (); VW_FadeIn (); VW_WaitVBL(2*70); VWB_DrawPic (124,44,BJCOLLAPSE2PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE3PIC); VW_UpdateScreen (); VW_WaitVBL(105); VWB_DrawPic (124,44,BJCOLLAPSE4PIC); VW_UpdateScreen (); VW_WaitVBL(3*70); CA_UnCacheGrChunk(BJCOLLAPSE1PIC); CA_UnCacheGrChunk(BJCOLLAPSE2PIC); CA_UnCacheGrChunk(BJCOLLAPSE3PIC); CA_UnCacheGrChunk(BJCOLLAPSE4PIC); VL_FadeOut (0,255,0,17,17,5); #endif StartCPMusic (URAHERO_MUS); ClearSplitVWB (); CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); CA_CacheGrChunk(STARTFONT); VW_Bar (0,0,320,200-STATUSLINES,127); Write(18,2,STR_YOUWIN); Write(TIMEX,TIMEY-2,STR_TOTALTIME); Write(12,RATIOY-2,"averages"); Write(RATIOX+8,RATIOY, STR_RATKILL); Write(RATIOX+4,RATIOY+2, STR_RATSECRET); Write(RATIOX, RATIOY+4,STR_RATTREASURE); VWB_DrawPic (8,4,L_BJWINSPIC); #ifndef SPEAR for (kr = sr = tr = sec = i = 0;i < 8;i++) #else for (kr = sr = tr = sec = i = 0;i < 20;i++) #endif { sec += LevelRatios[i].time; kr += LevelRatios[i].kill; sr += LevelRatios[i].secret; tr += LevelRatios[i].treasure; } #ifndef SPEAR kr /= 8; sr /= 8; tr /= 8; #else kr /= 14; sr /= 14; tr /= 14; #endif min = sec/60; sec %= 60; if (min > 99) min = sec = 99; i = TIMEX*8+1; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(min%10)); i += 2*8; Write(i/8,TIMEY,":"); i += 1*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec/10)); i += 2*8; VWB_DrawPic(i,TIMEY*8,L_NUM0PIC+(sec%10)); VW_UpdateScreen (); itoa(kr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY,tempstr); itoa(sr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+2,tempstr); itoa(tr,tempstr,10); x=RATIOX+24-strlen(tempstr)*2; Write(x,RATIOY+4,tempstr); fontnumber = 1; VW_UpdateScreen (); VW_FadeIn (); IN_Ack(); #ifndef SPEAR if (IN_KeyDown(sc_P) && MS_CheckParm("debugmode")) PicturePause(); #endif VW_FadeOut (); UnCacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); #ifndef SPEAR EndText(); #else EndSpear(); #endif #endif /* SPEARDEMO */ }
void StatusDrawPic(unsigned x, unsigned y, unsigned picnum) { VWB_DrawPic(x*8, y+160, picnum); }
void DoJukebox(void) { int which,lastsong=-1; unsigned start; unsigned songs[]= { #ifndef SPEAR GETTHEM_MUS, SEARCHN_MUS, POW_MUS, SUSPENSE_MUS, WARMARCH_MUS, CORNER_MUS, NAZI_OMI_MUS, PREGNANT_MUS, GOINGAFT_MUS, HEADACHE_MUS, DUNGEON_MUS, ULTIMATE_MUS, INTROCW3_MUS, NAZI_RAP_MUS, TWELFTH_MUS, ZEROHOUR_MUS, ULTIMATE_MUS, PACMAN_MUS #else XFUNKIE_MUS, // 0 XDEATH_MUS, // 2 XTIPTOE_MUS, // 4 XTHEEND_MUS, // 7 XEVIL_MUS, // 17 XJAZNAZI_MUS, // 18 XPUTIT_MUS, // 21 XGETYOU_MUS, // 22 XTOWER2_MUS // 23 #endif }; IN_ClearKeysDown(); if (!AdLibPresent && !SoundBlasterPresent) return; MenuFadeOut(); #ifndef SPEAR #ifndef UPLOAD start = ((LR_GetTicks()/10)%3)*6; #else start = 0; #endif #else start = 0; #endif CA_CacheGrChunk (STARTFONT+1); #ifdef SPEAR CacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END); #else CacheLump (CONTROLS_LUMP_START,CONTROLS_LUMP_END); #endif CA_LoadAllSounds (); fontnumber=1; ClearMScreen (); VWB_DrawPic(112,184,C_MOUSELBACKPIC); DrawStripes (10); SETFONTCOLOR (TEXTCOLOR,BKGDCOLOR); #ifndef SPEAR DrawWindow (CTL_X-2,CTL_Y-6,280,13*7,BKGDCOLOR); #else DrawWindow (CTL_X-2,CTL_Y-26,280,13*10,BKGDCOLOR); #endif DrawMenu (&MusicItems,&MusicMenu[start]); SETFONTCOLOR (READHCOLOR,BKGDCOLOR); PrintY = 15; WindowX = 0; WindowY = 320; US_CPrint ("Robert's Jukebox"); SETFONTCOLOR (TEXTCOLOR,BKGDCOLOR); VW_UpdateScreen(); MenuFadeIn(); do { which = HandleMenu(&MusicItems,&MusicMenu[start],NULL); if (which >= 0) { if (lastsong >= 0) MusicMenu[start+lastsong].active = 1; StartCPMusic(songs[start + which]); MusicMenu[start+which].active = 2; DrawMenu (&MusicItems,&MusicMenu[start]); VW_UpdateScreen(); lastsong = which; } } while(which >= 0); MenuFadeOut(); IN_ClearKeysDown(); #ifdef SPEAR UnCacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END); #else UnCacheLump (CONTROLS_LUMP_START,CONTROLS_LUMP_END); #endif }
void DemoLoop (void) { id0_int_t i,level; // // check for launch from ted // if (tedlevel) { NewGame(); gamestate.mapon = tedlevelnum; restartgame = gd_Normal; for (i = 1;i < id0_argc;i++) { if ( (level = US_CheckParm(id0_argv[i],ParmStrings)) == -1) continue; // REFKEEN - Cast for C++ restartgame = (GameDiff)(gd_Easy+level); break; } GameLoop(); TEDDeath(); } // // main game cycle // displayofs = bufferofs = 0; VW_Bar (0,0,320,200,0); while (1) { CA_CacheGrChunk (TITLEPIC); bufferofs = SCREEN2START; displayofs = SCREEN1START; VWB_DrawPic (0,0,TITLEPIC); MM_SetPurge (&grsegs[TITLEPIC],3); UNMARKGRCHUNK(TITLEPIC); FizzleFade (bufferofs,displayofs,320,200,true); if (!IN_UserInput(TickBase*3,false)) { CA_CacheGrChunk (CREDITSPIC); VWB_DrawPic (0,0,CREDITSPIC); MM_SetPurge (&grsegs[CREDITSPIC],3); UNMARKGRCHUNK(CREDITSPIC); FizzleFade (bufferofs,displayofs,320,200,true); } if (!IN_UserInput(TickBase*3,false)) { highscores: DrawHighScores (); FizzleFade (bufferofs,displayofs,320,200,true); IN_UserInput(TickBase*3,false); } if (IN_IsUserInput()) { US_ControlPanel (); if (restartgame || loadedgame) { GameLoop (); goto highscores; } } } }
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); } } } }