Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
SRB2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
246
Issues
246
List
Board
Labels
Milestones
Merge Requests
71
Merge Requests
71
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
STJr
SRB2
Compare Revisions
7f7ccc9911b058808bf5fdba892dee7643082bf3...acdb4b42eacd1ea4be87141063d6f544312b2382
Source
acdb4b42eacd1ea4be87141063d6f544312b2382
Select Git revision
...
Target
7f7ccc9911b058808bf5fdba892dee7643082bf3
Select Git revision
Compare
Commits (4)
Support act numbers up to 99 and draw both digits individually.
· 69c11a82
sphere
authored
Apr 30, 2020
69c11a82
Fix some errors and add some comments. Also, actnum is not an INT32.
· 0287c695
sphere
authored
Apr 30, 2020
0287c695
Restore SHORT().
· 4eb5f09c
sphere
authored
Apr 30, 2020
4eb5f09c
Merge branch 'actnum-tweaks' into 'next'
· acdb4b42
...
MascaraSnake
authored
May 13, 2020
Act number tweaks See merge request
!905
acdb4b42
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
21 deletions
+40
-21
d_clisrv.c
src/d_clisrv.c
+1
-1
dehacked.c
src/dehacked.c
+1
-1
g_game.c
src/g_game.c
+1
-1
hu_stuff.c
src/hu_stuff.c
+2
-2
hu_stuff.h
src/hu_stuff.h
+1
-1
m_menu.c
src/m_menu.c
+1
-1
st_stuff.c
src/st_stuff.c
+7
-2
v_video.c
src/v_video.c
+23
-9
v_video.h
src/v_video.h
+2
-2
y_inter.c
src/y_inter.c
+1
-1
No files found.
src/d_clisrv.c
View file @
acdb4b42
...
...
@@ -1690,7 +1690,7 @@ static void CL_LoadReceivedSavegame(void)
// load a base level
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
));
if
(
strcmp
(
mapheaderinfo
[
gamemap
-
1
]
->
lvlttl
,
""
))
{
...
...
src/dehacked.c
View file @
acdb4b42
...
...
@@ -1557,7 +1557,7 @@ static void readlevelheader(MYFILE *f, INT32 num)
}
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
;
else
deh_warning
(
"Level header %d: invalid act number %d"
,
num
,
i
);
...
...
src/g_game.c
View file @
acdb4b42
...
...
@@ -4629,7 +4629,7 @@ char *G_BuildMapTitle(INT32 mapnum)
{
size_t
len
=
1
;
const
char
*
zonetext
=
NULL
;
const
INT32
actnum
=
mapheaderinfo
[
mapnum
-
1
]
->
actnum
;
const
UINT8
actnum
=
mapheaderinfo
[
mapnum
-
1
]
->
actnum
;
len
+=
strlen
(
mapheaderinfo
[
mapnum
-
1
]
->
lvlttl
);
if
(
!
(
mapheaderinfo
[
mapnum
-
1
]
->
levelflags
&
LF_NOZONE
))
...
...
src/hu_stuff.c
View file @
acdb4b42
...
...
@@ -68,7 +68,7 @@ patch_t *nightsnum[10]; // 0-9
// Level title and credits fonts
patch_t
*
lt_font
[
LT_FONTSIZE
];
patch_t
*
cred_font
[
CRED_FONTSIZE
];
patch_t
*
ttlnum
[
20
];
// act numbers (0-1
9)
patch_t
*
ttlnum
[
10
];
// act numbers (0-
9)
// Name tag fonts
patch_t
*
ntb_font
[
NT_FONTSIZE
];
...
...
@@ -243,7 +243,7 @@ void HU_LoadGraphics(void)
tallinfin
=
(
patch_t
*
)
W_CachePatchName
(
"STTINFIN"
,
PU_HUDGFX
);
// cache act numbers for level titles
for
(
i
=
0
;
i
<
2
0
;
i
++
)
for
(
i
=
0
;
i
<
1
0
;
i
++
)
{
sprintf
(
buffer
,
"TTL%.2d"
,
i
);
ttlnum
[
i
]
=
(
patch_t
*
)
W_CachePatchName
(
buffer
,
PU_HUDGFX
);
...
...
src/hu_stuff.h
View file @
acdb4b42
...
...
@@ -85,7 +85,7 @@ extern patch_t *lt_font[LT_FONTSIZE];
extern
patch_t
*
cred_font
[
CRED_FONTSIZE
];
extern
patch_t
*
ntb_font
[
NT_FONTSIZE
];
extern
patch_t
*
nto_font
[
NT_FONTSIZE
];
extern
patch_t
*
ttlnum
[
2
0
];
extern
patch_t
*
ttlnum
[
1
0
];
extern
patch_t
*
emeraldpics
[
3
][
8
];
extern
patch_t
*
rflagico
;
extern
patch_t
*
bflagico
;
...
...
src/m_menu.c
View file @
acdb4b42
...
...
@@ -5186,7 +5186,7 @@ static boolean M_PrepareLevelPlatter(INT32 gt, boolean nextmappick)
{
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
wide
=
(
mapheaderinfo
[
mapnum
]
->
menuflags
&
LF2_WIDEICON
);
...
...
src/st_stuff.c
View file @
acdb4b42
...
...
@@ -1325,7 +1325,7 @@ void ST_drawTitleCard(void)
{
char
*
lvlttl
=
mapheaderinfo
[
gamemap
-
1
]
->
lvlttl
;
char
*
subttl
=
mapheaderinfo
[
gamemap
-
1
]
->
subttl
;
INT32
actnum
=
mapheaderinfo
[
gamemap
-
1
]
->
actnum
;
UINT8
actnum
=
mapheaderinfo
[
gamemap
-
1
]
->
actnum
;
INT32
lvlttlxpos
,
ttlnumxpos
,
zonexpos
;
INT32
subttlxpos
=
BASEVIDWIDTH
/
2
;
INT32
ttlscroll
=
FixedInt
(
lt_scroll
);
...
...
@@ -1382,7 +1382,12 @@ void ST_drawTitleCard(void)
if
(
actnum
)
{
if
(
!
splitscreen
)
V_DrawMappedPatch
(
ttlnumxpos
+
ttlscroll
,
104
-
ttlscroll
,
0
,
actpat
,
colormap
);
{
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_DrawLevelActNum
(
ttlnumxpos
+
ttlscroll
,
104
,
V_PERPLAYER
,
actnum
);
}
...
...
src/v_video.c
View file @
acdb4b42
...
...
@@ -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
// Todo: actually draw two-digit numbers as two act num patches
void
V_DrawLevelActNum
(
INT32
x
,
INT32
y
,
INT32
flags
,
INT32
num
)
void
V_DrawLevelActNum
(
INT32
x
,
INT32
y
,
INT32
flags
,
UINT8
num
)
{
if
(
num
<
0
||
num
>
1
9
)
if
(
num
>
9
9
)
return
;
// not supported
V_DrawScaledPatch
(
x
,
y
,
flags
,
ttlnum
[
num
]);
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
]);
num
=
num
/
10
;
}
}
// Write a string using the credit font
...
...
@@ -3339,13 +3345,21 @@ INT32 V_LevelNameHeight(const char *string)
}
// For ST_drawTitleCard
// Returns the width of the act num patch
INT
32
V_LevelActNumWidth
(
INT32
num
)
// Returns the width of the act num patch
(es)
INT
16
V_LevelActNumWidth
(
UINT8
num
)
{
if
(
num
<
0
||
num
>
19
)
return
0
;
// not a valid number
INT16
result
=
0
;
if
(
num
==
0
)
result
=
SHORT
(
ttlnum
[
num
]
->
width
);
while
(
num
>
0
&&
num
<=
99
)
{
result
=
result
+
SHORT
(
ttlnum
[
num
%
10
]
->
width
);
num
=
num
/
10
;
}
return
SHORT
(
ttlnum
[
num
]
->
width
)
;
return
result
;
}
//
...
...
src/v_video.h
View file @
acdb4b42
...
...
@@ -238,12 +238,12 @@ void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option
// Draw tall nums, used for menu, HUD, intermission
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_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
INT32
V_LevelNameWidth
(
const
char
*
string
);
INT32
V_LevelNameHeight
(
const
char
*
string
);
INT
32
V_LevelActNumWidth
(
INT32
num
);
// act number width
INT
16
V_LevelActNumWidth
(
UINT8
num
);
// act number width
void
V_DrawCreditString
(
fixed_t
x
,
fixed_t
y
,
INT32
option
,
const
char
*
string
);
INT32
V_CreditStringWidth
(
const
char
*
string
);
...
...
src/y_inter.c
View file @
acdb4b42
...
...
@@ -73,7 +73,7 @@ typedef union
UINT32
score
,
total
;
// fake score, total
UINT32
tics
;
// time
INT32
actnum
;
// act number being displayed
UINT8
actnum
;
// act number being displayed
patch_t
*
ptotal
;
// TOTAL
UINT8
gotlife
;
// Number of extra lives obtained
}
coop
;
...
...