mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-30 08:00:51 +00:00
fix some bogosities
This commit is contained in:
parent
ea614fc2c6
commit
99a4ea2093
4 changed files with 9 additions and 2 deletions
|
@ -35,6 +35,7 @@
|
|||
#include "QF/qargs.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
|
||||
|
@ -153,7 +154,7 @@ D_SCAlloc (int width, int size)
|
|||
Sys_Error ("D_SCAlloc: bad cache size %d\n", size);
|
||||
|
||||
/* This adds the offset of data[0] in the surfcache_t struct. */
|
||||
size += (int) ((surfcache_t *) 0)->data;
|
||||
size += field_offset (surfcache_t, data);
|
||||
|
||||
#define SIZE_ALIGN (sizeof(surfcache_t*)-1)
|
||||
size = (size + SIZE_ALIGN) & ~SIZE_ALIGN;
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
|
||||
static int sprite_height;
|
||||
|
@ -645,6 +646,7 @@ D_SpriteCalculateGradients (void)
|
|||
VectorInverse (p_taxis);
|
||||
|
||||
distinv = 1.0 / (-DotProduct (modelorg, r_spritedesc.vpn));
|
||||
distinv = min (distinv, 1.0);
|
||||
|
||||
d_sdivzstepu = p_saxis[0] * xscaleinv;
|
||||
d_tdivzstepu = p_taxis[0] * xscaleinv;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "QF/qargs.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
|
||||
|
@ -154,7 +155,7 @@ D_SCAlloc (int width, int size)
|
|||
Sys_Error ("D_SCAlloc: bad cache size %d\n", size);
|
||||
|
||||
/* This adds the offset of data[0] in the surfcache_t struct. */
|
||||
size += (int) ((surfcache_t *) 0)->data;
|
||||
size += field_offset (surfcache_t, data);
|
||||
|
||||
#define SIZE_ALIGN (sizeof(surfcache_t*)-1)
|
||||
size = (size + SIZE_ALIGN) & ~SIZE_ALIGN;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "QF/render.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_local.h"
|
||||
|
||||
#define MAXLEFTCLIPEDGES 100
|
||||
|
@ -494,6 +495,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
|
|||
TransformVector (pplane->normal, p_normal);
|
||||
// FIXME: cache this?
|
||||
distinv = 1.0 / (pplane->dist - DotProduct (modelorg, pplane->normal));
|
||||
distinv = min (distinv, 1.0);
|
||||
|
||||
surface_p->d_zistepu = p_normal[0] * xscaleinv * distinv;
|
||||
surface_p->d_zistepv = -p_normal[1] * yscaleinv * distinv;
|
||||
|
@ -594,6 +596,7 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
|||
TransformVector (pplane->normal, p_normal);
|
||||
// FIXME: cache this?
|
||||
distinv = 1.0 / (pplane->dist - DotProduct (modelorg, pplane->normal));
|
||||
distinv = min (distinv, 1.0);
|
||||
|
||||
surface_p->d_zistepu = p_normal[0] * xscaleinv * distinv;
|
||||
surface_p->d_zistepv = -p_normal[1] * yscaleinv * distinv;
|
||||
|
|
Loading…
Reference in a new issue