Commit 7c0a304e authored by Dino Bollinger's avatar Dino Bollinger
Browse files

Duke3D: Fix an error with the bonus tile, and extend EVENT_GETBONUSTILE

Within EVENT_GETBONUSTILE, you can now set ud.return[0] to ud.return[4]
to change each frame of the bonus screen animation separately.
parent c1d069e7
......@@ -2283,8 +2283,8 @@ const char* G_PrintBestTime(void)
void G_BonusScreen(int32_t bonusonly)
{
int32_t bonusscreen_tile;
int32_t bonuscnt;
int32_t bonusscreen_tiles[5];
int32_t k, bonuscnt;
int32_t clockpad = 2;
char *lastmapname;
......@@ -2370,9 +2370,15 @@ void G_BonusScreen(int32_t bonusonly)
if (bonusonly || (g_netServer || ud.multimode > 1)) return;
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);
bonusscreen_tiles[0] = BONUSSCREEN + ((ud.volume_number==1) ? 5 : 0);
for (k = 1; k < 5; ++k)
ud.returnvar[k-1] = bonusscreen_tiles[0] + k;
bonusscreen_tiles[0] = VM_OnEventWithReturn(EVENT_GETBONUSTILE, g_player[screenpeek].ps->i, screenpeek, bonusscreen_tiles[0]);
for (k = 1; k < 5; ++k)
bonusscreen_tiles[k] = ud.returnvar[k-1];
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, bonusscreen_tiles[0], 0, 0, 2+8+64+128+BGSTRETCH);
if (lastmapname)
menutext_center(20-6, lastmapname);
......@@ -2401,7 +2407,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_tile, 0, 0, 2+8+64+128+BGSTRETCH);
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, bonusscreen_tiles[0], 0, 0, 2+8+64+128+BGSTRETCH);
if (totalclock >= 1000000000 && totalclock < 1000000320)
{
......@@ -2432,11 +2438,11 @@ void G_BonusScreen(int32_t bonusonly)
case 1:
case 4:
case 5:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 3, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tiles[3], 0, 0, 2+8+16+64+128+BGSTRETCH);
break;
case 2:
case 3:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 4, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tiles[4], 0, 0, 2+8+16+64+128+BGSTRETCH);
break;
}
}
......@@ -2447,10 +2453,10 @@ void G_BonusScreen(int32_t bonusonly)
{
case 1:
case 3:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 1, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tiles[1], 0, 0, 2+8+16+64+128+BGSTRETCH);
break;
case 2:
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tile + 2, 0, 0, 2+8+16+64+128+BGSTRETCH);
rotatesprite_fs(199<<16, 31<<16, 65536L, 0, bonusscreen_tiles[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