Commit c1d069e7 authored by Dino Bollinger's avatar Dino Bollinger
Browse files

Duke3D: Add event EVENT_GETBONUSTILE to change bonus screen pic

The RETURN value will be set to the current base bonusscreen tile,
and changing it will change the tiles displayed in the bonusscreen.
parent 9bf153e0
......@@ -164,6 +164,7 @@ enum GameEvent_t {
EVENT_CAPIR,
EVENT_PREUPDATEANGLES,
EVENT_POSTUPDATEANGLES,
EVENT_GETBONUSTILE,
MAXEVENTS
};
......
......@@ -1033,6 +1033,7 @@ const char *EventNames[MAXEVENTS] =
"EVENT_CAPIR",
"EVENT_PREUPDATEANGLES",
"EVENT_POSTUPDATEANGLES",
"EVENT_GETBONUSTILE",
};
uint8_t *bitptr; // pointer to bitmap of which bytecode positions contain pointers
......
......@@ -2283,7 +2283,7 @@ const char* G_PrintBestTime(void)
void G_BonusScreen(int32_t bonusonly)
{
int32_t gfx_offset;
int32_t bonusscreen_tile;
int32_t bonuscnt;
int32_t clockpad = 2;
char *lastmapname;
......@@ -2370,8 +2370,9 @@ void G_BonusScreen(int32_t bonusonly)
if (bonusonly || (g_netServer || ud.multimode > 1)) return;
gfx_offset = (ud.volume_number==1) ? 5 : 0;
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, BONUSSCREEN+gfx_offset, 0, 0, 2+8+64+128+BGSTRETCH);
bonusscreen_tile = BONUSSCREEN + (ud.volume_number==1) ? 5 : 0;
bonusscreen_tile = VM_OnEventWithReturn(EVENT_GETBONUSTILE, g_player[screenpeek].ps->i, screenpeek, bonusscreen_tile);
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, bonusscreen_tile, 0, 0, 2+8+64+128+BGSTRETCH);
if (lastmapname)
menutext_center(20-6, lastmapname);
......@@ -2400,7 +2401,7 @@ void G_BonusScreen(int32_t bonusonly)
if (g_player[myconnectindex].ps->gm&MODE_EOL)
{
videoClearScreen(0);
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, BONUSSCREEN+gfx_offset, 0, 0, 2+8+64+128+BGSTRETCH);
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, bonusscreen_tile, 0, 0, 2+8+64+128+BGSTRETCH);
if (totalclock >= 1000000000 && totalclock < 1000000320)
{
......@@ -2431,11 +2432,11 @@ void G_BonusScreen(int32_t bonusonly)
case 1:
case 4:
case 5:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, BONUSSCREEN+3+gfx_offset, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 3, 0, 0, 2+8+16+64+128+BGSTRETCH);
break;
case 2:
case 3:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, BONUSSCREEN+4+gfx_offset, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 4, 0, 0, 2+8+16+64+128+BGSTRETCH);
break;
}
}
......@@ -2446,10 +2447,10 @@ void G_BonusScreen(int32_t bonusonly)
{
case 1:
case 3:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, BONUSSCREEN+1+gfx_offset, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 1, 0, 0, 2+8+16+64+128+BGSTRETCH);
break;
case 2:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, BONUSSCREEN+2+gfx_offset, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 2, 0, 0, 2+8+16+64+128+BGSTRETCH);
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment