mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 13:21:10 +00:00
Fixed Knuckles being able to climb in space in OpenGL.
To understand: look at AjustSegs(void) in hw_bsp.c. It reallocates the vetex_t pointers for lines as POLYVERTEX_T pointers, and of COURSE things are gonna get wacky when you're casting pointers. I dunno how resilient the FLOAT_TO_FIXED solution is or whether it'll be netgame compatible (yayyy float precision loss) but it's not like our builds are netgame compatible with themselves
This commit is contained in:
parent
c79428a178
commit
5d6463fafc
1 changed files with 23 additions and 4 deletions
27
src/r_main.c
27
src/r_main.c
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
#include "hardware/hw_main.h"
|
#include "hardware/hw_main.h"
|
||||||
|
#include "hardware/hw_glob.h" // polyvertex_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//profile stuff ---------------------------------------------------------
|
//profile stuff ---------------------------------------------------------
|
||||||
|
@ -268,10 +269,28 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node)
|
||||||
// killough 5/2/98: reformatted
|
// killough 5/2/98: reformatted
|
||||||
INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line)
|
INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line)
|
||||||
{
|
{
|
||||||
fixed_t lx = line->v1->x;
|
fixed_t lx, ly, ldx, ldy;
|
||||||
fixed_t ly = line->v1->y;
|
|
||||||
fixed_t ldx = line->v2->x - lx;
|
#ifdef HWRENDER // how did nobody notice this for years
|
||||||
fixed_t ldy = line->v2->y - ly;
|
// used for the hardware render
|
||||||
|
if (rendermode != render_soft && rendermode != render_none)
|
||||||
|
{
|
||||||
|
lx = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->x);
|
||||||
|
ly = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->y);
|
||||||
|
ldx = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->x);
|
||||||
|
ldy = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
lx = line->v1->x;
|
||||||
|
ly = line->v1->y;
|
||||||
|
ldx = line->v2->x;
|
||||||
|
ldy = line->v2->y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ldx -= lx;
|
||||||
|
ldy -= ly;
|
||||||
|
|
||||||
if (!ldx)
|
if (!ldx)
|
||||||
return x <= lx ? ldy > 0 : ldy < 0;
|
return x <= lx ? ldy > 0 : ldy < 0;
|
||||||
|
|
Loading…
Reference in a new issue