Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jaden
SRB2
Commits
b9f6069c
Commit
b9f6069c
authored
4 years ago
by
James R.
Browse files
Options
Downloads
Patches
Plain Diff
Replace TC macros with an enum that automatically counts up
Also fixes TC_DASHMODE not being accessible to Lua.
parent
4ab667c6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lua_hudlib.c
+4
-2
4 additions, 2 deletions
src/lua_hudlib.c
src/r_draw.h
+11
-7
11 additions, 7 deletions
src/r_draw.h
with
15 additions
and
9 deletions
src/lua_hudlib.c
+
4
−
2
View file @
b9f6069c
...
@@ -896,8 +896,10 @@ static int libd_getColormap(lua_State *L)
...
@@ -896,8 +896,10 @@ static int libd_getColormap(lua_State *L)
else
if
(
lua_type
(
L
,
1
)
==
LUA_TNUMBER
)
// skin number
else
if
(
lua_type
(
L
,
1
)
==
LUA_TNUMBER
)
// skin number
{
{
skinnum
=
(
INT32
)
luaL_checkinteger
(
L
,
1
);
skinnum
=
(
INT32
)
luaL_checkinteger
(
L
,
1
);
if
(
skinnum
<
TC_BLINK
||
skinnum
>=
MAXSKINS
)
if
(
skinnum
>=
MAXSKINS
)
return
luaL_error
(
L
,
"skin number %d is out of range (%d - %d)"
,
skinnum
,
TC_BLINK
,
MAXSKINS
-
1
);
return
luaL_error
(
L
,
"skin number %d is out of range (>%d)"
,
skinnum
,
MAXSKINS
-
1
);
else
if
(
skinnum
<
0
&&
skinnum
>
TC_DEFAULT
)
return
luaL_error
(
L
,
"translation colormap index is out of range"
);
}
}
else
// skin name
else
// skin name
{
{
...
...
This diff is collapsed.
Click to expand it.
src/r_draw.h
+
11
−
7
View file @
b9f6069c
...
@@ -106,13 +106,17 @@ extern lumpnum_t viewborderlump[8];
...
@@ -106,13 +106,17 @@ extern lumpnum_t viewborderlump[8];
#define GTC_CACHE 1
#define GTC_CACHE 1
#define TC_DEFAULT -1
enum
#define TC_BOSS -2
{
#define TC_METALSONIC -3 // For Metal Sonic battle
TC_BOSS
=
INT8_MIN
,
#define TC_ALLWHITE -4 // For Cy-Brak-demon
TC_METALSONIC
,
// For Metal Sonic battle
#define TC_RAINBOW -5 // For single colour
TC_ALLWHITE
,
// For Cy-Brak-demon
#define TC_BLINK -6 // For item blinking, according to kart
TC_RAINBOW
,
// For single colour
#define TC_DASHMODE -7 // For Metal Sonic's dashmode
TC_BLINK
,
// For item blinking, according to kart
TC_DASHMODE
,
// For Metal Sonic's dashmode
TC_DEFAULT
};
// Custom player skin translation
// Custom player skin translation
// Initialize color translation tables, for player rendering etc.
// Initialize color translation tables, for player rendering etc.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment