Exemplo n.º 1
0
//
// END ARTICLES
//
void EndText()
{
	int artnum;
	const char *text;

	ClearMemory();

	artnum = endextern+gamestate.episode;
	CA_CacheGrChunk(artnum);
	if (w0 == true){
		text = (const char *)grsegsWL1[artnum];
	} else if (w1 == true){
		text = (const char *)grsegsWL6[artnum];
	} else if (s0 == true){
		text = (const char *)grsegsSDM[artnum];
	} else {
		text = (const char *)grsegsSOD[artnum];
	}

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();
	SETFONTCOLOR(0,15);
	IN_ClearKeysDown();

	IN_GetMouseDelta(NULL, NULL); // Clear accumulated mouse movement
	
	FreeMusic();
}
Exemplo n.º 2
0
/*
=================
=
= HelpScreens
=
=================
*/
void HelpScreens()
{
	int artnum;
	const char *text;

	artnum = helpextern;
	CA_CacheGrChunk(artnum);
	if (w0 == true){
		text = (const char *)grsegsWL1[artnum];
	} else if (w1 == true){
		text = (const char *)grsegsWL6[artnum];
	} else if (s0 == true){
		text = (const char *)grsegsSDM[artnum];
	} else {
		text = (const char *)grsegsSOD[artnum];
	}

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();

	FreeMusic();
}
Exemplo n.º 3
0
void EndScreen(int palette, int screen)
{
	VL_CacheScreen(screen);
	VW_UpdateScreen();
	CA_CacheGrChunk(palette);
	VL_FadeIn(0, 255, grsegs[palette], 30);
	CA_UnCacheGrChunk(palette);
	
	IN_ClearKeysDown();
	IN_Ack();
	VW_FadeOut();
}
Exemplo n.º 4
0
void EndSpear()
{
	EndScreen(END1PALETTE, ENDSCREEN11PIC);

	VL_CacheScreen(ENDSCREEN3PIC);
	VW_UpdateScreen();
	CA_CacheGrChunk(END3PALETTE);
	VL_FadeIn(0, 255, grsegs[END3PALETTE], 30);
	CA_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 ();
	set_TimeCount(0);
	while ( !IN_CheckAck () && (get_TimeCount() < 700) );

	PrintX = 0;
	PrintY = 180;
	VW_Bar(0,180,320,20,0);
	US_CPrint(STR_ENDGAME3"\n");
	US_CPrint(STR_ENDGAME4);
	VW_UpdateScreen();
	
	IN_StartAck ();
	set_TimeCount(0);
	while ( !IN_CheckAck () && (get_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;
}
Exemplo n.º 5
0
void PG13()
{
	VW_FadeOut();
	VW_Bar(0,0,320,200,0x82);			// background

	CA_CacheGrChunk (PG13PIC);
	VWB_DrawPic (216,110,PG13PIC);
	VW_UpdateScreen ();

	CA_UnCacheGrChunk (PG13PIC);

	VW_FadeIn();
	IN_UserInput(TickBase*7);

	VW_FadeOut ();
}
Exemplo n.º 6
0
/*
=================
=
= HelpScreens
=
=================
*/
void HelpScreens()
{
	int artnum;
	signed char *text;

	artnum = helpextern;
	CA_CacheGrChunk(artnum);
	text = (signed char *)grsegs[artnum];

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();

	FreeMusic();
}
Exemplo n.º 7
0
//
// END ARTICLES
//
void EndText()
{
	int artnum;
	signed char *text;

	ClearMemory();

	artnum = endextern+gamestate.episode;
	CA_CacheGrChunk(artnum);
	text = (signed char *)grsegs[artnum];

	ShowArticle(text);

	CA_UnCacheGrChunk(artnum);
	
	VW_FadeOut();
	SETFONTCOLOR(0,15);
	IN_ClearKeysDown();

	FreeMusic();
}
Exemplo n.º 8
0
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 */
}
Exemplo n.º 9
0
static void CAL_SetupGrFile()
{
	char fname[13];
	int handle;
	byte *grtemp;
	int i;

/* load vgadict.ext (huffman dictionary for graphics files) */
	strcpy(fname, gdictname);
	strcat(fname, extension);

	handle = OpenRead(fname);
	if (handle == -1)
		CA_CannotOpen(fname);

	for (i = 0; i < 256; i++) {
		grhuffman[i].bit0 = ReadInt16(handle);
		grhuffman[i].bit1 = ReadInt16(handle);
	}
	
	CloseRead(handle);
	
/* load the data offsets from vgahead.ext */
	if (w0 == true){
		MM_GetPtr((memptr)&grstarts, (NUMCHUNKSWL1+1)*4);
		MM_GetPtr((memptr)&grtemp, (NUMCHUNKSWL1+1)*3);
	}else if (w1 == true){
		MM_GetPtr((memptr)&grstarts, (NUMCHUNKSWL6+1)*4);
		MM_GetPtr((memptr)&grtemp, (NUMCHUNKSWL6+1)*3);
	}else if (s0 == true){
		MM_GetPtr((memptr)&grstarts, (NUMCHUNKSSDM+1)*4);
		MM_GetPtr((memptr)&grtemp, (NUMCHUNKSSDM+1)*3);
	}else{
		MM_GetPtr((memptr)&grstarts, (NUMCHUNKSSOD+1)*4);
		MM_GetPtr((memptr)&grtemp, (NUMCHUNKSSOD+1)*3);
	}
	
	strcpy(fname, gheadname);
	strcat(fname, extension);

	handle = OpenRead(fname);
	if (handle == -1)
		CA_CannotOpen(fname);
	if (w0 == true){
		ReadBytes(handle, grtemp, (NUMCHUNKSWL1+1)*3);
	
		for (i = 0; i < NUMCHUNKSWL1+1; i++)
			grstarts[i] = (grtemp[i*3+0]<<0)|(grtemp[i*3+1]<<8)|(grtemp[i*3+2]<<16);
	}else if (w1 == true){
		ReadBytes(handle, grtemp, (NUMCHUNKSWL6+1)*3);
	
		for (i = 0; i < NUMCHUNKSWL6+1; i++)
			grstarts[i] = (grtemp[i*3+0]<<0)|(grtemp[i*3+1]<<8)|(grtemp[i*3+2]<<16);
	}else if (s0 == true){
		ReadBytes(handle, grtemp, (NUMCHUNKSSDM+1)*3);
	
		for (i = 0; i < NUMCHUNKSSDM+1; i++)
			grstarts[i] = (grtemp[i*3+0]<<0)|(grtemp[i*3+1]<<8)|(grtemp[i*3+2]<<16);
	}else{
		ReadBytes(handle, grtemp, (NUMCHUNKSSOD+1)*3);
	
		for (i = 0; i < NUMCHUNKSSOD+1; i++)
			grstarts[i] = (grtemp[i*3+0]<<0)|(grtemp[i*3+1]<<8)|(grtemp[i*3+2]<<16);
	}

	MM_FreePtr((memptr)&grtemp);
	
	CloseRead(handle);
	
/* Open the graphics file, leaving it open until the game is finished */
	strcpy(fname, gfilename);
	strcat(fname, extension);

	grhandle = OpenRead(fname);
	if (grhandle == -1)
		CA_CannotOpen(fname);

/* load the pic headers into pictable */
	CA_CacheGrChunk(STRUCTPIC);

	if (w0 == true){
		grtemp = grsegsWL1[STRUCTPIC];
		for (i = 0; i < NUMPICSWL1; i++) {
			pictableWL1[i].width = grtemp[i*4+0] | (grtemp[i*4+1] << 8);
			pictableWL1[i].height = grtemp[i*4+2] | (grtemp[i*4+3] << 8);
		}
	}else if (w1 == true){
		grtemp = grsegsWL6[STRUCTPIC];
		for (i = 0; i < NUMPICSWL6; i++) {
			pictableWL6[i].width = grtemp[i*4+0] | (grtemp[i*4+1] << 8);
			pictableWL6[i].height = grtemp[i*4+2] | (grtemp[i*4+3] << 8);
		}
	}else if (s0 == true){
		grtemp = grsegsSDM[STRUCTPIC];
		for (i = 0; i < NUMPICSSDM; i++) {
			pictableSDM[i].width = grtemp[i*4+0] | (grtemp[i*4+1] << 8);
			pictableSDM[i].height = grtemp[i*4+2] | (grtemp[i*4+3] << 8);
		}
	}else{
		grtemp = grsegsSOD[STRUCTPIC];
		for (i = 0; i < NUMPICSSOD; i++) {
			pictableSOD[i].width = grtemp[i*4+0] | (grtemp[i*4+1] << 8);
			pictableSOD[i].height = grtemp[i*4+2] | (grtemp[i*4+3] << 8);
		}
	}

	CA_UnCacheGrChunk(STRUCTPIC);
}