From 0cef1810c048ad9cecf0c6b8ac691c6b714d2151 Mon Sep 17 00:00:00 2001 From: danij Date: Tue, 12 May 2009 20:42:56 +0000 Subject: [PATCH] Changed jDoom: Use the original STCFN* lumps (rather than the FONTA* lumps in jDOOM.pk3) for the small graphic font (desaturate and amplify at load time). Moved all game-side font drawing routines used for both small and large fonts to hu_stuff.c --- doomsday/plugins/common/include/hu_lib.h | 16 +- doomsday/plugins/common/include/hu_stuff.h | 84 ++- doomsday/plugins/common/include/m_defs.h | 4 +- doomsday/plugins/common/src/am_map.c | 2 +- doomsday/plugins/common/src/f_infine.c | 14 +- doomsday/plugins/common/src/hu_lib.c | 91 +-- doomsday/plugins/common/src/hu_log.c | 10 +- doomsday/plugins/common/src/hu_menu.c | 102 ++-- doomsday/plugins/common/src/hu_msg.c | 18 +- doomsday/plugins/common/src/hu_stuff.c | 519 +++++++++++++----- doomsday/plugins/common/src/m_ctrl.c | 36 +- doomsday/plugins/common/src/m_multi.c | 30 +- .../plugins/jdoom/data/lumps/fonta033.lmp | Bin 72 -> 0 bytes .../plugins/jdoom/data/lumps/fonta034.lmp | Bin 100 -> 0 bytes .../plugins/jdoom/data/lumps/fonta035.lmp | Bin 116 -> 0 bytes .../plugins/jdoom/data/lumps/fonta036.lmp | Bin 128 -> 0 bytes .../plugins/jdoom/data/lumps/fonta037.lmp | Bin 144 -> 0 bytes .../plugins/jdoom/data/lumps/fonta038.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta039.lmp | Bin 60 -> 0 bytes .../plugins/jdoom/data/lumps/fonta040.lmp | Bin 120 -> 0 bytes .../plugins/jdoom/data/lumps/fonta041.lmp | Bin 120 -> 0 bytes .../plugins/jdoom/data/lumps/fonta042.lmp | Bin 96 -> 0 bytes .../plugins/jdoom/data/lumps/fonta043.lmp | Bin 76 -> 0 bytes .../plugins/jdoom/data/lumps/fonta044.lmp | Bin 60 -> 0 bytes .../plugins/jdoom/data/lumps/fonta045.lmp | Bin 80 -> 0 bytes .../plugins/jdoom/data/lumps/fonta046.lmp | Bin 56 -> 0 bytes .../plugins/jdoom/data/lumps/fonta047.lmp | Bin 100 -> 0 bytes .../plugins/jdoom/data/lumps/fonta048.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta049.lmp | Bin 84 -> 0 bytes .../plugins/jdoom/data/lumps/fonta050.lmp | Bin 140 -> 0 bytes .../plugins/jdoom/data/lumps/fonta051.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta052.lmp | Bin 116 -> 0 bytes .../plugins/jdoom/data/lumps/fonta053.lmp | Bin 124 -> 0 bytes .../plugins/jdoom/data/lumps/fonta054.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta055.lmp | Bin 120 -> 0 bytes .../plugins/jdoom/data/lumps/fonta056.lmp | Bin 140 -> 0 bytes .../plugins/jdoom/data/lumps/fonta057.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta058.lmp | Bin 84 -> 0 bytes .../plugins/jdoom/data/lumps/fonta059.lmp | Bin 72 -> 0 bytes .../plugins/jdoom/data/lumps/fonta060.lmp | Bin 80 -> 0 bytes .../plugins/jdoom/data/lumps/fonta061.lmp | Bin 80 -> 0 bytes .../plugins/jdoom/data/lumps/fonta062.lmp | Bin 80 -> 0 bytes .../plugins/jdoom/data/lumps/fonta063.lmp | Bin 128 -> 0 bytes .../plugins/jdoom/data/lumps/fonta064.lmp | Bin 156 -> 0 bytes .../plugins/jdoom/data/lumps/fonta065.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta066.lmp | Bin 140 -> 0 bytes .../plugins/jdoom/data/lumps/fonta067.lmp | Bin 140 -> 0 bytes .../plugins/jdoom/data/lumps/fonta068.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta069.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta070.lmp | Bin 128 -> 0 bytes .../plugins/jdoom/data/lumps/fonta071.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta072.lmp | Bin 136 -> 0 bytes .../plugins/jdoom/data/lumps/fonta073.lmp | Bin 72 -> 0 bytes .../plugins/jdoom/data/lumps/fonta074.lmp | Bin 120 -> 0 bytes .../plugins/jdoom/data/lumps/fonta075.lmp | Bin 140 -> 0 bytes .../plugins/jdoom/data/lumps/fonta076.lmp | Bin 120 -> 0 bytes .../plugins/jdoom/data/lumps/fonta077.lmp | Bin 148 -> 0 bytes .../plugins/jdoom/data/lumps/fonta078.lmp | Bin 136 -> 0 bytes .../plugins/jdoom/data/lumps/fonta079.lmp | Bin 124 -> 0 bytes .../plugins/jdoom/data/lumps/fonta080.lmp | Bin 128 -> 0 bytes .../plugins/jdoom/data/lumps/fonta081.lmp | Bin 136 -> 0 bytes .../plugins/jdoom/data/lumps/fonta082.lmp | Bin 140 -> 0 bytes .../plugins/jdoom/data/lumps/fonta083.lmp | Bin 120 -> 0 bytes .../plugins/jdoom/data/lumps/fonta084.lmp | Bin 120 -> 0 bytes .../plugins/jdoom/data/lumps/fonta085.lmp | Bin 132 -> 0 bytes .../plugins/jdoom/data/lumps/fonta086.lmp | Bin 108 -> 0 bytes .../plugins/jdoom/data/lumps/fonta087.lmp | Bin 148 -> 0 bytes .../plugins/jdoom/data/lumps/fonta088.lmp | Bin 160 -> 0 bytes .../plugins/jdoom/data/lumps/fonta089.lmp | Bin 124 -> 0 bytes .../plugins/jdoom/data/lumps/fonta090.lmp | Bin 128 -> 0 bytes .../plugins/jdoom/data/lumps/fonta091.lmp | Bin 92 -> 0 bytes .../plugins/jdoom/data/lumps/fonta092.lmp | Bin 100 -> 0 bytes .../plugins/jdoom/data/lumps/fonta093.lmp | Bin 92 -> 0 bytes .../plugins/jdoom/data/lumps/fonta094.lmp | Bin 96 -> 0 bytes .../plugins/jdoom/data/lumps/fonta095.lmp | Bin 104 -> 0 bytes .../plugins/jdoom/data/lumps/fonta121.lmp | Bin 72 -> 0 bytes doomsday/plugins/jdoom/src/d_console.c | 4 +- doomsday/plugins/jdoom/src/d_refresh.c | 6 +- doomsday/plugins/jdoom/src/st_stuff.c | 12 +- doomsday/plugins/jdoom/src/wi_stuff.c | 6 +- doomsday/plugins/jdoom64/src/d_console.c | 4 +- doomsday/plugins/jdoom64/src/d_items.c | 1 - doomsday/plugins/jdoom64/src/d_refresh.c | 6 +- doomsday/plugins/jdoom64/src/p_setup.c | 2 +- doomsday/plugins/jdoom64/src/st_stuff.c | 28 +- doomsday/plugins/jdoom64/src/wi_stuff.c | 6 +- doomsday/plugins/jheretic/include/h_refresh.h | 4 +- doomsday/plugins/jheretic/src/h_console.c | 4 +- doomsday/plugins/jheretic/src/h_refresh.c | 10 +- doomsday/plugins/jheretic/src/in_lude.c | 265 +++------ doomsday/plugins/jheretic/src/p_enemy.c | 2 +- doomsday/plugins/jheretic/src/st_stuff.c | 54 +- doomsday/plugins/jhexen/src/hconsole.c | 4 +- doomsday/plugins/jhexen/src/hrefresh.c | 8 +- doomsday/plugins/jhexen/src/in_lude.c | 14 +- doomsday/plugins/jhexen/src/st_stuff.c | 57 -- 96 files changed, 726 insertions(+), 697 deletions(-) delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta033.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta034.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta035.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta036.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta037.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta038.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta039.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta040.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta041.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta042.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta043.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta044.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta045.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta046.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta047.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta048.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta049.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta050.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta051.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta052.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta053.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta054.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta055.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta056.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta057.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta058.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta059.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta060.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta061.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta062.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta063.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta064.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta065.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta066.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta067.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta068.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta069.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta070.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta071.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta072.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta073.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta074.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta075.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta076.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta077.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta078.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta079.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta080.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta081.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta082.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta083.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta084.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta085.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta086.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta087.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta088.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta089.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta090.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta091.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta092.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta093.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta094.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta095.lmp delete mode 100644 doomsday/plugins/jdoom/data/lumps/fonta121.lmp diff --git a/doomsday/plugins/common/include/hu_lib.h b/doomsday/plugins/common/include/hu_lib.h index d36d84cce1..a1642d35ee 100644 --- a/doomsday/plugins/common/include/hu_lib.h +++ b/doomsday/plugins/common/include/hu_lib.h @@ -36,8 +36,7 @@ // Text Line widget, (parent of Scrolling Text and Input Text widgets). typedef struct { int x, y; // Left-justified position of scrolling text window. - struct dpatch_s* f; // Font. - int sc; // Start character. + gamefontid_t font; char l[HU_MAXLINELENGTH + 1]; // Line of text. int len; // Current line length. int needsupdate; // Whether this line needs to be udpated. @@ -64,21 +63,22 @@ void HUlib_init(void); void HUlib_clearTextLine(hu_textline_t* t); void HUlib_initTextLine(hu_textline_t* t, int x, int y, - dpatch_t* f, int sc); + gamefontid_t font); boolean HUlib_addCharToTextLine(hu_textline_t* t, char ch); boolean HUlib_delCharFromTextLine(hu_textline_t* t); -void HUlib_drawTextLine(hu_textline_t* l, boolean drawcursor); void HUlib_eraseTextLine(hu_textline_t* l); void HUlib_initSText(hu_stext_t* s, int x, int y, int h, - dpatch_t* font, int startchar, boolean* on); + gamefontid_t font,boolean* on); + void HUlib_addLineToSText(hu_stext_t* s); -void HUlib_addMessageToSText(hu_stext_t* s, char* prefix, char* msg); +void HUlib_addMessageToSText(hu_stext_t* s, char* prefix, + char* msg); void HUlib_drawSText(hu_stext_t* s); void HUlib_eraseSText(hu_stext_t* s); -void HUlib_initIText(hu_itext_t* it, int x, int y, dpatch_t* font, - int startchar, boolean* on); +void HUlib_initIText(hu_itext_t* it, int x, int y, + gamefontid_t font, boolean* on); void HUlib_delCharFromIText(hu_itext_t* it); void HUlib_eraseLineFromIText(hu_itext_t* it); void HUlib_resetIText(hu_itext_t* it); diff --git a/doomsday/plugins/common/include/hu_stuff.h b/doomsday/plugins/common/include/hu_stuff.h index d14fa93c63..2f44bb1054 100644 --- a/doomsday/plugins/common/include/hu_stuff.h +++ b/doomsday/plugins/common/include/hu_stuff.h @@ -34,6 +34,11 @@ #include "r_common.h" +typedef enum border_e { + BORDERUP = 1, + BORDERDOWN +} border_t; + enum { ALIGN_LEFT = 0, ALIGN_CENTER, @@ -46,16 +51,22 @@ enum { // Calculate # of glyphs in font. #define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1) -typedef enum border_e { - BORDERUP = 1, - BORDERDOWN -} border_t; - // The fonts. -extern dpatch_t huFont[HU_FONTSIZE]; -extern dpatch_t huFontA[HU_FONTSIZE], huFontB[HU_FONTSIZE]; -extern dpatch_t huMinus; +typedef enum { + GF_FIRST = 0, + GF_FONTA = GF_FIRST, + GF_FONTB, + NUM_GAME_FONTS +} gamefontid_t; + +typedef struct gamefont_s { + struct gamefont_char_s { + char lumpname[9]; + dpatch_t patch; + } chars[HU_FONTSIZE]; +} gamefont_t; +extern dpatch_t huMinus; #if __JHERETIC__ || __JHEXEN__ extern dpatch_t dpSmallNumbers[10]; #endif @@ -95,37 +106,56 @@ void Hu_FogEffectSetAlphaTarget(float alpha); // Implements patch replacement. void WI_DrawPatch(int x, int y, float r, float g, float b, float a, - const dpatch_t* patch, const char *altstring, + const dpatch_t* patch, const char* altstring, boolean builtin, int halign); - void WI_DrawParamText(int x, int y, const char* string, - dpatch_t* defFont, float defRed, float defGreen, - float defBlue, float defAlpha, boolean defCase, - boolean defTypeIn, int halign); - + gamefontid_t font, float defRed, + float defGreen, float defBlue, float defAlpha, + boolean defCase, boolean defTypeIn, + int halign); void M_WriteText(int x, int y, const char *string); -void M_WriteText2(int x, int y, const char *string, dpatch_t *font, float red, +void M_WriteText2(int x, int y, const char *string, + gamefontid_t font, float red, float green, float blue, float alpha); -void M_WriteText3(int x, int y, const char *string, dpatch_t *font, - float red, float green, float blue, float alpha, - boolean doTypeIn, int initialCount); - +void M_WriteText3(int x, int y, const char *string, + gamefontid_t font, float red, float green, + float blue, float alpha, boolean doTypeIn, + int initialCount); +void HUlib_drawTextLine2(int x, int y, const char* string, + size_t len, gamefontid_t font, + boolean drawcursor); +void M_DrawChar(int x, int y, int ch, gamefontid_t font); #if __JHERETIC__ || __JHEXEN__ -void Hu_DrawSmallNum(int val, int numDigits, int x, int y, float alpha); +void Hu_DrawSmallNum(int val, int numDigits, int x, int y, + float alpha); +#endif +#if __JHERETIC__ +void HU_DrawBNumber(signed int val, int x, int y, float red, + float green, float blue, float alpha); +void IN_DrawNumber(int val, int x, int y, int digits, float r, float g, + float b, float a); +void IN_DrawShadowChar(int x, int y, int ch, gamefontid_t font); +#endif +#if __JHEXEN__ +void DrBNumber(int val, int x, int y, float red, float green, float blue, + float alpha); #endif - int M_DrawText(int x, int y, boolean direct, char *string); void M_DrawTitle(char *text, int y); -int M_StringWidth(const char* string, dpatch_t* font); -int M_StringHeight(const char* string, dpatch_t* font); -void M_DrawBackgroundBox(float x, float y, float w, float h, float red, float green, - float blue, float alpha, boolean background, +int M_StringWidth(const char* string, gamefontid_t font); +int M_CharWidth(int ch, gamefontid_t font); +int M_StringHeight(const char* string, gamefontid_t font); + +void M_DrawBackgroundBox(float x, float y, float w, float h, + float red, float green, float blue, + float alpha, boolean background, int border); -#if __JHERETIC__ || __JHEXEN__ || __JSTRIFE__ +#if __JHERETIC__ || __JHEXEN__ void M_DrawSlider(int x, int y, int width, int slot, float alpha); #else -void M_DrawSlider(int x, int y, int width, int height, int slot, float alpha); +void M_DrawSlider(int x, int y, int width, int height, int slot, + float alpha); #endif void Draw_BeginZoom(float s, float originX, float originY); diff --git a/doomsday/plugins/common/include/m_defs.h b/doomsday/plugins/common/include/m_defs.h index de58f1f8da..00e38d5910 100644 --- a/doomsday/plugins/common/include/m_defs.h +++ b/doomsday/plugins/common/include/m_defs.h @@ -66,12 +66,12 @@ typedef struct { int flags; int x; int y; - void (*drawFunc) (void); + void (*drawFunc) (void); int itemCount; const menuitem_t* items; int lastOn; int prevMenu; // menutype_t - dpatch_t* font; // Font for menu items. + gamefontid_t font; // Font for menu items. float* color; char* background; // Background lump name for this menu (if any). boolean backgroundIsRaw; diff --git a/doomsday/plugins/common/src/am_map.c b/doomsday/plugins/common/src/am_map.c index f5c5cd4c95..1a039f8367 100644 --- a/doomsday/plugins/common/src/am_map.c +++ b/doomsday/plugins/common/src/am_map.c @@ -1928,7 +1928,7 @@ menu_t MapDef = { 13, MAPItems, #endif 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, diff --git a/doomsday/plugins/common/src/f_infine.c b/doomsday/plugins/common/src/f_infine.c index 6dcee9473e..f1970e4191 100644 --- a/doomsday/plugins/common/src/f_infine.c +++ b/doomsday/plugins/common/src/f_infine.c @@ -1468,11 +1468,10 @@ int FI_CharWidth(int ch, boolean fontb) if(ch < 33) return 4; - return fontb ? huFontB[ch - HU_FONTSTART].width : - huFontA[ch - HU_FONTSTART].width; + return M_CharWidth(ch - HU_FONTSTART, fontb? GF_FONTB : GF_FONTA); } -int FI_GetLineWidth(char *text, boolean fontb) +int FI_GetLineWidth(char* text, boolean fontb) { int width = 0; @@ -1497,18 +1496,11 @@ int FI_GetLineWidth(char *text, boolean fontb) int FI_DrawChar(int x, int y, int ch, boolean fontb) { - lumpnum_t lump; - ch = FI_FilterChar(ch); - if(fontb) - lump = huFontB[ch - HU_FONTSTART].lump; - else - lump = huFontA[ch - HU_FONTSTART].lump; - // Draw the character. Don't try to draw spaces. if(ch > 32) - GL_DrawPatch_CS(x, y, lump); + M_DrawChar(x, y, ch - HU_FONTSTART, fontb? GF_FONTB : GF_FONTA); return FI_CharWidth(ch, fontb); } diff --git a/doomsday/plugins/common/src/hu_lib.c b/doomsday/plugins/common/src/hu_lib.c index a2280eb36c..abcfaf17b4 100644 --- a/doomsday/plugins/common/src/hu_lib.c +++ b/doomsday/plugins/common/src/hu_lib.c @@ -39,12 +39,9 @@ # include "jheretic.h" #elif __JHEXEN__ # include "jhexen.h" -#elif __JSTRIFE__ -# include "jstrife.h" #endif #include "hu_lib.h" -#include "../../../engine/portable/include/r_draw.h" // MACROS ------------------------------------------------------------------ @@ -76,16 +73,15 @@ void HUlib_clearTextLine(hu_textline_t *t) t->needsupdate = true; } -void HUlib_initTextLine(hu_textline_t *t, int x, int y, dpatch_t *f, int sc) +void HUlib_initTextLine(hu_textline_t *t, int x, int y, gamefontid_t font) { t->x = x; t->y = y; - t->f = f; - t->sc = sc; + t->font = font; HUlib_clearTextLine(t); } -boolean HUlib_addCharToTextLine(hu_textline_t *t, char ch) +boolean HUlib_addCharToTextLine(hu_textline_t* t, char ch) { if(t->len == HU_MAXLINELENGTH) return false; @@ -106,51 +102,24 @@ boolean HUlib_delCharFromTextLine(hu_textline_t *t) return true; } -void HUlib_drawTextLine(hu_textline_t *l, boolean drawcursor) +void HUlib_drawTextLine(hu_textline_t* l, boolean drawcursor) { - int i, w, x; - unsigned char c; - - DGL_Color3fv(cfg.hudColor); - - x = l->x; - for(i = 0; i < l->len; ++i) - { - c = toupper(l->l[i]); - if(c != ' ' && c >= l->sc && c <= '_') - { - w = l->f[c - l->sc].width; - if(x + w > SCREENWIDTH) - break; - GL_DrawPatch_CS(x, l->y, l->f[c - l->sc].lump); - x += w; - } - else - { - x += 4; - if(x >= SCREENWIDTH) - break; - } - } - - // Draw the cursor if requested. - if(drawcursor && x + l->f['_' - l->sc].width <= SCREENWIDTH) - GL_DrawPatch_CS(x, l->y, l->f['_' - l->sc].lump); + HUlib_drawTextLine2(l->x, l->y, l->l, l->len, l->font, drawcursor); } /** * Sorta called by HU_Erase and just better darn get things straight. */ -void HUlib_eraseTextLine(hu_textline_t *l) +void HUlib_eraseTextLine(hu_textline_t* l) { if(l->needsupdate) l->needsupdate--; } -void HUlib_initSText(hu_stext_t *s, int x, int y, int h, dpatch_t *font, - int startchar, boolean *on) +void HUlib_initSText(hu_stext_t* s, int x, int y, int h, gamefontid_t font, + boolean* on) { - int i; + int i; s->h = h; s->on = on; @@ -159,14 +128,14 @@ void HUlib_initSText(hu_stext_t *s, int x, int y, int h, dpatch_t *font, for(i = 0; i < h; ++i) { - HUlib_initTextLine(&s->l[i], x, y - i * (font[0].height + 1), - font, startchar); + HUlib_initTextLine(&s->l[i], x, + y - i * M_StringHeight("A", font) + 1, font); } } -void HUlib_addLineToSText(hu_stext_t *s) +void HUlib_addLineToSText(hu_stext_t* s) { - int i; + int i; // Add a clear line. if(++s->cl == s->h) @@ -181,7 +150,7 @@ void HUlib_addLineToSText(hu_stext_t *s) } } -void HUlib_addMessageToSText(hu_stext_t *s, char *prefix, char *msg) +void HUlib_addMessageToSText(hu_stext_t* s, char* prefix, char* msg) { HUlib_addLineToSText(s); @@ -195,10 +164,10 @@ void HUlib_addMessageToSText(hu_stext_t *s, char *prefix, char *msg) HUlib_addCharToTextLine(&s->l[s->cl], *(msg++)); } -void HUlib_drawSText(hu_stext_t *s) +void HUlib_drawSText(hu_stext_t* s) { - int i, idx; - hu_textline_t *l; + int i, idx; + hu_textline_t* l; if(!*s->on) return; // If not on, don't draw. @@ -216,9 +185,9 @@ void HUlib_drawSText(hu_stext_t *s) } } -void HUlib_eraseSText(hu_stext_t *s) +void HUlib_eraseSText(hu_stext_t* s) { - int i; + int i; for(i = 0; i < s->h; ++i) { @@ -230,26 +199,26 @@ void HUlib_eraseSText(hu_stext_t *s) s->laston = *s->on; } -void HUlib_initIText(hu_itext_t *it, int x, int y, dpatch_t *font, - int startchar, boolean *on) +void HUlib_initIText(hu_itext_t* it, int x, int y, gamefontid_t font, + boolean* on) { it->lm = 0; // Default left margin is start of text. it->on = on; it->laston = true; - HUlib_initTextLine(&it->l, x, y, font, startchar); + HUlib_initTextLine(&it->l, x, y, font); } /** * Adheres to the left margin restriction */ -void HUlib_delCharFromIText(hu_itext_t *it) +void HUlib_delCharFromIText(hu_itext_t* it) { if(it->l.len != it->lm) HUlib_delCharFromTextLine(&it->l); } -void HUlib_eraseLineFromIText(hu_itext_t *it) +void HUlib_eraseLineFromIText(hu_itext_t* it) { while(it->lm != it->l.len) HUlib_delCharFromTextLine(&it->l); @@ -258,13 +227,13 @@ void HUlib_eraseLineFromIText(hu_itext_t *it) /** * Resets left margin as well. */ -void HUlib_resetIText(hu_itext_t *it) +void HUlib_resetIText(hu_itext_t* it) { it->lm = 0; HUlib_clearTextLine(&it->l); } -void HUlib_addPrefixToIText(hu_itext_t *it, char *str) +void HUlib_addPrefixToIText(hu_itext_t* it, char* str) { while(*str) HUlib_addCharToTextLine(&it->l, *(str++)); @@ -277,7 +246,7 @@ void HUlib_addPrefixToIText(hu_itext_t *it, char *str) * * @return @c true, if it ate the key. */ -boolean HUlib_keyInIText(hu_itext_t *it, unsigned char ch) +boolean HUlib_keyInIText(hu_itext_t* it, unsigned char ch) { if(ch >= ' ' && ch <= '_') { @@ -288,9 +257,9 @@ boolean HUlib_keyInIText(hu_itext_t *it, unsigned char ch) return false; } -void HUlib_drawIText(hu_itext_t *it) +void HUlib_drawIText(hu_itext_t* it) { - hu_textline_t *l = &it->l; + hu_textline_t* l = &it->l; if(!*it->on) return; @@ -298,7 +267,7 @@ void HUlib_drawIText(hu_itext_t *it) HUlib_drawTextLine(l, true); } -void HUlib_eraseIText(hu_itext_t * it) +void HUlib_eraseIText(hu_itext_t* it) { if(it->laston && !*it->on) it->l.needsupdate = 4; diff --git a/doomsday/plugins/common/src/hu_log.c b/doomsday/plugins/common/src/hu_log.c index 778542624a..4574046f29 100644 --- a/doomsday/plugins/common/src/hu_log.c +++ b/doomsday/plugins/common/src/hu_log.c @@ -339,7 +339,7 @@ static void logDrawer(msglog_t* log) // Draw using param text. // Messages may use the params to override the way the message is // is displayed, e.g. colour (Hexen's important messages). - WI_DrawParamText(x, 1 + y, msg->text, huFontA, + WI_DrawParamText(x, 1 + y, msg->text, GF_FONTA, col[CR], col[CG], col[CB], col[CA], false, false, cfg.msgAlign); @@ -604,9 +604,6 @@ void Hu_LogEmpty(int player) // MACROS ------------------------------------------------------------------ -#define CHAT_X (0) -#define CHAT_Y (0 + (huFont[0].height +1)) - // TYPES ------------------------------------------------------------------- #if __JHEXEN__ @@ -779,14 +776,15 @@ void Chat_Start(void) int i; // Create the chat widget - HUlib_initIText(&chat, CHAT_X, CHAT_Y, huFontA, HU_FONTSTART, &chatOn); + HUlib_initIText(&chat, 0, 0 + M_StringHeight("A", GF_FONTA) + 1, + GF_FONTA, &chatOn); for(i = 0; i < MAXPLAYERS; ++i) { Chat_Open(i, false); // Create the input buffers. - HUlib_initIText(&chatBuffer[i], 0, 0, 0, 0, &chatAlwaysOff); + HUlib_initIText(&chatBuffer[i], 0, 0, 0, &chatAlwaysOff); } } diff --git a/doomsday/plugins/common/src/hu_menu.c b/doomsday/plugins/common/src/hu_menu.c index 245a397f2c..4b530a585e 100644 --- a/doomsday/plugins/common/src/hu_menu.c +++ b/doomsday/plugins/common/src/hu_menu.c @@ -369,7 +369,7 @@ menu_t MainDef = { M_DrawMainMenu, 5, MainItems, 0, MENU_NONE, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B, @@ -380,7 +380,7 @@ menu_t MainDef = { M_DrawMainMenu, 5, MainItems, 0, MENU_NONE, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B, @@ -391,7 +391,7 @@ menu_t MainDef = { M_DrawMainMenu, 6, MainItems, 0, MENU_NONE, - huFontA, + GF_FONTA, cfg.menuColor, NULL, false, LINEHEIGHT_B + 1, @@ -402,7 +402,7 @@ menu_t MainDef = { M_DrawMainMenu, 5, MainItems, 0, MENU_NONE, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B + 1, @@ -413,7 +413,7 @@ menu_t MainDef = { M_DrawMainMenu, 6, MainItems, 0, MENU_NONE, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B + 1, @@ -433,7 +433,7 @@ menu_t NewGameDef = { M_DrawNewGameMenu, 2, NewGameItems, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B, @@ -444,7 +444,7 @@ menu_t NewGameDef = { M_DrawNewGameMenu, 2, NewGameItems, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B, @@ -455,7 +455,7 @@ menu_t NewGameDef = { M_DrawNewGameMenu, 2, NewGameItems, 0, MENU_MAIN, - huFontA, + GF_FONTA, cfg.menuColor, NULL, false, LINEHEIGHT_B + 1, @@ -466,7 +466,7 @@ menu_t NewGameDef = { M_DrawNewGameMenu, 2, NewGameItems, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B + 1, @@ -477,7 +477,7 @@ menu_t NewGameDef = { M_DrawNewGameMenu, 2, NewGameItems, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B + 1, @@ -494,7 +494,7 @@ menu_t ClassDef = { M_DrawClassMenu, 0, NULL, 0, MENU_NEWGAME, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B + 1, @@ -518,7 +518,7 @@ menu_t EpiDef = { M_DrawEpisode, 0, NULL, 0, MENU_NEWGAME, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT + 1, @@ -539,7 +539,7 @@ static menu_t FilesMenu = { M_DrawFilesMenu, 2, FilesItems, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT + 1, @@ -570,7 +570,7 @@ static menu_t LoadDef = { M_DrawLoad, NUMSAVESLOTS, LoadItems, 0, MENU_MAIN, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A + 8, @@ -600,7 +600,7 @@ static menu_t SaveDef = { M_DrawSave, NUMSAVESLOTS, SaveItems, 0, MENU_MAIN, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A + 8, @@ -622,7 +622,7 @@ static menu_t SkillDef = { M_DrawSkillMenu, 5, SkillItems, 2, MENU_NEWGAME, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT, @@ -644,7 +644,7 @@ static menu_t SkillDef = { M_DrawSkillMenu, 5, SkillItems, 2, MENU_CLASS, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT, @@ -665,7 +665,7 @@ static menu_t SkillDef = { M_DrawSkillMenu, 5, SkillItems, 2, MENU_EPISODE, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT, @@ -684,7 +684,7 @@ static menu_t SkillDef = { M_DrawSkillMenu, 4, SkillItems, 2, MENU_NEWGAME, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT, @@ -706,7 +706,7 @@ static menu_t SkillDef = { M_DrawSkillMenu, 5, SkillItems, 2, MENU_EPISODE, - huFontB, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT, @@ -741,7 +741,7 @@ static menu_t OptionsDef = { #endif OptionsItems, 0, MENU_MAIN, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -783,7 +783,7 @@ static menu_t Options2Def = { 7, Options2Items, #endif 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -805,7 +805,7 @@ menu_t ReadDef1 = { M_DrawReadThis, 1, ReadItems1, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, "HELP1", #if __JDOOM__ @@ -831,7 +831,7 @@ menu_t ReadDef2 = { M_DrawReadThis, 1, ReadItems2, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, "HELP2", #if __JDOOM__ @@ -854,7 +854,7 @@ menu_t ReadDef3 = { M_DrawReadThis, 1, ReadItems3, 0, MENU_MAIN, - huFontB, + GF_FONTB, cfg.menuColor, "CREDIT", true, LINEHEIGHT, @@ -981,7 +981,7 @@ static menu_t HUDDef = { 36, HUDItems, #endif 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -1015,7 +1015,7 @@ static menu_t InventoryDef = { M_DrawInventoryMenu, 9, InventoryItems, 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -1070,7 +1070,7 @@ static menu_t WeaponDef = { 11, WeaponItems, #endif 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -1141,7 +1141,7 @@ static menu_t GameplayDef = { M_DrawGameplay, 3, GameplayItems, 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -1164,7 +1164,7 @@ static menu_t GameplayDef = { 12, GameplayItems, #endif 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -1238,7 +1238,7 @@ static menu_t ColorWidgetMnu = { 10, ColorWidgetItems, #endif 0, MENU_OPTIONS, - huFontA, + GF_FONTA, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -2225,7 +2225,7 @@ boolean M_EditResponder(event_t *ev) if(saveStringEnter) { if(saveCharIndex < SAVESTRINGSIZE && - M_StringWidth(savegamestrings[saveSlot], huFontA) + M_StringWidth(savegamestrings[saveSlot], GF_FONTA) < (SAVESTRINGSIZE - 1) * 8) { savegamestrings[saveSlot][saveCharIndex++] = ch; @@ -2374,26 +2374,26 @@ void DrawColorWidget(void) #if __JDOOM__ || __JDOOM64__ MN_DrawSlider(menu, 0, 11, currentcolor[0] * 10 + .25f); M_WriteText3(menu->x, menu->y, ColorWidgetItems[0].text, - huFontA, 1, 1, 1, menuAlpha, true, 0); + GF_FONTA, 1, 1, 1, menuAlpha, true, 0); MN_DrawSlider(menu, 1, 11, currentcolor[1] * 10 + .25f); M_WriteText3(menu->x, menu->y + (LINEHEIGHT_A), - ColorWidgetItems[1].text, huFontA, 1, 1, 1, menuAlpha, + ColorWidgetItems[1].text, GF_FONTA, 1, 1, 1, menuAlpha, true, 0); MN_DrawSlider(menu, 2, 11, currentcolor[2] * 10 + .25f); M_WriteText3(menu->x, menu->y + (LINEHEIGHT_A * 2), - ColorWidgetItems[2].text, huFontA, 1, 1, 1, menuAlpha, + ColorWidgetItems[2].text, GF_FONTA, 1, 1, 1, menuAlpha, true, 0); #else MN_DrawSlider(menu, 1, 11, currentcolor[0] * 10 + .25f); M_WriteText3(menu->x, menu->y, ColorWidgetItems[0].text, - huFontA, 1, 1, 1, menuAlpha, true, 0); + GF_FONTA, 1, 1, 1, menuAlpha, true, 0); MN_DrawSlider(menu, 4, 11, currentcolor[1] * 10 + .25f); M_WriteText3(menu->x, menu->y + (LINEHEIGHT_A * 3), - ColorWidgetItems[3].text, huFontA, 1, 1, 1, menuAlpha, + ColorWidgetItems[3].text, GF_FONTA, 1, 1, 1, menuAlpha, true, 0); MN_DrawSlider(menu, 7, 11, currentcolor[2] * 10 + .25f); M_WriteText3(menu->x, menu->y + (LINEHEIGHT_A * 6), - ColorWidgetItems[6].text, huFontA, 1, 1, 1, menuAlpha, + ColorWidgetItems[6].text, GF_FONTA, 1, 1, 1, menuAlpha, true, 0); #endif if(rgba) @@ -2401,12 +2401,12 @@ void DrawColorWidget(void) #if __JDOOM__ || __JDOOM64__ MN_DrawSlider(menu, 3, 11, currentcolor[3] * 10 + .25f); M_WriteText3(menu->x, menu->y + (LINEHEIGHT_A * 3), - ColorWidgetItems[3].text, huFontA, 1, 1, 1, + ColorWidgetItems[3].text, GF_FONTA, 1, 1, 1, menuAlpha, true, 0); #else MN_DrawSlider(menu, 10, 11, currentcolor[3] * 10 + .25f); M_WriteText3(menu->x, menu->y + (LINEHEIGHT_A * 9), - ColorWidgetItems[9].text, huFontA, 1, 1, 1, + ColorWidgetItems[9].text, GF_FONTA, 1, 1, 1, menuAlpha, true, 0); #endif } @@ -2465,8 +2465,8 @@ void M_ToggleVar(int index, void* context) void M_DrawTitle(char *text, int y) { - WI_DrawParamText(160 - M_StringWidth(text, huFontB) / 2, y, text, - huFontB, cfg.menuColor[0], cfg.menuColor[1], + WI_DrawParamText(160 - M_StringWidth(text, GF_FONTB) / 2, y, text, + GF_FONTB, cfg.menuColor[0], cfg.menuColor[1], cfg.menuColor[2], menuAlpha, true, true, ALIGN_LEFT); } @@ -2635,7 +2635,7 @@ void M_DrawClassMenu(void) "m_mbox" }; - M_WriteText3(34, 24, "CHOOSE CLASS:", huFontB, menu->color[0], + M_WriteText3(34, 24, "CHOOSE CLASS:", GF_FONTB, menu->color[0], menu->color[1], menu->color[2], menuAlpha, true, 0); pClass = (playerclass_t) menu->items[itemOn].option; @@ -2683,8 +2683,8 @@ void M_DrawEpisode(void) composeNotDesignedForMessage(GET_TXT(TXT_SINGLEPLAYER)); - M_WriteText3(160 - M_StringWidth(str, huFontA) / 2, - 200 - M_StringHeight(str, huFontA) - 2, str, huFontA, + M_WriteText3(160 - M_StringWidth(str, GF_FONTA) / 2, + 200 - M_StringHeight(str, GF_FONTA) - 2, str, GF_FONTA, cfg.menuColor2[0], cfg.menuColor2[1], cfg.menuColor2[3], menuAlpha, true, 0); } @@ -2841,9 +2841,9 @@ void M_DrawSave(void) if(len < SAVESTRINGSIZE) { - i = M_StringWidth(savegamestrings[saveSlot], huFontA); + i = M_StringWidth(savegamestrings[saveSlot], GF_FONTA); M_WriteText3(SaveDef.x + i, SAVEGAME_BOX_YOFFSET + SaveDef.y + 1 + - (menu->itemHeight * saveSlot), "_", huFontA, + (menu->itemHeight * saveSlot), "_", GF_FONTA, r, g, b, menuAlpha, true, 0); } } @@ -3113,8 +3113,8 @@ void M_DrawWeaponMenu(void) { const char* str = "Use left/right to move weapon up/down"; - M_WriteText3(160 - M_StringWidth(str, huFontA) / 2, - 200 - M_StringHeight(str, huFontA) - 2, str, huFontA, + M_WriteText3(160 - M_StringWidth(str, GF_FONTA) / 2, + 200 - M_StringHeight(str, GF_FONTA) - 2, str, GF_FONTA, cfg.menuColor2[0], cfg.menuColor2[1], cfg.menuColor2[3], menuAlpha, true, 0); } @@ -3288,8 +3288,8 @@ void M_DrawHUDMenu(void) M_DrawTitle("HUD options", menu->y - 28); #if __JDOOM__ || __JDOOM64__ Hu_MenuPageString(buf, menu); - M_WriteText3(160 - M_StringWidth(buf, huFontA) / 2, menu->y - 12, buf, - huFontA, 1, .7f, .3f, Hu_MenuAlpha(), true, 0); + M_WriteText3(160 - M_StringWidth(buf, GF_FONTA) / 2, menu->y - 12, buf, + GF_FONTA, 1, .7f, .3f, Hu_MenuAlpha(), true, 0); #else DGL_Color4f(1, 1, 1, Hu_MenuAlpha()); diff --git a/doomsday/plugins/common/src/hu_msg.c b/doomsday/plugins/common/src/hu_msg.c index 05076bc4a5..44486ecf12 100644 --- a/doomsday/plugins/common/src/hu_msg.c +++ b/doomsday/plugins/common/src/hu_msg.c @@ -190,7 +190,7 @@ static void drawMessage(void) int x, y; char* p; - y = 100 - M_StringHeight(msgText, huFontA) / 2; + y = 100 - M_StringHeight(msgText, GF_FONTA) / 2; p = msgText; while(*p) { @@ -201,29 +201,29 @@ static void drawMessage(void) *p = 0; - x = 160 - M_StringWidth(string, huFontA) / 2; - M_WriteText3(x, y, string, huFontA, cfg.menuColor2[0], + x = 160 - M_StringWidth(string, GF_FONTA) / 2; + M_WriteText3(x, y, string, GF_FONTA, cfg.menuColor2[0], cfg.menuColor2[1], cfg.menuColor2[2], 1, true, 0); - y += huFontA[17].height; + y += M_StringHeight(string, GF_FONTA); if((*p) = c) p++; } // An additional blank line between the message and response prompt. - y += huFontA[17].height; + y += M_StringHeight("A", GF_FONTA); switch(msgType) { case MSG_ANYKEY: - x = 160 - M_StringWidth(PRESSKEY, huFontA) / 2; - M_WriteText3(x, y, PRESSKEY, huFontA, cfg.menuColor2[0], + x = 160 - M_StringWidth(PRESSKEY, GF_FONTA) / 2; + M_WriteText3(x, y, PRESSKEY, GF_FONTA, cfg.menuColor2[0], cfg.menuColor2[1], cfg.menuColor2[2], 1, true, 0); break; case MSG_YESNO: - x = 160 - M_StringWidth(yesNoMessage, huFontA) / 2; - M_WriteText3(x, y, yesNoMessage, huFontA, cfg.menuColor2[0], + x = 160 - M_StringWidth(yesNoMessage, GF_FONTA) / 2; + M_WriteText3(x, y, yesNoMessage, GF_FONTA, cfg.menuColor2[0], cfg.menuColor2[1], cfg.menuColor2[2], 1, true, 0); break; diff --git a/doomsday/plugins/common/src/hu_stuff.c b/doomsday/plugins/common/src/hu_stuff.c index 44e32241f6..737dfc3298 100644 --- a/doomsday/plugins/common/src/hu_stuff.c +++ b/doomsday/plugins/common/src/hu_stuff.c @@ -107,8 +107,9 @@ typedef struct fogeffectdata_s { // PUBLIC DATA DEFINITIONS ------------------------------------------------- -dpatch_t huFont[HU_FONTSIZE]; -dpatch_t huFontA[HU_FONTSIZE], huFontB[HU_FONTSIZE]; +static gamefont_t gFonts[NUM_GAME_FONTS]; +static gamefontid_t currentGFontIndex; + #if __JHERETIC__ || __JHEXEN__ dpatch_t dpSmallNumbers[10]; #endif @@ -165,6 +166,51 @@ void HU_Register(void) Con_AddVariable(&hudCVars[i]); } +void R_SetFontCharacter(gamefontid_t fontid, byte ch, const char* lumpname) +{ + gamefont_t* font; + + if(!(fontid >= GF_FIRST && fontid < NUM_GAME_FONTS)) + { + Con_Message("R_SetFontCharacter: Warning, unknown font id %i.\n", + (int) fontid); + return; + } + + font = &gFonts[fontid]; + memset(font->chars[ch].lumpname, 0, sizeof(font->chars[ch].lumpname)); + strncpy(font->chars[ch].lumpname, lumpname, 8); + + // Instruct Doomsday to load the patch in monochrome mode. + // (2 = weighted average). + DD_SetInteger(DD_MONOCHROME_PATCHES, 2); + DD_SetInteger(DD_UPSCALE_AND_SHARPEN_PATCHES, true); + + R_CachePatch(&font->chars[ch].patch, font->chars[ch].lumpname); + + DD_SetInteger(DD_MONOCHROME_PATCHES, 0); + DD_SetInteger(DD_UPSCALE_AND_SHARPEN_PATCHES, false); +} + +/** + * Change the current font. + */ +void R_SetFont(gamefontid_t fontid) +{ + if(!(fontid >= GF_FIRST && fontid < NUM_GAME_FONTS)) + return; // No such font. + + currentGFontIndex = fontid; +} + +gamefontid_t R_GetCurrentFont(void) +{ + if(currentGFontIndex == -1) + return 0; + + return currentGFontIndex; +} + /** * Loads the font patches and inits various strings * JHEXEN Note: Don't bother with the yellow font, we'll colour the white version @@ -173,10 +219,6 @@ void Hu_LoadData(void) { int i, j; char buffer[9]; -#if __JHERETIC__ || __JHEXEN__ - dpatch_t tmp; -#endif - #if __JDOOM__ || __JDOOM64__ char name[9]; static const char* skillModePatchNames[] = @@ -242,30 +284,17 @@ void Hu_LoadData(void) #if __JDOOM__ || __JDOOM64__ // load the heads-up fonts j = HU_FONTSTART; - DD_SetInteger(DD_UPSCALE_AND_SHARPEN_PATCHES, true); for(i = 0; i < HU_FONTSIZE; ++i, ++j) { - // The original small red font. + // Small font. sprintf(buffer, "STCFN%.3d", j); - R_CachePatch(&huFont[i], buffer); - - // Small white font. - sprintf(buffer, "FONTA%.3d", j); - R_CachePatch(&huFontA[i], buffer); + R_SetFontCharacter(GF_FONTA, i, buffer); - // Large (12) white font. + // Large font. sprintf(buffer, "FONTB%.3d", j); - R_CachePatch(&huFontB[i], buffer); - if(huFontB[i].lump == -1) - { - // This character is missing! (the first character - // is supposedly always found) - memcpy(&huFontB[0 + i], &huFontB[4], sizeof(dpatch_t)); - } + R_SetFontCharacter(GF_FONTB, i, buffer); } - DD_SetInteger(DD_UPSCALE_AND_SHARPEN_PATCHES, false); - for(i = 0; i < NUM_SKILL_MODES; ++i) { R_CachePatch(&skillModeNames[i], skillModePatchNames[i]); @@ -314,78 +343,29 @@ void Hu_LoadData(void) R_CachePatch(&episodeNamePatches[i], episodePatchNames[i]); } # endif -#elif __JSTRIFE__ - // load the heads-up fonts - - // Tell Doomsday to load the following patches in monochrome mode - // (2 = weighted average) - DD_SetInteger(DD_MONOCHROME_PATCHES, 2); - - j = HU_FONTSTART; - for(i = 0; i < HU_FONTSIZE; ++i, ++j) - { - // The original small red font. - sprintf(buffer, "STCFN%.3d", j); - R_CachePatch(&huFont[i], buffer); - - // Small white font. - sprintf(buffer, "STCFN%.3d", j); - R_CachePatch(&huFontA[i], buffer); - - // Large (12) white font. - sprintf(buffer, "STBFN.3d", j); - R_CachePatch(&huFontB[i], buffer); - if(huFontB[i].lump == -1) - { - // This character is missing! (the first character - // is supposedly always found) - memcpy(&huFontB[0 + i], &huFontB[4], sizeof(dpatch_t)); - } - } - - // deactivate monochrome mode - DD_SetInteger(DD_MONOCHROME_PATCHES, 0); #else - // Tell Doomsday to load the following patches in monochrome mode - // (2 = weighted average) - DD_SetInteger(DD_MONOCHROME_PATCHES, 2); - DD_SetInteger(DD_UPSCALE_AND_SHARPEN_PATCHES, true); - // Heretic/Hexen don't use ASCII numbered font patches // plus they don't even have a full set eg '!' = 1 '_'= 58 !!! j = 1; for(i = 0; i < HU_FONTSIZE; ++i, ++j) { - // Small font. - sprintf(buffer, "FONTA%.2d", j); - R_CachePatch(&huFontA[i], buffer); + int idx = j; - // Large (12) font. - sprintf(buffer, "FONTB%.2d", j); - R_CachePatch(&huFontB[i], buffer); - if(huFontB[i].lump == -1) - { - // This character is missing! (the first character - // is supposedly always found) - memcpy(&huFontB[0 + i], &huFontB[4], sizeof(dpatch_t)); - } - } + // Heretic and Hexen don't use ASCII numbering for all font patches. + // As such we need to switch some patches. + if(idx == 58) + idx = 62; + else if(idx == 62) + idx = 58; - // deactivate monochrome mode - DD_SetInteger(DD_MONOCHROME_PATCHES, 0); - DD_SetInteger(DD_UPSCALE_AND_SHARPEN_PATCHES, false); - - // Heretic and Hexen don't use ASCII numbering for all font patches. - // As such we need to switch some patches. - - tmp = huFontA[58]; - memcpy(&huFontA[58], &huFontA[62], sizeof(dpatch_t)); - memcpy(&huFontA[62], &tmp, sizeof(dpatch_t)); - - tmp = huFontB[58]; - memcpy(&huFontB[58], &huFontB[62], sizeof(dpatch_t)); - memcpy(&huFontB[62], &tmp, sizeof(dpatch_t)); + // Small font. + sprintf(buffer, "FONTA%.2d", idx); + R_SetFontCharacter(GF_FONTA, i, buffer); + // Large font. + sprintf(buffer, "FONTB%.2d", idx); + R_SetFontCharacter(GF_FONTB, i, buffer); + } #endif #if __JHERETIC__ || __JHEXEN__ @@ -482,7 +462,7 @@ static void drawQuad(float x, float y, float w, float h, float s, float t, DGL_End(); } -void HU_DrawText(const char* str, dpatch_t* font, float x, float y, +void HU_DrawText(const char* str, gamefontid_t font, float x, float y, float scale, float r, float g, float b, float a, boolean alignRight) { @@ -508,9 +488,9 @@ void HU_DrawText(const char* str, dpatch_t* font, float x, float y, if(c < 0 || c >= HU_FONTSIZE) continue; - if(!font[c].lump) + if(!gFonts[font].chars[c].patch.lump) continue; - p = &font[c]; + p = &gFonts[font].chars[c].patch; x -= p->width * scale; } @@ -537,9 +517,9 @@ void HU_DrawText(const char* str, dpatch_t* font, float x, float y, if(c < 0 || c >= HU_FONTSIZE) continue; - if(!font[c].lump) + if(!gFonts[font].chars[c].patch.lump) continue; - p = &font[c]; + p = &gFonts[font].chars[c].patch; w = p->width; h = p->height; @@ -731,7 +711,7 @@ static void drawTable(float x, float ly, float width, float height, colW = calloc(1, sizeof(*colW) * numCols); lineHeight = height / (MAXPLAYERS + 1); - fontHeight = M_StringHeight("AgIq^_", huFontA); + fontHeight = M_StringHeight("AgIq^_", GF_FONTA); fontScale = (lineHeight - CELL_PADDING * 2) / fontHeight; fontOffsetY = 0; if(fontScale > 1) @@ -748,7 +728,7 @@ static void drawTable(float x, float ly, float width, float height, if(columns[n].flags & CF_FIXEDWIDTH) { - colW[n] = M_StringWidth(columns[n].label, huFontA) + CELL_PADDING * 2; + colW[n] = M_StringWidth(columns[n].label, GF_FONTA) + CELL_PADDING * 2; fixedWidth += colW[n]; } } @@ -786,7 +766,7 @@ static void drawTable(float x, float ly, float width, float height, else cX += CELL_PADDING; - HU_DrawText(columns[n].label, huFontA, cX, cY, + HU_DrawText(columns[n].label, GF_FONTA, cX, cY, fontScale, 1.f, 1.f, 1.f, alpha, columns[n].alignRight); } ly += lineHeight; @@ -892,21 +872,21 @@ DGL_Enable(DGL_TEXTURING); } case 1: // Name. - HU_DrawText(name, huFontA, cX, cY + fontOffsetY, fontScale, + HU_DrawText(name, GF_FONTA, cX, cY + fontOffsetY, fontScale, info->color[0], info->color[1], info->color[2], alpha, false); break; case 2: // #Suicides. sprintf(buf, "%4i", info->suicides); - HU_DrawText(buf, huFontA, cX, cY + fontOffsetY, fontScale, + HU_DrawText(buf, GF_FONTA, cX, cY + fontOffsetY, fontScale, info->color[0], info->color[1], info->color[2], alpha, true); break; case 3: // #Kills. sprintf(buf, "%4i", info->kills); - HU_DrawText(buf, huFontA, cX, cY + fontOffsetY, fontScale, + HU_DrawText(buf, GF_FONTA, cX, cY + fontOffsetY, fontScale, info->color[0], info->color[1], info->color[2], alpha, true); break; @@ -937,10 +917,10 @@ const char* P_GetGameModeName(void) return sp; } -static void drawMapMetaData(float x, float y, dpatch_t* font, float alpha) +static void drawMapMetaData(float x, float y, gamefontid_t font, float alpha) { - static const char* unnamed = "unnamed"; - const char* lname = P_GetMapNiceName(); + static const char* unnamed = "unnamed"; + const char* lname = P_GetMapNiceName(); if(!lname) lname = unnamed; @@ -964,7 +944,7 @@ static void drawMapMetaData(float x, float y, dpatch_t* font, float alpha) */ void HU_DrawScoreBoard(int player) { -#define LINE_BORDER 4 +#define LINE_BORDER 4 column_t columns[] = { {"cl", 0, CF_FIXEDWIDTH, false}, @@ -1013,10 +993,10 @@ void HU_DrawScoreBoard(int player) DGL_Enable(DGL_TEXTURING); // Title: - M_WriteText2(x + width / 2 - M_StringWidth("ranking", huFontB) / 2, - y + LINE_BORDER, "ranking", huFontB, 1, 0, 0, hud->scoreAlpha); + M_WriteText2(x + width / 2 - M_StringWidth("ranking", GF_FONTB) / 2, + y + LINE_BORDER, "ranking", GF_FONTB, 1, 0, 0, hud->scoreAlpha); - drawMapMetaData(x, y + 16, huFontA, hud->scoreAlpha); + drawMapMetaData(x, y + 16, GF_FONTA, hud->scoreAlpha); drawTable(x, y + 20, width, height - 20, columns, scoreBoard, inCount, hud->scoreAlpha, player); @@ -1048,7 +1028,7 @@ static void drawWorldTimer(void) seconds = worldTimer; sprintf(timeBuffer, "%.2d : %.2d : %.2d", hours, minutes, seconds); - M_WriteText2(240, 8, timeBuffer, huFontA, 1, 1, 1, 1); + M_WriteText2(240, 8, timeBuffer, GF_FONTA, 1, 1, 1, 1); if(days) { @@ -1061,10 +1041,10 @@ static void drawWorldTimer(void) sprintf(dayBuffer, "%.2d DAYS", days); } - M_WriteText2(240, 20, dayBuffer, huFontA, 1, 1, 1, 1); + M_WriteText2(240, 20, dayBuffer, GF_FONTA, 1, 1, 1, 1); if(days >= 5) { - M_WriteText2(230, 35, "YOU FREAK!!!", huFontA, 1, 1, 1, 1); + M_WriteText2(230, 35, "YOU FREAK!!!", GF_FONTA, 1, 1, 1, 1); } } #endif @@ -1116,7 +1096,7 @@ void HU_DrawMapCounters(void) strcat(buf, tmp); } - M_WriteText2(x, y, buf, huFontA, 1, 1, 1, 1); + M_WriteText2(x, y, buf, GF_FONTA, 1, 1, 1, 1); y += LINEHEIGHT_A; } @@ -1138,7 +1118,7 @@ void HU_DrawMapCounters(void) strcat(buf, tmp); } - M_WriteText2(x, y, buf, huFontA, 1, 1, 1, 1); + M_WriteText2(x, y, buf, GF_FONTA, 1, 1, 1, 1); y += LINEHEIGHT_A; } @@ -1160,7 +1140,7 @@ void HU_DrawMapCounters(void) strcat(buf, tmp); } - M_WriteText2(x, y, buf, huFontA, 1, 1, 1, 1); + M_WriteText2(x, y, buf, GF_FONTA, 1, 1, 1, 1); y += LINEHEIGHT_A; } @@ -1316,7 +1296,7 @@ float WI_ParseFloat(char** str) /** * Draw a string of text controlled by parameter blocks. */ -void WI_DrawParamText(int x, int y, const char* inString, dpatch_t* defFont, +void WI_DrawParamText(int x, int y, const char* inString, gamefontid_t defFont, float defRed, float defGreen, float defBlue, float defAlpha, boolean defCase, boolean defTypeIn, int halign) @@ -1325,7 +1305,7 @@ void WI_DrawParamText(int x, int y, const char* inString, dpatch_t* defFont, char smallBuff[SMALLBUFF_SIZE+1], *bigBuff = NULL; char temp[256], *str, *string, *end; - dpatch_t* font = defFont; + gamefontid_t font = defFont; float r = defRed, g = defGreen, b = defBlue, a = defAlpha; float offX = 0, offY = 0, width = 0; float scaleX = 1, scaleY = 1, angle = 0, extraScale; @@ -1384,12 +1364,12 @@ void WI_DrawParamText(int x, int y, const char* inString, dpatch_t* defFont, // at this stage. if(!strnicmp(string, "fonta", 5)) { - font = huFontA; + font = GF_FONTA; string += 5; } else if(!strnicmp(string, "fontb", 5)) { - font = huFontB; + font = GF_FONTB; string += 5; } else @@ -1435,12 +1415,12 @@ void WI_DrawParamText(int x, int y, const char* inString, dpatch_t* defFont, // What do we have here? if(!strnicmp(string, "fonta", 5)) { - font = huFontA; + font = GF_FONTA; string += 5; } else if(!strnicmp(string, "fontb", 5)) { - font = huFontB; + font = GF_FONTB; string += 5; } else if(!strnicmp(string, "flash", 5)) @@ -1487,7 +1467,7 @@ void WI_DrawParamText(int x, int y, const char* inString, dpatch_t* defFont, { string += 5; cx = x; - cy += scaleY * font[0].height; + cy += scaleY * gFonts[font].chars[0].patch.height; } else if(!strnicmp(string, "r", 1)) { @@ -1631,7 +1611,7 @@ void WI_DrawParamText(int x, int y, const char* inString, dpatch_t* defFont, * Find string width from huFont chars * Skips parameter blocks eg "{param}Text" = 4 chars */ -int M_StringWidth(const char *string, dpatch_t * font) +int M_StringWidth(const char* string, gamefontid_t font) { uint i; int w = 0, maxWidth = -1; @@ -1650,7 +1630,7 @@ int M_StringWidth(const char *string, dpatch_t * font) if(c < 0 || c >= HU_FONTSIZE) w += 4; else - w += font[c].width; + w += gFonts[font].chars[c].patch.width; } if(string[i] == '}') @@ -1671,14 +1651,18 @@ int M_StringWidth(const char *string, dpatch_t * font) return maxWidth; } +int M_CharWidth(int ch, gamefontid_t font) +{ + return gFonts[font].chars[ch].patch.width; +} + /** * Find string height from huFont chars */ -int M_StringHeight(const char *string, dpatch_t *font) +int M_StringHeight(const char* string, gamefontid_t font) { - uint i; - int h; - int height = font[17].height; + uint i; + int h, height = gFonts[font].chars[17].patch.height; h = height; for(i = 0; i < strlen(string); ++i) @@ -1719,15 +1703,284 @@ void M_LetterFlash(int x, int y, int w, int h, int bright, float r, float g, DGL_BlendMode(BM_NORMAL); } +void M_DrawChar(int x, int y, int ch, gamefontid_t font) +{ + lumpnum_t lump; + + lump = gFonts[font].chars[ch].patch.lump; + + GL_DrawPatch_CS(x, y, lump); +} + +void HUlib_drawTextLine2(int x, int y, const char* string, size_t len, + gamefontid_t fontid, boolean drawCursor) +{ + const gamefont_t* font = &gFonts[fontid]; + size_t i; + + DGL_Color3fv(cfg.hudColor); + + for(i = 0; i < len; ++i) + { + unsigned char c = toupper(string[i]); + int w; + + if(c != ' ' && c >= HU_FONTSTART && c <= HU_FONTEND) + { + const dpatch_t* p = + &font->chars[c - HU_FONTSTART].patch; + + w = p->width; + if(x + w > SCREENWIDTH) + break; + + GL_DrawPatch_CS(x, y, p->lump); + x += w; + } + else + { + x += 4; + if(x >= SCREENWIDTH) + break; + } + } + + // Draw the cursor if requested. + if(drawCursor && + x + font->chars['_' - HU_FONTSTART].patch.width <= SCREENWIDTH) + GL_DrawPatch_CS(x, y, font->chars['_' - HU_FONTSTART].patch.lump); +} + +#if __JHERETIC__ +void HU_DrawBNumber(signed int val, int x, int y, float red, + float green, float blue, float alpha) +{ + const dpatch_t* patch; + int xpos; + int oldval; + + oldval = val; + xpos = x; + if(val < 0) + { + val = 0; + } + + if(val > 99) + { + patch = &gFonts[GF_FONTB].chars[15 + val / 100].patch; + + GL_DrawPatchLitAlpha(xpos + 8 - patch->width / 2, y +2, 0, alpha * .4f, + patch->lump); + DGL_Color4f(red, green, blue, alpha); + GL_DrawPatch_CS(xpos + 6 - patch->width / 2, y, patch->lump); + DGL_Color4f(1, 1, 1, 1); + } + + val = val % 100; + xpos += 12; + if(val > 9 || oldval > 99) + { + patch = &gFonts[GF_FONTB].chars[15 + val / 10].patch; + + GL_DrawPatchLitAlpha(xpos + 8 - patch->width / 2, y +2, 0, alpha * .4f, + patch->lump); + DGL_Color4f(red, green, blue, alpha); + GL_DrawPatch_CS(xpos + 6 - patch->width / 2, y, patch->lump); + DGL_Color4f(1, 1, 1, 1); + } + + val = val % 10; + xpos += 12; + patch = &gFonts[GF_FONTB].chars[15 + val].patch; + + GL_DrawPatchLitAlpha(xpos + 8 - patch->width / 2, y +2, 0, alpha * .4f, + patch->lump); + DGL_Color4f(red, green, blue, alpha); + GL_DrawPatch_CS(xpos + 6 - patch->width / 2, y, patch->lump); + DGL_Color4f(1, 1, 1, 1); +} +#endif + +#if __JHERETIC__ +void IN_DrawShadowChar(int x, int y, int ch, gamefontid_t font) +{ + GL_DrawPatchLitAlpha(x+2, y+2, 0, .4f, + gFonts[font].chars[ch].patch.lump); + DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + M_DrawChar(x, y, ch, font); +} +#elif __JHEXEN__ +void GL_DrawShadowedPatch2(float x, float y, float r, float g, float b, + float a, lumpnum_t lump) +{ + GL_DrawPatchLitAlpha(x + 2, y + 2, 0, a * .4f, lump); + DGL_Color4f(r, g, b, a); + GL_DrawPatch_CS(x, y, lump); + DGL_Color4f(1, 1, 1, 1); +} +#endif + +#if __JHERETIC__ +void IN_DrawNumber(int val, int x, int y, int digits, float r, float g, + float b, float a) +{ + int xpos; + int oldval; + int realdigits; + boolean neg; + + oldval = val; + xpos = x; + neg = false; + realdigits = 1; + + if(val < 0) + { + val = -val; + neg = true; + if(val > 99) + { + val = 99; + } + } + + if(val > 9) + { + realdigits++; + if(digits < realdigits) + { + realdigits = digits; + val = 9; + } + } + + if(val > 99) + { + realdigits++; + if(digits < realdigits) + { + realdigits = digits; + val = 99; + } + } + + if(val > 999) + { + realdigits++; + if(digits < realdigits) + { + realdigits = digits; + val = 999; + } + } + + if(digits == 4) + { + GL_DrawPatchLitAlpha(xpos + 8 - gFonts[GF_FONTB].chars[val / 1000].patch.width / 2 - 12, y + 2, 0, .4f, gFonts[GF_FONTB].chars[15+val / 1000].patch.lump); + DGL_Color4f(r, g, b, a); + GL_DrawPatch_CS(xpos + 6 - gFonts[GF_FONTB].chars[val / 1000].patch.width / 2 - 12, y, gFonts[GF_FONTB].chars[15+val / 1000].patch.lump); + } + + if(digits > 2) + { + if(realdigits > 2) + { + GL_DrawPatchLitAlpha(xpos + 8 - gFonts[GF_FONTB].chars[val / 100].patch.width / 2, y+2, 0, .4f, gFonts[GF_FONTB].chars[15+val / 100].patch.lump); + DGL_Color4f(r, g, b, a); + GL_DrawPatch_CS(xpos + 6 - gFonts[GF_FONTB].chars[val / 100].patch.width / 2, y, gFonts[GF_FONTB].chars[15+val / 100].patch.lump); + } + xpos += 12; + } + + val = val % 100; + if(digits > 1) + { + if(val > 9) + { + GL_DrawPatchLitAlpha(xpos + 8 - gFonts[GF_FONTB].chars[val / 10].patch.width / 2, y+2, 0, .4f, gFonts[GF_FONTB].chars[15+val / 10].patch.lump); + DGL_Color4f(r, g, b, a); + GL_DrawPatch_CS(xpos + 6 - gFonts[GF_FONTB].chars[val / 10].patch.width / 2, y, gFonts[GF_FONTB].chars[15+val / 10].patch.lump); + } + else if(digits == 2 || oldval > 99) + { + GL_DrawPatchLitAlpha(xpos+2, y+2, 0, .4f, gFonts[GF_FONTB].chars[15].patch.lump); + DGL_Color4f(r, g, b, a); + GL_DrawPatch_CS(xpos, y, gFonts[GF_FONTB].chars[15].patch.lump); + } + xpos += 12; + } + + val = val % 10; + GL_DrawPatchLitAlpha(xpos + 8 - gFonts[GF_FONTB].chars[val].patch.width / 2, y+2, 0, .4f, gFonts[GF_FONTB].chars[15+val].patch.lump); + DGL_Color4f(r, g, b, a); + GL_DrawPatch_CS(xpos + 6 - gFonts[GF_FONTB].chars[val].patch.width / 2, y, gFonts[GF_FONTB].chars[15+val].patch.lump); + if(neg) + { + GL_DrawPatchLitAlpha(xpos + 8 - gFonts[GF_FONTB].chars[13].patch.width / 2 - 12 * (realdigits), y+2, 0, .4f, gFonts[GF_FONTB].chars[13].patch.lump); + DGL_Color4f(r, g, b, a); + GL_DrawPatch_CS(xpos + 6 - gFonts[GF_FONTB].chars[13].patch.width / 2 - 12 * (realdigits), y, gFonts[GF_FONTB].chars[13].patch.lump); + } +} +#endif + +#if __JHEXEN__ +/** + * Draws a three digit number using FontB + */ +void DrBNumber(int val, int x, int y, float red, float green, float blue, + float alpha) +{ + dpatch_t* patch; + int xpos; + int oldval; + + // Limit to three digits. + if(val > 999) + val = 999; + if(val < -999) + val = -999; + + oldval = val; + xpos = x; + if(val < 0) + { + val = 0; + } + + if(val > 99) + { + patch = &gFonts[GF_FONTB].chars['0' - HU_FONTSTART + val / 100].patch; + GL_DrawShadowedPatch2(xpos + 6 - patch->width / 2, y, red, green, + blue, alpha, patch->lump); + } + + val = val % 100; + xpos += 12; + if(val > 9 || oldval > 99) + { + patch = &gFonts[GF_FONTB].chars['0' - HU_FONTSTART + val / 10].patch; + GL_DrawShadowedPatch2(xpos + 6 - patch->width / 2, y, red, green, + blue, alpha, patch->lump); + } + + val = val % 10; + xpos += 12; + patch = &gFonts[GF_FONTB].chars['0' - HU_FONTSTART + val].patch; + GL_DrawShadowedPatch2(xpos + 6 - patch->width / 2, y, red, green, blue, + alpha, patch->lump); +} +#endif + /** * Write a string using the huFont. */ void M_WriteText(int x, int y, const char* string) { - M_WriteText2(x, y, string, huFontA, 1, 1, 1, 1); + M_WriteText2(x, y, string, GF_FONTA, 1, 1, 1, 1); } -void M_WriteText2(int x, int y, const char* string, dpatch_t* font, +void M_WriteText2(int x, int y, const char* string, gamefontid_t font, float red, float green, float blue, float alpha) { M_WriteText3(x, y, string, font, red, green, blue, alpha, false, 0); @@ -1737,7 +1990,7 @@ void M_WriteText2(int x, int y, const char* string, dpatch_t* font, * Write a string using a colored, custom font. * Also do a type-in effect. */ -void M_WriteText3(int x, int y, const char* string, dpatch_t* font, +void M_WriteText3(int x, int y, const char* string, gamefontid_t font, float red, float green, float blue, float alpha, boolean doTypeIn, int initialCount) { @@ -1824,10 +2077,10 @@ void M_WriteText3(int x, int y, const char* string, dpatch_t* font, continue; } - w = font[c].width; - h = font[c].height; + w = gFonts[font].chars[c].patch.width; + h = gFonts[font].chars[c].patch.height; - if(!font[c].lump) + if(!gFonts[font].chars[c].patch.lump) { // A character we don't have a patch for...?! continue; @@ -1836,7 +2089,7 @@ void M_WriteText3(int x, int y, const char* string, dpatch_t* font, if(pass) { // The character itself. - GL_DrawPatch_CS(cx, cy + yoff, font[c].lump); + GL_DrawPatch_CS(cx, cy + yoff, gFonts[font].chars[c].patch.lump); // Do something flashy! if(flash > 0) @@ -1926,7 +2179,7 @@ void WI_DrawPatch(int x, int y, float r, float g, float b, float a, { // We have already determined a string to replace this with. if(W_IsFromIWAD(patch->lump)) { - WI_DrawParamText(x, y, altstring, huFontB, r, g, b, a, false, + WI_DrawParamText(x, y, altstring, GF_FONTB, r, g, b, a, false, true, halign); return; } @@ -1946,7 +2199,7 @@ void WI_DrawPatch(int x, int y, float r, float g, float b, float a, // A user replacement? if(patchString) { - WI_DrawParamText(x, y, string, huFontB, r, g, b, a, false, + WI_DrawParamText(x, y, string, GF_FONTB, r, g, b, a, false, true, halign); return; } @@ -1954,7 +2207,7 @@ void WI_DrawPatch(int x, int y, float r, float g, float b, float a, // A built-in replacement? if(cfg.usePatchReplacement == 2 && altstring) { - WI_DrawParamText(x, y, altstring, huFontB, r, g, b, a, false, + WI_DrawParamText(x, y, altstring, GF_FONTB, r, g, b, a, false, true, halign); return; } diff --git a/doomsday/plugins/common/src/m_ctrl.c b/doomsday/plugins/common/src/m_ctrl.c index 5d6be79ea1..9beb4adf45 100644 --- a/doomsday/plugins/common/src/m_ctrl.c +++ b/doomsday/plugins/common/src/m_ctrl.c @@ -110,7 +110,7 @@ menu_t ControlsDef = { M_DrawControlsMenu, 0, NULL, 1, MENU_OPTIONS, - huFontA, //1, 0, 0, + GF_FONTA, //1, 0, 0, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -125,7 +125,7 @@ menu_t ControlsDef = { M_DrawControlsMenu, 0, NULL, 1, MENU_OPTIONS, - huFontA, //1, 0, 0, + GF_FONTA, //1, 0, 0, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -140,7 +140,7 @@ menu_t ControlsDef = { M_DrawControlsMenu, 0, NULL, 1, MENU_OPTIONS, - huFontA, //1, 0, 0, + GF_FONTA, //1, 0, 0, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -432,7 +432,7 @@ void M_InitControlsMenu(void) static void M_DrawSmallText(int x, int y, const char* text) { - int height = M_StringHeight(text, huFontA); + int height = M_StringHeight(text, GF_FONTA); DGL_MatrixMode(DGL_MODELVIEW); DGL_PushMatrix(); @@ -441,7 +441,7 @@ static void M_DrawSmallText(int x, int y, const char* text) DGL_Scalef(SMALL_SCALE, SMALL_SCALE, 1); DGL_Translatef(-x, -y - height/2, 0); - M_WriteText2(x, y, text, huFontA, 1, 1, 1, Hu_MenuAlpha()); + M_WriteText2(x, y, text, GF_FONTA, 1, 1, 1, Hu_MenuAlpha()); DGL_MatrixMode(DGL_MODELVIEW); DGL_PopMatrix(); @@ -462,8 +462,8 @@ static void M_DrawBinding(bindingitertype_t type, int bid, const char* name, boo if(type == MIBT_KEY) { - width = M_StringWidth(name, huFontA); - height = M_StringHeight(name, huFontA); + width = M_StringWidth(name, GF_FONTA); + height = M_StringHeight(name, GF_FONTA); DGL_SetNoMaterial(); DGL_DrawRect(d->x, d->y, width*SMALL_SCALE + 2, height, @@ -480,8 +480,8 @@ static void M_DrawBinding(bindingitertype_t type, int bid, const char* name, boo sprintf(temp, "%s%c%s", type == MIBT_MOUSE? "mouse" : "joy", isInverse? '-' : '+', name); - width = M_StringWidth(temp, huFontA); - height = M_StringHeight(temp, huFontA); + width = M_StringWidth(temp, GF_FONTA); + height = M_StringHeight(temp, GF_FONTA); M_DrawSmallText(d->x, d->y, temp); @@ -614,10 +614,10 @@ void M_DrawControlsMenu(void) #if __JDOOM__ || __JDOOM64__ M_DrawTitle("CONTROLS", menu->y - 28); Hu_MenuPageString(buf, menu); - M_WriteText2(160 - M_StringWidth(buf, huFontA) / 2, menu->y - 12, buf, - huFontA, 1, .7f, .3f, Hu_MenuAlpha()); + M_WriteText2(160 - M_StringWidth(buf, GF_FONTA) / 2, menu->y - 12, buf, + GF_FONTA, 1, .7f, .3f, Hu_MenuAlpha()); #else - M_WriteText2(120, 100 - 98/cfg.menuScale, "CONTROLS", huFontB, cfg.menuColor[0], + M_WriteText2(120, 100 - 98/cfg.menuScale, "CONTROLS", GF_FONTB, cfg.menuColor[0], cfg.menuColor[1], cfg.menuColor[2], Hu_MenuAlpha()); DGL_Color4f(1, 1, 1, Hu_MenuAlpha()); @@ -631,8 +631,8 @@ void M_DrawControlsMenu(void) #endif strcpy(buf, "Select to assign new, [Del] to clear"); - M_WriteText2(160 - M_StringWidth(buf, huFontA) / 2, - 100 + (95/cfg.menuScale) - M_StringHeight(buf, huFontA), buf, huFontA, + M_WriteText2(160 - M_StringWidth(buf, GF_FONTA) / 2, + 100 + (95/cfg.menuScale) - M_StringHeight(buf, GF_FONTA), buf, GF_FONTA, #if __JDOOM__ 1, .7f, .3f, #else @@ -685,10 +685,10 @@ void M_ControlGrabDrawer(void) DGL_Translatef(-160, -100, 0); text = "press key or move controller for"; - M_WriteText2(160 - M_StringWidth(text, huFontA)/2, 98 - M_StringHeight(text, huFontA), - text, huFontA, .75f, .75f, .75f, 1); - M_WriteText2(160 - M_StringWidth(grabbing->item->text, huFontB)/2, - 102, grabbing->item->text, huFontB, 1, 1, 1, 1); + M_WriteText2(160 - M_StringWidth(text, GF_FONTA)/2, 98 - M_StringHeight(text, GF_FONTA), + text, GF_FONTA, .75f, .75f, .75f, 1); + M_WriteText2(160 - M_StringWidth(grabbing->item->text, GF_FONTB)/2, + 102, grabbing->item->text, GF_FONTB, 1, 1, 1, 1); DGL_MatrixMode(DGL_MODELVIEW); DGL_PopMatrix(); diff --git a/doomsday/plugins/common/src/m_multi.c b/doomsday/plugins/common/src/m_multi.c index 1c161e5a04..08f3bb115c 100644 --- a/doomsday/plugins/common/src/m_multi.c +++ b/doomsday/plugins/common/src/m_multi.c @@ -127,7 +127,7 @@ menu_t MultiplayerMenu = { DrawMultiplayerMenu, 3, MultiplayerItems, 0, MENU_NEWGAME, - huFontA,cfg.menuColor2, + GF_FONTA,cfg.menuColor2, NULL, false, LINEHEIGHT_A, 0, 3 @@ -266,7 +266,7 @@ menu_t GameSetupMenu = { DrawGameSetupMenu, NUM_GAMESETUP_ITEMS, GameSetupItems1, 0, MENU_MULTIPLAYER, - huFontA, //1, 0, 0, + GF_FONTA, //1, 0, 0, cfg.menuColor2, NULL, false, LINEHEIGHT_A, @@ -298,7 +298,7 @@ menu_t PlayerSetupMenu = { DrawPlayerSetupMenu, NUM_PLAYERSETUP_ITEMS, PlayerSetupItems, 0, MENU_MULTIPLAYER, - huFontB, cfg.menuColor, NULL, false, LINEHEIGHT_B, + GF_FONTB, cfg.menuColor, NULL, false, LINEHEIGHT_B, 0, NUM_PLAYERSETUP_ITEMS }; @@ -329,19 +329,19 @@ void DrANumber(int number, int x, int y) sprintf(buff, "%i", number); - M_WriteText2(x, y, buff, huFontA, 1, 1, 1, Hu_MenuAlpha()); + M_WriteText2(x, y, buff, GF_FONTA, 1, 1, 1, Hu_MenuAlpha()); } void MN_DrCenterTextA_CS(char* text, int centerX, int y) { - M_WriteText2(centerX - M_StringWidth(text, huFontA) / 2, y, text, - huFontA, 1, 0, 0, Hu_MenuAlpha()); + M_WriteText2(centerX - M_StringWidth(text, GF_FONTA) / 2, y, text, + GF_FONTA, 1, 0, 0, Hu_MenuAlpha()); } void MN_DrCenterTextB_CS(char *text, int centerX, int y) { - M_WriteText2(centerX - M_StringWidth(text, huFontB) / 2, y, text, - huFontB, 1, 0, 0, Hu_MenuAlpha()); + M_WriteText2(centerX - M_StringWidth(text, GF_FONTB) / 2, y, text, + GF_FONTB, 1, 0, 0, Hu_MenuAlpha()); } void DrawMultiplayerMenu(void) @@ -410,9 +410,9 @@ void DrawGameSetupMenu(void) sprintf(buf, "%i", cfg.netMap); M_WriteMenuText(menu, idx++, buf); - M_WriteText2(160 - M_StringWidth(mapName, huFontA) / 2, + M_WriteText2(160 - M_StringWidth(mapName, GF_FONTA) / 2, menu->y + menu->itemHeight, mapName, - huFontA, 1, 0.7f, 0.3f, Hu_MenuAlpha()); + GF_FONTA, 1, 0.7f, 0.3f, Hu_MenuAlpha()); idx++; M_WriteMenuText(menu, idx++, skillText[cfg.netSkill]); @@ -545,7 +545,7 @@ void DrawPlayerSetupMenu(void) #else menu->y + 64, #endif - "AUTOMATIC", huFontA, 1, 1, 1, menuAlpha); + "AUTOMATIC", GF_FONTA, 1, 1, 1, menuAlpha); } #undef AVAILABLE_WIDTH @@ -904,7 +904,7 @@ void MN_TickerEx(void) } } -int Ed_VisibleSlotChars(char* text, int (*widthFunc) (const char* text, dpatch_t* font)) +int Ed_VisibleSlotChars(char* text, int (*widthFunc) (const char* text, gamefontid_t font)) { char cbuf[2] = { 0, 0 }; int i, w; @@ -912,7 +912,7 @@ int Ed_VisibleSlotChars(char* text, int (*widthFunc) (const char* text, dpatch_t for(i = 0, w = 0; text[i]; ++i) { cbuf[0] = text[i]; - w += widthFunc(cbuf, huFontA); + w += widthFunc(cbuf, GF_FONTA); if(w > SLOT_WIDTH) break; } @@ -950,7 +950,7 @@ void DrawEditField(menu_t* menu, int index, editfield_t* ef) { int vis; char buf[MAX_EDIT_LEN + 1], *text; - int width = M_StringWidth("a", huFontA) * 27; + int width = M_StringWidth("a", GF_FONTA) * 27; strcpy(buf, ef->text); strupr(buf); @@ -962,7 +962,7 @@ void DrawEditField(menu_t* menu, int index, editfield_t* ef) M_DrawSaveLoadBorder(menu->x - 8, menu->y + EDITFIELD_BOX_YOFFSET + (menu->itemHeight * index), width + 16); M_WriteText2(menu->x, menu->y + EDITFIELD_BOX_YOFFSET + 1 + (menu->itemHeight * index), - text, huFontA, 1, 1, 1, Hu_MenuAlpha()); + text, GF_FONTA, 1, 1, 1, Hu_MenuAlpha()); } void SCEditField(int efptr, void* data) diff --git a/doomsday/plugins/jdoom/data/lumps/fonta033.lmp b/doomsday/plugins/jdoom/data/lumps/fonta033.lmp deleted file mode 100644 index afcd366dadebe93a718f679df8a9fcfd797e6bea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72 vcmZQ!U}pdU2_RMhVgn$y0b&OB{W%b@|38Qw5D}3RkppE11>}T4*)TN#5GEDU diff --git a/doomsday/plugins/jdoom/data/lumps/fonta034.lmp b/doomsday/plugins/jdoom/data/lumps/fonta034.lmp deleted file mode 100644 index d14040158e5fb009ba24f5bff75f40c3fc51999e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmZQ)U||3O6(H6DVpAZt17dd|4glgvAZB3RpOcfb|33rE{+tLHBP0qcLQskU038(` AEdT%j diff --git a/doomsday/plugins/jdoom/data/lumps/fonta035.lmp b/doomsday/plugins/jdoom/data/lumps/fonta035.lmp deleted file mode 100644 index c19077d6cb3d5204f7bb9c18c65ec42af1f51587..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 116 zcmZQ)U}pdU6(H6FVk;na1L7bcjsxN>AZBFUp92E>|1+=ySz$R5Fm^;hKtLEwJRm0k QCLV??9tP9_RD&=D02E9m1poj5 diff --git a/doomsday/plugins/jdoom/data/lumps/fonta036.lmp b/doomsday/plugins/jdoom/data/lumps/fonta036.lmp deleted file mode 100644 index cbb312f82d5916f938d1ad1dfee6716619c62312..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZY1u@QhU2nA4L&PxVy0tavbJ1R;VI~s?x{-ecDEQNaq90yIhWNft4K_?kqbW^E_ k2&@YWhBSnmhiBgrHggV-sj92}HhD6SFiJt7ejkU(3*N>l0{{R3 diff --git a/doomsday/plugins/jdoom/data/lumps/fonta037.lmp b/doomsday/plugins/jdoom/data/lumps/fonta037.lmp deleted file mode 100644 index 25192f4ff881d36355045d589e957e12bdd4e77d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 144 zcmd;NU}pdU9UwLVVrL-s2jWN|P6py!Ag%=B4j^V=-k+0`v;RMc4#?Th0^_oSgma=I rfKp7X`*R|~Vt_10IEw+u3W@-UF#uJD#DEk-3<1(0Lx5)ehZzO{@2xLr diff --git a/doomsday/plugins/jdoom/data/lumps/fonta038.lmp b/doomsday/plugins/jdoom/data/lumps/fonta038.lmp deleted file mode 100644 index 976514be650201194e4c8b21f8c3ddf0c5864a84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmd;JU}pdU4InlEVrw9F2jXBLjtAmwAg%;rX6F4lIXV0PGqM5cl&BOSlYxDIPFzSt rR1B0Ikrj~@1!YHtMMZ=`*$GKGVIVdm6Hx1Z7N9{O9*71R2s9f2F(oOa diff --git a/doomsday/plugins/jdoom/data/lumps/fonta039.lmp b/doomsday/plugins/jdoom/data/lumps/fonta039.lmp deleted file mode 100644 index b722f36356374f27d956e99cf7effc43cf81366c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60 scmZQ!U||3O2_RMgVoe}60%8W{{W&=~`~Ner?9YjSF+xH>A}|>S065?fLI3~& diff --git a/doomsday/plugins/jdoom/data/lumps/fonta040.lmp b/doomsday/plugins/jdoom/data/lumps/fonta040.lmp deleted file mode 100644 index 2aa43c77ed432e4f23ababac74c5c10ed9c87fac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmZQ)U}pdU6(H6DVlyCi0%AWPjsoILAZB9TpOcfb|34$^{+xuEBp{1{9mom^iim-- h!{QR+BB1OLpxPi18>lNTXFm&&0xN?U0^)+q0syRKCZzxX diff --git a/doomsday/plugins/jdoom/data/lumps/fonta041.lmp b/doomsday/plugins/jdoom/data/lumps/fonta041.lmp deleted file mode 100644 index f00d8aabc4111e12b9039da6dfcf6f5bae97ef35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmZQ)U}pdU6(BYSVkaQ>1L7zkP6OfsAZB3RpOcfbp9Mnw2XW&d+?bsG{~6f#=Y#;| ggP`oNxP-U}C_5n}C<3I0k#&DgLQE2n#RN430INYJ;{X5v diff --git a/doomsday/plugins/jdoom/data/lumps/fonta042.lmp b/doomsday/plugins/jdoom/data/lumps/fonta042.lmp deleted file mode 100644 index 926e0cb2c27ba8ad68a7a5a08b07f5ef7d6c87ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 zcmZQ)U}pdU6(H6EVk0270b&mz4g%sRAZBLVpR@lz6Z8I@I3Uf)x<4l>2*hGw2eE>{ LY=kIG9YhxZnD-pr diff --git a/doomsday/plugins/jdoom/data/lumps/fonta043.lmp b/doomsday/plugins/jdoom/data/lumps/fonta043.lmp deleted file mode 100644 index 297bd18ccb0815e34ec880222e484a5b1dfb80fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76 ycmZQ&U}a!n`2Sx9NU8v_9uQjqu@ew8GVjmH$=Uy(ffYzc!B|mIQ7B??RSW>X4;T9Y diff --git a/doomsday/plugins/jdoom/data/lumps/fonta044.lmp b/doomsday/plugins/jdoom/data/lumps/fonta044.lmp deleted file mode 100644 index 0a0b2da27d8f92ddecc5d696606380e1c35369e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60 ucmZQ!U}0cj`1@Z1NGbraCJ-9|F$44doSdBf{~1{J=S095At6u^h!g;$1QM$N diff --git a/doomsday/plugins/jdoom/data/lumps/fonta045.lmp b/doomsday/plugins/jdoom/data/lumps/fonta045.lmp deleted file mode 100644 index e04fd084eb0d8b5e015b70c7e61dfd766fd8ecd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 80 tcmZQ$U}j)o`1fA{NNNDF0T5dNu>%l$05Jpe{+yhg{r^F900A1L4glc88D{_h diff --git a/doomsday/plugins/jdoom/data/lumps/fonta046.lmp b/doomsday/plugins/jdoom/data/lumps/fonta046.lmp deleted file mode 100644 index e6f21fcf0f575aa9b5d44f21f72b27b5c3ea79b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56 qcmZQ!U}j)o`14-^NGbra1`rznF$44doSdBf|3P#Fln#N?AaMX)P!V?k diff --git a/doomsday/plugins/jdoom/data/lumps/fonta047.lmp b/doomsday/plugins/jdoom/data/lumps/fonta047.lmp deleted file mode 100644 index 47a5cfe126394122d0baad266e780c2d7d924626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmZQ)U}pdU6(H6DVpAZt2Vzek4hG^FAZB6SpOcfb|35R!{+zHlAcKi@e@;YH5|G6R SW+ebw3G13Qov7Z(R($Av_M#X-d* X5^@qEu(0F8g5YX$;-bKM5helvHQp-- diff --git a/doomsday/plugins/jdoom/data/lumps/fonta049.lmp b/doomsday/plugins/jdoom/data/lumps/fonta049.lmp deleted file mode 100644 index af0cfa07702828e95093a0a94f3927c363dfde8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 84 zcmZQ&U}pdU86Z{xVgn$y0b&mzW@O%=wg3PC diff --git a/doomsday/plugins/jdoom/data/lumps/fonta050.lmp b/doomsday/plugins/jdoom/data/lumps/fonta050.lmp deleted file mode 100644 index 5f0fd7c0fcd59912b49723f8ee17f37cd3c87532..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmd;JU}pdU4InlFVh14h0pbWCP66TqAg%#o2KN0q5U~G0h#irW77>vHVTa|!goQ!b p5or-XIf!^rLRd}+lpPWhkrM!ArzNC;)i5%H%-qk)1f+mE7yyxZEmQyi diff --git a/doomsday/plugins/jdoom/data/lumps/fonta051.lmp b/doomsday/plugins/jdoom/data/lumps/fonta051.lmp deleted file mode 100644 index 86600bc261cfc62c88e559c7e915e5cc6eeb7e5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmd;JU}pdU4InlJVn-nM1>#5`P6gsZAg%^t2B!TvIr~|`6nu!ErNu!OLL2q-%tBq#!;o{@EbPC`r)kj2CdG!i5W05FLvi~s-t diff --git a/doomsday/plugins/jdoom/data/lumps/fonta052.lmp b/doomsday/plugins/jdoom/data/lumps/fonta052.lmp deleted file mode 100644 index 3e033b7699567af3c027402e5710419165241587..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 116 zcmZQ)U}pdU6(H6FVhbR40%AWPjsoH|AZB3Qp92E>|ASZ|At6v!SOl2G4w4Ok$OGA7 VApt=!@vxAPurQEnuo|ct3;+~jBo6=p diff --git a/doomsday/plugins/jdoom/data/lumps/fonta053.lmp b/doomsday/plugins/jdoom/data/lumps/fonta053.lmp deleted file mode 100644 index f0840ce1c881cfade71cd4a8310dd554985eeece..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 124 zcmZQ)U}pdU6(BYMVjCd#0OAlJP5|N@AZB3Sp92B=|AW|3QBgT@IS_VGP*7R`jGYsd e76NBSghfEvVL1sw2_QBT(476u%plW%JO%(jwkJ>k diff --git a/doomsday/plugins/jdoom/data/lumps/fonta054.lmp b/doomsday/plugins/jdoom/data/lumps/fonta054.lmp deleted file mode 100644 index 06c54be93cdb2a67e2f77e4b88a86c9fe4a06b12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmd;JU}pdU4InlEVk;na1L7bcjsxN>AT9%9Cg%M)IXV0PGqUc_iHV5;vKZKbtgxUU k7&|N_ECAGXYK8&kQva03AkG0|2Il=aIXV0PgXjn-9fr(j-=7nd08|1J a1F@qbBEaf^?3jqKpb(%qBOAyJh!Ox~cO{en diff --git a/doomsday/plugins/jdoom/data/lumps/fonta056.lmp b/doomsday/plugins/jdoom/data/lumps/fonta056.lmp deleted file mode 100644 index 27e0ab87a10e4c15542f050bb196ec03f4402b51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmd;JU}pdU4InlJVn-nM1>#5`P6gsZAg%>sMyCBaIr~|_@XyDL_}Cv1XK-7FRGyo0E>?;Qvd(} diff --git a/doomsday/plugins/jdoom/data/lumps/fonta057.lmp b/doomsday/plugins/jdoom/data/lumps/fonta057.lmp deleted file mode 100644 index 09395db0a660fbc642dd25a282b3cc43eb7ca322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmd;JU}pdU4InlHVkaQ>1L7zkP6Og1Ag%#oMyCBaIr~|dfn?79{|xN=b5f#GauT5I nuz;wXASio94uTz$6O|GM6_1Gs3yT4=8Cmz|B*lPOOi}P>c{}}*@(-)io diff --git a/doomsday/plugins/jdoom/data/lumps/fonta061.lmp b/doomsday/plugins/jdoom/data/lumps/fonta061.lmp deleted file mode 100644 index 28c603471f166c9aaa69d642bd987127316cb02e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 80 wcmZQ&U}a!n`2Sx9NU8y`0T5dOu?rA0umJB_se@jLabO_WuU}mvJeL diff --git a/doomsday/plugins/jdoom/data/lumps/fonta064.lmp b/doomsday/plugins/jdoom/data/lumps/fonta064.lmp deleted file mode 100644 index 2f69da926372ab8c35ffcc1d2bba6b43e72fdb88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 156 zcmd;N;9vj&9UwLXVkaQ>2jUnY&IIBzAZ`ZYejsLI-Jb&j`~Net@6U+|3JQt=vKcsl z>=dAIO3ZdJCnzT+C@3dr6OGBisI*q_D6sAd`W8e@;wT cOiT=v9h4IRRss@7VMigM02#E-RsYyu4iAe#fVPpcDxt|40{s&qC0EZtevH$=8 diff --git a/doomsday/plugins/jdoom/data/lumps/fonta067.lmp b/doomsday/plugins/jdoom/data/lumps/fonta067.lmp deleted file mode 100644 index 82ac98f5cbea9b299948e18ca91f67d7e74bb45a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmd;JU}pdU4InlEVk;na1L7bcjsxOcAg%#oCg%M)IXV0PGqUc_Nr+1VvKZL+=Ol$h nguvJ#Kz0OFJOHRR0K^9B0@5rH3d{|IaHF8IKr=zIAfp)ogAXln diff --git a/doomsday/plugins/jdoom/data/lumps/fonta068.lmp b/doomsday/plugins/jdoom/data/lumps/fonta068.lmp deleted file mode 100644 index 3b086d843e8ebfebb62de67c35657bcc3d5cf93f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmd;JU}pdU4InlFVh14h0pbWCP66TqAg%&p2KN0qSverE|38QwmlF{d24x53L<9vv n*#STm0Z?{WN=`}$l${V27M1{HGqUc_Nr(cmn3(rNOk)55F?uR1 diff --git a/doomsday/plugins/jdoom/data/lumps/fonta069.lmp b/doomsday/plugins/jdoom/data/lumps/fonta069.lmp deleted file mode 100644 index 43713d4f6859c2b3dac9658288435d3be06a3a7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmXxcF$#b%429vSNIgnNXAj^3N+}si36An+uh*mLQ{saU{vl+MAnzirw9!t98l7~} lICTL19_9|K2TKAgC#~L^Iqzb{)H_2_yc-PvJ>PvFMIIzTDeV9N diff --git a/doomsday/plugins/jdoom/data/lumps/fonta070.lmp b/doomsday/plugins/jdoom/data/lumps/fonta070.lmp deleted file mode 100644 index 707bab58af13651b2d867a1efd18a83b57282df7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmd;JU}pdU4InlFVh14h0pbWCP6FZ_AT9%92KN0q5TO4b#Et-goc&;SSVTlr43r&^ b5CK#M6ldL^6OaQ|fyM&MGJ{M5s$u{DU0)~$ diff --git a/doomsday/plugins/jdoom/data/lumps/fonta071.lmp b/doomsday/plugins/jdoom/data/lumps/fonta071.lmp deleted file mode 100644 index bd363ddf556007066f8cbc04546684b216f09a31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmd;JU}pdU4InlEVk;na1L7bcjsxN>AT9%9Cg%M)IXV0PGqUc_iHS)9vKZKbtgx_% j7$`d|E+r1e4g#tTf{F*_gvCW5*g-IHpb{Ven!^A9EM_V1 diff --git a/doomsday/plugins/jdoom/data/lumps/fonta072.lmp b/doomsday/plugins/jdoom/data/lumps/fonta072.lmp deleted file mode 100644 index bc9ba0a2219b2260ab53fb0fb72c1b6138f69756..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmd;JU}pdU4InlFVh14h0pbWCP66TqAg%#o2KN0q5U~G0h#dw3IS_VCOjt||l%10k d0aOMNM`p)FM8w2F#e>3vfAkG0|7UumqIXV0PgXkzI9fCwNu!H1t5s2KN0q5U~G0h#dn0IS_V0SWr+1l%10k s22{5HKO^h@oS?8cn2NZZ5HOp0e@;}+eik4F*1!ZbbU!PY{LjDu0E>DpIRF3v diff --git a/doomsday/plugins/jdoom/data/lumps/fonta076.lmp b/doomsday/plugins/jdoom/data/lumps/fonta076.lmp deleted file mode 100644 index 69417ac895d6e83bdf9e3acc8244e50954ab8447..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmd;JU}pdU4InlKVtXL=2I6oajtAm&AkGJ32Dbe<+e7@(s4|Cw0!=Y&N;#S$Q5AZ;NLKmgU25E27a4bcWOnSlWSr7bU_ diff --git a/doomsday/plugins/jdoom/data/lumps/fonta078.lmp b/doomsday/plugins/jdoom/data/lumps/fonta078.lmp deleted file mode 100644 index 4c349862a7517e7add4fe1eab953e6a39a53a9f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmd;JU}pdU4InlKVtXL=2I6oaP6pz9Ag%^tMz;MqV6gu`1N;7*qzE9$fw03O!eZi} j?3B2elpH8KCnqK>38p40Bq#{V4hac~NCB~tjAQ@+*5xab diff --git a/doomsday/plugins/jdoom/data/lumps/fonta079.lmp b/doomsday/plugins/jdoom/data/lumps/fonta079.lmp deleted file mode 100644 index 6c605b10b4ce14f6ebabe3c0dabe364fe657854e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 124 zcmd;JU}pdU4InlEVk;na1L7bcjsxN>AT9x7Cg%M)IXV0PGqUc_Ns3DXvKZKbtdNKh b7&{;#Cm{eT4q}JF)I>zYfYcy#!ps5y>)I!t diff --git a/doomsday/plugins/jdoom/data/lumps/fonta080.lmp b/doomsday/plugins/jdoom/data/lumps/fonta080.lmp deleted file mode 100644 index e6b6226df7af1a7f3897ffbc1ec4ccf073b886f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmd;JU}pdU4InlFVh14h0pbWCP6FZ_AT9%92KN0q5U~G0h#iv?5D<|AVFw|x19Ad@ e%7Egm`*Q*^LSU>27%M3v2`I+M3^EO|1i;t< mIRQXr5b=PdfH*ii0--)BE(eJA|7TG1Ka+bn5dW}5R-j>PEbTd b1dI)o4~c<_BeTO`YJgg!Vjx-(<}m;OHo+=6 diff --git a/doomsday/plugins/jdoom/data/lumps/fonta086.lmp b/doomsday/plugins/jdoom/data/lumps/fonta086.lmp deleted file mode 100644 index 507eb86e27bd18b9113bfc2ac11464507543b994..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmZQ)U}pdU6(H6DVlyCi0%AWPjsoHoAZB3RpOcfb|33rk{+zHdFpGVEPC!st6pWpd ZlMoaJQUMeX3JHRU164;vfK@>C0{{UhA;SOw diff --git a/doomsday/plugins/jdoom/data/lumps/fonta087.lmp b/doomsday/plugins/jdoom/data/lumps/fonta087.lmp deleted file mode 100644 index f55ab580e65f461a321c9bc5b08637eb54d52419..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmd;NU}pdU9UwLbVrL-s2jXZTP6gsZAg%@CP9SDr+n)ml`~Ner@6QQ|ii(TNfwIFw lLV}>|oSdYnC?K1W6{sdG3`sNst~x9NrZXuH2teWp!vU0-FsJ|k diff --git a/doomsday/plugins/jdoom/data/lumps/fonta088.lmp b/doomsday/plugins/jdoom/data/lumps/fonta088.lmp deleted file mode 100644 index 0f534b4c65839f0eca6006c81c39084805bd281b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmd;NU}pdU9U!&@Vh!&;js@aOAT9!82Il=aIXV0PGqCK>2?zr**ny0Y2#6q% dos$y~69W|ovZErP>>!vLpvIsmkRZ$?1_15HCeHu> diff --git a/doomsday/plugins/jdoom/data/lumps/fonta090.lmp b/doomsday/plugins/jdoom/data/lumps/fonta090.lmp deleted file mode 100644 index 4435e0325e23c4d992e07c0e14a34fa0ac7333d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZQ)U}pdU6(BYSVtXL=2I6oaP6pz9AZB3RpOcfbp9MnwXJFr-6Ooe>6_K+a%nr*5 e3k!p?gTf+`LSXEuq?`aK8^{Fe0jftciU9!N04Wgw diff --git a/doomsday/plugins/jdoom/data/lumps/fonta091.lmp b/doomsday/plugins/jdoom/data/lumps/fonta091.lmp deleted file mode 100644 index 2faf56a6b58f2e2109554e267daa1b7859f0b547..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmZQ&U}pdU86Z{zVk02717a^AW@O!;0|NX1GqCT^Ns5b$OMcurrentFragsCount); - M_WriteText2(2, i, buf, huFontA, cfg.hudColor[0], cfg.hudColor[1], + M_WriteText2(2, i, buf, GF_FONTA, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textAlpha); } @@ -1073,9 +1073,9 @@ void ST_doFullscreenStuff(int player) ST_HUDSpriteSize(SPR_STIM, &w, &h); pos = w + 2; sprintf(buf, "%i%%", plr->health); - M_WriteText2(pos, height - 14, buf, huFontB, cfg.hudColor[0], + M_WriteText2(pos, height - 14, buf, GF_FONTB, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textAlpha); - pos += M_StringWidth(buf, huFontB) + 2; + pos += M_StringWidth(buf, GF_FONTB) + 2; } if(cfg.hudShown[HUD_AMMO]) @@ -1098,7 +1098,7 @@ void ST_doFullscreenStuff(int player) ST_HUDSpriteSize(spr, &w, &h); pos += w + 2; sprintf(buf, "%i", plr->ammo[ammoType]); - M_WriteText2(pos, height - 14, buf, huFontB, + M_WriteText2(pos, height - 14, buf, GF_FONTB, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textAlpha); break; @@ -1135,11 +1135,11 @@ Draw_EndZoom(); maxArmor = MAX_OF(maxArmor, armorPoints[2]); maxArmor = MAX_OF(maxArmor, armorPoints[2]); sprintf(buf, "%i%%", maxArmor); - armorOffset = M_StringWidth(buf, huFontB); + armorOffset = M_StringWidth(buf, GF_FONTB); sprintf(buf, "%i%%", plr->armorPoints); pos -= armorOffset; - M_WriteText2(pos + armorOffset - M_StringWidth(buf, huFontB), height - 14, buf, huFontB, + M_WriteText2(pos + armorOffset - M_StringWidth(buf, GF_FONTB), height - 14, buf, GF_FONTB, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textAlpha); pos -= 2; diff --git a/doomsday/plugins/jdoom/src/wi_stuff.c b/doomsday/plugins/jdoom/src/wi_stuff.c index 95d9e86114..c19d3e3cad 100644 --- a/doomsday/plugins/jdoom/src/wi_stuff.c +++ b/doomsday/plugins/jdoom/src/wi_stuff.c @@ -880,9 +880,9 @@ void WI_drawDeathmatchStats(void) sprintf(tmp, "%i", teamInfo[i].members); M_WriteText2(x - p[i].width / 2 + 1, DM_MATRIXY - WI_SPACINGY + p[i].height - 8, tmp, - huFontA, 1, 1, 1, 1); + GF_FONTA, 1, 1, 1, 1); M_WriteText2(DM_MATRIXX - p[i].width / 2 + 1, - y + p[i].height - 8, tmp, huFontA, 1, 1, 1, 1); + y + p[i].height - 8, tmp, GF_FONTA, 1, 1, 1, 1); } } else @@ -1125,7 +1125,7 @@ void WI_drawNetgameStats(void) sprintf(tmp, "%i", teamInfo[i].members); M_WriteText2(x - p[i].width + 1, y + p[i].height - 8, tmp, - huFontA, 1, 1, 1, 1); + GF_FONTA, 1, 1, 1, 1); } if(i == myTeam) diff --git a/doomsday/plugins/jdoom64/src/d_console.c b/doomsday/plugins/jdoom64/src/d_console.c index 04e19fe7fe..7b37ce510f 100644 --- a/doomsday/plugins/jdoom64/src/d_console.c +++ b/doomsday/plugins/jdoom64/src/d_console.c @@ -294,7 +294,7 @@ int ConTextOut(const char *text, int x, int y) typeInTime = 0xffffff; - M_WriteText2(x, y, text, huFontA, -1, -1, -1, -1); + M_WriteText2(x, y, text, GF_FONTA, -1, -1, -1, -1); typeInTime = old; return 0; } @@ -304,7 +304,7 @@ int ConTextOut(const char *text, int x, int y) */ int ConTextWidth(const char *text) { - return M_StringWidth(text, huFontA); + return M_StringWidth(text, GF_FONTA); } /** diff --git a/doomsday/plugins/jdoom64/src/d_items.c b/doomsday/plugins/jdoom64/src/d_items.c index 138926090a..cc2242e83b 100644 --- a/doomsday/plugins/jdoom64/src/d_items.c +++ b/doomsday/plugins/jdoom64/src/d_items.c @@ -203,7 +203,6 @@ void P_InitWeaponInfo(void) int i; int pclass = PCLASS_PLAYER; - ammotype_t k; char buf[80]; char* data; diff --git a/doomsday/plugins/jdoom64/src/d_refresh.c b/doomsday/plugins/jdoom64/src/d_refresh.c index de3eeb1db7..7f42304ae0 100644 --- a/doomsday/plugins/jdoom64/src/d_refresh.c +++ b/doomsday/plugins/jdoom64/src/d_refresh.c @@ -229,8 +229,8 @@ void R_DrawMapTitle(void) if(lauthor && W_IsFromIWAD(mapNamePatches[mapnum].lump) && (!cfg.hideAuthorMidway || stricmp(lauthor, "Midway"))) { - M_WriteText2(160 - M_StringWidth(lauthor, huFontA) / 2, y, lauthor, - huFontA, -1, -1, -1, -1); + M_WriteText2(160 - M_StringWidth(lauthor, GF_FONTA) / 2, y, lauthor, + GF_FONTA, -1, -1, -1, -1); } DGL_MatrixMode(DGL_MODELVIEW); @@ -426,7 +426,7 @@ void D_Display2(void) case GS_WAITING: //gl.Clear(DGL_COLOR_BUFFER_BIT); - //M_WriteText2(5, 188, "WAITING... PRESS ESC FOR MENU", huFontA, 1, 0, 0, 1); + //M_WriteText2(5, 188, "WAITING... PRESS ESC FOR MENU", GF_FONTA, 1, 0, 0, 1); break; case GS_INFINE: diff --git a/doomsday/plugins/jdoom64/src/p_setup.c b/doomsday/plugins/jdoom64/src/p_setup.c index 3a05c9f500..89990e4604 100644 --- a/doomsday/plugins/jdoom64/src/p_setup.c +++ b/doomsday/plugins/jdoom64/src/p_setup.c @@ -65,7 +65,7 @@ void P_RegisterMapObjs(void) P_RegisterMapObjProperty(MO_THING, MO_ID, "ID", DDVT_SHORT); P_RegisterMapObjProperty(MO_THING, MO_ANGLE, "Angle", DDVT_SHORT); P_RegisterMapObjProperty(MO_THING, MO_TYPE, "Type", DDVT_SHORT); - P_RegisterMapObjProperty(MO_THING, MO_FLAGS, "Flags", DDVT_SHORT); + P_RegisterMapObjProperty(MO_THING, MO_FLAGS, "Flags", DDVT_INT); P_RegisterMapObj(MO_XLINEDEF, "XLinedef"); P_RegisterMapObjProperty(MO_XLINEDEF, MO_TAG, "Tag", DDVT_SHORT); diff --git a/doomsday/plugins/jdoom64/src/st_stuff.c b/doomsday/plugins/jdoom64/src/st_stuff.c index c0a128804f..391980dec2 100644 --- a/doomsday/plugins/jdoom64/src/st_stuff.c +++ b/doomsday/plugins/jdoom64/src/st_stuff.c @@ -375,7 +375,7 @@ void ST_doFullscreenStuff(int player) i -= 18 * cfg.hudScale; } sprintf(buf, "FRAGS:%i", hud->currentFragsCount); - M_WriteText2(HUDBORDERX, i, buf, huFontA, cfg.hudColor[0], cfg.hudColor[1], + M_WriteText2(HUDBORDERX, i, buf, GF_FONTA, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textalpha); } @@ -388,17 +388,17 @@ void ST_doFullscreenStuff(int player) if(cfg.hudShown[HUD_HEALTH]) { sprintf(buf, "HEALTH"); - pos = M_StringWidth(buf, huFontA)/2; - M_WriteText2(HUDBORDERX, h_height - HUDBORDERY - huFont[0].height - 4, - buf, huFontA, 1, 1, 1, iconalpha); + pos = M_StringWidth(buf, GF_FONTA)/2; + M_WriteText2(HUDBORDERX, h_height - HUDBORDERY - M_StringHeight("A", GF_FONTA) - 4, + buf, GF_FONTA, 1, 1, 1, iconalpha); sprintf(buf, "%i", plr->health); - M_WriteText2(HUDBORDERX + pos - (M_StringWidth(buf, huFontB)/2), - h_height - HUDBORDERY, buf, huFontB, + M_WriteText2(HUDBORDERX + pos - (M_StringWidth(buf, GF_FONTB)/2), + h_height - HUDBORDERY, buf, GF_FONTB, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textalpha); oldPos = pos; - pos = HUDBORDERX * 2 + M_StringWidth(buf, huFontB); + pos = HUDBORDERX * 2 + M_StringWidth(buf, GF_FONTB); } // Keys | use a bit of extra scale. @@ -468,8 +468,8 @@ Draw_EndZoom(); continue; sprintf(buf, "%i", plr->ammo[ammotype]); - pos = (h_width/2) - (M_StringWidth(buf, huFontB)/2); - M_WriteText2(pos, h_height - HUDBORDERY, buf, huFontB, + pos = (h_width/2) - (M_StringWidth(buf, GF_FONTB)/2); + M_WriteText2(pos, h_height - HUDBORDERY, buf, GF_FONTB, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textalpha); break; } @@ -479,15 +479,15 @@ Draw_EndZoom(); if(cfg.hudShown[HUD_ARMOR]) { sprintf(buf, "ARMOR"); - w = M_StringWidth(buf, huFontA); + w = M_StringWidth(buf, GF_FONTA); M_WriteText2(h_width - w - HUDBORDERX, - h_height - HUDBORDERY - huFont[0].height - 4, - buf, huFontA, 1, 1, 1, iconalpha); + h_height - HUDBORDERY - M_StringHeight("A", GF_FONTA) - 4, + buf, GF_FONTA, 1, 1, 1, iconalpha); sprintf(buf, "%i", plr->armorPoints); - M_WriteText2(h_width - (w/2) - (M_StringWidth(buf, huFontB)/2) - HUDBORDERX, + M_WriteText2(h_width - (w/2) - (M_StringWidth(buf, GF_FONTB)/2) - HUDBORDERX, h_height - HUDBORDERY, - buf, huFontB, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], + buf, GF_FONTB, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textalpha); } diff --git a/doomsday/plugins/jdoom64/src/wi_stuff.c b/doomsday/plugins/jdoom64/src/wi_stuff.c index b9a2a72895..fe35401209 100644 --- a/doomsday/plugins/jdoom64/src/wi_stuff.c +++ b/doomsday/plugins/jdoom64/src/wi_stuff.c @@ -540,9 +540,9 @@ void WI_drawDeathmatchStats(void) sprintf(tmp, "%i", teamInfo[i].members); M_WriteText2(x - p[i].width / 2 + 1, DM_MATRIXY - WI_SPACINGY + p[i].height - 8, tmp, - huFontA, 1, 1, 1, 1); + GF_FONTA, 1, 1, 1, 1); M_WriteText2(DM_MATRIXX - p[i].width / 2 + 1, - y + p[i].height - 8, tmp, huFontA, 1, 1, 1, 1); + y + p[i].height - 8, tmp, GF_FONTA, 1, 1, 1, 1); } } else @@ -782,7 +782,7 @@ void WI_drawNetgameStats(void) sprintf(tmp, "%i", teamInfo[i].members); M_WriteText2(x - p[i].width + 1, y + p[i].height - 8, tmp, - huFontA, 1, 1, 1, 1); + GF_FONTA, 1, 1, 1, 1); } if(i == myTeam) diff --git a/doomsday/plugins/jheretic/include/h_refresh.h b/doomsday/plugins/jheretic/include/h_refresh.h index 06eb98ecd0..255b1225d6 100644 --- a/doomsday/plugins/jheretic/include/h_refresh.h +++ b/doomsday/plugins/jheretic/include/h_refresh.h @@ -32,7 +32,7 @@ # error "Using jHeretic headers without __JHERETIC__" #endif -#include "r_common.h" // For dpatch_t +#include "hu_stuff.h" // For gamefontid_t #include "p_mobj.h" @@ -44,7 +44,7 @@ void R_SetViewSize(int blocks); void R_DrawSpecialFilter(int pnum); void R_DrawMapTitle(int x, int y, float alpha, - dpatch_t* font, boolean center); + gamefontid_t font, boolean center); void P_SetDoomsdayFlags(mobj_t* mo); void R_SetAllDoomsdayFlags(void); diff --git a/doomsday/plugins/jheretic/src/h_console.c b/doomsday/plugins/jheretic/src/h_console.c index 9e9b4a6b1b..b0b0bb1b4a 100644 --- a/doomsday/plugins/jheretic/src/h_console.c +++ b/doomsday/plugins/jheretic/src/h_console.c @@ -282,7 +282,7 @@ int ConTextOut(const char* text, int x, int y) int old = typeInTime; typeInTime = 0xffffff; - M_WriteText2(x, y, text, huFontA, -1, -1, -1, -1); + M_WriteText2(x, y, text, GF_FONTA, -1, -1, -1, -1); typeInTime = old; return 0; } @@ -292,7 +292,7 @@ int ConTextOut(const char* text, int x, int y) */ int ConTextWidth(const char* text) { - return M_StringWidth(text, huFontA); + return M_StringWidth(text, GF_FONTA); } /** diff --git a/doomsday/plugins/jheretic/src/h_refresh.c b/doomsday/plugins/jheretic/src/h_refresh.c index 75d6658c2a..75f57eb617 100644 --- a/doomsday/plugins/jheretic/src/h_refresh.c +++ b/doomsday/plugins/jheretic/src/h_refresh.c @@ -166,8 +166,8 @@ boolean R_GetFilterColor(float rgba[4], int filter) return false; } -void R_DrawMapTitle(int x, int y, float alpha, dpatch_t* font, - boolean center) +void R_DrawMapTitle(int x, int y, float alpha, gamefontid_t font, + boolean center) { int strX; char* lname, *lauthor; @@ -190,9 +190,9 @@ void R_DrawMapTitle(int x, int y, float alpha, dpatch_t* font, { strX = x; if(center) - strX -= M_StringWidth(lauthor, huFontA) / 2; + strX -= M_StringWidth(lauthor, GF_FONTA) / 2; - M_WriteText3(strX, y, lauthor, huFontA, .5f, .5f, .5f, alpha, + M_WriteText3(strX, y, lauthor, GF_FONTA, .5f, .5f, .5f, alpha, false, 0); } } @@ -389,7 +389,7 @@ void H_Display2(void) x = SCREENWIDTH / 2; y = 13; Draw_BeginZoom((1 + cfg.hudScale)/2, x, y); - R_DrawMapTitle(x, y, alpha, huFontB, true); + R_DrawMapTitle(x, y, alpha, GF_FONTB, true); Draw_EndZoom(); } } diff --git a/doomsday/plugins/jheretic/src/in_lude.c b/doomsday/plugins/jheretic/src/in_lude.c index 77275cb6d9..8d113fb40b 100644 --- a/doomsday/plugins/jheretic/src/in_lude.c +++ b/doomsday/plugins/jheretic/src/in_lude.c @@ -105,8 +105,7 @@ static int secretPercent[NUMTEAMS]; static int playerTeam[MAXPLAYERS]; static teaminfo_t teamInfo[NUMTEAMS]; -static int interPic, beenThere, goingThere, numbers[10], negative, slash, - percent; +static int interPic, beenThere, goingThere; static int patchFaceOkayBase; static int patchFaceDeadBase; @@ -328,8 +327,6 @@ void IN_InitStats(void) void IN_LoadPics(void) { - int i; - switch(gameEpisode) { case 1: @@ -348,15 +345,6 @@ void IN_LoadPics(void) beenThere = W_GetNumForName("IN_X"); goingThere = W_GetNumForName("IN_YAH"); - for(i = 0; i < 10; ++i) - { - numbers[i] = huFontB[i+15].lump; - } - negative = huFontB[13].lump; - - slash = huFontB[14].lump; - percent = huFontB[5].lump; - patchFaceOkayBase = W_GetNumForName("FACEA0"); patchFaceDeadBase = W_GetNumForName("FACEB0"); } @@ -572,11 +560,11 @@ void IN_DrawOldLevel(void) levelname = P_GetShortMapName(gameEpisode, prevMap); - x = 160 - M_StringWidth(levelname, huFontB) / 2; - M_WriteText2(x, 3, levelname, huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + x = 160 - M_StringWidth(levelname, GF_FONTB) / 2; + M_WriteText2(x, 3, levelname, GF_FONTB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - x = 160 - M_StringWidth("FINISHED", huFontA) / 2; - M_WriteText2(x, 25, "FINISHED", huFontA, defFontRGB2[0], defFontRGB2[1],defFontRGB2[2], 1); + x = 160 - M_StringWidth("FINISHED", GF_FONTA) / 2; + M_WriteText2(x, 25, "FINISHED", GF_FONTA, defFontRGB2[0], defFontRGB2[1],defFontRGB2[2], 1); if(prevMap == 9) { @@ -621,11 +609,11 @@ void IN_DrawYAH(void) levelname = P_GetShortMapName(gameEpisode, gameMap); - x = 160 - M_StringWidth("NOW ENTERING:", huFontA) / 2; - M_WriteText2(x, 10, "NOW ENTERING:", huFontA, defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); + x = 160 - M_StringWidth("NOW ENTERING:", GF_FONTA) / 2; + M_WriteText2(x, 10, "NOW ENTERING:", GF_FONTA, defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); - x = 160 - M_StringWidth(levelname, huFontB) / 2; - M_WriteText2(x, 20, levelname, huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + x = 160 - M_StringWidth(levelname, GF_FONTB) / 2; + M_WriteText2(x, 20, levelname, GF_FONTB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); if(prevMap == 9) { @@ -660,15 +648,20 @@ void IN_DrawSingleStats(void) levelname = P_GetShortMapName(gameEpisode, prevMap); - M_WriteText2(50, 65, "KILLS", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - M_WriteText2(50, 90, "ITEMS", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - M_WriteText2(50, 115, "SECRETS", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + M_WriteText2(50, 65, "KILLS", GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); + M_WriteText2(50, 90, "ITEMS", GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); + M_WriteText2(50, 115, "SECRETS", GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); - x = 160 - M_StringWidth(levelname, huFontB) / 2; - M_WriteText2(x, 3, levelname, huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + x = 160 - M_StringWidth(levelname, GF_FONTB) / 2; + M_WriteText2(x, 3, levelname, GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); - x = 160 - M_StringWidth("FINISHED", huFontA) / 2; - M_WriteText2(x, 25, "FINISHED", huFontA, defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); + x = 160 - M_StringWidth("FINISHED", GF_FONTA) / 2; + M_WriteText2(x, 25, "FINISHED", GF_FONTA, defFontRGB2[0], + defFontRGB2[1], defFontRGB2[2], 1); if(interTime < 30) { @@ -682,16 +675,14 @@ void IN_DrawSingleStats(void) sounds++; } - IN_DrawNumber(players[CONSOLEPLAYER].killCount, 200, 65, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatchLitAlpha(250, 67, 0, .4f, slash); - DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatch_CS(248, 65, slash); - IN_DrawNumber(totalKills, 248, 65, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawNumber(players[CONSOLEPLAYER].killCount, 200, 65, 3, + defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawShadowChar(248, 65, 14, GF_FONTB); + IN_DrawNumber(totalKills, 248, 65, 3, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); if(interTime < 60) - { return; - } if(sounds < 2 && interTime >= 60) { @@ -699,16 +690,14 @@ void IN_DrawSingleStats(void) sounds++; } - IN_DrawNumber(players[CONSOLEPLAYER].itemCount, 200, 90, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatchLitAlpha(250, 92, 0, .4f, slash); - DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatch_CS(248, 90, slash); - IN_DrawNumber(totalItems, 248, 90, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawNumber(players[CONSOLEPLAYER].itemCount, 200, 90, 3, + defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawShadowChar(248, 90, 14, GF_FONTB); + IN_DrawNumber(totalItems, 248, 90, 3, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); if(interTime < 90) - { return; - } if(sounds < 3 && interTime >= 90) { @@ -716,11 +705,11 @@ void IN_DrawSingleStats(void) sounds++; } - IN_DrawNumber(players[CONSOLEPLAYER].secretCount, 200, 115, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatchLitAlpha(250, 117, 0, .4f, slash); - DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatch_CS(248, 115, slash); - IN_DrawNumber(totalSecret, 248, 115, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawNumber(players[CONSOLEPLAYER].secretCount, 200, 115, 3, + defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawShadowChar(248, 115, 14, GF_FONTB); + IN_DrawNumber(totalSecret, 248, 115, 3, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); if(interTime < 150) { @@ -735,18 +724,22 @@ void IN_DrawSingleStats(void) if(gameMode != extended || gameEpisode < 4) { - M_WriteText2(85, 160, "TIME", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - IN_DrawTime(155, 160, hours, minutes, seconds, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + M_WriteText2(85, 160, "TIME", GF_FONTB, defFontRGB[0], + defFontRGB[1], defFontRGB[2], 1); + IN_DrawTime(155, 160, hours, minutes, seconds, defFontRGB[0], + defFontRGB[1], defFontRGB[2], 1); } else { - x = 160 - M_StringWidth("NOW ENTERING:", huFontA) / 2; - M_WriteText2(x, 160, "NOW ENTERING:", huFontA, defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); + x = 160 - M_StringWidth("NOW ENTERING:", GF_FONTA) / 2; + M_WriteText2(x, 160, "NOW ENTERING:", GF_FONTA, defFontRGB2[0], + defFontRGB2[1], defFontRGB2[2], 1); levelname = P_GetShortMapName(gameEpisode, gameMap); - x = 160 - M_StringWidth(levelname, huFontB) / 2; - M_WriteText2(x, 170, levelname, huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + x = 160 - M_StringWidth(levelname, GF_FONTB) / 2; + M_WriteText2(x, 170, levelname, GF_FONTB, defFontRGB[0], + defFontRGB[1], defFontRGB[2], 1); skipIntermission = false; } @@ -763,15 +756,20 @@ void IN_DrawCoopStats(void) levelname = P_GetShortMapName(gameEpisode, prevMap); - M_WriteText2(95, 35, "KILLS", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - M_WriteText2(155, 35, "BONUS", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - M_WriteText2(232, 35, "SECRET", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + M_WriteText2(95, 35, "KILLS", GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); + M_WriteText2(155, 35, "BONUS", GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); + M_WriteText2(232, 35, "SECRET", GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); - x = 160 - M_StringWidth(levelname, huFontB) / 2; - M_WriteText2(x, 3, levelname, huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + x = 160 - M_StringWidth(levelname, GF_FONTB) / 2; + M_WriteText2(x, 3, levelname, GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); - x = 160 - M_StringWidth("FINISHED", huFontA) / 2; - M_WriteText2(x, 25, "FINISHED", huFontA, defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); + x = 160 - M_StringWidth("FINISHED", GF_FONTA) / 2; + M_WriteText2(x, 25, "FINISHED", GF_FONTA, defFontRGB2[0], + defFontRGB2[1], defFontRGB2[2], 1); ypos = 50; for(i = 0; i < NUMTEAMS; ++i) @@ -794,21 +792,16 @@ void IN_DrawCoopStats(void) sounds++; } - IN_DrawNumber(killPercent[i], 85, ypos + 10, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatchLitAlpha(123, ypos + 12, 0, .4f, percent); - - DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatch_CS(121, ypos + 10, percent); - IN_DrawNumber(bonusPercent[i], 160, ypos + 10, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatchLitAlpha(198, ypos + 12, 0, .4f, percent); - - DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatch_CS(196, ypos + 10, percent); - IN_DrawNumber(secretPercent[i], 237, ypos + 10, 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatchLitAlpha(275, ypos + 12, 0, .4f, percent); + IN_DrawNumber(killPercent[i], 85, ypos + 10, 3, defFontRGB[0], + defFontRGB[1], defFontRGB[2], 1); + IN_DrawShadowChar(121, ypos + 10, 5, GF_FONTB); + IN_DrawNumber(bonusPercent[i], 160, ypos + 10, 3, defFontRGB[0], + defFontRGB[1], defFontRGB[2], 1); - DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - GL_DrawPatch_CS(273, ypos + 10, percent); + IN_DrawShadowChar(196, ypos + 10, 5, GF_FONTB); + IN_DrawNumber(secretPercent[i], 237, ypos + 10, 3, + defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawShadowChar(273, ypos + 10, 5, GF_FONTB); ypos += 37; } } @@ -824,12 +817,15 @@ void IN_DrawDMStats(void) xpos = 90; ypos = 55; - M_WriteText2(265, 30, "TOTAL", huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - M_WriteText2(140, 8, "VICTIMS", huFontA, defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); + M_WriteText2(265, 30, "TOTAL", GF_FONTB, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); + M_WriteText2(140, 8, "VICTIMS", GF_FONTA, defFontRGB2[0], + defFontRGB2[1], defFontRGB2[2], 1); for(i = 0; i < 7; ++i) { - M_WriteText2(10, 80 + 9 * i, killersText[i], huFontA, defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); + M_WriteText2(10, 80 + 9 * i, killersText[i], GF_FONTA, + defFontRGB2[0], defFontRGB2[1], defFontRGB2[2], 1); } if(interTime < 20) @@ -843,8 +839,8 @@ void IN_DrawDMStats(void) dSlideY[i] * interTime) >> FRACBITS, patchFaceOkayBase + i); GL_DrawShadowedPatch(((xpos << FRACBITS) + - dSlideX[i] * interTime) >> FRACBITS, 18, - patchFaceDeadBase + i); + dSlideX[i] * interTime) >> FRACBITS, + 18, patchFaceDeadBase + i); } } @@ -884,9 +880,9 @@ void IN_DrawDMStats(void) { if(teamInfo[j].members) { - IN_DrawNumber(teamInfo[i].frags[j] - /*players[i].frags[j] */ , kpos, ypos + 10, - 3, defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); + IN_DrawNumber(teamInfo[i].frags[j], kpos, ypos + 10, + 3, defFontRGB[0], defFontRGB[1], + defFontRGB[2], 1); kpos += 43; } } @@ -918,7 +914,7 @@ void IN_DrawTime(int x, int y, int h, int m, int s, float r, float g, { IN_DrawNumber(h, x, y, 2, r, g, b, a); - M_WriteText2(x + 26, y, ":", huFontB, r, g, b, a); + M_WriteText2(x + 26, y, ":", GF_FONTB, r, g, b, a); } x += 34; @@ -928,107 +924,6 @@ void IN_DrawTime(int x, int y, int h, int m, int s, float r, float g, } x += 34; - M_WriteText2(x-8, y, ":", huFontB, r, g, b, a); + M_WriteText2(x-8, y, ":", GF_FONTB, r, g, b, a); IN_DrawNumber(s, x, y, 2, r, g, b, a); } - -void IN_DrawNumber(int val, int x, int y, int digits, float r, float g, - float b, float a) -{ - int xpos; - int oldval; - int realdigits; - boolean neg; - - oldval = val; - xpos = x; - neg = false; - realdigits = 1; - - if(val < 0) - { //...this should reflect negative frags. - val = -val; - neg = true; - if(val > 99) - { - val = 99; - } - } - - if(val > 9) - { - realdigits++; - if(digits < realdigits) - { - realdigits = digits; - val = 9; - } - } - - if(val > 99) - { - realdigits++; - if(digits < realdigits) - { - realdigits = digits; - val = 99; - } - } - - if(val > 999) - { - realdigits++; - if(digits < realdigits) - { - realdigits = digits; - val = 999; - } - } - - if(digits == 4) - { - GL_DrawPatchLitAlpha(xpos + 8 - huFontB[val / 1000].width / 2 - 12, y + 2, 0, .4f, numbers[val / 1000]); - DGL_Color4f(r, g, b, a); - GL_DrawPatch_CS(xpos + 6 - huFontB[val / 1000].width / 2 - 12, y, numbers[val / 1000]); - } - - if(digits > 2) - { - if(realdigits > 2) - { - GL_DrawPatchLitAlpha(xpos + 8 - huFontB[val / 100].width / 2, y+2, 0, .4f, numbers[val / 100]); - DGL_Color4f(r, g, b, a); - GL_DrawPatch_CS(xpos + 6 - huFontB[val / 100].width / 2, y, numbers[val / 100]); - } - xpos += 12; - } - - val = val % 100; - if(digits > 1) - { - if(val > 9) - { - GL_DrawPatchLitAlpha(xpos + 8 - huFontB[val / 10].width / 2, y+2, 0, .4f, numbers[val / 10]); - DGL_Color4f(r, g, b, a); - GL_DrawPatch_CS(xpos + 6 - huFontB[val / 10].width / 2, y, numbers[val / 10]); - } - else if(digits == 2 || oldval > 99) - { - GL_DrawPatchLitAlpha(xpos+2, y+2, 0, .4f, numbers[0]); - DGL_Color4f(r, g, b, a); - GL_DrawPatch_CS(xpos, y, numbers[0]); - } - xpos += 12; - } - - val = val % 10; - GL_DrawPatchLitAlpha(xpos + 8 - huFontB[val].width / 2, y+2, 0, .4f, numbers[val]); - DGL_Color4f(r, g, b, a); - GL_DrawPatch_CS(xpos + 6 - huFontB[val].width / 2, y, numbers[val]); - if(neg) - { - GL_DrawPatchLitAlpha(xpos + 8 - huFontB[negative].width / 2 - 12 * (realdigits), y+2, 0, .4f, negative); - DGL_Color4f(r, g, b, a); - GL_DrawPatch_CS(xpos + 6 - huFontB[negative].width / 2 - 12 * (realdigits), y, negative); - } -} diff --git a/doomsday/plugins/jheretic/src/p_enemy.c b/doomsday/plugins/jheretic/src/p_enemy.c index 96c98ba6f9..f3855c892c 100644 --- a/doomsday/plugins/jheretic/src/p_enemy.c +++ b/doomsday/plugins/jheretic/src/p_enemy.c @@ -1599,7 +1599,7 @@ void C_DECL A_MntrFloorFire(mobj_t *actor) mo = P_SpawnMobj3fv(MT_MNTRFX3, pos, angle, MTF_Z_FLOOR); mo->target = actor->target; - mo->mom[MX] = 1; // Force block checking. + mo->mom[MX] = 1.f / 16; // Force block checking. P_CheckMissileSpawn(mo); } diff --git a/doomsday/plugins/jheretic/src/st_stuff.c b/doomsday/plugins/jheretic/src/st_stuff.c index d0181bd8c2..47439f9455 100644 --- a/doomsday/plugins/jheretic/src/st_stuff.c +++ b/doomsday/plugins/jheretic/src/st_stuff.c @@ -140,7 +140,6 @@ DEFCC(CCmdStatusBarSize); // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- static void drawINumber(signed int val, int x, int y, float r, float g, float b, float a); -static void drawBNumber(signed int val, int x, int y, float Red, float Green, float Blue, float Alpha); // EXTERNAL DATA DECLARATIONS ---------------------------------------------- @@ -744,55 +743,6 @@ static void drawINumber(signed int val, int x, int y, float r, float g, GL_DrawPatch_CS(x + 18, y, iNumbers[val].lump); } -static void drawBNumber(signed int val, int x, int y, float red, - float green, float blue, float alpha) -{ - const dpatch_t* patch; - int xpos; - int oldval; - - oldval = val; - xpos = x; - if(val < 0) - { - val = 0; - } - - if(val > 99) - { - patch = &huFontB[15 + val / 100]; - - GL_DrawPatchLitAlpha(xpos + 8 - patch->width / 2, y +2, 0, alpha * .4f, - patch->lump); - DGL_Color4f(red, green, blue, alpha); - GL_DrawPatch_CS(xpos + 6 - patch->width / 2, y, patch->lump); - DGL_Color4f(1, 1, 1, 1); - } - - val = val % 100; - xpos += 12; - if(val > 9 || oldval > 99) - { - patch = &huFontB[15 + val / 10]; - - GL_DrawPatchLitAlpha(xpos + 8 - patch->width / 2, y +2, 0, alpha * .4f, - patch->lump); - DGL_Color4f(red, green, blue, alpha); - GL_DrawPatch_CS(xpos + 6 - patch->width / 2, y, patch->lump); - DGL_Color4f(1, 1, 1, 1); - } - - val = val % 10; - xpos += 12; - patch = &huFontB[15 + val]; - - GL_DrawPatchLitAlpha(xpos + 8 - patch->width / 2, y +2, 0, alpha * .4f, - patch->lump); - DGL_Color4f(red, green, blue, alpha); - GL_DrawPatch_CS(xpos + 6 - patch->width / 2, y, patch->lump); - DGL_Color4f(1, 1, 1, 1); -} - /** * Unhides the current HUD display if hidden. * @@ -998,13 +948,13 @@ Draw_BeginZoom(cfg.hudScale, 2, 198); { if(plr->plr->mo->health > 0) { - drawBNumber(plr->plr->mo->health, 2, 180, + HU_DrawBNumber(plr->plr->mo->health, 2, 180, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textAlpha); } else { - drawBNumber(0, 2, 180, cfg.hudColor[0], cfg.hudColor[1], + HU_DrawBNumber(0, 2, 180, cfg.hudColor[0], cfg.hudColor[1], cfg.hudColor[2], textAlpha); } } diff --git a/doomsday/plugins/jhexen/src/hconsole.c b/doomsday/plugins/jhexen/src/hconsole.c index 61df9bed41..b66167dcbd 100644 --- a/doomsday/plugins/jhexen/src/hconsole.c +++ b/doomsday/plugins/jhexen/src/hconsole.c @@ -269,7 +269,7 @@ int ConTextOut(const char *text, int x, int y) int old = typeInTime; typeInTime = 0xffffff; - M_WriteText2(x, y, text, huFontA, -1, -1, -1, -1); + M_WriteText2(x, y, text, GF_FONTA, -1, -1, -1, -1); typeInTime = old; return 0; } @@ -279,7 +279,7 @@ int ConTextOut(const char *text, int x, int y) */ int ConTextWidth(const char *text) { - return M_StringWidth(text, huFontA); + return M_StringWidth(text, GF_FONTA); } /** diff --git a/doomsday/plugins/jhexen/src/hrefresh.c b/doomsday/plugins/jhexen/src/hrefresh.c index ec324337ad..32db82b1f7 100644 --- a/doomsday/plugins/jhexen/src/hrefresh.c +++ b/doomsday/plugins/jhexen/src/hrefresh.c @@ -125,16 +125,16 @@ void R_DrawMapTitle(void) if(lname) { - M_WriteText3(160 - M_StringWidth(lname, huFontB) / 2, y, lname, - huFontB, defFontRGB[0], defFontRGB[1], defFontRGB[2], + M_WriteText3(160 - M_StringWidth(lname, GF_FONTB) / 2, y, lname, + GF_FONTB, defFontRGB[0], defFontRGB[1], defFontRGB[2], alpha, false, 0); y += 20; } if(lauthor) { - M_WriteText3(160 - M_StringWidth(lauthor, huFontA) / 2, y, lauthor, - huFontA, .5f, .5f, .5f, alpha, false, 0); + M_WriteText3(160 - M_StringWidth(lauthor, GF_FONTA) / 2, y, lauthor, + GF_FONTA, .5f, .5f, .5f, alpha, false, 0); } Draw_EndZoom(); diff --git a/doomsday/plugins/jhexen/src/in_lude.c b/doomsday/plugins/jhexen/src/in_lude.c index 42bd0df566..263c35cf7b 100644 --- a/doomsday/plugins/jhexen/src/in_lude.c +++ b/doomsday/plugins/jhexen/src/in_lude.c @@ -449,14 +449,14 @@ static void drawDeathTally(void) } else { - temp = M_StringWidth("--", huFontA) / 2; + temp = M_StringWidth("--", GF_FONTA) / 2; if(bold) { - M_WriteText2(x - temp, y, "--", huFontA, 1, 0.7f, 0.3f, 1); + M_WriteText2(x - temp, y, "--", GF_FONTA, 1, 0.7f, 0.3f, 1); } else { - M_WriteText2(x - temp, y, "--", huFontA, 1, 1, 1, 1); + M_WriteText2(x - temp, y, "--", GF_FONTA, 1, 1, 1, 1); } } } @@ -481,8 +481,8 @@ static void drawNumber(int val, int x, int y, int wrapThresh) sprintf(buff, "%d", val >= wrapThresh ? val % wrapThresh : val); } - M_WriteText2(x - M_StringWidth(buff, huFontA) / 2, y, buff, - huFontA, 1, 1, 1, 1); + M_WriteText2(x - M_StringWidth(buff, GF_FONTA) / 2, y, buff, + GF_FONTA, 1, 1, 1, 1); } static void drawNumberBold(int val, int x, int y, int wrapThresh) @@ -494,6 +494,6 @@ static void drawNumberBold(int val, int x, int y, int wrapThresh) sprintf(buff, "%d", val >= wrapThresh ? val % wrapThresh : val); } - M_WriteText2(x - M_StringWidth(buff, huFontA) / 2, y, buff, - huFontA, 1, 0.7f, 0.3f, 1); + M_WriteText2(x - M_StringWidth(buff, GF_FONTA) / 2, y, buff, + GF_FONTA, 1, 0.7f, 0.3f, 1); } diff --git a/doomsday/plugins/jhexen/src/st_stuff.c b/doomsday/plugins/jhexen/src/st_stuff.c index b1baa5456f..fa4bcce12a 100644 --- a/doomsday/plugins/jhexen/src/st_stuff.c +++ b/doomsday/plugins/jhexen/src/st_stuff.c @@ -149,8 +149,6 @@ DEFCC(CCmdStatusBarSize); static void DrINumber(signed int val, int x, int y, float r, float g, float b, float a); -static void DrBNumber(signed int val, int x, int y, float Red, float Green, - float Blue, float Alpha); // EXTERNAL DATA DECLARATIONS ---------------------------------------------- @@ -1351,61 +1349,6 @@ static void DrINumber(signed int val, int x, int y, float r, float g, } -void GL_DrawShadowedPatch2(float x, float y, float r, float g, float b, - float a, lumpnum_t lump) -{ - GL_DrawPatchLitAlpha(x + 2, y + 2, 0, a * .4f, lump); - DGL_Color4f(r, g, b, a); - GL_DrawPatch_CS(x, y, lump); - DGL_Color4f(1, 1, 1, 1); -} - -/** - * Draws a three digit number using FontB - */ -static void DrBNumber(int val, int x, int y, float red, float green, - float blue, float alpha) -{ - dpatch_t* patch; - int xpos; - int oldval; - - // Limit to three digits. - if(val > 999) - val = 999; - if(val < -999) - val = -999; - - oldval = val; - xpos = x; - if(val < 0) - { - val = 0; - } - - if(val > 99) - { - patch = &huFontB['0' - HU_FONTSTART + val / 100]; - GL_DrawShadowedPatch2(xpos + 6 - patch->width / 2, y, red, green, - blue, alpha, patch->lump); - } - - val = val % 100; - xpos += 12; - if(val > 9 || oldval > 99) - { - patch = &huFontB['0' - HU_FONTSTART + val / 10]; - GL_DrawShadowedPatch2(xpos + 6 - patch->width / 2, y, red, green, - blue, alpha, patch->lump); - } - - val = val % 10; - xpos += 12; - patch = &huFontB['0' - HU_FONTSTART + val]; - GL_DrawShadowedPatch2(xpos + 6 - patch->width / 2, y, red, green, blue, - alpha, patch->lump); -} - #if 0 // Unused atm /** * Displays sound debugging information.