mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 07:12:03 +00:00
Merge branch 'sp-tally-non-green-res-hud-fix' into 'master'
Single Player/Coop tally screen fixes * The TIME/SCORE part of the HUD now doesn't move from the position it was before the tally screen started in non-green resolutions. The example screenshots of this bug and the fix for it below are all taken in 640x480: How it should be: ![](https://dl.dropboxusercontent.com/s/4h86gnm0tvkwjxh/srb20293.png) How it displays in 2.1.19: ![](https://dl.dropboxusercontent.com/s/awyfupn5wgo40rv/srb20294.png) How it displays in an exe with the fix: ![](https://dl.dropboxusercontent.com/s/gbstznautbl5f38/srb20295.png) * The time display at the tally screen no longer limits the minute number to between 0 and 59. How a time > 60 mins displays normally just before finishing the level: ![](https://dl.dropboxusercontent.com/s/lclonkwfd656t55/srb20296.png) How it displays afterwards (it's supposed to be 61:19 but it's wrapped to 1:19 instead): ![](https://dl.dropboxusercontent.com/s/obv3fq2qeto9uo3/srb20297.png) See merge request !202
This commit is contained in:
commit
b291390edf
1 changed files with 30 additions and 13 deletions
|
@ -159,6 +159,20 @@ static void Y_CalculateMatchWinners(void);
|
|||
static void Y_FollowIntermission(void);
|
||||
static void Y_UnloadData(void);
|
||||
|
||||
// Stuff copy+pasted from st_stuff.c
|
||||
static INT32 SCX(INT32 x)
|
||||
{
|
||||
return FixedInt(FixedMul(x<<FRACBITS, vid.fdupx));
|
||||
}
|
||||
static INT32 SCY(INT32 z)
|
||||
{
|
||||
return FixedInt(FixedMul(z<<FRACBITS, vid.fdupy));
|
||||
}
|
||||
|
||||
#define ST_DrawNumFromHud(h,n) V_DrawTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, n)
|
||||
#define ST_DrawPadNumFromHud(h,n,q) V_DrawPaddedTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, n, q)
|
||||
#define ST_DrawPatchFromHud(h,p) V_DrawScaledPatch(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, p)
|
||||
|
||||
//
|
||||
// Y_IntermissionDrawer
|
||||
//
|
||||
|
@ -204,28 +218,31 @@ void Y_IntermissionDrawer(void)
|
|||
INT32 bonusy;
|
||||
|
||||
// draw score
|
||||
V_DrawScaledPatch(hudinfo[HUD_SCORE].x, hudinfo[HUD_SCORE].y, V_SNAPTOLEFT, sboscore);
|
||||
V_DrawTallNum(hudinfo[HUD_SCORENUM].x, hudinfo[HUD_SCORENUM].y, V_SNAPTOLEFT, data.coop.score);
|
||||
ST_DrawPatchFromHud(HUD_SCORE, sboscore);
|
||||
ST_DrawNumFromHud(HUD_SCORENUM, data.coop.score);
|
||||
|
||||
// draw time
|
||||
V_DrawScaledPatch(hudinfo[HUD_TIME].x, hudinfo[HUD_TIME].y, V_SNAPTOLEFT, sbotime);
|
||||
ST_DrawPatchFromHud(HUD_TIME, sbotime);
|
||||
if (cv_timetic.value == 1)
|
||||
V_DrawTallNum(hudinfo[HUD_SECONDS].x, hudinfo[HUD_SECONDS].y, V_SNAPTOLEFT, data.coop.tics);
|
||||
ST_DrawNumFromHud(HUD_SECONDS, data.coop.tics);
|
||||
else
|
||||
{
|
||||
INT32 seconds, minutes, tictrn;
|
||||
|
||||
seconds = G_TicsToSeconds(data.coop.tics);
|
||||
minutes = G_TicsToMinutes(data.coop.tics, true);
|
||||
tictrn = G_TicsToCentiseconds(data.coop.tics);
|
||||
|
||||
ST_DrawNumFromHud(HUD_MINUTES, minutes); // Minutes
|
||||
ST_DrawPatchFromHud(HUD_TIMECOLON, sbocolon); // Colon
|
||||
ST_DrawPadNumFromHud(HUD_SECONDS, seconds, 2); // Seconds
|
||||
|
||||
// we should show centiseconds on the intermission screen too, if the conditions are right.
|
||||
if (modeattacking || cv_timetic.value == 2)
|
||||
{
|
||||
V_DrawPaddedTallNum(hudinfo[HUD_TICS].x, hudinfo[HUD_TICS].y, V_SNAPTOLEFT,
|
||||
G_TicsToCentiseconds(data.coop.tics), 2);
|
||||
V_DrawScaledPatch(hudinfo[HUD_TIMETICCOLON].x, hudinfo[HUD_TIMETICCOLON].y, V_SNAPTOLEFT, sboperiod);
|
||||
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod); // Period
|
||||
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2); // Tics
|
||||
}
|
||||
|
||||
V_DrawPaddedTallNum(hudinfo[HUD_SECONDS].x, hudinfo[HUD_SECONDS].y, V_SNAPTOLEFT,
|
||||
G_TicsToSeconds(data.coop.tics), 2);
|
||||
V_DrawScaledPatch(hudinfo[HUD_TIMECOLON].x, hudinfo[HUD_TIMECOLON].y, V_SNAPTOLEFT, sbocolon);
|
||||
V_DrawTallNum(hudinfo[HUD_MINUTES].x, hudinfo[HUD_MINUTES].y, V_SNAPTOLEFT,
|
||||
G_TicsToMinutes(data.coop.tics, false));
|
||||
}
|
||||
|
||||
// draw the "got through act" lines and act number
|
||||
|
|
Loading…
Reference in a new issue