Replace conchars with charset

This commit is contained in:
cypress 2024-09-11 20:07:31 -07:00
parent 3356a77745
commit 593345a7f0
10 changed files with 25 additions and 25 deletions

View file

@ -3277,7 +3277,7 @@ static void SCR_DrawCharToSnap (int num, qbyte *dest, int width)
{
size_t lumpsize;
qbyte lumptype;
draw_chars = W_GetLumpName("conchars", &lumpsize, &lumptype);
draw_chars = W_GetLumpName("charset", &lumpsize, &lumptype);
// if (lumptype != )
// draw_chars = NULL;
if (!draw_chars || lumpsize != 128*128)

View file

@ -7512,7 +7512,7 @@ qbyte *ReadRawImageFile(qbyte *buf, int len, int *width, int *height, uploadfmt_
return data;
}
else if (len == 128*128 || len == 128*256)
{ //conchars lump (or h2). 0 is transparent.
{ //charset lump (or h2). 0 is transparent.
qbyte *in = buf;
h = 128;
w = len/h;

View file

@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//These are the item types:
//mt_childwindow -
//mt_button - Executes a console command or callback on enter. Uses conchars.
//mt_button - Executes a console command or callback on enter. Uses charset.
//mt_buttonbigfont - Used by hexen2's menus. Uses gfx/menu/bigfont.lmp as it's characters.
//mt_box - A 2d box. The same one as the quit dialog from q1, but resized.
//mt_colouredbox - Not used.

View file

@ -480,17 +480,17 @@ qbyte *W_GetTexture(const char *name, int *width, int *height, uploadfmt_t *form
p = W_GetLumpName(name+4, &lumpsize, &lumptype);
if (p)
{
if (/*lumptype == TYP_MIPTEX && */!strcmp(name+4, "conchars") && (lumpsize==128*128
if (/*lumptype == TYP_MIPTEX && */!strcmp(name+4, "charset") && (lumpsize==128*128
#ifdef HAVE_LEGACY
|| (lumptype == TYP_QPIC&&lumpsize==8+128*128)
#endif
))
{ //conchars has no header.
{ //charset has no header.
qbyte *lump = (qbyte*)p;
extern cvar_t con_ocranaleds;
if (lumpsize==8+128*128)
Con_Printf(CON_WARNING"WARNING: gfx.wad conchars lump has incorrect lump size.\n");
Con_Printf(CON_WARNING"WARNING: gfx.wad charset lump has incorrect lump size.\n");
if (con_ocranaleds.ival)
{

View file

@ -25,7 +25,7 @@ static char *vidfilenames[] = //list of filenames to check to see if graphics st
"gfx.wad",
"gfx/conback.lmp"/*q1*/,"gfx/menu/conback.lmp"/*h2*/,"pics/conback.pcx"/*q2*/, //misc stuff
"gfx/palette.lmp", "pics/colormap.pcx",
"gfx/conchars.png", //conchars...
"gfx/charset.png", //charset...
"fonts/qfont.kfont", "gfx/mcharset.lmp", //menu fonts
};
@ -6604,7 +6604,7 @@ qboolean FS_ChangeGame(ftemanifest_t *man, qboolean allowreloadconfigs, qboolean
#ifdef HAVE_CLIENT
qboolean allowvidrestart = true;
char *vidfile[] = {"gfx.wad", "gfx/conback.lmp"/*q1*/,"gfx/menu/conback.lmp"/*h2*/,"pics/conback.pcx"/*q2*/, //misc stuff
"gfx/palette.lmp", "pics/colormap.pcx", "gfx/conchars.png"}; //palettes
"gfx/palette.lmp", "pics/colormap.pcx", "gfx/charset.png"}; //palettes
searchpathfuncs_t *vidpath[countof(vidfile)];
char *menufile[] = {"menu.dat"/*mods*/, "gfx/ttl_main.lmp"/*q1*/, "pics/m_main_quit.pcx"/*q2*/, "gfx/menu/title0.lmp"/*h2*/};
searchpathfuncs_t *menupath[countof(menufile)];

View file

@ -302,7 +302,7 @@ typedef struct fontface_s
static fontface_t *faces;
#define GEN_CONCHAR_GLYPHS 0 //set to 0 or 1 to define whether to generate glyphs from conchars too, or if it should just draw them as glquake always used to
#define GEN_CONCHAR_GLYPHS 0 //set to 0 or 1 to define whether to generate glyphs from charset too, or if it should just draw them as glquake always used to
extern cvar_t cl_noblink;
extern cvar_t con_ocranaleds;
@ -1260,7 +1260,7 @@ static struct charcache_s *Font_TryLoadGlyph(font_t *f, CHARIDXTYPE charidx)
unsigned char *s;
int scale;
int x,y, ys;
qbyte *draw_chars = W_GetLumpName("conchars");
qbyte *draw_chars = W_GetLumpName("charset");
if (draw_chars)
{
d = img;
@ -2039,12 +2039,12 @@ static texid_t Font_LoadReplacementConchars(void)
{
texid_t tex;
//q1 replacement
tex = R_LoadHiResTexture("gfx/conchars.lmp", NULL, (r_font_linear.ival?IF_LINEAR:IF_NEAREST)|IF_PREMULTIPLYALPHA|IF_LOADNOW|IF_UIPIC|IF_NOMIPMAP|IF_NOGAMMA|IF_NOPURGE);
tex = R_LoadHiResTexture("gfx/charset.lmp", NULL, (r_font_linear.ival?IF_LINEAR:IF_NEAREST)|IF_PREMULTIPLYALPHA|IF_LOADNOW|IF_UIPIC|IF_NOMIPMAP|IF_NOGAMMA|IF_NOPURGE);
TEXDOWAIT(tex);
if (TEXLOADED(tex))
return tex;
//q2
tex = R_LoadHiResTexture("pics/conchars.pcx", NULL, (r_font_linear.ival?IF_LINEAR:IF_NEAREST)|IF_PREMULTIPLYALPHA|IF_LOADNOW|IF_UIPIC|IF_NOMIPMAP|IF_NOGAMMA|IF_NOPURGE);
tex = R_LoadHiResTexture("pics/charset.pcx", NULL, (r_font_linear.ival?IF_LINEAR:IF_NEAREST)|IF_PREMULTIPLYALPHA|IF_LOADNOW|IF_UIPIC|IF_NOMIPMAP|IF_NOGAMMA|IF_NOPURGE);
TEXDOWAIT(tex);
if (TEXLOADED(tex))
return tex;
@ -2059,14 +2059,14 @@ static texid_t Font_LoadReplacementConchars(void)
#ifdef HEXEN2
static texid_t Font_LoadHexen2Conchars(qboolean iso88591)
{
//gulp... so it's come to this has it? rework the hexen2 conchars into the q1 system.
//gulp... so it's come to this has it? rework the hexen2 charset into the q1 system.
texid_t tex;
unsigned int i, x;
unsigned char *tempchars;
unsigned char *in, *out, *outbuf;
FS_LoadFile("gfx/menu/conchars.lmp", (void**)&tempchars);
FS_LoadFile("gfx/menu/charset.lmp", (void**)&tempchars);
/*hexen2's conchars are arranged 32-wide, 16 high.
/*hexen2's charset are arranged 32-wide, 16 high.
the upper 8 rows are 256 8859-1 chars
the lower 8 rows are a separate set of recoloured 8859-1 chars.
@ -2177,7 +2177,7 @@ static texid_t Font_LoadFallbackConchars(void)
int width, height;
unsigned int i;
uploadfmt_t format;
qbyte *lump = ReadRawImageFile(default_conchar, sizeof(default_conchar), &width, &height, &format, false, "conchars");
qbyte *lump = ReadRawImageFile(default_conchar, sizeof(default_conchar), &width, &height, &format, false, "charset");
if (!lump || (format != PTI_RGBX8 && format != PTI_RGBA8 && format != PTI_LLLX8))
return r_nulltex;
/*convert greyscale to alpha*/
@ -2226,7 +2226,7 @@ static texid_t Font_LoadDefaultConchars(enum fontfmt_e *fmt)
*fmt = FMT_QUAKE;
return tex;
}
Sys_Error("Unable to load any conchars\n");
Sys_Error("Unable to load any charset\n");
}
typedef struct
@ -2645,7 +2645,7 @@ struct font_s *Font_LoadFont(const char *fontfilename, float vheight, float scal
}
if (!f->faces && !TEXLOADED(f->singletexture) && r_font_linear.ival)
Font_LoadFontLump(f, "conchars");
Font_LoadFontLump(f, "charset");
defaultplane = INVALIDPLANE;/*assume the bitmap plane - don't use the fallback as people don't think to use com_parseutf8*/
if (!explicit && TEXLOADED(f->singletexture))

View file

@ -2343,7 +2343,7 @@ static void XIMPreEditDrawCallback(XIM ic, XPointer client_data, XIMPreeditDrawC
{
//so inputs are in terms of chars.
//our conchar_t struct is variable-sized (*sigh*), so we always use our longchar encoding.
//so we end up with two conchars per wchar.
//so we end up with two charset per wchar.
part[0] = vid.ime_preview;
clen[0] = bound(0, d->chg_first, vid.ime_previewlen/2)*2;
part[1] = NULL;

View file

@ -1545,7 +1545,7 @@ static void ImgTool_Enumerate(struct opts_s *args, const char *inname, void(*cal
unsigned int h=0;
in = NULL;
if (!strcasecmp(e->name, "CONCHARS") && (e->size==128*128 || e->size==128*128+8))
{ //special hack for buggy conchars, which is listed as a miptex for some reason, with no qpic header (it not being a qpic lump)
{ //special hack for buggy charset, which is listed as a miptex for some reason, with no qpic header (it not being a qpic lump)
printf("\t%16.16s: corrupt CONCHARS lump - wrongly marked as qpic. Treating as a legacy engine would...\n", e->name);
in = Z_Malloc(sizeof(*in));
in->encoding = TF_H2_TRANS8_0;
@ -1611,7 +1611,7 @@ static void ImgTool_Enumerate(struct opts_s *args, const char *inname, void(*cal
miptex_t *mip = (miptex_t *)(indata+e->offset);
if (!strcasecmp(e->name, "CONCHARS") && e->size==128*128)
{ //special hack for conchars, which is listed as a miptex for some reason, with no qpic header (it not being a qpic lump)
{ //special hack for charset, which is listed as a miptex for some reason, with no qpic header (it not being a qpic lump)
in = Z_Malloc(sizeof(*in));
in->encoding = TF_H2_TRANS8_0;
in->mip[0].data = indata+e->offset+8;
@ -2006,7 +2006,7 @@ static void ImgTool_WadExtract(struct opts_s *args, const char *wadname)
miptex_t *mip = (miptex_t *)(indata+e->offset);
if (!strcasecmp(e->name, "CONCHARS") && e->size==128*128)
{ //special hack for conchars, which is listed as a miptex for some reason, with no qpic header (it not being a qpic lump)
{ //special hack for charset, which is listed as a miptex for some reason, with no qpic header (it not being a qpic lump)
struct pendingtextureinfo *out = Z_Malloc(sizeof(*out));
out->encoding = TF_H2_TRANS8_0;
out->type = PTI_2D;
@ -2016,7 +2016,7 @@ static void ImgTool_WadExtract(struct opts_s *args, const char *wadname)
out->mip[0].datasize = out->mip[0].width*out->mip[0].height*out->mip[0].depth;
out->mip[0].data = (char*)mip;
out->mipcount = 1;
ImgTool_Convert(args, out, "conchars", NULL);
ImgTool_Convert(args, out, "charset", NULL);
break;
}

View file

@ -610,7 +610,7 @@ void UI_SbarInit(void)
ibarback = Draw_LoadImage("ibar", true);
sbarback = Draw_LoadImage("sbar", true);
con_chars = Draw_LoadImage("conchars", true);
con_chars = Draw_LoadImage("charset", true);
//load images.
for (i = 0; i < 10; i++)

View file

@ -37,7 +37,7 @@ static void LoadPics(void)
char buffer[256];
//main bar (add cvars later)
con_chars = drawfuncs->LoadImage("gfx/conchars.lmp");
con_chars = drawfuncs->LoadImage("gfx/charset.lmp");
cvarfuncs->GetString("cl_cursor", buffer, sizeof(buffer));
if (*buffer)
pic_cursor = drawfuncs->LoadImage(buffer);