Merge branch 'nametags' into 'master'

Online name tags

See merge request KartKrew/Kart!279
This commit is contained in:
James R 2020-06-07 04:38:20 -04:00
commit 2918c1a9a7
20 changed files with 1013 additions and 949 deletions

View file

@ -18,6 +18,7 @@ set(SRB2_CORE_SOURCES
g_game.c
g_input.c
g_splitscreen.c
font.c
hu_stuff.c
i_tcp.c
info.c
@ -73,6 +74,7 @@ set(SRB2_CORE_HEADERS
g_game.h
g_input.h
g_state.h
font.h
hu_stuff.h
i_joy.h
i_net.h

View file

@ -502,6 +502,7 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/am_map.o \
$(OBJDIR)/command.o \
$(OBJDIR)/console.o \
$(OBJDIR)/font.o \
$(OBJDIR)/hu_stuff.o \
$(OBJDIR)/y_inter.o \
$(OBJDIR)/st_stuff.o \
@ -814,7 +815,7 @@ $(OBJDIR)/v_video.o: v_video.c doomdef.h doomtype.h g_state.h m_swap.h r_local.h
tables.h m_fixed.h screen.h command.h m_bbox.h r_main.h d_player.h \
p_pspr.h info.h d_think.h sounds.h p_mobj.h doomdata.h d_ticcmd.h \
r_data.h r_defs.h r_state.h r_bsp.h r_segs.h r_plane.h r_sky.h \
r_things.h r_draw.h v_video.h hu_stuff.h d_event.h w_wad.h console.h \
r_things.h r_draw.h v_video.h font.h hu_stuff.h d_event.h w_wad.h console.h \
i_video.h z_zone.h doomstat.h d_clisrv.h d_netcmd.h
$(CC) $(CFLAGS) -fno-omit-frame-pointer $(WFLAGS) -c $< -o $@
endif

77
src/font.c Normal file
View file

@ -0,0 +1,77 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1999-2018 by Sonic Team Junior.
// Copyright (C) 2019 by Kart Krew.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file font.c
/// \brief Font setup
#include "doomdef.h"
#include "hu_stuff.h"
#include "font.h"
#include "z_zone.h"
font_t fontv[MAX_FONTS];
int fontc;
static void
FontCache (font_t *fnt)
{
int i;
int c;
c = fnt->start;
for (i = 0; i < fnt->size; ++i, ++c)
{
fnt->font[i] = HU_CachePatch(
"%s%.*d",
fnt->prefix,
fnt->digits,
c);
}
}
void
Font_Load (void)
{
int i;
for (i = 0; i < fontc; ++i)
{
FontCache(&fontv[i]);
}
}
int
Font_DumbRegister (const font_t *sfnt)
{
font_t *fnt;
if (fontc == MAX_FONTS)
return -1;
fnt = &fontv[fontc];
memcpy(fnt, sfnt, sizeof (font_t));
if (!( fnt->font = ZZ_Alloc(sfnt->size * sizeof (patch_t *)) ))
return -1;
return fontc++;
}
int
Font_Register (const font_t *sfnt)
{
int d;
d = Font_DumbRegister(sfnt);
if (d >= 0)
FontCache(&fontv[d]);
return d;
}

49
src/font.h Normal file
View file

@ -0,0 +1,49 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1999-2018 by Sonic Team Junior.
// Copyright (C) 2019 by Kart Krew.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file font.h
/// \brief Font setup
#ifndef __FONT_H__
#define __FONT_H__
#define MAX_FONTS 32
typedef struct font font_t;
struct font
{
patch_t **font;
UINT8 start;
UINT8 size;
char prefix[8];/* 7 used at most */
unsigned digits : 2;
};
extern font_t fontv[MAX_FONTS];
extern int fontc;
/*
Reloads already registered fonts.
*/
void Font_Load (void);
/*
Registers and loads a new font.
*/
int Font_Register (const font_t *);
/*
Register a new font, but do not load it yet.
*/
int Font_DumbRegister (const font_t *);
#endif

View file

@ -8107,7 +8107,7 @@ boolean G_DemoTitleResponder(event_t *ev)
return true;
}
if ((ch >= HU_FONTSTART && ch <= HU_FONTEND && hu_font[ch-HU_FONTSTART])
if ((ch >= HU_FONTSTART && ch <= HU_FONTEND && fontv[HU_FONT].font[ch-HU_FONTSTART])
|| ch == ' ') // Allow spaces, of course
{
len = strlen(demo.titlename);

View file

@ -14,6 +14,7 @@
#include "doomdef.h"
#include "byteptr.h"
#include "hu_stuff.h"
#include "font.h"
#include "m_menu.h" // gametype_cons_t
#include "m_cond.h" // emblems
@ -53,6 +54,7 @@
#include "s_sound.h" // song credits
#include "k_kart.h"
#include "k_color.h"
// coords are scaled
#define HU_INPUTX 0
@ -64,19 +66,9 @@
//-------------------------------------------
// heads up font
//-------------------------------------------
patch_t *hu_font[HU_FONTSIZE];
patch_t *kart_font[KART_FONTSIZE]; // SRB2kart
patch_t *tny_font[HU_FONTSIZE];
patch_t *tallnum[10]; // 0-9
patch_t *nightsnum[10]; // 0-9
// Level title and credits fonts
patch_t *lt_font[LT_FONTSIZE];
patch_t *cred_font[CRED_FONTSIZE];
// ping font
// Note: I'd like to adress that at this point we might *REALLY* want to work towards a common drawString function that can take any font we want because this is really turning into a MESS. :V -Lat'
patch_t *pingnum[10];
patch_t *pinggfx[5]; // small ping graphic
patch_t *mping[5]; // smaller ping graphic
@ -188,137 +180,53 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum);
void HU_LoadGraphics(void)
{
char buffer[9];
INT32 i, j;
INT32 i;
if (dedicated)
return;
j = HU_FONTSTART;
for (i = 0; i < HU_FONTSIZE; i++, j++)
{
// cache the heads-up font for entire game execution
sprintf(buffer, "STCFN%.3d", j);
if (W_CheckNumForName(buffer) == LUMPERROR)
hu_font[i] = NULL;
else
hu_font[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
// tiny version of the heads-up font
sprintf(buffer, "TNYFN%.3d", j);
if (W_CheckNumForName(buffer) == LUMPERROR)
tny_font[i] = NULL;
else
tny_font[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
}
// cache the level title font for entire game execution
lt_font[0] = (patch_t *)W_CachePatchName("LTFNT039", PU_HUDGFX); /// \note fake start hack
// Number support
lt_font[9] = (patch_t *)W_CachePatchName("LTFNT048", PU_HUDGFX);
lt_font[10] = (patch_t *)W_CachePatchName("LTFNT049", PU_HUDGFX);
lt_font[11] = (patch_t *)W_CachePatchName("LTFNT050", PU_HUDGFX);
lt_font[12] = (patch_t *)W_CachePatchName("LTFNT051", PU_HUDGFX);
lt_font[13] = (patch_t *)W_CachePatchName("LTFNT052", PU_HUDGFX);
lt_font[14] = (patch_t *)W_CachePatchName("LTFNT053", PU_HUDGFX);
lt_font[15] = (patch_t *)W_CachePatchName("LTFNT054", PU_HUDGFX);
lt_font[16] = (patch_t *)W_CachePatchName("LTFNT055", PU_HUDGFX);
lt_font[17] = (patch_t *)W_CachePatchName("LTFNT056", PU_HUDGFX);
lt_font[18] = (patch_t *)W_CachePatchName("LTFNT057", PU_HUDGFX);
// SRB2kart
j = KART_FONTSTART;
for (i = 0; i < KART_FONTSIZE; i++, j++)
{
// cache the heads-up font for entire game execution
sprintf(buffer, "MKFNT%.3d", j);
if (W_CheckNumForName(buffer) == LUMPERROR)
kart_font[i] = NULL;
else
kart_font[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
}
//
j = LT_FONTSTART;
for (i = 0; i < LT_FONTSIZE; i++)
{
sprintf(buffer, "LTFNT%.3d", j);
j++;
if (W_CheckNumForName(buffer) == LUMPERROR)
lt_font[i] = NULL;
else
lt_font[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
}
// cache the credits font for entire game execution (why not?)
j = CRED_FONTSTART;
for (i = 0; i < CRED_FONTSIZE; i++)
{
sprintf(buffer, "CRFNT%.3d", j);
j++;
if (W_CheckNumForName(buffer) == LUMPERROR)
cred_font[i] = NULL;
else
cred_font[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
}
//cache numbers too!
for (i = 0; i < 10; i++)
{
sprintf(buffer, "STTNUM%d", i);
tallnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
sprintf(buffer, "NGTNUM%d", i);
nightsnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
sprintf(buffer, "PINGN%d", i);
pingnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
}
Font_Load();
// minus for negative tallnums
tallminus = (patch_t *)W_CachePatchName("STTMINUS", PU_HUDGFX);
tallminus = HU_CachePatch("STTMINUS");
// cache the crosshairs, don't bother to know which one is being used,
// just cache all 3, they're so small anyway.
for (i = 0; i < HU_CROSSHAIRS; i++)
{
sprintf(buffer, "CROSHAI%c", '1'+i);
crosshair[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
crosshair[i] = HU_CachePatch("CROSHAI%c", '1'+i);
}
emblemicon = W_CachePatchName("EMBLICON", PU_HUDGFX);
tokenicon = W_CachePatchName("TOKNICON", PU_HUDGFX);
emblemicon = HU_CachePatch("EMBLICON");
tokenicon = HU_CachePatch("TOKNICON");
emeraldpics[0] = W_CachePatchName("CHAOS1", PU_HUDGFX);
emeraldpics[1] = W_CachePatchName("CHAOS2", PU_HUDGFX);
emeraldpics[2] = W_CachePatchName("CHAOS3", PU_HUDGFX);
emeraldpics[3] = W_CachePatchName("CHAOS4", PU_HUDGFX);
emeraldpics[4] = W_CachePatchName("CHAOS5", PU_HUDGFX);
emeraldpics[5] = W_CachePatchName("CHAOS6", PU_HUDGFX);
emeraldpics[6] = W_CachePatchName("CHAOS7", PU_HUDGFX);
tinyemeraldpics[0] = W_CachePatchName("TEMER1", PU_HUDGFX);
tinyemeraldpics[1] = W_CachePatchName("TEMER2", PU_HUDGFX);
tinyemeraldpics[2] = W_CachePatchName("TEMER3", PU_HUDGFX);
tinyemeraldpics[3] = W_CachePatchName("TEMER4", PU_HUDGFX);
tinyemeraldpics[4] = W_CachePatchName("TEMER5", PU_HUDGFX);
tinyemeraldpics[5] = W_CachePatchName("TEMER6", PU_HUDGFX);
tinyemeraldpics[6] = W_CachePatchName("TEMER7", PU_HUDGFX);
emeraldpics[0] = HU_CachePatch("CHAOS1");
emeraldpics[1] = HU_CachePatch("CHAOS2");
emeraldpics[2] = HU_CachePatch("CHAOS3");
emeraldpics[3] = HU_CachePatch("CHAOS4");
emeraldpics[4] = HU_CachePatch("CHAOS5");
emeraldpics[5] = HU_CachePatch("CHAOS6");
emeraldpics[6] = HU_CachePatch("CHAOS7");
tinyemeraldpics[0] = HU_CachePatch("TEMER1");
tinyemeraldpics[1] = HU_CachePatch("TEMER2");
tinyemeraldpics[2] = HU_CachePatch("TEMER3");
tinyemeraldpics[3] = HU_CachePatch("TEMER4");
tinyemeraldpics[4] = HU_CachePatch("TEMER5");
tinyemeraldpics[5] = HU_CachePatch("TEMER6");
tinyemeraldpics[6] = HU_CachePatch("TEMER7");
songcreditbg = W_CachePatchName("K_SONGCR", PU_HUDGFX);
songcreditbg = HU_CachePatch("K_SONGCR");
// cache ping gfx:
for (i = 0; i < 5; i++)
{
sprintf(buffer, "PINGGFX%d", i+1);
pinggfx[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
sprintf(buffer, "MPING%d", i+1);
mping[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
pinggfx[i] = HU_CachePatch("PINGGFX%d", i+1);
mping[i] = HU_CachePatch("MPING%d", i+1);
}
// fps stuff
framecounter = W_CachePatchName("FRAMER", PU_HUDGFX);
frameslash = W_CachePatchName("FRAMESL", PU_HUDGFX);;
framecounter = HU_CachePatch("FRAMER");
frameslash = HU_CachePatch("FRAMESL");;
}
// Initialise Heads up
@ -326,6 +234,8 @@ void HU_LoadGraphics(void)
//
void HU_Init(void)
{
font_t font;
#ifndef NONET
COM_AddCommand("say", Command_Say_f);
COM_AddCommand("sayto", Command_Sayto_f);
@ -337,9 +247,78 @@ void HU_Init(void)
// set shift translation table
shiftxform = english_shiftxform;
/*
Setup fonts
*/
if (!dedicated)
{
#define DIM( s, n ) ( font.start = s, font.size = n )
#define ADIM( name ) DIM (name ## _FONTSTART, name ## _FONTSIZE)
#define PR( s ) strcpy(font.prefix, s)
#define DIG( n ) ( font.digits = n )
#define REG Font_DumbRegister(&font)
DIG (3);
ADIM (HU);
PR ("STCFN");
REG;
PR ("TNYFN");
REG;
ADIM (KART);
PR ("MKFNT");
REG;
ADIM (LT);
PR ("LTFNT");
REG;
ADIM (CRED);
PR ("CRFNT");
REG;
DIG (1);
DIM (0, 10);
PR ("STTNUM");
REG;
PR ("NGTNUM");
REG;
PR ("PINGN");
REG;
#undef REG
#undef DIG
#undef PR
#undef ADMIN
#undef DIM
}
HU_LoadGraphics();
}
patch_t *HU_CachePatch(const char *format, ...)
{
va_list ap;
char buffer[9];
va_start (ap, format);
vsprintf(buffer, format, ap);
va_end (ap);
if (W_CheckNumForName(buffer) == LUMPERROR)
return NULL;
else
return (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
}
static inline void HU_Stop(void)
{
headsupactive = false;
@ -761,168 +740,27 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80";
char *tempchar = NULL;
// player is a spectator?
if (players[playernum].spectator)
if (players[playernum].spectator)
{
cstart = "\x86"; // grey name
textcolor = "\x86";
// grey text
cstart = textcolor = "\x86";
}
else if (target == -1) // say team
{
if (players[playernum].ctfteam == 1) // red
if (players[playernum].ctfteam == 1)
{
cstart = "\x85";
textcolor = "\x85";
// red text
cstart = textcolor = "\x85";
}
else // blue
else
{
cstart = "\x84";
textcolor = "\x84";
// blue text
cstart = textcolor = "\x84";
}
}
else
{
const UINT8 color = players[playernum].skincolor;
cstart = "\x83";
switch (color)
{
case SKINCOLOR_WHITE:
case SKINCOLOR_SILVER:
case SKINCOLOR_SLATE:
cstart = "\x80"; // White
break;
case SKINCOLOR_GREY:
case SKINCOLOR_NICKEL:
case SKINCOLOR_BLACK:
case SKINCOLOR_SKUNK:
case SKINCOLOR_PLATINUM:
case SKINCOLOR_JET:
cstart = "\x86"; // V_GRAYMAP
break;
case SKINCOLOR_SEPIA:
case SKINCOLOR_BEIGE:
case SKINCOLOR_CARAMEL:
case SKINCOLOR_PEACH:
case SKINCOLOR_BROWN:
case SKINCOLOR_LEATHER:
case SKINCOLOR_RUST:
case SKINCOLOR_WRISTWATCH:
cstart = "\x8e"; // V_BROWNMAP
break;
case SKINCOLOR_FAIRY:
case SKINCOLOR_PINK:
case SKINCOLOR_ROSE:
case SKINCOLOR_LEMONADE:
case SKINCOLOR_LILAC:
case SKINCOLOR_BLOSSOM:
case SKINCOLOR_TAFFY:
cstart = "\x8d"; // V_PINKMAP
break;
case SKINCOLOR_CINNAMON:
case SKINCOLOR_RUBY:
case SKINCOLOR_RASPBERRY:
case SKINCOLOR_RED:
case SKINCOLOR_CRIMSON:
case SKINCOLOR_MAROON:
case SKINCOLOR_SCARLET:
case SKINCOLOR_KETCHUP:
cstart = "\x85"; // V_REDMAP
break;
case SKINCOLOR_DAWN:
case SKINCOLOR_SUNSLAM:
case SKINCOLOR_CREAMSICLE:
case SKINCOLOR_ORANGE:
case SKINCOLOR_ROSEWOOD:
case SKINCOLOR_TANGERINE:
cstart = "\x87"; // V_ORANGEMAP
break;
case SKINCOLOR_TAN:
case SKINCOLOR_CREAM:
cstart = "\x8f"; // V_TANMAP
break;
case SKINCOLOR_GOLD:
case SKINCOLOR_ROYAL:
case SKINCOLOR_BRONZE:
case SKINCOLOR_COPPER:
case SKINCOLOR_THUNDER:
cstart = "\x8A"; // V_GOLDMAP
break;
case SKINCOLOR_POPCORN:
case SKINCOLOR_YELLOW:
case SKINCOLOR_MUSTARD:
case SKINCOLOR_BANANA:
case SKINCOLOR_OLIVE:
case SKINCOLOR_CROCODILE:
cstart = "\x82"; // V_YELLOWMAP
break;
case SKINCOLOR_ARTICHOKE:
case SKINCOLOR_PERIDOT:
case SKINCOLOR_VOMIT:
case SKINCOLOR_GARDEN:
case SKINCOLOR_LIME:
case SKINCOLOR_HANDHELD:
case SKINCOLOR_TEA:
case SKINCOLOR_PISTACHIO:
case SKINCOLOR_MOSS:
case SKINCOLOR_CAMOUFLAGE:
case SKINCOLOR_MINT:
case SKINCOLOR_GREEN:
case SKINCOLOR_PINETREE:
case SKINCOLOR_TURTLE:
case SKINCOLOR_SWAMP:
case SKINCOLOR_DREAM:
case SKINCOLOR_PLAGUE:
case SKINCOLOR_EMERALD:
case SKINCOLOR_ALGAE:
cstart = "\x83"; // V_GREENMAP
break;
case SKINCOLOR_AQUAMARINE:
case SKINCOLOR_TURQUOISE:
case SKINCOLOR_TEAL:
cstart = "\x8b"; // V_AQUAMAP
break;
case SKINCOLOR_PIGEON:
case SKINCOLOR_ROBIN:
case SKINCOLOR_CYAN:
case SKINCOLOR_JAWZ:
case SKINCOLOR_CERULEAN:
case SKINCOLOR_NAVY:
case SKINCOLOR_SAPPHIRE:
cstart = "\x88"; // V_SKYMAP
break;
case SKINCOLOR_STEEL:
case SKINCOLOR_ULTRAMARINE:
case SKINCOLOR_PERIWINKLE:
case SKINCOLOR_BLUE:
case SKINCOLOR_MIDNIGHT:
case SKINCOLOR_BLUEBERRY:
case SKINCOLOR_NOVA:
cstart = "\x84"; // V_BLUEMAP
break;
case SKINCOLOR_THISTLE:
case SKINCOLOR_PURPLE:
case SKINCOLOR_PASTEL:
cstart = "\x81"; // V_PURPLEMAP
break;
case SKINCOLOR_MAGENTA:
case SKINCOLOR_FUCHSIA:
case SKINCOLOR_MOONSET:
case SKINCOLOR_VIOLET:
cstart = "\x8c"; // V_MAGENTAMAP
break;
case SKINCOLOR_DUSK:
case SKINCOLOR_TOXIC:
case SKINCOLOR_MAUVE:
case SKINCOLOR_LAVENDER:
case SKINCOLOR_BYZANTIUM:
case SKINCOLOR_POMEGRANATE:
cstart = "\x89"; // V_LAVENDERMAP
break;
default:
break;
}
cstart = "\x80" + (K_SkincolorToTextColor(players[playernum].skincolor) >> V_CHARCOLORSHIFT);
}
prefix = cstart;
@ -932,6 +770,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL);
else if (IsPlayerAdmin(playernum))
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(remotechar) + 1, PU_STATIC, NULL);
if (tempchar)
{
if (playernum == serverplayer)
@ -999,7 +838,7 @@ static inline boolean HU_keyInChatString(char *s, char ch)
{
size_t l;
if ((ch >= HU_FONTSTART && ch <= HU_FONTEND && hu_font[ch-HU_FONTSTART])
if ((ch >= HU_FONTSTART && ch <= HU_FONTEND && fontv[HU_FONT].font[ch-HU_FONTSTART])
|| ch == ' ') // Allow spaces, of course
{
l = strlen(s);
@ -1433,7 +1272,7 @@ static char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
c = toupper(c);
c -= HU_FONTSTART;
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
if (c < 0 || c >= HU_FONTSIZE || !fontv[HU_FONT].font[c])
{
chw = spacewidth;
lastusablespace = i;

View file

@ -17,6 +17,7 @@
#include "d_event.h"
#include "w_wad.h"
#include "r_defs.h"
#include "font.h"
//------------------------------------
// heads up font
@ -42,6 +43,23 @@
#define CRED_FONTEND 'Z' // the last font character
#define CRED_FONTSIZE (CRED_FONTEND - CRED_FONTSTART + 1)
#define X( name ) name ## _FONT
/* fonts */
enum
{
X (HU),
X (TINY),
X (KART),
X (LT),
X (CRED),
X (TALLNUM),
X (NIGHTSNUM),
X (PINGNUM),
};
#undef X
#define HU_CROSSHAIRS 3 // maximum of 9 - see HU_Init();
extern char *shiftxform; // english translation shift table
@ -78,15 +96,9 @@ void HU_AddChatText(const char *text, boolean playsound);
// set true when entering a chat message
extern boolean chat_on;
extern patch_t *hu_font[HU_FONTSIZE], *kart_font[KART_FONTSIZE], *tny_font[HU_FONTSIZE]; // SRB2kart
extern patch_t *tallnum[10];
extern patch_t *pingnum[10];
extern patch_t *pinggfx[5];
extern patch_t *nightsnum[10];
extern patch_t *framecounter;
extern patch_t *frameslash;
extern patch_t *lt_font[LT_FONTSIZE];
extern patch_t *cred_font[CRED_FONTSIZE];
extern patch_t *emeraldpics[7];
extern patch_t *tinyemeraldpics[7];
extern patch_t *rflagico;
@ -104,6 +116,9 @@ void HU_Init(void);
void HU_LoadGraphics(void);
// Load a HUDGFX patch or NULL.
patch_t *HU_CachePatch(const char *format, ...);
// reset heads up when consoleplayer respawns.
void HU_Start(void);

View file

@ -380,12 +380,160 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = {
{ 0, 0, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5
};
/*--------------------------------------------------
INT32 K_SkincolorToTextColor(UINT8 skincolor)
See header file for description.
--------------------------------------------------*/
INT32 K_SkincolorToTextColor(UINT8 skincolor)
{
INT32 textcolor = 0;
switch (skincolor)
{
default: // default to white?
case SKINCOLOR_WHITE:
case SKINCOLOR_SILVER:
case SKINCOLOR_SLATE:
textcolor = 0; // No color is white
break;
case SKINCOLOR_GREY:
case SKINCOLOR_NICKEL:
case SKINCOLOR_BLACK:
case SKINCOLOR_SKUNK:
case SKINCOLOR_PLATINUM:
case SKINCOLOR_JET:
textcolor = V_GRAYMAP;
break;
case SKINCOLOR_SEPIA:
case SKINCOLOR_BEIGE:
case SKINCOLOR_CARAMEL:
case SKINCOLOR_PEACH:
case SKINCOLOR_BROWN:
case SKINCOLOR_LEATHER:
case SKINCOLOR_RUST:
case SKINCOLOR_WRISTWATCH:
textcolor = V_BROWNMAP;
break;
case SKINCOLOR_FAIRY:
case SKINCOLOR_PINK:
case SKINCOLOR_ROSE:
case SKINCOLOR_LEMONADE:
case SKINCOLOR_LILAC:
case SKINCOLOR_BLOSSOM:
case SKINCOLOR_TAFFY:
textcolor = V_PINKMAP;
break;
case SKINCOLOR_CINNAMON:
case SKINCOLOR_RUBY:
case SKINCOLOR_RASPBERRY:
case SKINCOLOR_RED:
case SKINCOLOR_CRIMSON:
case SKINCOLOR_MAROON:
case SKINCOLOR_SCARLET:
case SKINCOLOR_KETCHUP:
textcolor = V_REDMAP;
break;
case SKINCOLOR_DAWN:
case SKINCOLOR_SUNSLAM:
case SKINCOLOR_CREAMSICLE:
case SKINCOLOR_ORANGE:
case SKINCOLOR_ROSEWOOD:
case SKINCOLOR_TANGERINE:
textcolor = V_ORANGEMAP;
break;
case SKINCOLOR_TAN:
case SKINCOLOR_CREAM:
textcolor = V_TANMAP;
break;
case SKINCOLOR_GOLD:
case SKINCOLOR_ROYAL:
case SKINCOLOR_BRONZE:
case SKINCOLOR_COPPER:
case SKINCOLOR_THUNDER:
textcolor = V_GOLDMAP;
break;
case SKINCOLOR_POPCORN:
case SKINCOLOR_YELLOW:
case SKINCOLOR_MUSTARD:
case SKINCOLOR_BANANA:
case SKINCOLOR_OLIVE:
case SKINCOLOR_CROCODILE:
textcolor = V_YELLOWMAP;
break;
case SKINCOLOR_ARTICHOKE:
case SKINCOLOR_PERIDOT:
case SKINCOLOR_VOMIT:
case SKINCOLOR_GARDEN:
case SKINCOLOR_LIME:
case SKINCOLOR_HANDHELD:
case SKINCOLOR_TEA:
case SKINCOLOR_PISTACHIO:
case SKINCOLOR_MOSS:
case SKINCOLOR_CAMOUFLAGE:
case SKINCOLOR_MINT:
case SKINCOLOR_GREEN:
case SKINCOLOR_PINETREE:
case SKINCOLOR_TURTLE:
case SKINCOLOR_SWAMP:
case SKINCOLOR_DREAM:
case SKINCOLOR_PLAGUE:
case SKINCOLOR_EMERALD:
case SKINCOLOR_ALGAE:
textcolor = V_GREENMAP;
break;
case SKINCOLOR_AQUAMARINE:
case SKINCOLOR_TURQUOISE:
case SKINCOLOR_TEAL:
textcolor = V_AQUAMAP;
break;
case SKINCOLOR_PIGEON:
case SKINCOLOR_ROBIN:
case SKINCOLOR_CYAN:
case SKINCOLOR_JAWZ:
case SKINCOLOR_CERULEAN:
case SKINCOLOR_NAVY:
case SKINCOLOR_SAPPHIRE:
textcolor = V_SKYMAP;
break;
case SKINCOLOR_STEEL:
case SKINCOLOR_ULTRAMARINE:
case SKINCOLOR_PERIWINKLE:
case SKINCOLOR_BLUE:
case SKINCOLOR_MIDNIGHT:
case SKINCOLOR_BLUEBERRY:
case SKINCOLOR_NOVA:
textcolor = V_BLUEMAP;
break;
case SKINCOLOR_THISTLE:
case SKINCOLOR_PURPLE:
case SKINCOLOR_PASTEL:
textcolor = V_PURPLEMAP;
break;
case SKINCOLOR_MAGENTA:
case SKINCOLOR_FUCHSIA:
case SKINCOLOR_MOONSET:
case SKINCOLOR_VIOLET:
textcolor = V_MAGENTAMAP;
break;
case SKINCOLOR_DUSK:
case SKINCOLOR_TOXIC:
case SKINCOLOR_MAUVE:
case SKINCOLOR_LAVENDER:
case SKINCOLOR_BYZANTIUM:
case SKINCOLOR_POMEGRANATE:
textcolor = V_LAVENDERMAP;
break;
}
return textcolor;
}
/*--------------------------------------------------
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b)
See header file for description.
--------------------------------------------------*/
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b)
{
UINT32 redweight = 1063 * r;
@ -400,7 +548,6 @@ UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b)
See header file for description.
--------------------------------------------------*/
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
{
INT32 i;
@ -444,14 +591,11 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
}
}
/** \brief Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c
/*--------------------------------------------------
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
\param dest_colormap colormap to populate
\param skinnum number of skin, TC_DEFAULT or TC_BOSS
\param color translation color
\return void
*/
See header file for description.
--------------------------------------------------*/
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
{
INT32 i;
@ -505,12 +649,11 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
}
}
/** \brief Pulls kart color by name, to replace R_GetColorByName in r_draw.c
/*--------------------------------------------------
UINT8 K_GetKartColorByName(const char *name)
\param name color name
\return 0
*/
See header file for description.
--------------------------------------------------*/
UINT8 K_GetKartColorByName(const char *name)
{
UINT8 color = (UINT8)atoi(name);

View file

@ -23,6 +23,21 @@ extern UINT8 colortranslations[MAXTRANSLATIONS][16];
extern const char *KartColor_Names[MAXSKINCOLORS];
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
/*--------------------------------------------------
INT32 K_SkincolorToTextColor(UINT8 skincolor);
Gives you the "text" color (V_ constants) from a skincolor (SKINCOLOR_ constants).
Used primarily by the chat system.
Input Arguments:-
skincolor - SKINCOLOR_ constant
Return:-
V_ constant for font coloring
--------------------------------------------------*/
INT32 K_SkincolorToTextColor(UINT8 skincolor);
/*--------------------------------------------------
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b);

View file

@ -7766,6 +7766,8 @@ static patch_t *kp_blagles[6];
static patch_t *kp_cpu;
static patch_t *kp_nametagstem;
void K_LoadKartHUDGraphics(void)
{
INT32 i, j;
@ -8133,6 +8135,8 @@ void K_LoadKartHUDGraphics(void)
}
kp_cpu = (patch_t *) W_CachePatchName("K_CPU", PU_HUDGFX);
kp_nametagstem = (patch_t *) W_CachePatchName("K_NAMEST", PU_HUDGFX);
}
// For the item toggle menu
@ -9359,14 +9363,14 @@ static void K_drawKartLapsAndRings(void)
ln[0] = ((stplyr->laps / 10) % 10);
ln[1] = (stplyr->laps % 10);
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|splitflags, pingnum[ln[0]]);
V_DrawScaledPatch(fx+17, fy, V_HUDTRANS|splitflags, pingnum[ln[1]]);
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[0]]);
V_DrawScaledPatch(fx+17, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[1]]);
ln[0] = ((abs(cv_numlaps.value) / 10) % 10);
ln[1] = (abs(cv_numlaps.value) % 10);
V_DrawScaledPatch(fx+27, fy, V_HUDTRANS|splitflags, pingnum[ln[0]]);
V_DrawScaledPatch(fx+31, fy, V_HUDTRANS|splitflags, pingnum[ln[1]]);
V_DrawScaledPatch(fx+27, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[0]]);
V_DrawScaledPatch(fx+31, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[1]]);
}
else
{
@ -9389,8 +9393,8 @@ static void K_drawKartLapsAndRings(void)
if (stplyr->kartstuff[k_rings] < 0) // Draw the minus for ring debt
V_DrawMappedPatch(fr+7, fy-10, V_HUDTRANS|splitflags, kp_ringdebtminussmall, ringmap);
V_DrawMappedPatch(fr+11, fy-10, V_HUDTRANS|splitflags, pingnum[rn[0]], ringmap);
V_DrawMappedPatch(fr+15, fy-10, V_HUDTRANS|splitflags, pingnum[rn[1]], ringmap);
V_DrawMappedPatch(fr+11, fy-10, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[rn[0]], ringmap);
V_DrawMappedPatch(fr+15, fy-10, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[rn[1]], ringmap);
// SPB ring lock
if (stplyr->kartstuff[k_ringlock])
@ -9401,7 +9405,7 @@ static void K_drawKartLapsAndRings(void)
{
UINT8 *colormap = R_GetTranslationColormap(stplyr->skin, stplyr->skincolor, GTC_CACHE);
V_DrawMappedPatch(fr+21, fy-13, V_HUDTRANS|splitflags, facemmapprefix[stplyr->skin], colormap);
V_DrawScaledPatch(fr+34, fy-10, V_HUDTRANS|splitflags, pingnum[(stplyr->lives % 10)]); // make sure this doesn't overflow
V_DrawScaledPatch(fr+34, fy-10, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[(stplyr->lives % 10)]); // make sure this doesn't overflow
}
}
else
@ -9547,14 +9551,14 @@ static void K_drawKartBumpersOrKarma(void)
ln[0] = ((numtargets / 10) % 10);
ln[1] = (numtargets % 10);
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|splitflags, pingnum[ln[0]]);
V_DrawScaledPatch(fx+17, fy, V_HUDTRANS|splitflags, pingnum[ln[1]]);
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[0]]);
V_DrawScaledPatch(fx+17, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[1]]);
ln[0] = ((maptargets / 10) % 10);
ln[1] = (maptargets % 10);
V_DrawScaledPatch(fx+27, fy, V_HUDTRANS|splitflags, pingnum[ln[0]]);
V_DrawScaledPatch(fx+31, fy, V_HUDTRANS|splitflags, pingnum[ln[1]]);
V_DrawScaledPatch(fx+27, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[0]]);
V_DrawScaledPatch(fx+31, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[1]]);
}
else
{
@ -9581,14 +9585,14 @@ static void K_drawKartBumpersOrKarma(void)
ln[0] = ((abs(stplyr->kartstuff[k_bumper]) / 10) % 10);
ln[1] = (abs(stplyr->kartstuff[k_bumper]) % 10);
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|splitflags, pingnum[ln[0]]);
V_DrawScaledPatch(fx+17, fy, V_HUDTRANS|splitflags, pingnum[ln[1]]);
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[0]]);
V_DrawScaledPatch(fx+17, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[1]]);
ln[0] = ((abs(maxbumper) / 10) % 10);
ln[1] = (abs(maxbumper) % 10);
V_DrawScaledPatch(fx+27, fy, V_HUDTRANS|splitflags, pingnum[ln[0]]);
V_DrawScaledPatch(fx+31, fy, V_HUDTRANS|splitflags, pingnum[ln[1]]);
V_DrawScaledPatch(fx+27, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[0]]);
V_DrawScaledPatch(fx+31, fy, V_HUDTRANS|splitflags, fontv[PINGNUM_FONT].font[ln[1]]);
}
else
{
@ -9738,6 +9742,11 @@ static void K_ObjectTracking(fixed_t *hud_x, fixed_t *hud_y, vertex_t *campos, a
{
*hud_x = FixedMul(NEWTAN(anglediff), swhalffixed) + swhalffixed;
if (encoremode)
{
*hud_x = (BASEVIDWIDTH * FRACUNIT) - *hud_x;
}
if (r_splitscreen >= 2)
{
*hud_x /= 2;
@ -9810,9 +9819,9 @@ static void K_drawKartPlayerCheck(void)
thiscam = &camera[cnum];
c.x = thiscam->x;
c.y = thiscam->y;
c.z = thiscam->z;
c.x = stplyr->mo->x;
c.y = stplyr->mo->y;
c.z = stplyr->mo->z;
for (i = 0; i < MAXPLAYERS; i++)
{
@ -9876,7 +9885,7 @@ static void K_drawKartPlayerCheck(void)
static void K_drawKartNameTags(void)
{
const fixed_t maxdistance = 4096*mapobjectscale;
const fixed_t maxdistance = 8192*mapobjectscale;
camera_t *thiscam;
vertex_t c;
UINT8 cnum = 0;
@ -9947,7 +9956,7 @@ static void K_drawKartNameTags(void)
}
}
if (j < r_splitscreen)
if (j <= r_splitscreen)
{
// Is a player that's being shown on this computer
continue;
@ -9986,12 +9995,46 @@ static void K_drawKartNameTags(void)
V_DrawFixedPatch(x, y, FRACUNIT, V_HUDTRANS, kp_rival[blink], NULL);
}
}
else
else if (netgame)
{
if ((ntplayer->kartstuff[k_position] >= stplyr->kartstuff[k_position]-1)
&& (ntplayer->kartstuff[k_position] <= stplyr->kartstuff[k_position]+1))
if ((ntplayer->kartstuff[k_position] >= stplyr->kartstuff[k_position]-2)
&& (ntplayer->kartstuff[k_position] <= stplyr->kartstuff[k_position]+2))
{
; // TODO: Draw a cool name tag for online
INT32 namelen = V_ThinStringWidth(player_names[i], V_6WIDTHSPACE|V_ALLOWLOWERCASE);
INT32 clr = K_SkincolorToTextColor(ntplayer->skincolor);
UINT8 *colormap = V_GetStringColormap(clr);
INT32 barx = 0, bary = 0, barw = 0;
// Since there's no "V_DrawFixedFill", and I don't feel like making it,
// fuck it, we're gonna just V_NOSCALESTART hack it
barw = (namelen * vid.dupx);
barx = (x * vid.dupx) / FRACUNIT;
bary = (y * vid.dupy) / FRACUNIT;
barx += (6 * vid.dupx);
bary -= (16 * vid.dupx);
// Center it if necessary
if (vid.width != BASEVIDWIDTH * vid.dupx)
{
barx += (vid.width - (BASEVIDWIDTH * vid.dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * vid.dupy)
{
bary += (vid.height - (BASEVIDHEIGHT * vid.dupy)) / 2;
}
V_DrawFill(barx, bary, barw, (3 * vid.dupy), colormap[31]|V_NOSCALESTART);
V_DrawFill(barx, bary + vid.dupy, barw, vid.dupy, colormap[0]|V_NOSCALESTART);
// END DRAWFILL DUMBNESS
// Draw the stem
V_DrawFixedPatch(x, y, FRACUNIT, 0, kp_nametagstem, colormap);
// Draw the name itself
V_DrawThinStringAtFixed(x + (5*FRACUNIT), y - (26*FRACUNIT), V_6WIDTHSPACE|V_ALLOWLOWERCASE|clr, player_names[i]);
}
}
}
@ -10649,7 +10692,7 @@ static void K_drawInput(void)
V_DrawFill(x+(xoffs), y+BUTTH, BUTTW-1, 2, splitflags|31);\
}\
V_DrawFill(x+(xoffs), y+offs, BUTTW-1, BUTTH, col);\
V_DrawFixedPatch((x+1+(xoffs))<<FRACBITS, (y+offs+1)<<FRACBITS, FRACUNIT, splitflags, tny_font[symb-HU_FONTSTART], NULL)
V_DrawFixedPatch((x+1+(xoffs))<<FRACBITS, (y+offs+1)<<FRACBITS, FRACUNIT, splitflags, fontv[TINY_FONT].font[symb-HU_FONTSTART], NULL)
drawbutt(-2*BUTTW, BT_ACCELERATE, 'A');
drawbutt( -BUTTW, BT_BRAKE, 'B');

View file

@ -22,6 +22,7 @@
#include "v_video.h"
#include "w_wad.h"
#include "z_zone.h"
#include "hu_stuff.h"
#include "lua_script.h"
#include "lua_libs.h"

View file

@ -231,6 +231,7 @@
<ClInclude Include="..\hardware\hw_md3load.h" />
<ClInclude Include="..\hardware\hw_model.h" />
<ClInclude Include="..\hardware\u_list.h" />
<ClInclude Include="..\font.h" />
<ClInclude Include="..\hu_stuff.h" />
<ClInclude Include="..\info.h" />
<ClInclude Include="..\i_addrinfo.h" />
@ -376,6 +377,7 @@
<ClCompile Include="..\hardware\hw_trick.c" />
<ClCompile Include="..\hardware\r_opengl\r_opengl.c" />
<ClCompile Include="..\hardware\u_list.c" />
<ClCompile Include="..\font.c" />
<ClCompile Include="..\hu_stuff.c" />
<ClCompile Include="..\info.c" />
<ClCompile Include="..\i_addrinfo.c">

View file

@ -2090,6 +2090,50 @@
RelativePath="..\console.h"
>
</File>
<File
RelativePath="..\font.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\font.h"
>
</File>
<File
RelativePath="..\hu_stuff.c"
>

View file

@ -655,6 +655,16 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\font.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\hu_stuff.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -1366,6 +1376,7 @@
<ClInclude Include="..\am_map.h" />
<ClInclude Include="..\command.h" />
<ClInclude Include="..\console.h" />
<ClInclude Include="..\font.h" />
<ClInclude Include="..\hu_stuff.h" />
<ClInclude Include="..\st_stuff.h" />
<ClInclude Include="..\y_inter.h" />

View file

@ -2090,6 +2090,50 @@
RelativePath="..\console.h"
>
</File>
<File
RelativePath="..\font.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\font.h"
>
</File>
<File
RelativePath="..\hu_stuff.c"
>

View file

@ -65,7 +65,6 @@ extern INT32 st_palette; // 0 is default, any others are special palettes.
extern lumpnum_t st_borderpatchnum;
// patches, also used in intermission
extern patch_t *tallnum[10];
extern patch_t *sboscore;
extern patch_t *sbotime;
extern patch_t *sbocolon;

File diff suppressed because it is too large Load diff

View file

@ -173,6 +173,12 @@ void V_DrawCustomFadeScreen(const char *lump, UINT8 strength);
void V_DrawFadeConsBack(INT32 plines);
void V_EncoreInvertScreen(void);
/* Convenience macros for leagacy string function macros. */
#define V__DrawOneScaleString( x,y,scale,option,font,string ) \
V_DrawStringScaled(x,y,scale,FRACUNIT,FRACUNIT,option,font,string)
#define V__DrawDupxString( x,y,scale,option,font,string )\
V__DrawOneScaleString ((x)<<FRACBITS,(y)<<FRACBITS,scale,option,font,string)
// draw a single character
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
// draw a single character, but for the chat
@ -180,27 +186,47 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI
UINT8 *V_GetStringColormap(INT32 colorflags);
void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string);
#define V_DrawLevelTitle( x,y,option,string ) \
V__DrawDupxString (x,y,FRACUNIT,option,LT_FONT,string)
// wordwrap a string using the hu_font
char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string);
// draw a string using a font
void V_DrawStringScaled(
fixed_t x,
fixed_t y,
fixed_t scale,
fixed_t space_scale,
fixed_t linefeed_scale,
INT32 flags,
int font,
const char *text);
// draw a string using the hu_font
void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string);
void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string); // SRB2kart
#define V_DrawString( x,y,option,string ) \
V__DrawDupxString (x,y,FRACUNIT,option,HU_FONT,string)
#define V_DrawKartString( x,y,option,string ) \
V__DrawDupxString (x,y,FRACUNIT,option,KART_FONT,string)
void V_DrawCenteredString(INT32 x, INT32 y, INT32 option, const char *string);
void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string);
// draw a string using the hu_font, 0.5x scale
void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string);
#define V_DrawSmallString( x,y,option,string ) \
V__DrawDupxString (x,y,FRACUNIT>>1,option,HU_FONT,string)
void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string);
// draw a string using the tny_font
void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string);
#define V_DrawThinString( x,y,option,string ) \
V__DrawDupxString (x,y,FRACUNIT,option,TINY_FONT,string)
void V_DrawCenteredThinString(INT32 x, INT32 y, INT32 option, const char *string);
void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *string);
void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
#define V_DrawStringAtFixed( x,y,option,string ) \
V__DrawOneScaleString (x,y,FRACUNIT,option,HU_FONT,string)
#define V_DrawThinStringAtFixed( x,y,option,string ) \
V__DrawOneScaleString (x,y,FRACUNIT,option,TINY_FONT,string)
// Draw tall nums, used for menu, HUD, intermission
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);
@ -214,7 +240,8 @@ void V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colorm
INT32 V_LevelNameWidth(const char *string);
INT32 V_LevelNameHeight(const char *string);
void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string);
#define V_DrawCreditString( x,y,option,string ) \
V__DrawOneScaleString (x,y,FRACUNIT,option,CRED_FONT,string)
INT32 V_CreditStringWidth(const char *string);
// Find string width from hu_font chars

View file

@ -223,6 +223,20 @@
<ClCompile Include="..\f_wipe.c" />
<ClCompile Include="..\g_game.c" />
<ClCompile Include="..\g_input.c" />
<ClCompile Include="..\hardware\hw3sound.c" />
<ClCompile Include="..\hardware\hw_bsp.c" />
<ClCompile Include="..\hardware\hw_cache.c" />
<ClCompile Include="..\hardware\hw_clip.c" />
<ClCompile Include="..\hardware\hw_draw.c" />
<ClCompile Include="..\hardware\hw_light.c" />
<ClCompile Include="..\hardware\hw_main.c" />
<ClCompile Include="..\hardware\hw_md2.c" />
<ClCompile Include="..\hardware\hw_md2load.c" />
<ClCompile Include="..\hardware\hw_md3load.c" />
<ClCompile Include="..\hardware\hw_model.c" />
<ClCompile Include="..\hardware\hw_trick.c" />
<ClCompile Include="..\hardware\u_list.c" />
<ClCompile Include="..\font.c" />
<ClCompile Include="..\hu_stuff.c" />
<ClCompile Include="..\info.c" />
<ClCompile Include="..\i_addrinfo.c">
@ -376,6 +390,21 @@
<ClInclude Include="..\hardware\hw3dsdrv.h" />
<ClInclude Include="..\hardware\hw3sound.h" />
<ClInclude Include="..\hardware\hws_data.h" />
<ClInclude Include="..\hardware\hw_clip.h" />
<ClInclude Include="..\hardware\hw_data.h" />
<ClInclude Include="..\hardware\hw_defs.h" />
<ClInclude Include="..\hardware\hw_dll.h" />
<ClInclude Include="..\hardware\hw_drv.h" />
<ClInclude Include="..\hardware\hw_glide.h" />
<ClInclude Include="..\hardware\hw_glob.h" />
<ClInclude Include="..\hardware\hw_light.h" />
<ClInclude Include="..\hardware\hw_main.h" />
<ClInclude Include="..\hardware\hw_md2.h" />
<ClInclude Include="..\hardware\hw_md2load.h" />
<ClInclude Include="..\hardware\hw_md3load.h" />
<ClInclude Include="..\hardware\hw_model.h" />
<ClInclude Include="..\hardware\u_list.h" />
<ClInclude Include="..\font.h" />
<ClInclude Include="..\hu_stuff.h" />
<ClInclude Include="..\info.h" />
<ClInclude Include="..\i_addrinfo.h" />

View file

@ -1831,6 +1831,50 @@
RelativePath="..\console.h"
>
</File>
<File
RelativePath="..\font.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\font.h"
>
</File>
<File
RelativePath="..\hu_stuff.c"
>