From b0b4725119640b40472b4cb305dc0f59122b19f2 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Sun, 13 Aug 2023 01:52:04 +0100 Subject: [PATCH] Fix up PACKAGE_DOOMWAD --- engine/client/renderer.c | 4 ++++ engine/common/fs_pak.c | 11 ++++++----- engine/gl/gl_font.c | 30 +++++++++++++++--------------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 1801a0430..55e0fa142 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -1547,7 +1547,11 @@ qboolean R_ApplyRenderer_Load (rendererstate_t *newr) host_basepal = (qbyte *)FS_LoadMallocFile ("gfx/palette.lmp", &sz); vid.fullbright = host_basepal?32:0; //q1-like mods are assumed to have 32 fullbright pixels, even if the colormap is missing. if (!host_basepal) + { host_basepal = (qbyte *)FS_LoadMallocFile ("wad/playpal", &sz); + if (host_basepal && sz > 768) + sz = 768; + } if (!host_basepal || sz != 768) { #if defined(Q2CLIENT) && defined(IMAGEFMT_PCX) diff --git a/engine/common/fs_pak.c b/engine/common/fs_pak.c index de306ca0d..a7a5b14b2 100644 --- a/engine/common/fs_pak.c +++ b/engine/common/fs_pak.c @@ -389,7 +389,7 @@ searchpathfuncs_t *QDECL FSPAK_LoadArchive (vfsfile_t *file, searchpathfuncs_t * } #ifdef PACKAGE_DOOMWAD -searchpathfuncs_t *QDECL FSDWD_LoadArchive (vfsfile_t *packhandle, const char *desc, const char *prefix) +searchpathfuncs_t *QDECL FSDWD_LoadArchive (vfsfile_t *packhandle, searchpathfuncs_t *parent, const char *wadname, const char *desc, const char *prefix) { dwadheader_t header; int i; @@ -484,7 +484,7 @@ newsection: newfiles[i].filelen = 4; break; } - if (!strncmp(filename, "gl_", 3) && ((filename[4] == 'e' && filename[5] == 'm') || !strncmp(filename+3, "map", 3))) + if (!strncmp(filename, "gl_", 3) && ((filename[3] == 'e' && filename[5] == 'm') || !strncmp(filename+3, "map", 3))) { //this is the start of a beutiful new map section = 5; strcpy(sectionname, filename+3); @@ -523,7 +523,8 @@ newsection: } sprintf (newfiles[i].name, "maps/%s%s.%s", neatwadname, sectionname, filename); break; - case 2: //sprite section + case 2: //sprite section. sprites use the first 4 letters to identify the name of the sprite, and the last 4 to define its frame+dir [+ xflipped frame+dir] + //FIXME: inject a '.dsp' file for filesystem accountability when we see an a0 (or a1) postfix. if (!strcmp(filename, "s_end")) { section = 0; @@ -531,7 +532,7 @@ newsection: } sprintf (newfiles[i].name, "sprites/%s", filename); break; - case 3: //patches section + case 3: //patches section. they need the textures1/2 lump in order to position correctly as actual textures. if (!strcmp(filename, "p_end")) { section = 0; @@ -539,7 +540,7 @@ newsection: } sprintf (newfiles[i].name, "patches/%s.pat", filename); break; - case 4: //flats section + case 4: //flats section. note that these are raw p8 64*64 images if (!strcmp(filename, "f_end")) { section = 0; diff --git a/engine/gl/gl_font.c b/engine/gl/gl_font.c index 3964a3853..4314bde6e 100644 --- a/engine/gl/gl_font.c +++ b/engine/gl/gl_font.c @@ -2460,17 +2460,17 @@ struct font_s *Font_LoadFont(const char *fontfilename, float vheight, float scal h = 0; } - f->chars[i].advance = dp->width; /*this is how much line space the char takes*/ - f->chars[i].left = -dp->leftoffset; - f->chars[i].top = -dp->topoffset; - f->chars[i].nextchar = 0; - f->chars[i].pad = 0; - f->chars[i].texplane = SINGLEPLANE; + c = Font_GetCharStore(f, i); + c->advance = dp->width; /*this is how much line space the char takes*/ + c->left = -dp->leftoffset; + c->top = -dp->topoffset; + c->nextchar = 0; + c->texplane = SINGLEPLANE; - f->chars[i].bmx = x; - f->chars[i].bmy = y; - f->chars[i].bmh = dp->height; - f->chars[i].bmw = dp->width; + c->bmx = x; + c->bmy = y; + c->bmh = dp->height; + c->bmw = dp->width; Doom_ExpandPatch(dp, &buf[y*PLANEWIDTH + x], PLANEWIDTH); @@ -2490,15 +2490,15 @@ struct font_s *Font_LoadFont(const char *fontfilename, float vheight, float scal { //doom doesn't have many chars, so make sure the lower case chars exist. for (i = 'a'; i <= 'z'; i++) - f->chars[i] = f->chars[i-'a'+'A']; + Font_CopyChar(f, i-'a'+'A', i); + //no space char either - f->chars[' '].advance = 8; + c = Font_GetCharStore(f, ' '); + c->advance = 8; f->singletexture = R_LoadTexture8("doomfont", PLANEWIDTH, PLANEHEIGHT, buf, 0, true); for (i = 0xe000; i <= 0xe0ff; i++) - { - f->chars[i] = f->chars[toupper(i&0x7f)]; - } + Font_CopyChar(f, toupper(i&0x7f), i); return f; } }