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_wastes.h
|
||||
engine/common/config_freecs.h
|
||||
engine/common/config_fteqw_noweb.h
|
||||
|
||||
#useless headers that I'll never search for
|
||||
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)
|
||||
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");
|
||||
|
||||
#ifdef CSQC_DAT
|
||||
|
@ -4517,19 +4522,21 @@ static void CLQ2_ParseConfigString (void)
|
|||
}
|
||||
else if (i == Q2CS_MAPCHECKSUM)
|
||||
{
|
||||
int serverchecksum = atoi(s);
|
||||
int serverchecksum = (int)strtol(s, NULL, 10);
|
||||
int mapchecksum = 0;
|
||||
|
||||
if (cl.worldmodel)
|
||||
{
|
||||
if (cl.worldmodel->loadstate == MLS_LOADING)
|
||||
COM_WorkerPartialSync(cl.worldmodel, &cl.worldmodel->loadstate, MLS_LOADING);
|
||||
mapchecksum = cl.worldmodel->checksum;
|
||||
}
|
||||
|
||||
// the Q2 client normally exits here, however for our purposes we might as well ignore it
|
||||
if (mapchecksum != serverchecksum)
|
||||
Con_Printf(CON_WARNING "WARNING: Client checksum does not match server checksum (%i != %i)", mapchecksum, serverchecksum);
|
||||
}
|
||||
|
||||
cl.q2mapchecksum = serverchecksum;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -941,6 +941,7 @@ typedef struct
|
|||
char q2airaccel[16];
|
||||
char q2statusbar[1024];
|
||||
char q2layout[MAX_SPLITS][1024];
|
||||
int q2mapchecksum;
|
||||
int parse_entities;
|
||||
float lerpfrac;
|
||||
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)
|
||||
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.");
|
||||
|
||||
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_PreparePackageList(void);
|
||||
#ifdef WEBCLIENT
|
||||
static qboolean PM_SignatureOkay(package_t *p);
|
||||
#endif
|
||||
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
if (!PM_SignatureOkay(package))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
//any file-conflicts prevent the package from being installable.
|
||||
//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))
|
||||
Draw_FunStringWidth(0, y, "!", x+8, true, true);
|
||||
#ifdef WEBCLIENT
|
||||
if (!PM_SignatureOkay(p))
|
||||
Draw_FunStringWidth(0, y, "^b!", x+8, true, true);
|
||||
#endif
|
||||
|
||||
// if (!(p->flags & (DPF_ENABLED|DPF_MARKED|DPF_PRESENT))
|
||||
// continue;
|
||||
|
@ -3912,6 +3916,7 @@ static int MD_AddItemsToDownloadMenu(emenu_t *m, int y, const char *pathprefix)
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef WEBCLIENT
|
||||
if (!PM_SignatureOkay(p))
|
||||
{
|
||||
if (!p->signature)
|
||||
|
@ -3923,6 +3928,7 @@ static int MD_AddItemsToDownloadMenu(emenu_t *m, int y, const char *pathprefix)
|
|||
else
|
||||
head = va(CON_ERROR"Unable to verify signature"CON_DEFAULT"\n%s", head?head:""); //clientside problem.
|
||||
}
|
||||
#endif
|
||||
|
||||
if (head && desc)
|
||||
desc = va("%s\n%s", head, desc);
|
||||
|
|
|
@ -4950,7 +4950,7 @@ static void COM_Version_f (void)
|
|||
#endif
|
||||
|
||||
//print out which libraries are disabled
|
||||
Con_Printf("^3Compression:^7\n");
|
||||
Con_Printf("^3Compression:^7");
|
||||
#ifdef AVAIL_ZLIB
|
||||
Con_Printf(" zlib^h("
|
||||
#ifdef ZLIB_STATIC
|
||||
|
|
|
@ -1323,9 +1323,11 @@ static texture_t *Mod_LoadWall(model_t *loadmodel, char *mapname, char *texname,
|
|||
wal->width = 64;
|
||||
wal->height = 64;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
wal->width = LittleLong(wal->width);
|
||||
wal->height = LittleLong(wal->height);
|
||||
}
|
||||
{
|
||||
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->vwidth = wal->width;
|
||||
tex->vheight = wal->height;
|
||||
tex->vwidth = tex->srcwidth = wal->width;
|
||||
tex->vheight = tex->srcheight = wal->height;
|
||||
|
||||
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);
|
||||
|
||||
tex->srcdata = out = BZ_Malloc(size);
|
||||
tex->srcfmt = TF_MIP4_8PAL24_T255;
|
||||
tex->palette = host_basepal;
|
||||
memcpy(out, (qbyte *)wal + wal->offsets[0], (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;
|
||||
if (gl_specular.ival)
|
||||
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);
|
||||
mod->textures[a]->srcdata = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue