3 #include <ctype.h> // for toupper()
8 #define WR_CacheLumpName(a,b) W_GetNumForName(a)
9 #define V_DrawPatch(x,y,p) OGL_DrawPatch(x,y,p)
10 #define V_DrawFuzzPatch(x,y,p) OGL_DrawFuzzPatch(x,y,p)
11 #define V_DrawAltFuzzPatch(x,y,p) OGL_DrawAltFuzzPatch(x,y,p)
12 #define V_DrawShadowedPatch(x,y,p) OGL_DrawShadowedPatch(x,y,p)
13 #define V_DrawRawScreen(a) OGL_DrawRawScreen(a)
15 #define WR_CacheLumpName(a,b) W_CacheLumpName(a,b)
18 int finalestage; // 0 = text, 1 = art screen
24 char *e1text = E1TEXT;
25 char *e2text = E2TEXT;
26 char *e3text = E3TEXT;
27 char *e4text = E4TEXT;
28 char *e5text = E5TEXT;
34 extern boolean automapactive;
35 extern boolean viewactive;
37 extern void D_StartTitle(void);
40 =======================
44 =======================
47 void F_StartFinale (void)
49 gameaction = ga_nothing;
50 gamestate = GS_FINALE;
52 automapactive = false;
53 players[consoleplayer].messageTics = 1;
54 players[consoleplayer].message = NULL;
59 finaleflat = "FLOOR25";
63 finaleflat = "FLATHUH1";
67 finaleflat = "FLTWAWA2";
71 finaleflat = "FLOOR28";
75 finaleflat = "FLOOR08";
82 FontABaseLump = W_GetNumForName("FONTA_S")+1;
84 // S_ChangeMusic(mus_victor, true);
85 S_StartSong(mus_cptd, true);
90 boolean F_Responder (event_t *event)
92 if(event->type != ev_keydown)
96 if(finalestage == 1 && gameepisode == 2)
97 { // we're showing the water pic, make any key kick to demo mode
99 // Hmm... naughty Heretic again :/ - DDOI
100 //memset((byte *)0xa0000, 0, SCREENWIDTH*SCREENHEIGHT);
101 //memset(screen, 0, SCREENWIDTH*SCREENHEIGHT);
102 I_SetPalette(W_CacheLumpName("PLAYPAL", PU_CACHE));
110 =======================
114 =======================
120 if (!finalestage && finalecount>strlen (finaletext)*TEXTSPEED + TEXTWAIT)
128 // wipegamestate = -1; // force a wipe
130 if (gameepisode == 3)
131 S_StartMusic (mus_bunny);
138 =======================
142 =======================
145 //#include "HU_stuff.h"
146 //extern patch_t *hu_font[HU_FONTSIZE];
148 void F_TextWrite (void)
161 // erase the entire screen to a tiled background
164 src = W_CacheLumpName(finaleflat, PU_CACHE);
166 for (y=0 ; y<SCREENHEIGHT ; y++)
168 for (x=0 ; x<SCREENWIDTH/64 ; x++)
170 memcpy (dest, src+((y&63)<<6), 64);
175 memcpy (dest, src+((y&63)<<6), SCREENWIDTH&63);
176 dest += (SCREENWIDTH&63);
180 OGL_SetFlat (R_FlatNumForName(finaleflat));
181 OGL_DrawRectTiled(0,0,SCREENWIDTH,SCREENHEIGHT,64,64);
184 // V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
187 // draw some of the text onto the screen
193 count = (finalecount - 10)/TEXTSPEED;
196 for ( ; count ; count-- )
215 w = W_CacheLumpNum(FontABaseLump+c-33, PU_CACHE);
216 if (cx+w->width > SCREENWIDTH)
219 OGL_DrawPatch (cx,cy,FontABaseLump+c-33);
221 V_DrawPatch(cx, cy, w);
228 void F_DrawPatchCol (int x, patch_t *patch, int col)
231 byte *source, *dest, *desttop;
234 column = (column_t *)((byte *)patch + LONG(patch->columnofs[col]));
237 // step through the posts in a column
239 while (column->topdelta != 0xff )
241 source = (byte *)column + 3;
242 dest = desttop + column->topdelta*SCREENWIDTH;
243 count = column->length;
250 column = (column_t *)( (byte *)column + column->length+ 4 );
262 void F_DemonScroll(void)
266 static int nextscroll = 0;
268 if(finalecount < nextscroll)
272 p1 = W_CacheLumpName("FINAL1", PU_LEVEL);
273 p2 = W_CacheLumpName("FINAL2", PU_LEVEL);
276 memcpy(screen, p1, SCREENHEIGHT*SCREENWIDTH);
277 nextscroll = finalecount;
282 memcpy(screen, p2+SCREENHEIGHT*SCREENWIDTH-yval, yval);
283 memcpy(screen+yval, p1, SCREENHEIGHT*SCREENWIDTH-yval);
285 nextscroll = finalecount+3;
288 { //else, we'll just sit here and wait, for now
289 memcpy(screen, p2, SCREENWIDTH*SCREENHEIGHT);
301 void F_DrawUnderwater(void)
304 static boolean underwawa;
306 extern boolean MenuActive;
307 extern boolean askforquit;
316 // Naughty Heretic :/ - DDOI
317 //memset((byte *)0xa0000, 0, SCREENWIDTH*SCREENHEIGHT);
318 I_SetPalette(W_CacheLumpName("E2PAL", PU_CACHE));
319 memcpy(screen, W_CacheLumpName("E2END", PU_CACHE),
320 SCREENWIDTH*SCREENHEIGHT);
330 memcpy(screen, W_CacheLumpName("TITLE", PU_CACHE),
331 SCREENWIDTH*SCREENHEIGHT);
333 OGL_DrawRawScreen(W_GetNumForName("TITLE"));
335 //D_StartTitle(); // go to intro/demo mode.
349 void F_BunnyScroll (void)
355 static int laststage;
357 p1 = W_CacheLumpName ("PFUB2", PU_LEVEL);
358 p2 = W_CacheLumpName ("PFUB1", PU_LEVEL);
360 V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
362 scrolled = 320 - (finalecount-230)/2;
368 for ( x=0 ; x<SCREENWIDTH ; x++)
370 if (x+scrolled < 320)
371 F_DrawPatchCol (x, p1, x+scrolled);
373 F_DrawPatchCol (x, p2, x+scrolled - 320);
376 if (finalecount < 1130)
378 if (finalecount < 1180)
380 V_DrawPatch ((SCREENWIDTH-13*8)/2, (SCREENHEIGHT-8*8)/2,0, W_CacheLumpName ("END0",PU_CACHE));
385 stage = (finalecount-1180) / 5;
388 if (stage > laststage)
390 S_StartSound (NULL, sfx_pistol);
394 sprintf (name,"END%i",stage);
395 V_DrawPatch ((SCREENWIDTH-13*8)/2, (SCREENHEIGHT-8*8)/2, W_CacheLumpName (name,PU_CACHE));
400 =======================
404 =======================
409 UpdateState |= I_FULLSCRN;
419 V_DrawRawScreen(WR_CacheLumpName("ORDER", PU_CACHE));
423 V_DrawRawScreen(WR_CacheLumpName("CREDIT", PU_CACHE));
432 case 4: // Just show credits screen for extended episodes
434 V_DrawRawScreen(WR_CacheLumpName("CREDIT", PU_CACHE));