mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
add r_drawflat_nonworldmodel, defaults to 0
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2315 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
f67a1e5ce4
commit
3866a4c292
10 changed files with 33 additions and 17 deletions
|
@ -542,6 +542,7 @@ qboolean CL_CheckMD2Skins (char *name)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Model_NextDownload
|
||||
|
|
|
@ -364,7 +364,7 @@ qbyte *CIN_ReadNextFrame (void)
|
|||
if (cin.s_width == 1)
|
||||
COM_CharBias(samples, count*cin.s_channels);
|
||||
else if (cin.s_width == 2)
|
||||
COM_SwapLittleShortBlock(samples, count*cin.s_channels);
|
||||
COM_SwapLittleShortBlock((short *)samples, count*cin.s_channels);
|
||||
|
||||
S_RawAudio (0, samples, cin.s_rate, count, cin.s_channels, cin.s_width);
|
||||
|
||||
|
|
|
@ -589,6 +589,7 @@ void CLQ3_ParseGameState(void)
|
|||
|
||||
if (!cl.worldmodel)
|
||||
Host_EndGame("CGame didn't set a map.\n");
|
||||
|
||||
R_NewMap ();
|
||||
|
||||
SCR_EndLoadingPlaque();
|
||||
|
|
|
@ -221,6 +221,7 @@ extern cvar_t r_novis;
|
|||
extern cvar_t r_netgraph;
|
||||
|
||||
cvar_t r_drawflat = SCVARF("r_drawflat","0", CVAR_SEMICHEAT|CVAR_RENDERERCALLBACK);
|
||||
cvar_t r_drawflat_nonworldmodel = SCVAR("r_drawflat_nonworldmodel", "0");
|
||||
cvar_t r_wallcolour = SCVARF("r_wallcolour","255 255 255", CVAR_RENDERERCALLBACK);
|
||||
cvar_t r_floorcolour = SCVARF("r_floorcolour","255 255 255", CVAR_RENDERERCALLBACK);
|
||||
cvar_t r_walltexture = SCVARF("r_walltexture","", CVAR_RENDERERCALLBACK);
|
||||
|
@ -433,7 +434,6 @@ void SWRenderer_Init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
void R_InitTextures (void)
|
||||
{
|
||||
int x,y, m;
|
||||
|
@ -567,6 +567,7 @@ void Renderer_Init(void)
|
|||
Cvar_Register (&r_wateralpha, GRAPHICALNICETIES);
|
||||
|
||||
Cvar_Register (&r_drawflat, GRAPHICALNICETIES);
|
||||
Cvar_Register (&r_drawflat_nonworldmodel, GRAPHICALNICETIES);
|
||||
Cvar_Register (&r_menutint, GRAPHICALNICETIES);
|
||||
|
||||
Cvar_Register (&r_fb_models, GRAPHICALNICETIES);
|
||||
|
|
|
@ -1622,7 +1622,7 @@ void S_RawAudio(int sourceid, qbyte *data, int speed, int samples, int channels,
|
|||
// Con_Printf("Restarting raw stream\n");
|
||||
}
|
||||
|
||||
speedfactor = (float)speed/snd_speed;
|
||||
speedfactor = (double)speed/snd_speed;
|
||||
outsamples = samples/speedfactor;
|
||||
|
||||
oldlength = s->sfxcache->length;
|
||||
|
|
|
@ -173,16 +173,17 @@ typedef struct texture_s
|
|||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
} texture_t;
|
||||
|
||||
#define SURF_DRAWSKYBOX 1
|
||||
#define SURF_PLANEBACK 2
|
||||
#define SURF_DRAWSKY 4
|
||||
#define SURF_DRAWSPRITE 8
|
||||
#define SURF_DRAWTURB 0x10
|
||||
#define SURF_DRAWTILED 0x20
|
||||
#define SURF_DRAWBACKGROUND 0x40
|
||||
#define SURF_UNDERWATER 0x80
|
||||
#define SURF_DONTWARP 0x100
|
||||
#define SURF_BULLETEN 0x200
|
||||
#define SURF_DRAWSKYBOX 0x00001
|
||||
#define SURF_PLANEBACK 0x00002
|
||||
#define SURF_DRAWSKY 0x00004
|
||||
#define SURF_DRAWSPRITE 0x00008
|
||||
#define SURF_DRAWTURB 0x00010
|
||||
#define SURF_DRAWTILED 0x00020
|
||||
#define SURF_DRAWBACKGROUND 0x00040
|
||||
#define SURF_UNDERWATER 0x00080
|
||||
#define SURF_DONTWARP 0x00100
|
||||
#define SURF_BULLETEN 0x00200
|
||||
#define SURF_NOFLAT 0x08000
|
||||
#define SURF_DRAWALPHA 0x10000
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
|
|
|
@ -1515,7 +1515,7 @@ static void PPL_BaseTextureChain(msurface_t *first)
|
|||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!(first->flags & SURF_NOFLAT))
|
||||
{
|
||||
if (gl_mtexarbable >= 2 && simpletextures)
|
||||
PPL_BaseChain_SimpleTexture(first);
|
||||
|
@ -1830,9 +1830,11 @@ void PPL_BaseTextures(model_t *model)
|
|||
|
||||
void PPL_BaseBModelTextures(entity_t *e)
|
||||
{
|
||||
extern cvar_t r_drawflat_nonworldmodel;
|
||||
extern msurface_t *r_alpha_surfaces;
|
||||
int i, k;
|
||||
int shift;
|
||||
int sflags;
|
||||
model_t *model;
|
||||
msurface_t *s;
|
||||
msurface_t *chain = NULL;
|
||||
|
@ -1891,6 +1893,10 @@ void PPL_BaseBModelTextures(entity_t *e)
|
|||
R_RenderDynamicLightmaps (s, shift);
|
||||
}
|
||||
|
||||
if (!r_drawflat_nonworldmodel.value && (!cl.worldmodel->submodels || model->submodels != cl.worldmodel->submodels))
|
||||
sflags = SURF_NOFLAT;
|
||||
else
|
||||
sflags = 0;
|
||||
|
||||
for (s = model->surfaces+model->firstmodelsurface,i = 0; i < model->nummodelsurfaces; i++, s++)
|
||||
{
|
||||
|
@ -1907,6 +1913,7 @@ void PPL_BaseBModelTextures(entity_t *e)
|
|||
chain = NULL;
|
||||
}
|
||||
|
||||
s->flags |= sflags;
|
||||
s->texturechain = chain;
|
||||
chain = s;
|
||||
}
|
||||
|
|
|
@ -1099,7 +1099,6 @@ TRACE(("dbg: GLR_NewMap: ui\n"));
|
|||
TRACE(("dbg: GLR_NewMap: tp\n"));
|
||||
TP_NewMap();
|
||||
|
||||
|
||||
if (r_shadows.value)
|
||||
{
|
||||
R_LoadRTLights();
|
||||
|
|
|
@ -433,7 +433,7 @@ void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
|||
int i;
|
||||
vec_t dot;
|
||||
msurface_t *psurf;
|
||||
int numsurfaces;
|
||||
int numsurfaces, sflags;
|
||||
mplane_t *pplane;
|
||||
|
||||
// FIXME: use bounding-box-based frustum clipping info?
|
||||
|
@ -441,6 +441,11 @@ void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
|||
psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
|
||||
numsurfaces = pmodel->nummodelsurfaces;
|
||||
|
||||
if (!cl.worldmodel->submodels || pmodel->submodels != cl.worldmodel->submodels)
|
||||
sflags = SURF_NOFLAT;
|
||||
else
|
||||
sflags = 0;
|
||||
|
||||
for (i=0 ; i<numsurfaces ; i++, psurf++)
|
||||
{
|
||||
// find which side of the node we are on
|
||||
|
@ -454,6 +459,7 @@ void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
|||
{
|
||||
r_currentkey = ((mleaf_t *)currententity->topnode)->key;
|
||||
|
||||
psurf->flags |= sflags;
|
||||
// FIXME: use bounding-box-based frustum clipping info?
|
||||
R_RenderFace (psurf, clipflags);
|
||||
}
|
||||
|
|
|
@ -1103,7 +1103,7 @@ void R_DrawSurface (void)
|
|||
|
||||
if (r_pixbytes == 1 || r_pixbytes == 4) //if we are using 4, textures are stored as 1 and expanded acording to palette
|
||||
{
|
||||
if (r_drawflat.value)
|
||||
if (r_drawflat.value && !(r_drawsurf.surf->flags & SURF_NOFLAT))
|
||||
{
|
||||
if (r_drawsurf.surf->plane->normal[2] <= 0.5)
|
||||
ptexcolor = r_wallindex;
|
||||
|
|
Loading…
Reference in a new issue