1
0
Fork 0
forked from fte/fteqw

Software renderer now compiles on MINIMAL.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@853 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-28 04:32:20 +00:00
parent bfb1906d8e
commit 5136f7bcbc
7 changed files with 41 additions and 11 deletions

View file

@ -659,6 +659,7 @@ void SWR_RecursiveWorldNode (mnode_t *node, int clipflags)
}
}
#ifdef Q2BSPS
qbyte areabits[MAX_Q2MAP_AREAS/8];
void SWR_RecursiveQ2WorldNode (mnode_t *node, int clipflags)
{
@ -853,7 +854,7 @@ void SWR_RecursiveQ2WorldNode (mnode_t *node, int clipflags)
SWR_RecursiveQ2WorldNode (node->children[!side], clipflags);
}
}
#endif
/*
================
@ -873,14 +874,17 @@ void R_RenderWorld (void)
clmodel = currententity->model;
r_pcurrentvertbase = clmodel->vertexes;
#ifdef Q2BSPS
if (clmodel->fromgame == fg_quake2)
{
int leafnum;
int clientarea;
int CM_WriteAreaBits (qbyte *buffer, int area);
#ifdef Q2CLIENT
if (cls.q2server)
memcpy(areabits, cl.q2frame.areabits, sizeof(areabits));
else
#endif
{
leafnum = CM_PointLeafnum (r_refdef.vieworg);
clientarea = CM_LeafArea (leafnum);
@ -890,6 +894,7 @@ void R_RenderWorld (void)
SWR_RecursiveQ2WorldNode (clmodel->nodes, 15);
}
else
#endif
SWR_RecursiveWorldNode (clmodel->nodes, 15);
// if the driver wants the polygons back to front, play the visible ones back

View file

@ -164,9 +164,10 @@ qboolean SWR_CheckSky (void)
R_LoadSkyBox
================
*/
void *Mod_LoadWall(char *name);
void R_LoadSkyBox (void)
{
#ifdef Q2BSPS
void *Mod_LoadWall(char *name);
int i;
char pathname[MAX_QPATH];
for (i=0 ; i<6 ; i++)
@ -179,6 +180,7 @@ void R_LoadSkyBox (void)
r_skytexinfo[i].texture = Mod_LoadWall (pathname); //q2 fall back
}
}
#endif
}
/*
================

View file

@ -553,7 +553,7 @@ void SWR_MarkLeaves (void)
mnode_t *node;
int i;
#ifdef Q2BSPS
if (cl.worldmodel->fromgame == fg_quake2)
{
qbyte fatvis[MAX_MAP_LEAFS/8];
@ -610,6 +610,7 @@ void SWR_MarkLeaves (void)
}
return;
}
#endif
if (r_oldviewleaf == r_viewleaf)
return;
@ -777,8 +778,10 @@ void SWR_DrawViewModel (void)
return;
#endif
#ifdef Q2CLIENT
if (cls.q2server)
return;
#endif
if (!r_drawviewmodel.value || r_fov_greater_than_90 || !Cam_DrawViewModel(pnum))
return;
@ -1338,8 +1341,10 @@ void SWR_RenderView_ (void)
r_warpbuffer = warpbuffer;
r_dosirds = r_sirds.value;
#ifdef FISH
if (ffov.value && cls.allow_fish) //THAT's HORRIBLE!
r_dosirds = false;
#endif
if (r_timegraph.value || r_speeds.value || r_dspeeds.value)
r_time1 = Sys_DoubleTime ();

View file

@ -500,6 +500,7 @@ r_refdef.viewangles[2]= 0;
r_oldviewleaf = r_viewleaf = &fakeleaf; //so we can use quake1 rendering routines for q2 bsps.
r_viewleaf->contents = Q1CONTENTS_EMPTY;
}
#ifdef Q2BSPS
else if (cl.worldmodel->fromgame == fg_quake2)
{
mleaf_t *leaf;
@ -536,6 +537,7 @@ r_refdef.viewangles[2]= 0;
r_viewcluster2 = leaf->cluster;
}
}
#endif
else
{
// current viewleaf

View file

@ -477,7 +477,9 @@ void SWDraw_Init (void)
r_rectdesc.rowbytes = draw_backtile->width;
}
#ifdef PLUGINS
Plug_DrawReloadImages();
#endif
}
void SWDraw_Shutdown(void)
@ -1989,12 +1991,10 @@ void SWDraw_ConsoleBackground (int lines)
memcpy(conback->data + 320*186, saveback, 320*8);
}
#ifdef TEXTEDITOR
void SWDraw_EditorBackground (int lines)
{
SWDraw_ConsoleBackground (lines);
}
#endif
/*

View file

@ -104,10 +104,12 @@ int SWMod_LeafForPoint (vec3_t p, model_t *model)
float d;
mplane_t *plane;
#ifdef Q2BSPS
if (model->fromgame == fg_quake2 || model->fromgame == fg_quake3)
{
return CM_PointLeafnum(p);
}
#endif
if (!model || !model->nodes)
Sys_Error ("Mod_PointInLeaf: bad model");
@ -294,7 +296,7 @@ model_t *SWMod_LoadModel (model_t *mod, qboolean crash)
else
return mod; // not cached at all
}
#ifdef Q2BSPS
if (!*mod->name)
{
loadmodel = mod;
@ -303,6 +305,7 @@ model_t *SWMod_LoadModel (model_t *mod, qboolean crash)
R_DefaultTrail(mod);
return mod;
}
#endif
//
// because the world is so huge, load it one piece at a time
@ -310,7 +313,7 @@ model_t *SWMod_LoadModel (model_t *mod, qboolean crash)
//look for a replacement
ext = COM_FileExtension(mod->name);
#ifndef SERVERONLY
#ifndef CLIENTONLY
if (!isDedicated && (!Q_strcasecmp(ext, "mdl") || !Q_strcasecmp(ext, "bsp")))
{
char mdlbase[MAX_QPATH];
@ -386,9 +389,11 @@ model_t *SWMod_LoadModel (model_t *mod, qboolean crash)
SWMod_LoadSprite2Model (mod, buf);
break;
#endif
#ifdef Q2BSPS
case IDBSPHEADER: //looks like id switched to have proper ids
Mod_LoadQ2BrushModel (mod, buf);
break;
#endif
case BSPVERSIONHL:
case BSPVERSION: //hmm.
@ -1855,9 +1860,11 @@ float RadiusFromBounds (vec3_t mins, vec3_t maxs);
void Q1BSP_MarkLights (dlight_t *light, int bit, mnode_t *node);
#ifndef CLIENTONLY
void Q1BSP_FatPVS (vec3_t org, qboolean add);
qboolean Q1BSP_EdictInFatPVS(edict_t *ent);
void Q1BSP_FindTouchedLeafs(edict_t *ent);
#endif
void SWQ1BSP_LightPointValues(vec3_t point, vec3_t res_diffuse, vec3_t res_ambient, vec3_t res_dir);
void SWR_Q1BSP_StainNode (mnode_t *node, float *parms);
@ -1910,8 +1917,9 @@ void SWMod_LoadBrushModel (model_t *mod, void *buffer)
}
// load into heap
#ifndef SERVERONLY
#ifndef CLIENTONLY
if (!isDedicated)
#endif
{
SWMod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
SWMod_LoadEdges (&header->lumps[LUMP_EDGES]);
@ -1919,20 +1927,19 @@ void SWMod_LoadBrushModel (model_t *mod, void *buffer)
SWMod_LoadLighting (&header->lumps[LUMP_LIGHTING]); //DMW, made lighting load first. (so we know if lighting is rgb or luminance)
SWMod_LoadTextures (&header->lumps[LUMP_TEXTURES]);
}
#endif
SWMod_LoadSubmodels (&header->lumps[LUMP_MODELS]); //needs to come before we set the headnodes[3]
SWMod_LoadCrouchHull ();
SWMod_LoadPlanes (&header->lumps[LUMP_PLANES]);
#ifndef SERVERONLY
#ifndef CLIENTONLY
if (!isDedicated)
#endif
{
SWMod_LoadTexinfo (&header->lumps[LUMP_TEXINFO]);
SWMod_LoadFaces (&header->lumps[LUMP_FACES]);
SWMod_LoadMarksurfaces (&header->lumps[LUMP_MARKSURFACES]);
}
#endif
SWMod_LoadVisibility (&header->lumps[LUMP_VISIBILITY]);
SWMod_LoadLeafs (&header->lumps[LUMP_LEAFS]);
@ -1946,9 +1953,11 @@ void SWMod_LoadBrushModel (model_t *mod, void *buffer)
crouchhullfile=NULL;
}
#ifndef CLIENTONLY
mod->funcs.FatPVS = Q1BSP_FatPVS;
mod->funcs.EdictInFatPVS = Q1BSP_EdictInFatPVS;
mod->funcs.FindTouchedLeafs_Q1 = Q1BSP_FindTouchedLeafs;
#endif
mod->funcs.LightPointValues = SWQ1BSP_LightPointValues;
mod->funcs.StainNode = SWR_Q1BSP_StainNode;
mod->funcs.MarkLights = Q1BSP_MarkLights;

View file

@ -160,12 +160,16 @@ void SWSCR_UpdateScreen (void)
if (scr_drawloading)
{
SCR_DrawLoading ();
#ifdef PLUGINS
Plug_SBar ();
#endif
SCR_ShowPics_Draw();
}
else if (scr_drawdialog)
{
#ifdef PLUGINS
Plug_SBar ();
#endif
SCR_ShowPics_Draw();
Draw_FadeScreen ();
SCR_DrawNotifyString ();
@ -190,7 +194,10 @@ void SWSCR_UpdateScreen (void)
SCR_DrawPause ();
SCR_DrawFPS ();
SCR_DrawUPS ();
SCR_DrawClock();
#ifdef PLUGINS
Plug_SBar ();
#endif
SCR_ShowPics_Draw();
SCR_CheckDrawCenterString ();
#ifdef TEXTEDITOR