Fix up PACKAGE_DOOMWAD
This commit is contained in:
parent
99569251a8
commit
b0b4725119
3 changed files with 25 additions and 20 deletions
|
@ -1547,7 +1547,11 @@ qboolean R_ApplyRenderer_Load (rendererstate_t *newr)
|
||||||
host_basepal = (qbyte *)FS_LoadMallocFile ("gfx/palette.lmp", &sz);
|
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.
|
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)
|
if (!host_basepal)
|
||||||
|
{
|
||||||
host_basepal = (qbyte *)FS_LoadMallocFile ("wad/playpal", &sz);
|
host_basepal = (qbyte *)FS_LoadMallocFile ("wad/playpal", &sz);
|
||||||
|
if (host_basepal && sz > 768)
|
||||||
|
sz = 768;
|
||||||
|
}
|
||||||
if (!host_basepal || sz != 768)
|
if (!host_basepal || sz != 768)
|
||||||
{
|
{
|
||||||
#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX)
|
#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX)
|
||||||
|
|
|
@ -389,7 +389,7 @@ searchpathfuncs_t *QDECL FSPAK_LoadArchive (vfsfile_t *file, searchpathfuncs_t *
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PACKAGE_DOOMWAD
|
#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;
|
dwadheader_t header;
|
||||||
int i;
|
int i;
|
||||||
|
@ -484,7 +484,7 @@ newsection:
|
||||||
newfiles[i].filelen = 4;
|
newfiles[i].filelen = 4;
|
||||||
break;
|
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
|
{ //this is the start of a beutiful new map
|
||||||
section = 5;
|
section = 5;
|
||||||
strcpy(sectionname, filename+3);
|
strcpy(sectionname, filename+3);
|
||||||
|
@ -523,7 +523,8 @@ newsection:
|
||||||
}
|
}
|
||||||
sprintf (newfiles[i].name, "maps/%s%s.%s", neatwadname, sectionname, filename);
|
sprintf (newfiles[i].name, "maps/%s%s.%s", neatwadname, sectionname, filename);
|
||||||
break;
|
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"))
|
if (!strcmp(filename, "s_end"))
|
||||||
{
|
{
|
||||||
section = 0;
|
section = 0;
|
||||||
|
@ -531,7 +532,7 @@ newsection:
|
||||||
}
|
}
|
||||||
sprintf (newfiles[i].name, "sprites/%s", filename);
|
sprintf (newfiles[i].name, "sprites/%s", filename);
|
||||||
break;
|
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"))
|
if (!strcmp(filename, "p_end"))
|
||||||
{
|
{
|
||||||
section = 0;
|
section = 0;
|
||||||
|
@ -539,7 +540,7 @@ newsection:
|
||||||
}
|
}
|
||||||
sprintf (newfiles[i].name, "patches/%s.pat", filename);
|
sprintf (newfiles[i].name, "patches/%s.pat", filename);
|
||||||
break;
|
break;
|
||||||
case 4: //flats section
|
case 4: //flats section. note that these are raw p8 64*64 images
|
||||||
if (!strcmp(filename, "f_end"))
|
if (!strcmp(filename, "f_end"))
|
||||||
{
|
{
|
||||||
section = 0;
|
section = 0;
|
||||||
|
|
|
@ -2460,17 +2460,17 @@ struct font_s *Font_LoadFont(const char *fontfilename, float vheight, float scal
|
||||||
h = 0;
|
h = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
f->chars[i].advance = dp->width; /*this is how much line space the char takes*/
|
c = Font_GetCharStore(f, i);
|
||||||
f->chars[i].left = -dp->leftoffset;
|
c->advance = dp->width; /*this is how much line space the char takes*/
|
||||||
f->chars[i].top = -dp->topoffset;
|
c->left = -dp->leftoffset;
|
||||||
f->chars[i].nextchar = 0;
|
c->top = -dp->topoffset;
|
||||||
f->chars[i].pad = 0;
|
c->nextchar = 0;
|
||||||
f->chars[i].texplane = SINGLEPLANE;
|
c->texplane = SINGLEPLANE;
|
||||||
|
|
||||||
f->chars[i].bmx = x;
|
c->bmx = x;
|
||||||
f->chars[i].bmy = y;
|
c->bmy = y;
|
||||||
f->chars[i].bmh = dp->height;
|
c->bmh = dp->height;
|
||||||
f->chars[i].bmw = dp->width;
|
c->bmw = dp->width;
|
||||||
|
|
||||||
Doom_ExpandPatch(dp, &buf[y*PLANEWIDTH + x], PLANEWIDTH);
|
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.
|
//doom doesn't have many chars, so make sure the lower case chars exist.
|
||||||
for (i = 'a'; i <= 'z'; i++)
|
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
|
//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);
|
f->singletexture = R_LoadTexture8("doomfont", PLANEWIDTH, PLANEHEIGHT, buf, 0, true);
|
||||||
for (i = 0xe000; i <= 0xe0ff; i++)
|
for (i = 0xe000; i <= 0xe0ff; i++)
|
||||||
{
|
Font_CopyChar(f, toupper(i&0x7f), i);
|
||||||
f->chars[i] = f->chars[toupper(i&0x7f)];
|
|
||||||
}
|
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue