Font Kerning Implementation

This commit is contained in:
cypress 2024-08-31 13:53:27 -07:00
parent 21e0494fe9
commit cf6f4c3bf8
5 changed files with 187 additions and 118 deletions

View file

@ -285,7 +285,7 @@ void HUD_EndScreen (void)
l = scoreboardlines;
Draw_ColoredString((vid.width - 9*8)/2, 40, "GAME OVER", 255, 0, 0, 255, 1);
Draw_ColoredStringCentered(40, "GAME OVER", 255, 0, 0, 255, 1);
sprintf (str,"You survived %3i rounds", cl.stats[STAT_ROUNDS]);
Draw_String ((vid.width - strlen (str)*8)/2, 52, str);
@ -407,7 +407,7 @@ void HUD_Points (void)
}
}
Draw_Pic (x, y, sb_moneyback);
xplus = strlen(va("%i", current_points))*8;
xplus = getTextWidth(va("%i", current_points), 1);
Draw_String (((64 - xplus)/2)+5, y + 3, va("%i", current_points));
@ -567,7 +567,7 @@ void HUD_MaxAmmo(void)
maxammoy -= cl.time * 0.003;
maxammoopac -= 5;
Draw_ColoredString(vid.width/2 - strlen("MAX AMMO!")/2, maxammoy, "MAX AMMO!", 255, 255, 255, maxammoopac, 1);
Draw_ColoredStringCentered(maxammoy, "MAX AMMO!", 255, 255, 255, maxammoopac, 1);
if (maxammoopac <= 0) {
domaxammo = false;
@ -609,7 +609,7 @@ void HUD_Rounds (void)
if (!value)
value = 255;
Draw_ColoredString(vid.width/2 - (strlen("Round")*16)/2, 80, "Round", 255, value, value, 255, 2);
Draw_ColoredStringCentered(80, "Round", 255, value, value, 255, 2);
value -= cl.time * 0.4;
@ -623,7 +623,7 @@ void HUD_Rounds (void)
// Now, fade out, and start fading worldtext in
// ~3s for fade out,
else if (textstate == 1) {
Draw_ColoredString(vid.width/2 - (strlen("Round")*16)/2, 80, "Round", 255, 0, 0, value, 2);
Draw_ColoredStringCentered(80, "Round", 255, 0, 0, value, 2);
HUD_WorldText(value2);
Draw_ColoredString(4, vid.height/2 + 6, "'Nazi Zombies'", 255, 255, 255, value2, 1);
@ -1293,16 +1293,16 @@ void HUD_Ammo (void)
char* magstring;
int reslen;
reslen = strlen(va("/%i", cl.stats[STAT_AMMO]));
reslen = getTextWidth(va("/%i", cl.stats[STAT_AMMO]), 1);
//
// Magazine
//
magstring = va("%i", cl.stats[STAT_CURRENTMAG]);
if (GetLowAmmo(cl.stats[STAT_ACTIVEWEAPON], 1) >= cl.stats[STAT_CURRENTMAG]) {
Draw_ColoredString((355-(reslen*8)) - strlen(magstring)*8, 218, magstring, 255, 0, 0, 255, 1);
Draw_ColoredString((355-(reslen)) - getTextWidth(magstring, 1), 218, magstring, 255, 0, 0, 255, 1);
} else {
Draw_ColoredString((355-(reslen*8)) - strlen(magstring)*8, 218, magstring, 255, 255, 255, 255, 1);
Draw_ColoredString((355-(reslen)) - getTextWidth(magstring, 1), 218, magstring, 255, 255, 255, 255, 1);
}
//
@ -1310,9 +1310,9 @@ void HUD_Ammo (void)
//
magstring = va("/%i", cl.stats[STAT_AMMO]);
if (GetLowAmmo(cl.stats[STAT_ACTIVEWEAPON], 0) >= cl.stats[STAT_AMMO]) {
Draw_ColoredString(355 - strlen(magstring)*8, 218, magstring, 255, 0, 0, 255, 1);
Draw_ColoredString(355 - getTextWidth(magstring, 1), 218, magstring, 255, 0, 0, 255, 1);
} else {
Draw_ColoredString(355 - strlen(magstring)*8, 218, magstring, 255, 255, 255, 255, 1);
Draw_ColoredString(355 - getTextWidth(magstring, 1), 218, magstring, 255, 255, 255, 255, 1);
}
}
@ -1326,17 +1326,12 @@ void HUD_AmmoString (void)
{
if (GetLowAmmo(cl.stats[STAT_ACTIVEWEAPON], 1) >= cl.stats[STAT_CURRENTMAG])
{
int x;
if (0 < cl.stats[STAT_AMMO] && cl.stats[STAT_CURRENTMAG] >= 0) {
x = (vid.width - strlen("Reload")*8)/2;
Draw_ColoredString (x, 140, "Reload", 255, 255, 255, 255, 1);
Draw_ColoredStringCentered(140, "Reload", 255, 255, 255, 255, 1);
} else if (0 < cl.stats[STAT_CURRENTMAG]) {
x = (vid.width - strlen("LOW AMMO")*8)/2;
Draw_ColoredString (x, 140, "LOW AMMO", 255, 255, 0, 255, 1);
Draw_ColoredStringCentered(140, "LOW AMMO", 255, 255, 0, 255, 1);
} else {
x = (vid.width - strlen("NO AMMO")*8)/2;
Draw_ColoredString (x, 140, "NO AMMO", 255, 0, 0, 255, 1);
Draw_ColoredStringCentered(140, "NO AMMO", 255, 0, 0, 255, 1);
}
}
}
@ -1384,7 +1379,7 @@ void HUD_Weapon (void)
strcpy(str, pr_strings+sv_player->v.Weapon_Name);
l = strlen(str);
x_value = 355 - l*8;
x_value = 355 - getTextWidth(str, 1);
Draw_String (x_value, y_value, str);
}
@ -1398,16 +1393,16 @@ void HUD_BettyPrompt (void)
char str[32];
char str2[32];
strcpy(str, va("Tap SWAP then press %s to\n", GetGrenadeButtonL()));
strcpy(str, va("Tap SWAP then press %s to\n", GetGrenadeButtonL()));
strcpy(str2, "place a Bouncing Betty\n");
int x, x2;
x = (vid.width - strlen(str)*8)/2;
x2 = (vid.width - strlen(str2)*8)/2;
int x;
x = (vid.width - getTextWidth(str, 1))/2;
Draw_String(x, 60, str);
Draw_String(x2, 72, str2);
Draw_Pic (x + 20*8 - 4, 56, GetButtonIcon("+grenade"));
Draw_ColoredStringCentered(60, str, 255, 255, 255, 255, 1);
Draw_ColoredStringCentered(72, str2, 255, 255, 255, 255, 1);
Draw_Pic (x + getTextWidth("Tap SWAP then press ", 1) - 4, 56, GetButtonIcon("+grenade"));
}
/*

View file

@ -41,12 +41,15 @@ void Draw_FillByColor (int x, int y, int w, int h, float r, float g, float b, fl
void Draw_FadeScreen (void);
void Draw_String (int x, int y, char *str);
void Draw_ColoredString(int x, int y, char *text, float r, float g, float b, float a, int scale);
void Draw_ColoredStringCentered(int y, char *text, float r, float g, float b, float a, int scale);
qpic_t *Draw_PicFromWad (char *name);
qpic_t *Draw_CachePic (char *path);
int getTextWidth(char *str, int scale);
extern float loading_cur_step;
extern int loading_step;
extern char loading_name[32];
extern float loading_num_step;
extern int font_kerningamount[96];
void Clear_LoadingFill (void);

View file

@ -366,6 +366,40 @@ void Draw_TextureMode_f (void)
}
}
// ! " # $ % & ' ( ) * _ , - . / 0
// 1 2 3 4 5 6 7 8 9 : ; < = > ? @
// A B C D E F G H I J K L M N O P
// Q R S T U V W X Y Z [ \ ] ^ _ `
// a b c d e f g h i j k l m n o p
// q r s t u v w x y z { | } ~
int font_kerningamount[96];
void InitKerningMap(void)
{
// Initialize the kerning amount as 8px for each
// char in the event we cant load the file.
for(int i = 0; i < 96; i++) {
font_kerningamount[i] = 8;
}
FILE *kerning_map = fopen(va("%s/gfx/kerning_map.txt", com_gamedir), "r");
if (kerning_map == NULL) {
return;
}
char buffer[1024];
if (fgets(buffer, sizeof(buffer), kerning_map) != NULL) {
char *token = strtok(buffer, ",");
int i = 0;
while (token != NULL && i < 96) {
font_kerningamount[i++] = atoi(token);
token = strtok(NULL, ",");
}
}
fclose(kerning_map);
}
/*
===============
Draw_Init
@ -416,6 +450,8 @@ void Draw_Init (void)
sniper_scope = Draw_CachePic ("gfx/hud/scope");
Clear_LoadingFill ();
InitKerningMap();
}
@ -470,7 +506,7 @@ void Draw_Character (int x, int y, int num)
Draw_CharacterRGBA
This is the same as Draw_Character, but with RGBA color codes.
- MotoLegacy
- Cypress
================
*/
extern cvar_t scr_coloredtext;
@ -531,11 +567,42 @@ void Draw_ColoredString(int x, int y, char *str, float r, float g, float b, floa
while (*str)
{
Draw_CharacterRGBA (x, y, *str, r, g, b, a, scale);
// Hooray for variable-spacing!
if (*str == ' ')
x += 4 * scale;
else if ((int)*str < 33 || (int)*str > 126)
x += 8 * scale;
else
x += (font_kerningamount[(int)(*str - 33)] + 1) * scale;
str++;
x += 8*scale;
}
}
int getTextWidth(char *str, int scale)
{
int width = 0;
for (int i = 0; i < strlen(str); i++) {
// Hooray for variable-spacing!
if (str[i] == ' ')
width += 4 * scale;
else if ((int)str[i] < 33 || (int)str[i] > 126)
width += 8 * scale;
else
width += (font_kerningamount[(int)(str[i] - 33)] + 1) * scale;
}
return width;
}
void Draw_ColoredStringCentered(int y, char *str, float r, float g, float b, float a, int scale)
{
Draw_ColoredString((vid.width - getTextWidth(str, scale))/2, y, str, r, g, b, a, scale);
}
/*
================
Draw_DebugChar
@ -814,9 +881,8 @@ void Draw_LoadingFill(void)
case 4: text = "Loading Sounds.."; break;
default: text = "Initializing.."; break;
}
l = strlen (text);
Draw_String((vid.width - l*8)/2, y, text);
Draw_ColoredStringCentered(y, text, 255, 255, 255, 255, 1);
loading_cur_step_bk = loading_cur_step;
}

View file

@ -197,10 +197,19 @@ void SCR_DrawCenterString (void)
for (l=0 ; l<40 ; l++)
if (start[l] == '\n' || !start[l])
break;
x = (vid.width - l*8)/2;
for (j=0 ; j<l ; j++, x+=8)
x = (vid.width - getTextWidth(start, 1))/2;
for (j=0 ; j<l ; j++)
{
Draw_Character (x, y, start[j]);
// Hooray for variable-spacing!
if (start[j] == ' ')
x += 4;
else if ((int)start[j] < 33 || (int)start[j] > 126)
x += 8;
else
x += (font_kerningamount[(int)(start[j] - 33)] + 1);
if (!remaining--)
return;
}
@ -403,39 +412,39 @@ void SCR_UsePrint (int type, int cost, int weapon)
strcpy(c, "");
break;
case 1://door
strcpy(s, va("Hold %s to open Door\n", GetUseButtonL()));
strcpy(s, va("Hold %s to open Door\n", GetUseButtonL()));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 2://debris
strcpy(s, va("Hold %s to remove Debris\n", GetUseButtonL()));
strcpy(s, va("Hold %s to remove Debris\n", GetUseButtonL()));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 3://ammo
strcpy(s, va("Hold %s to buy Ammo for %s\n", GetUseButtonL(), pr_strings+sv_player->v.Weapon_Name_Touch));
strcpy(s, va("Hold %s to buy Ammo for %s\n", GetUseButtonL(), pr_strings+sv_player->v.Weapon_Name_Touch));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 4://weapon
strcpy(s, va("Hold %s to buy %s\n", GetUseButtonL(), pr_strings+sv_player->v.Weapon_Name_Touch));
strcpy(s, va("Hold %s to buy %s\n", GetUseButtonL(), pr_strings+sv_player->v.Weapon_Name_Touch));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 5://window
strcpy(s, va("Hold %s to Rebuild Barrier\n", GetUseButtonL()));
strcpy(s, va("Hold %s to Rebuild Barrier\n", GetUseButtonL()));
strcpy(c, "");
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 6://box
strcpy(s, va("Hold %s to for Mystery Box\n", GetUseButtonL()));
strcpy(s, va("Hold %s to for Mystery Box\n", GetUseButtonL()));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 7://box take
strcpy(s, va("Hold %s for %s\n", GetUseButtonL(), pr_strings+sv_player->v.Weapon_Name_Touch));
strcpy(s, va("Hold %s for %s\n", GetUseButtonL(), pr_strings+sv_player->v.Weapon_Name_Touch));
strcpy(c, "");
button_pic_x = 6;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 8://power
strcpy(s, "The Power must be Activated first\n");
@ -443,39 +452,39 @@ void SCR_UsePrint (int type, int cost, int weapon)
button_pic_x = 100;
break;
case 9://perk
strcpy(s, va("Hold %s to buy %s\n", GetUseButtonL(), GetPerkName(weapon)));
strcpy(s, va("Hold %s to buy %s\n", GetUseButtonL(), GetPerkName(weapon)));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 10://turn on power
strcpy(s, va("Hold %s to Turn On the Power\n", GetUseButtonL()));
strcpy(s, va("Hold %s to Turn On the Power\n", GetUseButtonL()));
strcpy(c, "");
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 11://turn on trap
strcpy(s, va("Hold %s to Activate the Trap\n", GetUseButtonL()));
strcpy(s, va("Hold %s to Activate the Trap\n", GetUseButtonL()));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 12://PAP
strcpy(s, va("Hold %s to Pack-a-Punch\n", GetUseButtonL()));
strcpy(s, va("Hold %s to Pack-a-Punch\n", GetUseButtonL()));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 13://revive
strcpy(s, va("Hold %s to Fix your Code.. :)\n", GetUseButtonL()));
strcpy(s, va("Hold %s to Fix your Code.. :)\n", GetUseButtonL()));
strcpy(c, "");
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 14://use teleporter (free)
strcpy(s, va("Hold %s to use Teleporter\n", GetUseButtonL()));
strcpy(s, va("Hold %s to use Teleporter\n", GetUseButtonL()));
strcpy(c, "");
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 15://use teleporter (cost)
strcpy(s, va("Hold %s to use Teleporter\n", GetUseButtonL()));
strcpy(s, va("Hold %s to use Teleporter\n", GetUseButtonL()));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 16://tp cooldown
strcpy(s, "Teleporter is cooling down\n");
@ -483,9 +492,9 @@ void SCR_UsePrint (int type, int cost, int weapon)
button_pic_x = 100;
break;
case 17://link
strcpy(s, va("Hold %s to initiate link to pad\n", GetUseButtonL()));
strcpy(s, va("Hold %s to initiate link to pad\n", GetUseButtonL()));
strcpy(c, "");
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 18://no link
strcpy(s, "Link not active\n");
@ -493,14 +502,14 @@ void SCR_UsePrint (int type, int cost, int weapon)
button_pic_x = 100;
break;
case 19://finish link
strcpy(s, va("Hold %s to link pad with core\n", GetUseButtonL()));
strcpy(s, va("Hold %s to link pad with core\n", GetUseButtonL()));
strcpy(c, "");
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
case 20://buyable ending
strcpy(s, va("Hold %s to End the Game\n", GetUseButtonL()));
strcpy(s, va("Hold %s to End the Game\n", GetUseButtonL()));
strcpy(c, va("[Cost: %i]\n", cost));
button_pic_x = 5;
button_pic_x = getTextWidth("Hold ", 1);
break;
default:
Con_Printf ("No type defined in engine for useprint\n");
@ -515,23 +524,21 @@ void SCR_UsePrint (int type, int cost, int weapon)
void SCR_DrawUseString (void)
{
int l, l2;
int x, x2, y;
int y;
int x;
if (cl.stats[STAT_HEALTH] < 0)
return;
// the finale prints the characters one at a time
y = 160;
l = strlen (scr_usestring);
x = (vid.width - l*8)/2;
x = (vid.width - getTextWidth(scr_usestring, 1))/2;
l2 = strlen (scr_usestring2);
x2 = (vid.width - l2*8)/2;
Draw_ColoredStringCentered(y, scr_usestring, 255, 255, 255, 255, 1);
Draw_ColoredStringCentered(y + 10, scr_usestring2, 255, 255, 255, 255, 1);
Draw_String (x, y, scr_usestring);
Draw_String (x2, y + 10, scr_usestring2);
Draw_Pic (x + button_pic_x*8, y - 4, GetButtonIcon("+use"));
if (button_pic_x != 100)
Draw_Pic (x + button_pic_x, y - 4, GetButtonIcon("+use"));
}
void SCR_CheckDrawUseString (void)
@ -823,7 +830,6 @@ SCR_DrawLoadScreen
double loadingtimechange;
int loadingdot;
int loadingtextwidth;
char *lodinglinetext;
qpic_t *awoo;
char *ReturnLoadingtex (void)
@ -1113,12 +1119,11 @@ void SCR_DrawLoadScreen (void)
if (loadingtimechange < Sys_FloatTime ())
{
lodinglinetext = ReturnLoadingtex();
loadingtextwidth = strlen(lodinglinetext)*8;
loadingtimechange = Sys_FloatTime () + 5;
}
if (key_dest == key_game) {
Draw_ColoredString(vid.width/2 - loadingtextwidth/2, 225, lodinglinetext, 255, 255, 255, 255, 1);
Draw_ColoredStringCentered(225, lodinglinetext, 255, 255, 255, 255, 1);
if (strcmp(lodinglinetext, "Please help me find the meaning of . Thanks.") == 0) {
Draw_Pic(280, 225, awoo);

View file

@ -416,7 +416,7 @@ void M_Main_Draw (void)
Draw_FillByColor(0, 0, 400, 240, 0, 0, 0, 102);
// Version String
Draw_ColoredString((vid.width - (strlen(game_build_date) * 8)) + 4, 5, game_build_date, 255, 255, 255, 255, 1);
Draw_ColoredString((vid.width - getTextWidth(game_build_date, 1)) + 4, 5, game_build_date, 255, 255, 255, 255, 1);
// Header
Draw_ColoredString(5, 5, "MAIN MENU", 255, 255, 255, 255, 2);
@ -788,46 +788,46 @@ void M_SinglePlayer_Draw (void)
switch(m_singleplayer_cursor) {
case 0:
menu_ndu = Draw_CachePic("gfx/menu/nacht_der_untoten");
Draw_StretchPic(195, 40, menu_ndu, 175, 100);
Draw_ColoredString(140, 148, "Desolate bunker located on a Ge-", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 158, "rman airfield, stranded after a", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 168, "brutal plane crash surrounded by", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 178, "hordes of undead. Exploit myste-", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 188, "rious forces at play and hold o-", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 198, "ut against relentless waves. Der", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 208, "Anstieg ist jetzt. Will you fall", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 218, "to the overwhelming onslaught?", 255, 255, 255, 255, 1);
Draw_StretchPic(185, 40, menu_ndu, 175, 100);
Draw_ColoredString(180, 148, "Desolate bunker located on a Ge-", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 158, "rman airfield, stranded after a", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 168, "brutal plane crash surrounded by", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 178, "hordes of undead. Exploit myste-", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 188, "rious forces at play and hold o-", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 198, "ut against relentless waves. Der", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 208, "Anstieg ist jetzt. Will you fall", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 218, "to the overwhelming onslaught?", 255, 255, 255, 255, 1);
break;
case 1:
menu_wh2 = Draw_CachePic("gfx/menu/nzp_warehouse2");
Draw_StretchPic(195, 40, menu_wh2, 175, 100);
Draw_ColoredString(140, 148, "Four nameless marines find them-", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 158, "selves at a forsaken warehouse,", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 168, "or is it something more? Fight", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 178, "your way to uncovering its sec-", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 188, "rets, though you may not like", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 198, "what you find..", 255, 255, 255, 255, 1);
Draw_StretchPic(185, 40, menu_wh2, 175, 100);
Draw_ColoredString(180, 148, "Four nameless marines find them-", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 158, "selves at a forsaken warehouse,", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 168, "or is it something more? Fight", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 178, "your way to uncovering its sec-", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 188, "rets, though you may not like", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 198, "what you find..", 255, 255, 255, 255, 1);
break;
case 2:
menu_wh = Draw_CachePic("gfx/menu/nzp_warehouse");
Draw_StretchPic(195, 40, menu_wh, 175, 100);
Draw_ColoredString(140, 148, "Old Warehouse full of Zombies!", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 158, "Fight your way to the Power", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 168, "Switch through the Hordes!", 255, 255, 255, 255, 1);
Draw_StretchPic(185, 40, menu_wh, 175, 100);
Draw_ColoredString(180, 148, "Old Warehouse full of Zombies!", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 158, "Fight your way to the Power", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 168, "Switch through the Hordes!", 255, 255, 255, 255, 1);
break;
case 3:
menu_ch = Draw_CachePic("gfx/menu/christmas_special");
Draw_StretchPic(195, 40, menu_ch, 175, 100);
Draw_ColoredString(140, 148, "No Santa this year. Though we're", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 158, "sure you will get presents from", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 168, "the undead! Will you accept them?", 255, 255, 255, 255, 1);
Draw_StretchPic(185, 40, menu_ch, 175, 100);
Draw_ColoredString(180, 148, "No Santa this year. Though we're", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 158, "sure you will get presents from", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 168, "the undead! Will you accept them?", 255, 255, 255, 255, 1);
break;
case 4:
menu_custom = Draw_CachePic("gfx/menu/custom");
Draw_StretchPic(195, 40, menu_custom, 175, 100);
Draw_ColoredString(140, 148, "Custom Maps made by Community", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 158, "Members on GitHub and on the", 255, 255, 255, 255, 1);
Draw_ColoredString(140, 168, "NZ:P Forum!", 255, 255, 255, 255, 1);
Draw_StretchPic(185, 40, menu_custom, 175, 100);
Draw_ColoredString(180, 148, "Custom Maps made by Community", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 158, "Members on GitHub and on the", 255, 255, 255, 255, 1);
Draw_ColoredString(180, 168, "NZ:P Forum!", 255, 255, 255, 255, 1);
break;
}
}
@ -1093,7 +1093,7 @@ void M_Menu_CustomMaps_Draw (void)
if (custom_maps[i + multiplier].map_use_thumbnail == 1) {
menu_cuthum = Draw_CachePic(custom_maps[i + multiplier].map_thumbnail_path);
if (menu_cuthum != NULL) {
Draw_StretchPic(195, 40, menu_cuthum, 175, 100);
Draw_StretchPic(185, 40, menu_cuthum, 175, 100);
}
}
@ -1104,55 +1104,55 @@ void M_Menu_CustomMaps_Draw (void)
if (custom_maps[i + multiplier].map_desc_1 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_1, " ") != 0) {
Draw_ColoredString(140, 148, custom_maps[i + multiplier].map_desc_1, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 148, custom_maps[i + multiplier].map_desc_1, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_desc_2 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_2, " ") != 0) {
line_increment++;
Draw_ColoredString(140, 158, custom_maps[i + multiplier].map_desc_2, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 158, custom_maps[i + multiplier].map_desc_2, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_desc_3 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_3, " ") != 0) {
line_increment++;
Draw_ColoredString(140, 168, custom_maps[i + multiplier].map_desc_3, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 168, custom_maps[i + multiplier].map_desc_3, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_desc_4 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_4, " ") != 0) {
line_increment++;
Draw_ColoredString(140, 178, custom_maps[i + multiplier].map_desc_4, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 178, custom_maps[i + multiplier].map_desc_4, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_desc_5 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_5, " ") != 0) {
line_increment++;
Draw_ColoredString(140, 188, custom_maps[i + multiplier].map_desc_5, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 188, custom_maps[i + multiplier].map_desc_5, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_desc_6 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_6, " ") != 0) {
line_increment++;
Draw_ColoredString(140, 198, custom_maps[i + multiplier].map_desc_6, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 198, custom_maps[i + multiplier].map_desc_6, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_desc_7 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_7, " ") != 0) {
line_increment++;
Draw_ColoredString(140, 208, custom_maps[i + multiplier].map_desc_7, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 208, custom_maps[i + multiplier].map_desc_7, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_desc_8 != 0) {
if (strcmp(custom_maps[i + multiplier].map_desc_8, " ") != 0) {
line_increment++;
Draw_ColoredString(140, 218, custom_maps[i + multiplier].map_desc_8, 255, 255, 255, 255, 1);
Draw_ColoredString(180, 218, custom_maps[i + multiplier].map_desc_8, 255, 255, 255, 255, 1);
}
}
if (custom_maps[i + multiplier].map_author != 0) {
if (strcmp(custom_maps[i + multiplier].map_author, " ") != 0) {
int y = 158 + (10 * line_increment);
Draw_ColoredString(140, y, custom_maps[i + multiplier].map_author, 255, 255, 0, 255, 1);
Draw_ColoredString(180, y, custom_maps[i + multiplier].map_author, 255, 255, 0, 255, 1);
}
}
} else {