mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
* Allocate the "MISSING" patch only once, statically, at first boot via missingpat, and prevent it from being freed.
* Rework HU_UpdatePatch to HU_UpdateOrBlankPatch with a "required" boolean.
* If desired graphic is not present in resources:
* If required is true, return `missingpat`.
* If false, return NULL as before (font compatibility).
* Add an alias with the previous function signature, so you don't need to add a million `true`s everywhere.
* Remove a ton of irrelevant graphics the game attempts to cache only because of code inherited from vanilla SRB2.
* Remove the unused hudinfo system, also inherited from vanilla SRB2.
This commit is contained in:
parent
ea6aaa3321
commit
884064049e
17 changed files with 43 additions and 517 deletions
|
|
@ -436,16 +436,6 @@ static inline int lib_getenum(lua_State *L)
|
|||
}
|
||||
return luaL_error(L, "karthud '%s' could not be found.\n", word);
|
||||
}
|
||||
else if (fastncmp("HUD_",word,4)) {
|
||||
p = word+4;
|
||||
for (i = 0; i < NUMHUDITEMS; i++)
|
||||
if (fastcmp(p, HUDITEMS_LIST[i])) {
|
||||
lua_pushinteger(L, i);
|
||||
return 1;
|
||||
}
|
||||
if (mathlib) return luaL_error(L, "huditem '%s' could not be found.\n", word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("SKINCOLOR_",word,10)) {
|
||||
p = word+10;
|
||||
for (i = 0; i < NUMCOLORFREESLOTS; i++) {
|
||||
|
|
|
|||
|
|
@ -2407,66 +2407,6 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
void readhuditem(MYFILE *f, INT32 num)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word = s;
|
||||
char *word2;
|
||||
char *tmp;
|
||||
INT32 i;
|
||||
|
||||
do
|
||||
{
|
||||
if (myfgets(s, MAXLINELEN, f))
|
||||
{
|
||||
if (s[0] == '\n')
|
||||
break;
|
||||
|
||||
// First remove trailing newline, if there is one
|
||||
tmp = strchr(s, '\n');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
|
||||
tmp = strchr(s, '#');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
if (s == tmp)
|
||||
continue; // Skip comment lines, but don't break.
|
||||
|
||||
// Get the part before the " = "
|
||||
tmp = strchr(s, '=');
|
||||
if (tmp)
|
||||
*(tmp-1) = '\0';
|
||||
else
|
||||
break;
|
||||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
strupr(word2);
|
||||
|
||||
i = atoi(word2); // used for numerical settings
|
||||
|
||||
if (fastcmp(word, "X"))
|
||||
{
|
||||
hudinfo[num].x = i;
|
||||
}
|
||||
else if (fastcmp(word, "Y"))
|
||||
{
|
||||
hudinfo[num].y = i;
|
||||
}
|
||||
else if (fastcmp(word, "F"))
|
||||
{
|
||||
hudinfo[num].f = i;
|
||||
}
|
||||
else
|
||||
deh_warning("Level header %d: unknown word '%s'", num, word);
|
||||
}
|
||||
} while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
Z_Free(s);
|
||||
}
|
||||
|
||||
void readframe(MYFILE *f, INT32 num)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
|
|
@ -4204,20 +4144,6 @@ sfxenum_t get_sfx(const char *word)
|
|||
return sfx_None;
|
||||
}
|
||||
|
||||
hudnum_t get_huditem(const char *word)
|
||||
{ // Returns the value of HUD_ enumerations
|
||||
hudnum_t i;
|
||||
if (*word >= '0' && *word <= '9')
|
||||
return atoi(word);
|
||||
if (fastncmp("HUD_",word,4))
|
||||
word += 4; // take off the HUD_
|
||||
for (i = 0; i < NUMHUDITEMS; i++)
|
||||
if (fastcmp(word, HUDITEMS_LIST[i]))
|
||||
return i;
|
||||
deh_warning("Couldn't find huditem named 'HUD_%s'",word);
|
||||
return HUD_LIVES;
|
||||
}
|
||||
|
||||
menutype_t get_menutype(const char *word)
|
||||
{ // Returns the value of MN_ enumerations
|
||||
menutype_t i;
|
||||
|
|
@ -4461,11 +4387,6 @@ static fixed_t find_const(const char **rword)
|
|||
free(word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("HUD_",word,4)) {
|
||||
r = get_huditem(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
else if (fastncmp("GRADE_",word,6))
|
||||
{
|
||||
char *p = word+6;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ statenum_t get_state(const char *word);
|
|||
spritenum_t get_sprite(const char *word);
|
||||
playersprite_t get_sprite2(const char *word);
|
||||
sfxenum_t get_sfx(const char *word);
|
||||
hudnum_t get_huditem(const char *word);
|
||||
menutype_t get_menutype(const char *word);
|
||||
//INT16 get_gametype(const char *word);
|
||||
//powertype_t get_power(const char *word);
|
||||
|
|
|
|||
|
|
@ -495,18 +495,6 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
ignorelines(f);
|
||||
}
|
||||
}
|
||||
else if (fastcmp(word, "HUDITEM"))
|
||||
{
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
i = get_huditem(word2); // find a huditem by name
|
||||
if (i >= 0 && i < NUMHUDITEMS)
|
||||
readhuditem(f, i);
|
||||
else
|
||||
{
|
||||
deh_warning("HUD item number %d out of range (0 - %d)", i, NUMHUDITEMS-1);
|
||||
ignorelines(f);
|
||||
}
|
||||
}
|
||||
else if (fastcmp(word, "MENU"))
|
||||
{
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ FontCache (font_t *fnt)
|
|||
c = fnt->start;
|
||||
for (i = 0; i < fnt->size; ++i, ++c)
|
||||
{
|
||||
HU_UpdatePatch(&fnt->font[i],
|
||||
HU_UpdateOrBlankPatch(&fnt->font[i],
|
||||
false,
|
||||
"%s%.*d",
|
||||
fnt->prefix,
|
||||
fnt->digits,
|
||||
|
|
|
|||
|
|
@ -87,24 +87,12 @@ static boolean headsupactive = false;
|
|||
boolean hu_showscores; // draw rankings
|
||||
static char hu_tick;
|
||||
|
||||
patch_t *rflagico;
|
||||
patch_t *bflagico;
|
||||
patch_t *rmatcico;
|
||||
patch_t *bmatcico;
|
||||
patch_t *tagico;
|
||||
patch_t *tallminus;
|
||||
patch_t *tallinfin;
|
||||
|
||||
//-------------------------------------------
|
||||
// coop hud
|
||||
//-------------------------------------------
|
||||
|
||||
static patch_t *emblemicon;
|
||||
|
||||
//-------------------------------------------
|
||||
// misc vars
|
||||
//-------------------------------------------
|
||||
|
||||
patch_t *missingpat;
|
||||
|
||||
// song credits
|
||||
static patch_t *songcreditbg;
|
||||
|
||||
|
|
@ -189,10 +177,6 @@ void HU_LoadGraphics(void)
|
|||
|
||||
Font_Load();
|
||||
|
||||
// minus for negative tallnums
|
||||
HU_UpdatePatch(&tallminus, "STTMINUS");
|
||||
|
||||
HU_UpdatePatch(&emblemicon, "EMBLICON");
|
||||
HU_UpdatePatch(&songcreditbg, "K_SONGCR");
|
||||
|
||||
// cache ping gfx:
|
||||
|
|
@ -222,6 +206,16 @@ void HU_Init(void)
|
|||
RegisterNetXCmd(XD_SAY, Got_Saycmd);
|
||||
#endif
|
||||
|
||||
// only allocate if not present, to save us a lot of headache
|
||||
if (missingpat == NULL)
|
||||
{
|
||||
lumpnum_t missingnum = W_GetNumForName("MISSING");
|
||||
if (missingnum == LUMPERROR)
|
||||
I_Error("HU_LoadGraphics: \"MISSING\" patch not present in resource files.");
|
||||
|
||||
missingpat = W_CachePatchNum(W_GetNumForName("MISSING"), PU_STATIC);
|
||||
}
|
||||
|
||||
// set shift translation table
|
||||
shiftxform = english_shiftxform;
|
||||
|
||||
|
|
@ -292,7 +286,7 @@ void HU_Init(void)
|
|||
HU_LoadGraphics();
|
||||
}
|
||||
|
||||
patch_t *HU_UpdatePatch(patch_t **user, const char *format, ...)
|
||||
patch_t *HU_UpdateOrBlankPatch(patch_t **user, boolean required, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buffer[9];
|
||||
|
|
@ -319,7 +313,12 @@ patch_t *HU_UpdatePatch(patch_t **user, const char *format, ...)
|
|||
lump = W_CheckNumForName(buffer);
|
||||
|
||||
if (lump == LUMPERROR)
|
||||
return NULL;
|
||||
{
|
||||
if (required == true)
|
||||
*user = missingpat;
|
||||
|
||||
return *user;
|
||||
}
|
||||
}
|
||||
|
||||
patch = W_CachePatchNum(lump, PU_HUDGFX);
|
||||
|
|
@ -2151,10 +2150,10 @@ void HU_Drawer(void)
|
|||
if (modeattacking && pausedelay > 0 && !pausebreakkey)
|
||||
{
|
||||
INT32 strength = ((pausedelay - 1 - NEWTICRATE/2)*10)/(NEWTICRATE/3);
|
||||
INT32 y = hudinfo[HUD_LIVES].y - 13;
|
||||
INT32 x = BASEVIDWIDTH/2, y = BASEVIDHEIGHT/2; // obviously incorrect values while we scrap hudinfo
|
||||
|
||||
V_DrawThinString(hudinfo[HUD_LIVES].x-2, y,
|
||||
hudinfo[HUD_LIVES].f|((leveltime & 4) ? V_SKYMAP : V_BLUEMAP),
|
||||
V_DrawThinString(x, y,
|
||||
((leveltime & 4) ? V_SKYMAP : V_BLUEMAP),
|
||||
"HOLD TO RETRY...");
|
||||
|
||||
if (strength > 9)
|
||||
|
|
|
|||
|
|
@ -104,14 +104,6 @@ extern patch_t *pinggfx[5];
|
|||
extern patch_t *framecounter;
|
||||
extern patch_t *frameslash;
|
||||
|
||||
extern patch_t *rflagico;
|
||||
extern patch_t *bflagico;
|
||||
extern patch_t *rmatcico;
|
||||
extern patch_t *bmatcico;
|
||||
extern patch_t *tagico;
|
||||
extern patch_t *tallminus;
|
||||
extern patch_t *tallinfin;
|
||||
|
||||
// set true whenever the tab rankings are being shown for any reason
|
||||
extern boolean hu_showscores;
|
||||
|
||||
|
|
@ -120,9 +112,10 @@ void HU_Init(void);
|
|||
|
||||
void HU_LoadGraphics(void);
|
||||
|
||||
// Load a HUDGFX patch or NULL.
|
||||
patch_t *HU_UpdatePatch(patch_t **user, const char *format, ...);
|
||||
#define HU_CachePatch(...) HU_UpdatePatch(NULL, __VA_ARGS__)
|
||||
// Load a HUDGFX patch or NULL/missingpat (dependent on required boolean).
|
||||
patch_t *HU_UpdateOrBlankPatch(patch_t **user, boolean required, const char *format, ...);
|
||||
//#define HU_CachePatch(...) HU_UpdateOrBlankPatch(NULL, false, __VA_ARGS__) -- not sure how to default the missingpat here plus not currently used
|
||||
#define HU_UpdatePatch(user, ...) HU_UpdateOrBlankPatch(user, true, __VA_ARGS__)
|
||||
|
||||
// reset heads up when consoleplayer respawns.
|
||||
void HU_Start(void);
|
||||
|
|
|
|||
|
|
@ -623,14 +623,14 @@ void K_LoadKartHUDGraphics(void)
|
|||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
buffer[7] = '0'+((i+1)%10);
|
||||
HU_UpdatePatch(&kp_bossbar[i], buffer);
|
||||
HU_UpdatePatch(&kp_bossbar[i], "%s", buffer);
|
||||
}
|
||||
|
||||
sprintf(buffer, "K_BOSR0x");
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
buffer[7] = '0'+((i+1)%10);
|
||||
HU_UpdatePatch(&kp_bossret[i], buffer);
|
||||
HU_UpdatePatch(&kp_bossret[i], "%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -214,7 +214,6 @@ static const struct {
|
|||
|
||||
{META_BBOX, "bbox"},
|
||||
|
||||
{META_HUDINFO, "hudinfo_t"},
|
||||
{META_PATCH, "patch_t"},
|
||||
{META_COLORMAP, "colormap"},
|
||||
{META_CAMERA, "camera_t"},
|
||||
|
|
|
|||
102
src/lua_hudlib.c
102
src/lua_hudlib.c
|
|
@ -14,7 +14,7 @@
|
|||
#include "fastcmp.h"
|
||||
#include "r_defs.h"
|
||||
#include "r_local.h"
|
||||
#include "st_stuff.h" // hudinfo[]
|
||||
#include "st_stuff.h"
|
||||
#include "g_game.h"
|
||||
#include "i_video.h" // rendermode
|
||||
#include "p_local.h" // camera_t
|
||||
|
|
@ -63,18 +63,6 @@ static const char *const hud_disable_options[] = {
|
|||
"intermissionmessages",
|
||||
NULL};
|
||||
|
||||
enum hudinfo {
|
||||
hudinfo_x = 0,
|
||||
hudinfo_y,
|
||||
hudinfo_f
|
||||
};
|
||||
|
||||
static const char *const hudinfo_opt[] = {
|
||||
"x",
|
||||
"y",
|
||||
"f",
|
||||
NULL};
|
||||
|
||||
enum patch {
|
||||
patch_valid = 0,
|
||||
patch_width,
|
||||
|
|
@ -182,73 +170,6 @@ static const char *const camera_opt[] = {
|
|||
"pnum",
|
||||
NULL};
|
||||
|
||||
static int lib_getHudInfo(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
lua_remove(L, 1);
|
||||
|
||||
i = luaL_checkinteger(L, 1);
|
||||
if (i >= NUMHUDITEMS)
|
||||
return luaL_error(L, "hudinfo[] index %d out of range (0 - %d)", i, NUMHUDITEMS-1);
|
||||
LUA_PushUserdata(L, &hudinfo[i], META_HUDINFO);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_hudinfolen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMHUDITEMS);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int hudinfo_get(lua_State *L)
|
||||
{
|
||||
hudinfo_t *info = *((hudinfo_t **)luaL_checkudata(L, 1, META_HUDINFO));
|
||||
enum hudinfo field = luaL_checkoption(L, 2, hudinfo_opt[0], hudinfo_opt);
|
||||
I_Assert(info != NULL); // huditems are always valid
|
||||
|
||||
switch(field)
|
||||
{
|
||||
case hudinfo_x:
|
||||
lua_pushinteger(L, info->x);
|
||||
break;
|
||||
case hudinfo_y:
|
||||
lua_pushinteger(L, info->y);
|
||||
break;
|
||||
case hudinfo_f:
|
||||
lua_pushinteger(L, info->f);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int hudinfo_set(lua_State *L)
|
||||
{
|
||||
hudinfo_t *info = *((hudinfo_t **)luaL_checkudata(L, 1, META_HUDINFO));
|
||||
enum hudinfo field = luaL_checkoption(L, 2, hudinfo_opt[0], hudinfo_opt);
|
||||
I_Assert(info != NULL);
|
||||
|
||||
switch(field)
|
||||
{
|
||||
case hudinfo_x:
|
||||
info->x = (INT32)luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case hudinfo_y:
|
||||
info->y = (INT32)luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case hudinfo_f:
|
||||
info->f = (INT32)luaL_checkinteger(L, 3);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hudinfo_num(lua_State *L)
|
||||
{
|
||||
hudinfo_t *info = *((hudinfo_t **)luaL_checkudata(L, 1, META_HUDINFO));
|
||||
lua_pushinteger(L, info-hudinfo);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int colormap_get(lua_State *L)
|
||||
{
|
||||
const UINT8 *colormap = *((UINT8 **)luaL_checkudata(L, 1, META_COLORMAP));
|
||||
|
|
@ -1307,27 +1228,6 @@ int LUA_HudLib(lua_State *L)
|
|||
lua_rawseti(L, -2, 6); // HUD[6] = title card rendering functions array
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, "HUD");
|
||||
|
||||
luaL_newmetatable(L, META_HUDINFO);
|
||||
lua_pushcfunction(L, hudinfo_get);
|
||||
lua_setfield(L, -2, "__index");
|
||||
|
||||
lua_pushcfunction(L, hudinfo_set);
|
||||
lua_setfield(L, -2, "__newindex");
|
||||
|
||||
lua_pushcfunction(L, hudinfo_num);
|
||||
lua_setfield(L, -2, "__len");
|
||||
lua_pop(L,1);
|
||||
|
||||
lua_newuserdata(L, 0);
|
||||
lua_createtable(L, 0, 2);
|
||||
lua_pushcfunction(L, lib_getHudInfo);
|
||||
lua_setfield(L, -2, "__index");
|
||||
|
||||
lua_pushcfunction(L, lib_hudinfolen);
|
||||
lua_setfield(L, -2, "__len");
|
||||
lua_setmetatable(L, -2);
|
||||
lua_setglobal(L, "hudinfo");
|
||||
|
||||
luaL_newmetatable(L, META_COLORMAP);
|
||||
lua_pushcfunction(L, colormap_get);
|
||||
lua_setfield(L, -2, "__index");
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ extern lua_State *gL;
|
|||
|
||||
#define META_BBOX "BOUNDING_BOX"
|
||||
|
||||
#define META_HUDINFO "HUDINFO_T*"
|
||||
#define META_PATCH "PATCH_T*"
|
||||
#define META_COLORMAP "COLORMAP"
|
||||
#define META_CAMERA "CAMERA_T*"
|
||||
|
|
|
|||
|
|
@ -691,6 +691,8 @@ typedef struct
|
|||
#endif
|
||||
} patch_t;
|
||||
|
||||
extern patch_t *missingpat;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ static void Patch_FreeData(patch_t *patch)
|
|||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (patch->flats[i])
|
||||
Z_Free(patch->flats[i]);
|
||||
}
|
||||
|
||||
|
|
@ -96,14 +95,14 @@ static void Patch_FreeData(patch_t *patch)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (patch->columnofs)
|
||||
Z_Free(patch->columnofs);
|
||||
if (patch->columns)
|
||||
Z_Free(patch->columns);
|
||||
}
|
||||
|
||||
void Patch_Free(patch_t *patch)
|
||||
{
|
||||
if (patch == missingpat)
|
||||
return;
|
||||
Patch_FreeData(patch);
|
||||
Z_Free(patch);
|
||||
}
|
||||
|
|
|
|||
219
src/st_stuff.c
219
src/st_stuff.c
|
|
@ -63,77 +63,6 @@ patch_t *faceprefix[MAXSKINS][NUMFACES];
|
|||
// status bar overlay
|
||||
// ------------------------------------------
|
||||
|
||||
// icons for overlay
|
||||
patch_t *sboscore; // Score logo
|
||||
patch_t *sbotime; // Time logo
|
||||
patch_t *sbocolon; // Colon for time
|
||||
patch_t *sboperiod; // Period for time centiseconds
|
||||
patch_t *livesback; // Lives icon background
|
||||
patch_t *stlivex;
|
||||
static patch_t *nrec_timer; // Timer for NiGHTS records
|
||||
static patch_t *sborings;
|
||||
static patch_t *slidgame;
|
||||
static patch_t *slidtime;
|
||||
static patch_t *slidover;
|
||||
static patch_t *sboredrings;
|
||||
static patch_t *sboredtime;
|
||||
static patch_t *getall; // Special Stage HUD
|
||||
static patch_t *timeup; // Special Stage HUD
|
||||
static patch_t *hunthoming[6];
|
||||
static patch_t *itemhoming[6];
|
||||
static patch_t *race1;
|
||||
static patch_t *race2;
|
||||
static patch_t *race3;
|
||||
static patch_t *racego;
|
||||
static patch_t *nightslink;
|
||||
static patch_t *curweapon;
|
||||
static patch_t *normring;
|
||||
static patch_t *bouncering;
|
||||
static patch_t *infinityring;
|
||||
static patch_t *autoring;
|
||||
static patch_t *explosionring;
|
||||
static patch_t *scatterring;
|
||||
static patch_t *grenadering;
|
||||
static patch_t *railring;
|
||||
static patch_t *jumpshield;
|
||||
static patch_t *forceshield;
|
||||
static patch_t *ringshield;
|
||||
static patch_t *watershield;
|
||||
static patch_t *bombshield;
|
||||
static patch_t *pityshield;
|
||||
static patch_t *pinkshield;
|
||||
static patch_t *flameshield;
|
||||
static patch_t *bubbleshield;
|
||||
static patch_t *thundershield;
|
||||
static patch_t *invincibility;
|
||||
static patch_t *sneakers;
|
||||
static patch_t *gravboots;
|
||||
static patch_t *nonicon;
|
||||
static patch_t *nonicon2;
|
||||
static patch_t *bluestat;
|
||||
static patch_t *byelstat;
|
||||
static patch_t *orngstat;
|
||||
static patch_t *redstat;
|
||||
static patch_t *yelstat;
|
||||
static patch_t *nbracket;
|
||||
static patch_t *nring;
|
||||
static patch_t *nhud[12];
|
||||
static patch_t *nsshud;
|
||||
static patch_t *nbon[12];
|
||||
static patch_t *nssbon;
|
||||
static patch_t *narrow[9];
|
||||
static patch_t *nredar[8]; // Red arrow
|
||||
static patch_t *drillbar;
|
||||
static patch_t *drillfill[3];
|
||||
static patch_t *capsulebar;
|
||||
static patch_t *capsulefill;
|
||||
patch_t *ngradeletters[7];
|
||||
static patch_t *minus5sec;
|
||||
static patch_t *minicaps;
|
||||
static patch_t *gotrflag;
|
||||
static patch_t *gotbflag;
|
||||
static patch_t *fnshico;
|
||||
|
||||
// Midnight Channel:
|
||||
static patch_t *hud_tv1;
|
||||
static patch_t *hud_tv2;
|
||||
|
|
@ -143,38 +72,6 @@ static patch_t *hud_tv2;
|
|||
static patch_t *envelope;
|
||||
#endif
|
||||
|
||||
// SRB2kart
|
||||
|
||||
hudinfo_t hudinfo[NUMHUDITEMS] =
|
||||
{
|
||||
{ 16, 176, V_SNAPTOLEFT|V_SNAPTOBOTTOM}, // HUD_LIVES
|
||||
|
||||
{ 16, 42, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_RINGS
|
||||
{ 96, 42, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_RINGSNUM
|
||||
{ 120, 42, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_RINGSNUMTICS
|
||||
|
||||
{ 16, 10, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_SCORE
|
||||
{ 120, 10, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_SCORENUM
|
||||
|
||||
{ 16, 26, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_TIME
|
||||
{ 72, 26, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_MINUTES
|
||||
{ 72, 26, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_TIMECOLON
|
||||
{ 96, 26, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_SECONDS
|
||||
{ 96, 26, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_TIMETICCOLON
|
||||
{ 120, 26, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_TICS
|
||||
|
||||
{ 0, 56, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_SS_TOTALRINGS
|
||||
|
||||
{ 110, 93, 0}, // HUD_GETRINGS
|
||||
{ 160, 93, 0}, // HUD_GETRINGSNUM
|
||||
{ 124, 160, 0}, // HUD_TIMELEFT
|
||||
{ 168, 176, 0}, // HUD_TIMELEFTNUM
|
||||
{ 130, 93, 0}, // HUD_TIMEUP
|
||||
{ 152, 168, 0}, // HUD_HUNTPICS
|
||||
|
||||
{ 288, 176, V_SNAPTORIGHT|V_SNAPTOBOTTOM}, // HUD_POWERUPS
|
||||
};
|
||||
|
||||
//
|
||||
// STATUS BAR CODE
|
||||
//
|
||||
|
|
@ -249,8 +146,6 @@ void ST_UnloadGraphics(void)
|
|||
|
||||
void ST_LoadGraphics(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
// SRB2 border patch
|
||||
// st_borderpatchnum = W_GetNumForName("GFZFLR01");
|
||||
// scr_borderpatch = W_CacheLumpNum(st_borderpatchnum, PU_HUDGFX);
|
||||
|
|
@ -260,107 +155,6 @@ void ST_LoadGraphics(void)
|
|||
// but load them in R_AddSkins, that gets called
|
||||
// first anyway
|
||||
// cache the status bar overlay icons (fullscreen mode)
|
||||
|
||||
// Prefix "STT" is whitelisted (doesn't trigger ISGAMEMODIFIED), btw
|
||||
HU_UpdatePatch(&sborings, "STTRINGS");
|
||||
HU_UpdatePatch(&sboredrings, "STTRRING");
|
||||
HU_UpdatePatch(&sboscore, "STTSCORE");
|
||||
HU_UpdatePatch(&sbotime, "STTTIME"); // Time logo
|
||||
HU_UpdatePatch(&sboredtime, "STTRTIME");
|
||||
HU_UpdatePatch(&sbocolon, "STTCOLON"); // Colon for time
|
||||
HU_UpdatePatch(&sboperiod, "STTPERIO"); // Period for time centiseconds
|
||||
|
||||
HU_UpdatePatch(&slidgame, "SLIDGAME");
|
||||
HU_UpdatePatch(&slidtime, "SLIDTIME");
|
||||
HU_UpdatePatch(&slidover, "SLIDOVER");
|
||||
|
||||
HU_UpdatePatch(&stlivex, "STLIVEX");
|
||||
HU_UpdatePatch(&livesback, "STLIVEBK");
|
||||
HU_UpdatePatch(&nrec_timer, "NGRTIMER"); // Timer for NiGHTS
|
||||
HU_UpdatePatch(&getall, "GETALL"); // Special Stage HUD
|
||||
HU_UpdatePatch(&timeup, "TIMEUP"); // Special Stage HUD
|
||||
HU_UpdatePatch(&race1, "RACE1");
|
||||
HU_UpdatePatch(&race2, "RACE2");
|
||||
HU_UpdatePatch(&race3, "RACE3");
|
||||
HU_UpdatePatch(&racego, "RACEGO");
|
||||
HU_UpdatePatch(&nightslink, "NGHTLINK");
|
||||
|
||||
for (i = 0; i < 6; ++i)
|
||||
{
|
||||
HU_UpdatePatch(&hunthoming[i], "HOMING%d", i+1);
|
||||
HU_UpdatePatch(&itemhoming[i], "HOMITM%d", i+1);
|
||||
}
|
||||
|
||||
HU_UpdatePatch(&curweapon, "CURWEAP");
|
||||
HU_UpdatePatch(&normring, "RINGIND");
|
||||
HU_UpdatePatch(&bouncering, "BNCEIND");
|
||||
HU_UpdatePatch(&infinityring, "INFNIND");
|
||||
HU_UpdatePatch(&autoring, "AUTOIND");
|
||||
HU_UpdatePatch(&explosionring, "BOMBIND");
|
||||
HU_UpdatePatch(&scatterring, "SCATIND");
|
||||
HU_UpdatePatch(&grenadering, "GRENIND");
|
||||
HU_UpdatePatch(&railring, "RAILIND");
|
||||
HU_UpdatePatch(&jumpshield, "TVWWICON");
|
||||
HU_UpdatePatch(&forceshield, "TVFOICON");
|
||||
HU_UpdatePatch(&ringshield, "TVATICON");
|
||||
HU_UpdatePatch(&watershield, "TVELICON");
|
||||
HU_UpdatePatch(&bombshield, "TVARICON");
|
||||
HU_UpdatePatch(&pityshield, "TVPIICON");
|
||||
HU_UpdatePatch(&pinkshield, "TVPPICON");
|
||||
HU_UpdatePatch(&flameshield, "TVFLICON");
|
||||
HU_UpdatePatch(&bubbleshield, "TVBBICON");
|
||||
HU_UpdatePatch(&thundershield, "TVZPICON");
|
||||
HU_UpdatePatch(&invincibility, "TVIVICON");
|
||||
HU_UpdatePatch(&sneakers, "TVSSICON");
|
||||
HU_UpdatePatch(&gravboots, "TVGVICON");
|
||||
|
||||
HU_UpdatePatch(&tagico, "TAGICO");
|
||||
HU_UpdatePatch(&rflagico, "RFLAGICO");
|
||||
HU_UpdatePatch(&bflagico, "BFLAGICO");
|
||||
HU_UpdatePatch(&rmatcico, "RMATCICO");
|
||||
HU_UpdatePatch(&bmatcico, "BMATCICO");
|
||||
HU_UpdatePatch(&gotrflag, "GOTRFLAG");
|
||||
HU_UpdatePatch(&gotbflag, "GOTBFLAG");
|
||||
HU_UpdatePatch(&fnshico, "FNSHICO");
|
||||
HU_UpdatePatch(&nonicon, "NONICON");
|
||||
HU_UpdatePatch(&nonicon2, "NONICON2");
|
||||
|
||||
// NiGHTS HUD things
|
||||
HU_UpdatePatch(&bluestat, "BLUESTAT");
|
||||
HU_UpdatePatch(&byelstat, "BYELSTAT");
|
||||
HU_UpdatePatch(&orngstat, "ORNGSTAT");
|
||||
HU_UpdatePatch(&redstat, "REDSTAT");
|
||||
HU_UpdatePatch(&yelstat, "YELSTAT");
|
||||
HU_UpdatePatch(&nbracket, "NBRACKET");
|
||||
HU_UpdatePatch(&nring, "NRNG1");
|
||||
for (i = 0; i < 12; ++i)
|
||||
{
|
||||
HU_UpdatePatch(&nhud[i], "NHUD%d", i+1);
|
||||
HU_UpdatePatch(&nbon[i], "NBON%d", i+1);
|
||||
}
|
||||
HU_UpdatePatch(&nsshud, "NSSHUD");
|
||||
HU_UpdatePatch(&nssbon, "NSSBON");
|
||||
HU_UpdatePatch(&minicaps, "MINICAPS");
|
||||
|
||||
for (i = 0; i < 8; ++i)
|
||||
{
|
||||
HU_UpdatePatch(&narrow[i], "NARROW%d", i+1);
|
||||
HU_UpdatePatch(&nredar[i], "NREDAR%d", i+1);
|
||||
}
|
||||
|
||||
// non-animated version
|
||||
HU_UpdatePatch(&narrow[8], "NARROW9");
|
||||
|
||||
HU_UpdatePatch(&drillbar, "DRILLBAR");
|
||||
for (i = 0; i < 3; ++i)
|
||||
HU_UpdatePatch(&drillfill[i], "DRILLFI%d", i+1);
|
||||
HU_UpdatePatch(&capsulebar, "CAPSBAR");
|
||||
HU_UpdatePatch(&capsulefill, "CAPSFILL");
|
||||
HU_UpdatePatch(&minus5sec, "MINUS5");
|
||||
|
||||
for (i = 0; i < 7; ++i)
|
||||
HU_UpdatePatch(&ngradeletters[i], "GRADE%d", i);
|
||||
|
||||
K_LoadKartHUDGraphics();
|
||||
|
||||
// Midnight Channel:
|
||||
|
|
@ -547,17 +341,6 @@ static INT32 SCR(INT32 r)
|
|||
// =========================================================================
|
||||
// INTERNAL DRAWING
|
||||
// =========================================================================
|
||||
#define ST_DrawTopLeftOverlayPatch(x,y,p) V_DrawScaledPatch(SCX(hudinfo[h+!!r_splitscreen].x), SCY(hudinfo[h+!!r_splitscreen].y), V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, p)
|
||||
#define ST_DrawOverlayNum(x,y,n) V_DrawTallNum(x, y, V_NOSCALESTART|V_HUDTRANS, n)
|
||||
#define ST_DrawPaddedOverlayNum(x,y,n,d) V_DrawPaddedTallNum(x, y, V_NOSCALESTART|V_HUDTRANS, n, d)
|
||||
#define ST_DrawOverlayPatch(x,y,p) V_DrawScaledPatch(x, y, V_NOSCALESTART|V_HUDTRANS, p)
|
||||
#define ST_DrawMappedOverlayPatch(x,y,p,c) V_DrawMappedScaledPatch(x, y, V_NOSCALESTART|V_HUDTRANS, p, c)
|
||||
#define ST_DrawNumFromHud(h,n) V_DrawTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|V_HUDTRANS, n)
|
||||
#define ST_DrawPadNumFromHud(h,n,q) V_DrawPaddedTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|V_HUDTRANS, n, q)
|
||||
#define ST_DrawPatchFromHud(h,p) V_DrawScaledPatch(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|V_HUDTRANS, p)
|
||||
#define ST_DrawNumFromHudWS(h,n) V_DrawTallNum(SCX(hudinfo[h+!!r_splitscreen].x), SCY(hudinfo[h+!!r_splitscreen].y), V_NOSCALESTART|V_HUDTRANS, n)
|
||||
#define ST_DrawPadNumFromHudWS(h,n,q) V_DrawPaddedTallNum(SCX(hudinfo[h+!!r_splitscreen].x), SCY(hudinfo[h+!!r_splitscreen].y), V_NOSCALESTART|V_HUDTRANS, n, q)
|
||||
#define ST_DrawPatchFromHudWS(h,p) V_DrawScaledPatch(SCX(hudinfo[h+!!r_splitscreen].x), SCY(hudinfo[h+!!r_splitscreen].y), V_NOSCALESTART|V_HUDTRANS, p)
|
||||
|
||||
// Devmode information
|
||||
static void ST_drawDebugInfo(void)
|
||||
|
|
@ -807,7 +590,7 @@ void ST_runTitleCard(void)
|
|||
char c = toupper(bossinfo.enemyname[bossinfo.titleshow]);
|
||||
bossinfo.titleshow++;
|
||||
c -= LT_FONTSTART;
|
||||
if (c < 0 || c >= LT_FONTSIZE || !tc_font[1][(INT32)c] || !bossinfo.titlesound)
|
||||
if (c < 0 || c >= LT_FONTSIZE || !fontv[GTFN_FONT].font[(INT32)c] || !bossinfo.titlesound)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,54 +81,7 @@ extern UINT32 st_translucency;
|
|||
|
||||
extern lumpnum_t st_borderpatchnum;
|
||||
// patches, also used in intermission
|
||||
extern patch_t *sboscore;
|
||||
extern patch_t *sbotime;
|
||||
extern patch_t *sbocolon;
|
||||
extern patch_t *sboperiod;
|
||||
extern patch_t *faceprefix[MAXSKINS][NUMFACES];
|
||||
extern patch_t *livesback;
|
||||
extern patch_t *stlivex;
|
||||
extern patch_t *ngradeletters[7];
|
||||
|
||||
/** HUD location information (don't move this comment)
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
INT32 x, y, f;
|
||||
} hudinfo_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HUD_LIVES,
|
||||
|
||||
HUD_RINGS,
|
||||
HUD_RINGSNUM,
|
||||
HUD_RINGSNUMTICS,
|
||||
|
||||
HUD_SCORE,
|
||||
HUD_SCORENUM,
|
||||
|
||||
HUD_TIME,
|
||||
HUD_MINUTES,
|
||||
HUD_TIMECOLON,
|
||||
HUD_SECONDS,
|
||||
HUD_TIMETICCOLON,
|
||||
HUD_TICS,
|
||||
|
||||
HUD_SS_TOTALRINGS,
|
||||
|
||||
HUD_GETRINGS,
|
||||
HUD_GETRINGSNUM,
|
||||
HUD_TIMELEFT,
|
||||
HUD_TIMELEFTNUM,
|
||||
HUD_TIMEUP,
|
||||
HUD_HUNTPICS,
|
||||
HUD_POWERUPS,
|
||||
|
||||
NUMHUDITEMS
|
||||
} hudnum_t;
|
||||
|
||||
extern hudinfo_t hudinfo[NUMHUDITEMS];
|
||||
|
||||
extern UINT16 objectsdrawn;
|
||||
|
||||
|
|
|
|||
|
|
@ -2310,8 +2310,8 @@ void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num)
|
|||
} while (num);
|
||||
|
||||
// draw a minus sign if necessary
|
||||
if (neg)
|
||||
V_DrawScaledPatch(x - w, y, flags, tallminus); // Tails
|
||||
//if (neg)
|
||||
//V_DrawScaledPatch(x - w, y, flags, tallminus); // Tails
|
||||
}
|
||||
|
||||
// Draws a number with a set number of digits.
|
||||
|
|
|
|||
|
|
@ -1796,7 +1796,7 @@ void *W_CachePatchName(const char *name, INT32 tag)
|
|||
num = W_CheckNumForName(name);
|
||||
|
||||
if (num == LUMPERROR)
|
||||
return W_CachePatchNum(W_GetNumForName("MISSING"), tag);
|
||||
return missingpat;
|
||||
return W_CachePatchNum(num, tag);
|
||||
}
|
||||
|
||||
|
|
@ -1807,7 +1807,7 @@ void *W_CachePatchLongName(const char *name, INT32 tag)
|
|||
num = W_CheckNumForLongName(name);
|
||||
|
||||
if (num == LUMPERROR)
|
||||
return W_CachePatchNum(W_GetNumForLongName("MISSING"), tag);
|
||||
return missingpat;
|
||||
return W_CachePatchNum(num, tag);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue