mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 19:01:06 +00:00
rename (most of) r_*.[cS] to sw_r#1.#2 (mmv rocks:) to finally fix the borked
naming scheme of sw vs gl
This commit is contained in:
parent
4dc5da173b
commit
0146992d67
20 changed files with 6 additions and 272 deletions
|
@ -180,7 +180,7 @@ endif
|
|||
client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \
|
||||
cl_main.c cl_misc.c cl_parse.c cl_pred.c cl_slist.c cl_tent.c \
|
||||
console.c keys.c locs.c model_alias.c model_sprite.c nonintel.c \
|
||||
pcx.c r_view.c sbar.c skin.c teamplay.c tga.c wad.c vid.c $(client_ASM)
|
||||
pcx.c r_efrag.c r_view.c sbar.c skin.c teamplay.c tga.c wad.c vid.c $(client_ASM)
|
||||
|
||||
#
|
||||
# Software-rendering clients
|
||||
|
@ -189,15 +189,15 @@ client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \
|
|||
#
|
||||
if ASM_ARCH
|
||||
soft_ASM= d_draw.S d_draw16.S d_parta.S d_polysa.S d_scana.S d_spr8.S \
|
||||
d_varsa.S r_aclipa.S r_aliasa.S r_drawa.S r_edgea.S r_varsa.S \
|
||||
d_varsa.S sw_raclipa.S sw_raliasa.S sw_rdrawa.S sw_redgea.S sw_rvarsa.S \
|
||||
surf16.S surf8.S
|
||||
endif
|
||||
|
||||
soft_SOURCES= d_edge.c d_fill.c d_init.c d_modech.c \
|
||||
d_part.c d_polyse.c d_scan.c d_sky.c d_sprite.c d_surf.c \
|
||||
d_vars.c d_zpoint.c draw.c r_aclip.c r_alias.c r_bsp.c \
|
||||
r_draw.c r_edge.c r_efrag.c r_light.c r_main.c r_misc.c \
|
||||
r_part.c r_sky.c r_sprite.c r_surf.c r_vars.c sw_skin.c sw_view.c \
|
||||
d_vars.c d_zpoint.c draw.c sw_raclip.c sw_ralias.c sw_rbsp.c \
|
||||
sw_rdraw.c sw_redge.c sw_rlight.c sw_rmain.c sw_rmisc.c \
|
||||
sw_rpart.c sw_rsky.c sw_rsprite.c sw_rsurf.c sw_rvars.c sw_skin.c sw_view.c \
|
||||
screen.c $(soft_ASM) sw_model_alias.c sw_model_brush.c \
|
||||
sw_model_sprite.c
|
||||
|
||||
|
@ -262,7 +262,7 @@ qw_client_x11_DEPENDENCIES= $(CLIENT_LIB_DEPS)
|
|||
#
|
||||
ogl_SOURCES= noisetextures.c gl_textures.c gl_draw.c gl_dyn_fires.c \
|
||||
gl_dyn_part.c gl_dyn_textures.c gl_mesh.c gl_ngraph.c \
|
||||
r_efrag.c gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c \
|
||||
gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c \
|
||||
gl_screen.c gl_skin.c gl_sky.c gl_sky_clip.c gl_view.c \
|
||||
gl_warp.c gl_model_alias.c gl_model_brush.c \
|
||||
gl_model_fullbright.c gl_model_sprite.c qfgl_ext.c
|
||||
|
|
|
@ -1,266 +0,0 @@
|
|||
/*
|
||||
r_efrag.c
|
||||
|
||||
(description)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "bothdefs.h"
|
||||
#include "cl_main.h"
|
||||
#include "cl_tent.h"
|
||||
#include "QF/console.h"
|
||||
#include "r_local.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
mnode_t *r_pefragtopnode;
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
ENTITY FRAGMENT FUNCTIONS
|
||||
*/
|
||||
|
||||
efrag_t **lastlink;
|
||||
|
||||
vec3_t r_emins, r_emaxs;
|
||||
|
||||
entity_t *r_addent;
|
||||
|
||||
|
||||
/*
|
||||
R_RemoveEfrags
|
||||
|
||||
Call when removing an object from the world or moving it to another position
|
||||
*/
|
||||
void
|
||||
R_RemoveEfrags (entity_t *ent)
|
||||
{
|
||||
efrag_t *ef, *old, *walk, **prev;
|
||||
|
||||
ef = ent->efrag;
|
||||
|
||||
while (ef) {
|
||||
prev = &ef->leaf->efrags;
|
||||
while (1) {
|
||||
walk = *prev;
|
||||
if (!walk)
|
||||
break;
|
||||
if (walk == ef) { // remove this fragment
|
||||
*prev = ef->leafnext;
|
||||
break;
|
||||
} else
|
||||
prev = &walk->leafnext;
|
||||
}
|
||||
|
||||
old = ef;
|
||||
ef = ef->entnext;
|
||||
|
||||
// put it on the free list
|
||||
old->entnext = cl.free_efrags;
|
||||
cl.free_efrags = old;
|
||||
}
|
||||
|
||||
ent->efrag = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
R_SplitEntityOnNode
|
||||
*/
|
||||
void
|
||||
R_SplitEntityOnNode (mnode_t *node)
|
||||
{
|
||||
efrag_t *ef;
|
||||
mplane_t *splitplane;
|
||||
mleaf_t *leaf;
|
||||
int sides;
|
||||
|
||||
if (node->contents == CONTENTS_SOLID) {
|
||||
return;
|
||||
}
|
||||
// add an efrag if the node is a leaf
|
||||
|
||||
if (node->contents < 0) {
|
||||
if (!r_pefragtopnode)
|
||||
r_pefragtopnode = node;
|
||||
|
||||
leaf = (mleaf_t *) node;
|
||||
|
||||
// grab an efrag off the free list
|
||||
ef = cl.free_efrags;
|
||||
if (!ef) {
|
||||
Con_Printf ("Too many efrags!\n");
|
||||
return; // no free fragments...
|
||||
}
|
||||
cl.free_efrags = cl.free_efrags->entnext;
|
||||
|
||||
ef->entity = r_addent;
|
||||
|
||||
// add the entity link
|
||||
*lastlink = ef;
|
||||
lastlink = &ef->entnext;
|
||||
ef->entnext = NULL;
|
||||
|
||||
// set the leaf links
|
||||
ef->leaf = leaf;
|
||||
ef->leafnext = leaf->efrags;
|
||||
leaf->efrags = ef;
|
||||
|
||||
return;
|
||||
}
|
||||
// NODE_MIXED
|
||||
|
||||
splitplane = node->plane;
|
||||
sides = BOX_ON_PLANE_SIDE (r_emins, r_emaxs, splitplane);
|
||||
|
||||
if (sides == 3) {
|
||||
// split on this plane
|
||||
// if this is the first splitter of this bmodel, remember it
|
||||
if (!r_pefragtopnode)
|
||||
r_pefragtopnode = node;
|
||||
}
|
||||
// recurse down the contacted sides
|
||||
if (sides & 1)
|
||||
R_SplitEntityOnNode (node->children[0]);
|
||||
|
||||
if (sides & 2)
|
||||
R_SplitEntityOnNode (node->children[1]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_SplitEntityOnNode2
|
||||
*/
|
||||
void
|
||||
R_SplitEntityOnNode2 (mnode_t *node)
|
||||
{
|
||||
mplane_t *splitplane;
|
||||
int sides;
|
||||
|
||||
if (node->visframe != r_visframecount)
|
||||
return;
|
||||
|
||||
if (node->contents < 0) {
|
||||
if (node->contents != CONTENTS_SOLID)
|
||||
r_pefragtopnode = node; // we've reached a non-solid leaf, so
|
||||
// it's
|
||||
// visible and not BSP clipped
|
||||
return;
|
||||
}
|
||||
|
||||
splitplane = node->plane;
|
||||
sides = BOX_ON_PLANE_SIDE (r_emins, r_emaxs, splitplane);
|
||||
|
||||
if (sides == 3) {
|
||||
// remember first splitter
|
||||
r_pefragtopnode = node;
|
||||
return;
|
||||
}
|
||||
// not split yet; recurse down the contacted side
|
||||
if (sides & 1)
|
||||
R_SplitEntityOnNode2 (node->children[0]);
|
||||
else
|
||||
R_SplitEntityOnNode2 (node->children[1]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AddEfrags
|
||||
*/
|
||||
void
|
||||
R_AddEfrags (entity_t *ent)
|
||||
{
|
||||
model_t *entmodel;
|
||||
int i;
|
||||
|
||||
if (!ent->model)
|
||||
return;
|
||||
|
||||
if (ent == &r_worldentity)
|
||||
return; // never add the world
|
||||
|
||||
r_addent = ent;
|
||||
|
||||
lastlink = &ent->efrag;
|
||||
r_pefragtopnode = NULL;
|
||||
|
||||
entmodel = ent->model;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
r_emins[i] = ent->origin[i] + entmodel->mins[i];
|
||||
r_emaxs[i] = ent->origin[i] + entmodel->maxs[i];
|
||||
}
|
||||
|
||||
R_SplitEntityOnNode (cl.worldmodel->nodes);
|
||||
|
||||
ent->topnode = r_pefragtopnode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_StoreEfrags
|
||||
|
||||
// FIXME: a lot of this goes away with edge-based
|
||||
*/
|
||||
void
|
||||
R_StoreEfrags (efrag_t **ppefrag)
|
||||
{
|
||||
entity_t *pent;
|
||||
model_t *clmodel;
|
||||
efrag_t *pefrag;
|
||||
|
||||
|
||||
while ((pefrag = *ppefrag) != NULL) {
|
||||
pent = pefrag->entity;
|
||||
clmodel = pent->model;
|
||||
|
||||
switch (clmodel->type) {
|
||||
case mod_alias:
|
||||
case mod_brush:
|
||||
case mod_sprite:
|
||||
pent = pefrag->entity;
|
||||
|
||||
if (pent->visframe != r_framecount) {
|
||||
entity_t **ent = CL_NewTempEntity ();
|
||||
if (!ent)
|
||||
return;
|
||||
*ent = pent;
|
||||
|
||||
// mark that we've recorded this entity for this frame
|
||||
pent->visframe = r_framecount;
|
||||
}
|
||||
|
||||
ppefrag = &pefrag->leafnext;
|
||||
break;
|
||||
|
||||
default:
|
||||
Sys_Error ("R_StoreEfrags: Bad entity type %d\n",
|
||||
clmodel->type);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue