Fixed hexen2 plaques.
Fixed hexen2 new game menu ignoring class the first time around. Fixed hexen2 pickup glows. Slight loading speed improvement due to testing less texture paths. git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3587 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
11d870ac27
commit
a4ed95a376
11 changed files with 71 additions and 48 deletions
|
@ -1492,6 +1492,8 @@ void CL_CheckServerInfo(void)
|
|||
cl.minpitch = -89.9;
|
||||
}
|
||||
|
||||
cl.hexen2pickups = atoi(Info_ValueForKey(cl.serverinfo, "sv_pupglow"));
|
||||
|
||||
allowed = atoi(Info_ValueForKey(cl.serverinfo, "allow"));
|
||||
if (allowed & 1)
|
||||
cls.allow_watervis = true;
|
||||
|
|
|
@ -991,11 +991,6 @@ int CL_LoadModels(int stage, qboolean dontactuallyload)
|
|||
// Host_EndGame("Worldmodel wasn't loaded\n");
|
||||
}
|
||||
|
||||
if (cl.worldmodel && cl.worldmodel->fromgame == fg_quake)
|
||||
cl.hexen2pickups = cl.worldmodel->hulls[MAX_MAP_HULLSDH2-1].available;
|
||||
else
|
||||
cl.hexen2pickups = false;
|
||||
|
||||
#ifdef CSQC_DAT
|
||||
CSQC_WorldLoaded();
|
||||
#endif
|
||||
|
|
|
@ -447,12 +447,15 @@ void SCR_DrawCenterString (vrect_t *rect, cprint_t *p)
|
|||
|
||||
if (p->flags & CPRINT_BACKGROUND)
|
||||
{ //hexen2 style plaque.
|
||||
int lines, len;
|
||||
if (rect->width > 320)
|
||||
{
|
||||
rect->x = (rect->x + rect->width/2) - 160;
|
||||
rect->x = (rect->x + rect->width/2) - (160);
|
||||
rect->width = 320;
|
||||
}
|
||||
if (rect->width < 32)
|
||||
return;
|
||||
rect->x += 16;
|
||||
rect->width -= 32;
|
||||
}
|
||||
|
||||
Font_BeginString(font_conchar, rect->x, rect->y, &left, &top);
|
||||
|
@ -484,8 +487,11 @@ void SCR_DrawCenterString (vrect_t *rect, cprint_t *p)
|
|||
|
||||
if (p->flags & CPRINT_BACKGROUND)
|
||||
{ //hexen2 style plaque.
|
||||
x = rect->x+(rect->width-320)/2;
|
||||
Draw_TextBox(x-6, y-8, 320/8-1, linecount);
|
||||
int px, py, pw;
|
||||
px = rect->x;
|
||||
py = ( y * vid.height) / (float)vid.pixelheight;
|
||||
pw = rect->width+8;
|
||||
Draw_TextBox(px-16, py-8-8, pw/8, linecount+2);
|
||||
}
|
||||
|
||||
for (l = 0; l < linecount; l++, y += Font_CharHeight())
|
||||
|
|
|
@ -2012,11 +2012,14 @@ texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
|
|||
*data = '#';
|
||||
}
|
||||
|
||||
snprintf(fname, sizeof(fname)-1, "%s/%s", subpath, name);
|
||||
snprintf(fname, sizeof(fname)-1, "%s/%s", subpath, name); /*should be safe if its null*/
|
||||
if (subpath && *subpath)
|
||||
{
|
||||
tex = R_FindTexture(fname);
|
||||
if (TEXVALID(tex)) //don't bother if it already exists.
|
||||
return tex;
|
||||
if (subpath && *subpath)
|
||||
}
|
||||
if (!(flags & IF_SUBDIRONLY))
|
||||
{
|
||||
tex = R_FindTexture(name);
|
||||
if (TEXVALID(tex)) //don't bother if it already exists.
|
||||
|
@ -2024,12 +2027,18 @@ texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
|
|||
}
|
||||
|
||||
|
||||
if (subpath && *subpath)
|
||||
{
|
||||
tex = R_LoadCompressed(fname);
|
||||
if (TEXVALID(tex))
|
||||
return tex;
|
||||
}
|
||||
if (!(flags & IF_SUBDIRONLY))
|
||||
{
|
||||
tex = R_LoadCompressed(name);
|
||||
if (TEXVALID(tex))
|
||||
return tex;
|
||||
}
|
||||
|
||||
if (strchr(name, '/')) //never look in a root dir for the pic
|
||||
i = 0;
|
||||
|
@ -2053,7 +2062,11 @@ texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
|
|||
snprintf(fname, sizeof(fname)-1, tex_path[i].path, subpath, nicename, tex_extensions[e].name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flags & IF_SUBDIRONLY)
|
||||
continue;
|
||||
snprintf(fname, sizeof(fname)-1, tex_path[i].path, nicename, tex_extensions[e].name);
|
||||
}
|
||||
TRACE(("dbg: Mod_LoadHiResTexture: trying %s\n", fname));
|
||||
if ((buf = COM_LoadFile (fname, 5)))
|
||||
{
|
||||
|
@ -2094,6 +2107,8 @@ texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
|
|||
}
|
||||
}
|
||||
|
||||
if (!(flags & IF_SUBDIRONLY))
|
||||
{
|
||||
/*still failed? attempt to load quake lmp files, which have no real format id*/
|
||||
snprintf(fname, sizeof(fname)-1, "%s%s", nicename, ".lmp");
|
||||
if ((buf = COM_LoadFile (fname, 5)))
|
||||
|
@ -2121,6 +2136,7 @@ texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
|
|||
BZ_Free(data);
|
||||
return tex;
|
||||
}
|
||||
}
|
||||
return r_nulltex;
|
||||
}
|
||||
texid_t R_LoadReplacementTexture(char *name, char *subpath, unsigned int flags)
|
||||
|
|
|
@ -180,6 +180,8 @@ void M_Menu_SinglePlayer_f (void)
|
|||
menu = M_CreateMenu(0);
|
||||
MC_AddPicture(menu, 16, 0, 35, 176, "gfx/menu/hplaque.lmp");
|
||||
|
||||
Cvar_Get("cl_playerclass", "1", CVAR_USERINFO|CVAR_ARCHIVE, "Hexen2");
|
||||
|
||||
y = 64-20;
|
||||
|
||||
if (!strncmp(Cmd_Argv(1), "class", 5))
|
||||
|
|
|
@ -245,7 +245,9 @@ enum imageflags
|
|||
IF_NOPICMIP = 1<<1,
|
||||
IF_NOMIPMAP = 1<<2,
|
||||
IF_NOALPHA = 1<<3,
|
||||
IF_NOGAMMA = 1<<4
|
||||
IF_NOGAMMA = 1<<4,
|
||||
|
||||
IF_SUBDIRONLY = 1<<31
|
||||
};
|
||||
|
||||
enum uploadfmt
|
||||
|
|
|
@ -1803,7 +1803,7 @@ void COM_Gamedir (const char *dir)
|
|||
#define DPCOMPAT "set dpcompat_set 1\nset dpcompat_trailparticles 1\n"
|
||||
#define NEXCFG DPCOMPAT "set sv_maxairspeed \"400\"\nset sv_jumpvelocity 270\nset sv_mintic \"0.01\"\ncl_nolerp 0\nset r_particlesdesc effectinfo\n"
|
||||
#define DMFCFG "set com_parseutf8 1\npm_airstep 1\n"
|
||||
#define HEX2CFG "set sv_maxspeed 640\nset watervis 1\nset r_wateralpha 0.5\n"
|
||||
#define HEX2CFG "set sv_maxspeed 640\nset watervis 1\nset r_wateralpha 0.5\nset sv_pupglow 1\n"
|
||||
|
||||
typedef struct {
|
||||
const char *protocolname; //sent to the master server when this is the current gamemode.
|
||||
|
|
|
@ -841,7 +841,7 @@ static qboolean R_CalcModelLighting(entity_t *e, model_t *clmodel, unsigned int
|
|||
if ((e->model->flags & EF_ROTATE) && cl.hexen2pickups)
|
||||
{
|
||||
shadelight[0] = shadelight[1] = shadelight[2] =
|
||||
ambientlight[0] = ambientlight[1] = ambientlight[2] = 128+sin(cl.time*4)*64;
|
||||
ambientlight[0] = ambientlight[1] = ambientlight[2] = 128+sin(cl.servertime*4)*64;
|
||||
}
|
||||
if ((e->drawflags & MLS_MASKIN) == MLS_ABSLIGHT)
|
||||
{
|
||||
|
|
|
@ -1085,7 +1085,7 @@ TRACE(("dbg: RMod_LoadTextures: inittexturedescs\n"));
|
|||
mipheight = tx->height;
|
||||
}
|
||||
|
||||
tn.base = R_LoadReplacementTexture(mt->name, loadname, IF_NOALPHA);
|
||||
tn.base = R_LoadReplacementTexture(mt->name, loadname, IF_NOALPHA|IF_SUBDIRONLY);
|
||||
if (!TEXVALID(tn.base))
|
||||
{
|
||||
tn.base = R_LoadReplacementTexture(mt->name, "bmodels", (*mt->name == '{')?0:IF_NOALPHA);
|
||||
|
@ -1098,7 +1098,7 @@ TRACE(("dbg: RMod_LoadTextures: inittexturedescs\n"));
|
|||
snprintf(altname, sizeof(altname)-1, "%s_luma", mt->name);
|
||||
if (gl_load24bit.value)
|
||||
{
|
||||
tn.fullbright = R_LoadReplacementTexture(altname, loadname, IF_NOGAMMA);
|
||||
tn.fullbright = R_LoadReplacementTexture(altname, loadname, IF_NOGAMMA|IF_SUBDIRONLY);
|
||||
if (!TEXVALID(tn.fullbright))
|
||||
tn.fullbright = R_LoadReplacementTexture(altname, "bmodels", IF_NOGAMMA);
|
||||
}
|
||||
|
@ -1114,7 +1114,7 @@ TRACE(("dbg: RMod_LoadTextures: inittexturedescs\n"));
|
|||
if (gl_bump.ival<2) //set to 2 to have faster loading.
|
||||
{
|
||||
snprintf(altname, sizeof(altname)-1, "%s_norm", mt->name);
|
||||
tn.bump = R_LoadReplacementTexture(altname, loadname, IF_NOALPHA|IF_NOGAMMA);
|
||||
tn.bump = R_LoadReplacementTexture(altname, loadname, IF_NOALPHA|IF_NOGAMMA|IF_SUBDIRONLY);
|
||||
if (!TEXVALID(tn.bump))
|
||||
tn.bump = R_LoadReplacementTexture(altname, "bmodels", IF_NOALPHA|IF_NOGAMMA);
|
||||
}
|
||||
|
@ -1145,7 +1145,7 @@ TRACE(("dbg: RMod_LoadTextures: inittexturedescs\n"));
|
|||
if (gl_specular.value && gl_load24bit.value)
|
||||
{
|
||||
snprintf(altname, sizeof(altname)-1, "%s_gloss", mt->name);
|
||||
tn.specular = R_LoadHiResTexture(altname, loadname, IF_NOALPHA|IF_NOGAMMA);
|
||||
tn.specular = R_LoadHiResTexture(altname, loadname, IF_NOALPHA|IF_NOGAMMA|IF_SUBDIRONLY);
|
||||
if (!TEXVALID(tn.specular))
|
||||
tn.specular = R_LoadHiResTexture(altname, "bmodels", IF_NOALPHA|IF_NOGAMMA);
|
||||
}
|
||||
|
|
|
@ -1217,8 +1217,6 @@ Con_DPrintf("PF_readcmd: %s\n%s", s, output);
|
|||
|
||||
case G_SETPAUSE:
|
||||
{
|
||||
int i;
|
||||
client_t *cl;
|
||||
int pause = VM_LONG(arg[0]);
|
||||
if ((sv.paused&1) == (pause&1))
|
||||
break; //nothing changed, ignore it.
|
||||
|
|
|
@ -148,6 +148,7 @@ cvar_t sv_cullplayers_trace = CVARF("sv_cullplayers_trace", "", CVAR_SERVERINFO)
|
|||
cvar_t sv_cullentities_trace = CVARF("sv_cullentities_trace", "", CVAR_SERVERINFO);
|
||||
cvar_t sv_phs = CVAR("sv_phs", "1");
|
||||
cvar_t sv_resetparms = CVAR("sv_resetparms", "0");
|
||||
cvar_t sv_pupglow = CVARF("sv_pupglow", "", CVAR_SERVERINFO);
|
||||
|
||||
cvar_t sv_master = CVAR("sv_master", "0");
|
||||
cvar_t sv_masterport = CVAR("sv_masterport", "0");
|
||||
|
@ -3623,6 +3624,7 @@ void SV_InitLocal (void)
|
|||
Cvar_Register (&timeout, cvargroup_servercontrol);
|
||||
Cvar_Register (&zombietime, cvargroup_servercontrol);
|
||||
|
||||
Cvar_Register (&sv_pupglow, cvargroup_serverinfo);
|
||||
Cvar_Register (&sv_loadentfiles, cvargroup_servercontrol);
|
||||
|
||||
Cvar_Register (&sv_maxvelocity, cvargroup_serverphysics);
|
||||
|
|
Loading…
Reference in a new issue