mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 09:11:21 +00:00
Load intermission patches in Y_LoadIntermisionData
This commit is contained in:
parent
2c1b383c4a
commit
397fdef034
3 changed files with 87 additions and 48 deletions
|
@ -3973,6 +3973,7 @@ static void G_DoCompleted(void)
|
||||||
{
|
{
|
||||||
G_SetGamestate(GS_INTERMISSION);
|
G_SetGamestate(GS_INTERMISSION);
|
||||||
Y_StartIntermission();
|
Y_StartIntermission();
|
||||||
|
Y_LoadIntermisionData();
|
||||||
G_UpdateVisited();
|
G_UpdateVisited();
|
||||||
G_HandleSaveLevel();
|
G_HandleSaveLevel();
|
||||||
}
|
}
|
||||||
|
|
133
src/y_inter.c
133
src/y_inter.c
|
@ -215,6 +215,86 @@ static void Y_IntermissionTokenDrawer(void)
|
||||||
V_DrawCroppedPatch(32<<FRACBITS, y<<FRACBITS, FRACUNIT/2, 0, tokenicon, 0, 0, tokenicon->width, calc);
|
V_DrawCroppedPatch(32<<FRACBITS, y<<FRACBITS, FRACUNIT/2, 0, tokenicon, 0, 0, tokenicon->width, calc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y_LoadData
|
||||||
|
//
|
||||||
|
// Load patches for drawing the intermission, if acceptable
|
||||||
|
//
|
||||||
|
void Y_LoadIntermisionData(void)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
if (dedicated)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (intertype)
|
||||||
|
{
|
||||||
|
case int_coop:
|
||||||
|
{
|
||||||
|
for (i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
if (strlen(data.coop.bonuses[i].patch))
|
||||||
|
data.coop.bonuspatches[i] = W_CachePatchName(data.coop.bonuses[i].patch, PU_PATCH);
|
||||||
|
}
|
||||||
|
data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_PATCH);
|
||||||
|
|
||||||
|
// get background patches
|
||||||
|
bgpatch = W_CachePatchName("INTERSCR", PU_PATCH);
|
||||||
|
|
||||||
|
// grab an interscreen if appropriate
|
||||||
|
if (mapheaderinfo[gamemap-1]->interscreen[0] != '#')
|
||||||
|
interpic = W_CachePatchName(mapheaderinfo[gamemap-1]->interscreen, PU_PATCH);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case int_spec:
|
||||||
|
{
|
||||||
|
for (i = 0; i < 2; ++i)
|
||||||
|
data.spec.bonuspatches[i] = W_CachePatchName(data.spec.bonuses[i].patch, PU_PATCH);
|
||||||
|
|
||||||
|
data.spec.pscore = W_CachePatchName("YB_SCORE", PU_PATCH);
|
||||||
|
data.spec.pcontinues = W_CachePatchName("YB_CONTI", PU_PATCH);
|
||||||
|
|
||||||
|
// get background tile
|
||||||
|
bgtile = W_CachePatchName("SPECTILE", PU_PATCH);
|
||||||
|
|
||||||
|
// grab an interscreen if appropriate
|
||||||
|
if (mapheaderinfo[gamemap-1]->interscreen[0] != '#')
|
||||||
|
interpic = W_CachePatchName(mapheaderinfo[gamemap-1]->interscreen, PU_PATCH);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case int_match:
|
||||||
|
case int_race:
|
||||||
|
case int_teammatch:
|
||||||
|
case int_ctf:
|
||||||
|
{
|
||||||
|
if (intertype == int_match || intertype == int_race)
|
||||||
|
{
|
||||||
|
// get RESULT header
|
||||||
|
data.match.result = W_CachePatchName("RESULT", PU_PATCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (intertype == int_ctf)
|
||||||
|
{
|
||||||
|
data.match.redflag = rflagico;
|
||||||
|
data.match.blueflag = bflagico;
|
||||||
|
}
|
||||||
|
else // team match
|
||||||
|
{
|
||||||
|
data.match.redflag = rmatcico;
|
||||||
|
data.match.blueflag = bmatcico;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get background tile
|
||||||
|
bgtile = W_CachePatchName("SRB2BACK", PU_PATCH);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case int_none:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y_ConsiderScreenBuffer
|
// Y_ConsiderScreenBuffer
|
||||||
//
|
//
|
||||||
|
@ -1176,6 +1256,11 @@ void Y_DetermineIntermissionType(void)
|
||||||
intertype = int_ctf;
|
intertype = int_ctf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y_StartIntermission
|
||||||
|
//
|
||||||
|
// Called by G_DoCompleted. Sets up data for intermission drawer/ticker.
|
||||||
|
//
|
||||||
//
|
//
|
||||||
// Y_StartIntermission
|
// Y_StartIntermission
|
||||||
//
|
//
|
||||||
|
@ -1183,8 +1268,6 @@ void Y_DetermineIntermissionType(void)
|
||||||
//
|
//
|
||||||
void Y_StartIntermission(void)
|
void Y_StartIntermission(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
intertic = -1;
|
intertic = -1;
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
|
@ -1228,23 +1311,12 @@ void Y_StartIntermission(void)
|
||||||
// setup time data
|
// setup time data
|
||||||
data.coop.tics = players[consoleplayer].realtime;
|
data.coop.tics = players[consoleplayer].realtime;
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i)
|
|
||||||
{
|
|
||||||
if (strlen(data.coop.bonuses[i].patch))
|
|
||||||
data.coop.bonuspatches[i] = W_CachePatchName(data.coop.bonuses[i].patch, PU_PATCH);
|
|
||||||
}
|
|
||||||
data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_PATCH);
|
|
||||||
|
|
||||||
// get act number
|
// get act number
|
||||||
data.coop.actnum = mapheaderinfo[gamemap-1]->actnum;
|
data.coop.actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||||
|
|
||||||
// get background patches
|
|
||||||
bgpatch = W_CachePatchName("INTERSCR", PU_PATCH);
|
|
||||||
|
|
||||||
// grab an interscreen if appropriate
|
// grab an interscreen if appropriate
|
||||||
if (mapheaderinfo[gamemap-1]->interscreen[0] != '#')
|
if (mapheaderinfo[gamemap-1]->interscreen[0] != '#')
|
||||||
{
|
{
|
||||||
interpic = W_CachePatchName(mapheaderinfo[gamemap-1]->interscreen, PU_PATCH);
|
|
||||||
useinterpic = true;
|
useinterpic = true;
|
||||||
usebuffer = false;
|
usebuffer = false;
|
||||||
}
|
}
|
||||||
|
@ -1301,21 +1373,9 @@ void Y_StartIntermission(void)
|
||||||
// give out ring bonuses
|
// give out ring bonuses
|
||||||
Y_AwardSpecialStageBonus();
|
Y_AwardSpecialStageBonus();
|
||||||
|
|
||||||
for (i = 0; i < 2; ++i)
|
|
||||||
data.spec.bonuspatches[i] = W_CachePatchName(data.spec.bonuses[i].patch, PU_PATCH);
|
|
||||||
|
|
||||||
data.spec.pscore = W_CachePatchName("YB_SCORE", PU_PATCH);
|
|
||||||
data.spec.pcontinues = W_CachePatchName("YB_CONTI", PU_PATCH);
|
|
||||||
|
|
||||||
// get background tile
|
|
||||||
bgtile = W_CachePatchName("SPECTILE", PU_PATCH);
|
|
||||||
|
|
||||||
// grab an interscreen if appropriate
|
// grab an interscreen if appropriate
|
||||||
if (mapheaderinfo[gamemap-1]->interscreen[0] != '#')
|
if (mapheaderinfo[gamemap-1]->interscreen[0] != '#')
|
||||||
{
|
|
||||||
interpic = W_CachePatchName(mapheaderinfo[gamemap-1]->interscreen, PU_PATCH);
|
|
||||||
useinterpic = true;
|
useinterpic = true;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
useinterpic = false;
|
useinterpic = false;
|
||||||
|
|
||||||
|
@ -1408,11 +1468,6 @@ void Y_StartIntermission(void)
|
||||||
|
|
||||||
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
|
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
|
||||||
|
|
||||||
// get RESULT header
|
|
||||||
data.match.result =
|
|
||||||
W_CachePatchName("RESULT", PU_PATCH);
|
|
||||||
|
|
||||||
bgtile = W_CachePatchName("SRB2BACK", PU_PATCH);
|
|
||||||
usetile = true;
|
usetile = true;
|
||||||
useinterpic = false;
|
useinterpic = false;
|
||||||
break;
|
break;
|
||||||
|
@ -1437,10 +1492,6 @@ void Y_StartIntermission(void)
|
||||||
|
|
||||||
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
|
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
|
||||||
|
|
||||||
// get RESULT header
|
|
||||||
data.match.result = W_CachePatchName("RESULT", PU_PATCH);
|
|
||||||
|
|
||||||
bgtile = W_CachePatchName("SRB2BACK", PU_PATCH);
|
|
||||||
usetile = true;
|
usetile = true;
|
||||||
useinterpic = false;
|
useinterpic = false;
|
||||||
break;
|
break;
|
||||||
|
@ -1466,18 +1517,6 @@ void Y_StartIntermission(void)
|
||||||
|
|
||||||
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
|
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
|
||||||
|
|
||||||
if (intertype == int_ctf)
|
|
||||||
{
|
|
||||||
data.match.redflag = rflagico;
|
|
||||||
data.match.blueflag = bflagico;
|
|
||||||
}
|
|
||||||
else // team match
|
|
||||||
{
|
|
||||||
data.match.redflag = rmatcico;
|
|
||||||
data.match.blueflag = bmatcico;
|
|
||||||
}
|
|
||||||
|
|
||||||
bgtile = W_CachePatchName("SRB2BACK", PU_PATCH);
|
|
||||||
usetile = true;
|
usetile = true;
|
||||||
useinterpic = false;
|
useinterpic = false;
|
||||||
break;
|
break;
|
||||||
|
@ -1502,8 +1541,6 @@ void Y_StartIntermission(void)
|
||||||
|
|
||||||
data.competition.levelstring[sizeof data.competition.levelstring - 1] = '\0';
|
data.competition.levelstring[sizeof data.competition.levelstring - 1] = '\0';
|
||||||
|
|
||||||
// get background tile
|
|
||||||
bgtile = W_CachePatchName("SRB2BACK", PU_PATCH);
|
|
||||||
usetile = true;
|
usetile = true;
|
||||||
useinterpic = false;
|
useinterpic = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -14,6 +14,7 @@ extern boolean usebuffer;
|
||||||
void Y_IntermissionDrawer(void);
|
void Y_IntermissionDrawer(void);
|
||||||
void Y_Ticker(void);
|
void Y_Ticker(void);
|
||||||
|
|
||||||
|
void Y_LoadIntermisionData(void);
|
||||||
void Y_StartIntermission(void);
|
void Y_StartIntermission(void);
|
||||||
void Y_EndIntermission(void);
|
void Y_EndIntermission(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue