mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2024-12-12 02:34:13 +00:00
efrags: Merge remaining differences between gl/sw efrags
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
730c3f112d
commit
53077c2c54
@ -20,11 +20,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
// r_efrag.c
|
||||
|
||||
#include "console.h"
|
||||
#include "glquake.h"
|
||||
#include "gl_model.h"
|
||||
#include "quakedef.h"
|
||||
#include "sys.h"
|
||||
|
||||
#ifdef GLQUAKE
|
||||
#include "glquake.h"
|
||||
#include "gl_model.h"
|
||||
#else
|
||||
#include "r_local.h"
|
||||
#endif
|
||||
|
||||
mnode_t *r_pefragtopnode;
|
||||
|
||||
|
||||
@ -147,6 +152,44 @@ R_SplitEntityOnNode(mnode_t *node)
|
||||
}
|
||||
|
||||
|
||||
#ifndef GLQUAKE
|
||||
/*
|
||||
===================
|
||||
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]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
===========
|
||||
|
@ -21,9 +21,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "console.h"
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include "sys.h"
|
||||
|
||||
#ifdef GLQUAKE
|
||||
#include "glquake.h"
|
||||
#include "gl_model.h"
|
||||
#else
|
||||
#include "r_local.h"
|
||||
#endif
|
||||
|
||||
mnode_t *r_pefragtopnode;
|
||||
|
||||
|
||||
@ -32,7 +38,7 @@ mnode_t *r_pefragtopnode;
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
ENTITY FRAGMENT FUNCTIONS
|
||||
ENTITY FRAGMENT FUNCTIONS
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
@ -146,6 +152,7 @@ R_SplitEntityOnNode(mnode_t *node)
|
||||
}
|
||||
|
||||
|
||||
#ifndef GLQUAKE
|
||||
/*
|
||||
===================
|
||||
R_SplitEntityOnNode2
|
||||
@ -181,6 +188,7 @@ R_SplitEntityOnNode2(mnode_t *node)
|
||||
else
|
||||
R_SplitEntityOnNode2(node->children[1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user