2014-03-15 16:59:03 +00:00
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
2023-03-31 12:53:31 +00:00
// Copyright (C) 1999-2023 by Sonic Team Junior.
2014-03-15 16:59:03 +00:00
//
// 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 hu_stuff.h
/// \brief Heads up display
# ifndef __HU_STUFF_H__
# define __HU_STUFF_H__
# include "d_event.h"
# include "w_wad.h"
# include "r_defs.h"
//------------------------------------
2022-02-14 20:35:11 +00:00
// Fonts & stuff
2014-03-15 16:59:03 +00:00
//------------------------------------
2022-09-05 15:18:26 +00:00
# define FONTSTART '\x16' // the first font character
# define FONTEND '~'
# define FONTSIZE (FONTEND - FONTSTART + 1)
2019-10-09 04:28:01 +00:00
2014-03-15 16:59:03 +00:00
# define HU_CROSSHAIRS 3 // maximum of 9 - see HU_Init();
extern char * shiftxform ; // english translation shift table
extern char english_shiftxform [ ] ;
2022-02-03 12:41:24 +00:00
typedef struct
{
2022-09-05 15:18:26 +00:00
patch_t * chars [ FONTSIZE ] ;
2022-02-04 12:36:27 +00:00
INT32 kerning ;
UINT32 spacewidth ;
2024-03-07 20:36:59 +00:00
UINT32 charwidth ;
2022-02-04 12:36:27 +00:00
UINT32 linespacing ;
2022-02-03 12:41:24 +00:00
} fontdef_t ;
2022-02-05 14:45:27 +00:00
extern fontdef_t hu_font , tny_font , cred_font , lt_font ;
2022-02-14 20:35:11 +00:00
extern fontdef_t ntb_font , nto_font ;
extern patch_t * tallnum [ 10 ] ;
extern patch_t * nightsnum [ 10 ] ;
extern patch_t * ttlnum [ 10 ] ;
extern patch_t * tallminus ;
extern patch_t * tallinfin ;
2022-02-03 12:41:24 +00:00
2014-03-15 16:59:03 +00:00
//------------------------------------
// sorted player lines
//------------------------------------
typedef struct
{
UINT32 count ;
INT32 num ;
INT32 color ;
INT32 emeralds ;
const char * name ;
} playersort_t ;
//------------------------------------
// chat stuff
//------------------------------------
2022-01-02 22:06:34 +00:00
# define HU_MAXMSGLEN 223
2018-12-17 19:43:59 +00:00
# define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand.
2018-12-23 01:52:32 +00:00
# ifdef NETSPLITSCREEN
2018-12-17 19:43:59 +00:00
# define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640)
2018-12-23 01:52:32 +00:00
# else
2018-12-23 02:30:39 +00:00
# define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640 || splitscreen)
2018-12-23 01:52:32 +00:00
# endif
2024-02-27 10:58:59 +00:00
# define CHAT_MUTE ((cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot.
# define OLD_MUTE (OLDCHAT && (cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.
2018-12-17 19:43:59 +00:00
// some functions
void HU_AddChatText ( const char * text , boolean playsound ) ;
// set true when entering a chat message
extern boolean chat_on ;
2014-03-15 16:59:03 +00:00
2018-06-03 21:41:54 +00:00
extern patch_t * emeraldpics [ 3 ] [ 8 ] ;
2014-03-15 16:59:03 +00:00
extern patch_t * rflagico ;
extern patch_t * bflagico ;
extern patch_t * rmatcico ;
extern patch_t * bmatcico ;
extern patch_t * tagico ;
2017-04-24 20:56:17 +00:00
extern patch_t * tokenicon ;
2014-03-15 16:59:03 +00:00
// set true whenever the tab rankings are being shown for any reason
extern boolean hu_showscores ;
// init heads up data at game startup.
void HU_Init ( void ) ;
void HU_LoadGraphics ( void ) ;
2022-11-07 22:09:25 +00:00
void HU_LoadFontCharacters ( fontdef_t * font , const char * prefix ) ;
2024-03-07 20:36:59 +00:00
void HU_SetFontProperties ( fontdef_t * font , INT32 kerning , UINT32 spacewidth , UINT32 charwidth , UINT32 linespacing ) ;
2014-03-15 16:59:03 +00:00
// reset heads up when consoleplayer respawns.
2018-11-07 21:37:42 +00:00
void HU_Start ( void ) ;
2014-03-15 16:59:03 +00:00
boolean HU_Responder ( event_t * ev ) ;
void HU_Ticker ( void ) ;
void HU_Drawer ( void ) ;
char HU_dequeueChatChar ( void ) ;
void HU_clearChatChars ( void ) ;
2019-11-18 02:52:05 +00:00
void HU_drawPing ( INT32 x , INT32 y , UINT32 ping , boolean notext , INT32 flags ) ; // Lat': Ping drawer for scoreboard.
2014-03-15 16:59:03 +00:00
void HU_DrawTabRankings ( INT32 x , INT32 y , playersort_t * tab , INT32 scorelines , INT32 whiteplayer ) ;
void HU_DrawTeamTabRankings ( playersort_t * tab , INT32 whiteplayer ) ;
void HU_DrawDualTabRankings ( INT32 x , INT32 y , playersort_t * tab , INT32 scorelines , INT32 whiteplayer ) ;
void HU_DrawEmeralds ( INT32 x , INT32 y , INT32 pemeralds ) ;
INT32 HU_CreateTeamScoresTbl ( playersort_t * tab , UINT32 dmtotals [ ] ) ;
// CECHO interface.
void HU_ClearCEcho ( void ) ;
void HU_SetCEchoDuration ( INT32 seconds ) ;
void HU_SetCEchoFlags ( INT32 flags ) ;
void HU_DoCEcho ( const char * msg ) ;
// Demo playback info
extern UINT32 hu_demoscore ;
extern UINT32 hu_demotime ;
extern UINT16 hu_demorings ;
# endif