mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Merge branch 'actnum-tweaks' into 'next'
Act number tweaks See merge request STJr/SRB2!905
This commit is contained in:
commit
acdb4b42ea
10 changed files with 40 additions and 21 deletions
|
@ -1690,7 +1690,7 @@ static void CL_LoadReceivedSavegame(void)
|
||||||
// load a base level
|
// load a base level
|
||||||
if (P_LoadNetGame())
|
if (P_LoadNetGame())
|
||||||
{
|
{
|
||||||
const INT32 actnum = mapheaderinfo[gamemap-1]->actnum;
|
const UINT8 actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||||
CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap));
|
CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap));
|
||||||
if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, ""))
|
if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, ""))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1557,7 +1557,7 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
}
|
}
|
||||||
else if (fastcmp(word, "ACT"))
|
else if (fastcmp(word, "ACT"))
|
||||||
{
|
{
|
||||||
if (i >= 0 && i < 20) // 0 for no act number, TTL1 through TTL19
|
if (i >= 0 && i <= 99) // 0 for no act number
|
||||||
mapheaderinfo[num-1]->actnum = (UINT8)i;
|
mapheaderinfo[num-1]->actnum = (UINT8)i;
|
||||||
else
|
else
|
||||||
deh_warning("Level header %d: invalid act number %d", num, i);
|
deh_warning("Level header %d: invalid act number %d", num, i);
|
||||||
|
|
|
@ -4629,7 +4629,7 @@ char *G_BuildMapTitle(INT32 mapnum)
|
||||||
{
|
{
|
||||||
size_t len = 1;
|
size_t len = 1;
|
||||||
const char *zonetext = NULL;
|
const char *zonetext = NULL;
|
||||||
const INT32 actnum = mapheaderinfo[mapnum-1]->actnum;
|
const UINT8 actnum = mapheaderinfo[mapnum-1]->actnum;
|
||||||
|
|
||||||
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
|
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
|
||||||
if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE))
|
if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE))
|
||||||
|
|
|
@ -68,7 +68,7 @@ patch_t *nightsnum[10]; // 0-9
|
||||||
// Level title and credits fonts
|
// Level title and credits fonts
|
||||||
patch_t *lt_font[LT_FONTSIZE];
|
patch_t *lt_font[LT_FONTSIZE];
|
||||||
patch_t *cred_font[CRED_FONTSIZE];
|
patch_t *cred_font[CRED_FONTSIZE];
|
||||||
patch_t *ttlnum[20]; // act numbers (0-19)
|
patch_t *ttlnum[10]; // act numbers (0-9)
|
||||||
|
|
||||||
// Name tag fonts
|
// Name tag fonts
|
||||||
patch_t *ntb_font[NT_FONTSIZE];
|
patch_t *ntb_font[NT_FONTSIZE];
|
||||||
|
@ -243,7 +243,7 @@ void HU_LoadGraphics(void)
|
||||||
tallinfin = (patch_t *)W_CachePatchName("STTINFIN", PU_HUDGFX);
|
tallinfin = (patch_t *)W_CachePatchName("STTINFIN", PU_HUDGFX);
|
||||||
|
|
||||||
// cache act numbers for level titles
|
// cache act numbers for level titles
|
||||||
for (i = 0; i < 20; i++)
|
for (i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
sprintf(buffer, "TTL%.2d", i);
|
sprintf(buffer, "TTL%.2d", i);
|
||||||
ttlnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
|
ttlnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
|
||||||
|
|
|
@ -85,7 +85,7 @@ extern patch_t *lt_font[LT_FONTSIZE];
|
||||||
extern patch_t *cred_font[CRED_FONTSIZE];
|
extern patch_t *cred_font[CRED_FONTSIZE];
|
||||||
extern patch_t *ntb_font[NT_FONTSIZE];
|
extern patch_t *ntb_font[NT_FONTSIZE];
|
||||||
extern patch_t *nto_font[NT_FONTSIZE];
|
extern patch_t *nto_font[NT_FONTSIZE];
|
||||||
extern patch_t *ttlnum[20];
|
extern patch_t *ttlnum[10];
|
||||||
extern patch_t *emeraldpics[3][8];
|
extern patch_t *emeraldpics[3][8];
|
||||||
extern patch_t *rflagico;
|
extern patch_t *rflagico;
|
||||||
extern patch_t *bflagico;
|
extern patch_t *bflagico;
|
||||||
|
|
|
@ -5186,7 +5186,7 @@ static boolean M_PrepareLevelPlatter(INT32 gt, boolean nextmappick)
|
||||||
{
|
{
|
||||||
if (M_CanShowLevelOnPlatter(mapnum, gt))
|
if (M_CanShowLevelOnPlatter(mapnum, gt))
|
||||||
{
|
{
|
||||||
const INT32 actnum = mapheaderinfo[mapnum]->actnum;
|
const UINT8 actnum = mapheaderinfo[mapnum]->actnum;
|
||||||
const boolean headingisname = (fastcmp(mapheaderinfo[mapnum]->selectheading, mapheaderinfo[mapnum]->lvlttl));
|
const boolean headingisname = (fastcmp(mapheaderinfo[mapnum]->selectheading, mapheaderinfo[mapnum]->lvlttl));
|
||||||
const boolean wide = (mapheaderinfo[mapnum]->menuflags & LF2_WIDEICON);
|
const boolean wide = (mapheaderinfo[mapnum]->menuflags & LF2_WIDEICON);
|
||||||
|
|
||||||
|
|
|
@ -1325,7 +1325,7 @@ void ST_drawTitleCard(void)
|
||||||
{
|
{
|
||||||
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||||
char *subttl = mapheaderinfo[gamemap-1]->subttl;
|
char *subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||||
INT32 actnum = mapheaderinfo[gamemap-1]->actnum;
|
UINT8 actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||||
INT32 lvlttlxpos, ttlnumxpos, zonexpos;
|
INT32 lvlttlxpos, ttlnumxpos, zonexpos;
|
||||||
INT32 subttlxpos = BASEVIDWIDTH/2;
|
INT32 subttlxpos = BASEVIDWIDTH/2;
|
||||||
INT32 ttlscroll = FixedInt(lt_scroll);
|
INT32 ttlscroll = FixedInt(lt_scroll);
|
||||||
|
@ -1382,7 +1382,12 @@ void ST_drawTitleCard(void)
|
||||||
if (actnum)
|
if (actnum)
|
||||||
{
|
{
|
||||||
if (!splitscreen)
|
if (!splitscreen)
|
||||||
|
{
|
||||||
|
if (actnum > 9) // slightly offset the act diamond for two-digit act numbers
|
||||||
|
V_DrawMappedPatch(ttlnumxpos + (V_LevelActNumWidth(actnum)/4) + ttlscroll, 104 - ttlscroll, 0, actpat, colormap);
|
||||||
|
else
|
||||||
V_DrawMappedPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, 0, actpat, colormap);
|
V_DrawMappedPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, 0, actpat, colormap);
|
||||||
|
}
|
||||||
V_DrawLevelActNum(ttlnumxpos + ttlscroll, 104, V_PERPLAYER, actnum);
|
V_DrawLevelActNum(ttlnumxpos + ttlscroll, 104, V_PERPLAYER, actnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2952,13 +2952,19 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw an act number for a level title
|
// Draw an act number for a level title
|
||||||
// Todo: actually draw two-digit numbers as two act num patches
|
void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, UINT8 num)
|
||||||
void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, INT32 num)
|
|
||||||
{
|
{
|
||||||
if (num < 0 || num > 19)
|
if (num > 99)
|
||||||
return; // not supported
|
return; // not supported
|
||||||
|
|
||||||
|
while (num > 0)
|
||||||
|
{
|
||||||
|
if (num > 9) // if there are two digits, draw second digit first
|
||||||
|
V_DrawScaledPatch(x + (V_LevelActNumWidth(num) - V_LevelActNumWidth(num%10)), y, flags, ttlnum[num%10]);
|
||||||
|
else
|
||||||
V_DrawScaledPatch(x, y, flags, ttlnum[num]);
|
V_DrawScaledPatch(x, y, flags, ttlnum[num]);
|
||||||
|
num = num/10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write a string using the credit font
|
// Write a string using the credit font
|
||||||
|
@ -3339,13 +3345,21 @@ INT32 V_LevelNameHeight(const char *string)
|
||||||
}
|
}
|
||||||
|
|
||||||
// For ST_drawTitleCard
|
// For ST_drawTitleCard
|
||||||
// Returns the width of the act num patch
|
// Returns the width of the act num patch(es)
|
||||||
INT32 V_LevelActNumWidth(INT32 num)
|
INT16 V_LevelActNumWidth(UINT8 num)
|
||||||
{
|
{
|
||||||
if (num < 0 || num > 19)
|
INT16 result = 0;
|
||||||
return 0; // not a valid number
|
|
||||||
|
|
||||||
return SHORT(ttlnum[num]->width);
|
if (num == 0)
|
||||||
|
result = SHORT(ttlnum[num]->width);
|
||||||
|
|
||||||
|
while (num > 0 && num <= 99)
|
||||||
|
{
|
||||||
|
result = result + SHORT(ttlnum[num%10]->width);
|
||||||
|
num = num/10;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -238,12 +238,12 @@ void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option
|
||||||
// Draw tall nums, used for menu, HUD, intermission
|
// Draw tall nums, used for menu, HUD, intermission
|
||||||
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);
|
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);
|
||||||
void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits);
|
void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits);
|
||||||
void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, INT32 num);
|
void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, UINT8 num);
|
||||||
|
|
||||||
// Find string width from lt_font chars
|
// Find string width from lt_font chars
|
||||||
INT32 V_LevelNameWidth(const char *string);
|
INT32 V_LevelNameWidth(const char *string);
|
||||||
INT32 V_LevelNameHeight(const char *string);
|
INT32 V_LevelNameHeight(const char *string);
|
||||||
INT32 V_LevelActNumWidth(INT32 num); // act number width
|
INT16 V_LevelActNumWidth(UINT8 num); // act number width
|
||||||
|
|
||||||
void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string);
|
void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||||
INT32 V_CreditStringWidth(const char *string);
|
INT32 V_CreditStringWidth(const char *string);
|
||||||
|
|
|
@ -73,7 +73,7 @@ typedef union
|
||||||
UINT32 score, total; // fake score, total
|
UINT32 score, total; // fake score, total
|
||||||
UINT32 tics; // time
|
UINT32 tics; // time
|
||||||
|
|
||||||
INT32 actnum; // act number being displayed
|
UINT8 actnum; // act number being displayed
|
||||||
patch_t *ptotal; // TOTAL
|
patch_t *ptotal; // TOTAL
|
||||||
UINT8 gotlife; // Number of extra lives obtained
|
UINT8 gotlife; // Number of extra lives obtained
|
||||||
} coop;
|
} coop;
|
||||||
|
|
Loading…
Reference in a new issue