Fix some Q2 issues.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5659 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
2d1699985f
commit
11e41f1e7d
8 changed files with 33 additions and 15 deletions
|
@ -480,6 +480,7 @@ SET(FTE_COMMON_FILES
|
||||||
engine/common/config_nocompat.h
|
engine/common/config_nocompat.h
|
||||||
engine/common/config_wastes.h
|
engine/common/config_wastes.h
|
||||||
engine/common/config_freecs.h
|
engine/common/config_freecs.h
|
||||||
|
engine/common/config_fteqw_noweb.h
|
||||||
|
|
||||||
#useless headers that I'll never search for
|
#useless headers that I'll never search for
|
||||||
engine/client/api_menu.h
|
engine/client/api_menu.h
|
||||||
|
|
|
@ -1393,6 +1393,11 @@ static int CL_LoadModels(int stage, qboolean dontactuallyload)
|
||||||
if (cl.worldmodel && cl.worldmodel->loadstate == MLS_LOADING)
|
if (cl.worldmodel && cl.worldmodel->loadstate == MLS_LOADING)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
#ifdef Q2CLIENT
|
||||||
|
if (cl.worldmodel && cl.worldmodel->checksum != cl.q2mapchecksum)
|
||||||
|
Host_EndGame("Local map version differs from server: %i != '%i'\n", cl.worldmodel->checksum, cl.q2mapchecksum);
|
||||||
|
#endif
|
||||||
|
|
||||||
SCR_SetLoadingFile("csprogs world");
|
SCR_SetLoadingFile("csprogs world");
|
||||||
|
|
||||||
#ifdef CSQC_DAT
|
#ifdef CSQC_DAT
|
||||||
|
@ -4517,19 +4522,21 @@ static void CLQ2_ParseConfigString (void)
|
||||||
}
|
}
|
||||||
else if (i == Q2CS_MAPCHECKSUM)
|
else if (i == Q2CS_MAPCHECKSUM)
|
||||||
{
|
{
|
||||||
int serverchecksum = atoi(s);
|
int serverchecksum = (int)strtol(s, NULL, 10);
|
||||||
int mapchecksum = 0;
|
int mapchecksum = 0;
|
||||||
|
|
||||||
if (cl.worldmodel)
|
if (cl.worldmodel)
|
||||||
{
|
{
|
||||||
if (cl.worldmodel->loadstate == MLS_LOADING)
|
if (cl.worldmodel->loadstate == MLS_LOADING)
|
||||||
COM_WorkerPartialSync(cl.worldmodel, &cl.worldmodel->loadstate, MLS_LOADING);
|
COM_WorkerPartialSync(cl.worldmodel, &cl.worldmodel->loadstate, MLS_LOADING);
|
||||||
mapchecksum = cl.worldmodel->checksum;
|
mapchecksum = cl.worldmodel->checksum;
|
||||||
}
|
|
||||||
// the Q2 client normally exits here, however for our purposes we might as well ignore it
|
// the Q2 client normally exits here, however for our purposes we might as well ignore it
|
||||||
if (mapchecksum != serverchecksum)
|
if (mapchecksum != serverchecksum)
|
||||||
Con_Printf(CON_WARNING "WARNING: Client checksum does not match server checksum (%i != %i)", mapchecksum, serverchecksum);
|
Con_Printf(CON_WARNING "WARNING: Client checksum does not match server checksum (%i != %i)", mapchecksum, serverchecksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cl.q2mapchecksum = serverchecksum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -941,6 +941,7 @@ typedef struct
|
||||||
char q2airaccel[16];
|
char q2airaccel[16];
|
||||||
char q2statusbar[1024];
|
char q2statusbar[1024];
|
||||||
char q2layout[MAX_SPLITS][1024];
|
char q2layout[MAX_SPLITS][1024];
|
||||||
|
int q2mapchecksum;
|
||||||
int parse_entities;
|
int parse_entities;
|
||||||
float lerpfrac;
|
float lerpfrac;
|
||||||
float q2svnetrate; //number of frames we expect to receive per second (required to calculate the server time correctly).
|
float q2svnetrate; //number of frames we expect to receive per second (required to calculate the server time correctly).
|
||||||
|
|
|
@ -33,7 +33,7 @@ static void QDECL R_Image_BuggyCvar (struct cvar_s *var, char *oldvalue)
|
||||||
if (!*var->string)
|
if (!*var->string)
|
||||||
var->ival = var->value = true;
|
var->ival = var->value = true;
|
||||||
}
|
}
|
||||||
cvar_t r_keepimages = CVARCD("r_keepimages", "", R_Image_BuggyCvar, "Retain unused images in memory for slightly faster map loading. FIXME: a setting of 0 may be crashy! (empty is treated as 1 for now)");
|
cvar_t r_keepimages = CVARCD("r_keepimages", "", R_Image_BuggyCvar, "Retain unused images in memory for slightly faster map loading. FIXME: a setting of 0 may be crashy! (empty is treated as 1 for now).\n0: Redundant images will be purged after each map change.\n1: Images will be retained until vid_reload (potentially consuming a lot of ram).");
|
||||||
cvar_t r_ignoremapprefixes = CVARCD("r_ignoremapprefixes", "", R_Image_BuggyCvar, "Ignores when textures were loaded from map-specific paths. FIXME: empty is currently interpretted as 1 because the alternative is too memory hungary with r_keepimages 1.");
|
cvar_t r_ignoremapprefixes = CVARCD("r_ignoremapprefixes", "", R_Image_BuggyCvar, "Ignores when textures were loaded from map-specific paths. FIXME: empty is currently interpretted as 1 because the alternative is too memory hungary with r_keepimages 1.");
|
||||||
|
|
||||||
char *r_defaultimageextensions =
|
char *r_defaultimageextensions =
|
||||||
|
|
|
@ -209,7 +209,9 @@ static int downloadablessequence; //bumped any time any package is purged
|
||||||
|
|
||||||
static void PM_WriteInstalledPackages(void);
|
static void PM_WriteInstalledPackages(void);
|
||||||
static void PM_PreparePackageList(void);
|
static void PM_PreparePackageList(void);
|
||||||
|
#ifdef WEBCLIENT
|
||||||
static qboolean PM_SignatureOkay(package_t *p);
|
static qboolean PM_SignatureOkay(package_t *p);
|
||||||
|
#endif
|
||||||
|
|
||||||
static void PM_FreePackage(package_t *p)
|
static void PM_FreePackage(package_t *p)
|
||||||
{
|
{
|
||||||
|
@ -1601,10 +1603,10 @@ static qboolean PM_MarkPackage(package_t *package, unsigned int markflag)
|
||||||
package->flags &= ~DPF_PURGE;
|
package->flags &= ~DPF_PURGE;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
if (!PM_SignatureOkay(package))
|
if (!PM_SignatureOkay(package))
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
//any file-conflicts prevent the package from being installable.
|
//any file-conflicts prevent the package from being installable.
|
||||||
//this is mostly for pak1.pak
|
//this is mostly for pak1.pak
|
||||||
|
@ -3661,8 +3663,10 @@ static void MD_Draw (int x, int y, struct menucustom_s *c, struct emenu_s *m)
|
||||||
|
|
||||||
if (!PM_CheckPackageFeatures(p))
|
if (!PM_CheckPackageFeatures(p))
|
||||||
Draw_FunStringWidth(0, y, "!", x+8, true, true);
|
Draw_FunStringWidth(0, y, "!", x+8, true, true);
|
||||||
|
#ifdef WEBCLIENT
|
||||||
if (!PM_SignatureOkay(p))
|
if (!PM_SignatureOkay(p))
|
||||||
Draw_FunStringWidth(0, y, "^b!", x+8, true, true);
|
Draw_FunStringWidth(0, y, "^b!", x+8, true, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
// if (!(p->flags & (DPF_ENABLED|DPF_MARKED|DPF_PRESENT))
|
// if (!(p->flags & (DPF_ENABLED|DPF_MARKED|DPF_PRESENT))
|
||||||
// continue;
|
// continue;
|
||||||
|
@ -3912,6 +3916,7 @@ static int MD_AddItemsToDownloadMenu(emenu_t *m, int y, const char *pathprefix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef WEBCLIENT
|
||||||
if (!PM_SignatureOkay(p))
|
if (!PM_SignatureOkay(p))
|
||||||
{
|
{
|
||||||
if (!p->signature)
|
if (!p->signature)
|
||||||
|
@ -3923,6 +3928,7 @@ static int MD_AddItemsToDownloadMenu(emenu_t *m, int y, const char *pathprefix)
|
||||||
else
|
else
|
||||||
head = va(CON_ERROR"Unable to verify signature"CON_DEFAULT"\n%s", head?head:""); //clientside problem.
|
head = va(CON_ERROR"Unable to verify signature"CON_DEFAULT"\n%s", head?head:""); //clientside problem.
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (head && desc)
|
if (head && desc)
|
||||||
desc = va("%s\n%s", head, desc);
|
desc = va("%s\n%s", head, desc);
|
||||||
|
|
|
@ -4950,7 +4950,7 @@ static void COM_Version_f (void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//print out which libraries are disabled
|
//print out which libraries are disabled
|
||||||
Con_Printf("^3Compression:^7\n");
|
Con_Printf("^3Compression:^7");
|
||||||
#ifdef AVAIL_ZLIB
|
#ifdef AVAIL_ZLIB
|
||||||
Con_Printf(" zlib^h("
|
Con_Printf(" zlib^h("
|
||||||
#ifdef ZLIB_STATIC
|
#ifdef ZLIB_STATIC
|
||||||
|
|
|
@ -1323,9 +1323,11 @@ static texture_t *Mod_LoadWall(model_t *loadmodel, char *mapname, char *texname,
|
||||||
wal->width = 64;
|
wal->width = 64;
|
||||||
wal->height = 64;
|
wal->height = 64;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wal->width = LittleLong(wal->width);
|
wal->width = LittleLong(wal->width);
|
||||||
wal->height = LittleLong(wal->height);
|
wal->height = LittleLong(wal->height);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1339,8 +1341,8 @@ static texture_t *Mod_LoadWall(model_t *loadmodel, char *mapname, char *texname,
|
||||||
|
|
||||||
tex = ZG_Malloc(&loadmodel->memgroup, sizeof(texture_t));
|
tex = ZG_Malloc(&loadmodel->memgroup, sizeof(texture_t));
|
||||||
|
|
||||||
tex->vwidth = wal->width;
|
tex->vwidth = tex->srcwidth = wal->width;
|
||||||
tex->vheight = wal->height;
|
tex->vheight = tex->srcheight = wal->height;
|
||||||
|
|
||||||
if (!tex->vwidth || !tex->vheight || wal == &replacementwal)
|
if (!tex->vwidth || !tex->vheight || wal == &replacementwal)
|
||||||
{
|
{
|
||||||
|
@ -1377,6 +1379,7 @@ static texture_t *Mod_LoadWall(model_t *loadmodel, char *mapname, char *texname,
|
||||||
(wal->width>>3)*(wal->height>>3);
|
(wal->width>>3)*(wal->height>>3);
|
||||||
|
|
||||||
tex->srcdata = out = BZ_Malloc(size);
|
tex->srcdata = out = BZ_Malloc(size);
|
||||||
|
tex->srcfmt = TF_MIP4_8PAL24_T255;
|
||||||
tex->palette = host_basepal;
|
tex->palette = host_basepal;
|
||||||
memcpy(out, (qbyte *)wal + wal->offsets[0], (wal->width>>0)*(wal->height>>0));
|
memcpy(out, (qbyte *)wal + wal->offsets[0], (wal->width>>0)*(wal->height>>0));
|
||||||
out += (wal->width>>0)*(wal->height>>0);
|
out += (wal->width>>0)*(wal->height>>0);
|
||||||
|
|
|
@ -5151,7 +5151,7 @@ void ModBrush_LoadGLStuff(void *ctx, void *data, size_t a, size_t b)
|
||||||
// maps |= SHADER_HASNORMALMAP;
|
// maps |= SHADER_HASNORMALMAP;
|
||||||
if (gl_specular.ival)
|
if (gl_specular.ival)
|
||||||
maps |= SHADER_HASGLOSS;
|
maps |= SHADER_HASGLOSS;
|
||||||
R_BuildLegacyTexnums(mod->textures[a]->shader, mod->textures[a]->name, loadname, maps, IF_WORLDTEX, TF_MIP4_8PAL24_T255, mod->textures[a]->srcwidth, mod->textures[a]->srcheight, mod->textures[a]->srcdata, mod->textures[a]->palette);
|
R_BuildLegacyTexnums(mod->textures[a]->shader, mod->textures[a]->name, loadname, maps, IF_WORLDTEX, mod->textures[a]->srcfmt, mod->textures[a]->srcwidth, mod->textures[a]->srcheight, mod->textures[a]->srcdata, mod->textures[a]->palette);
|
||||||
BZ_Free(mod->textures[a]->srcdata);
|
BZ_Free(mod->textures[a]->srcdata);
|
||||||
mod->textures[a]->srcdata = NULL;
|
mod->textures[a]->srcdata = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue