From 273c1ea51053dfc1327dd6514acc2575596c564b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 11 Apr 2016 19:59:39 +0200 Subject: [PATCH] - fixed PointOnSide caclulation for dynamic lights. --- src/gl/dynlights/a_dynlight.cpp | 2 +- src/gl/scene/gl_drawinfo.cpp | 6 +++--- src/gl/system/gl_system.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gl/dynlights/a_dynlight.cpp b/src/gl/dynlights/a_dynlight.cpp index eccd8afcb0..34c7683dcc 100644 --- a/src/gl/dynlights/a_dynlight.cpp +++ b/src/gl/dynlights/a_dynlight.cpp @@ -560,7 +560,7 @@ void ADynamicLight::CollectWithinRadius(const DVector3 &pos, subsector_t *subSec if (seg->sidedef && seg->linedef && seg->linedef->validcount != ::validcount) { // light is in front of the seg - if ((pos.Y - seg->v1->fY()) * (seg->v2->fX() - seg->v1->fX()) + (seg->v1->fX() - pos.X * (seg->v2->fY() - seg->v1->fY())) <= 0) + if ((pos.Y - seg->v1->fY()) * (seg->v2->fX() - seg->v1->fX()) + (seg->v1->fX() - pos.X) * (seg->v2->fY() - seg->v1->fY()) <= 0) { seg->linedef->validcount = validcount; touching_sides = AddLightNode(&seg->sidedef->lighthead, seg->sidedef, this, touching_sides); diff --git a/src/gl/scene/gl_drawinfo.cpp b/src/gl/scene/gl_drawinfo.cpp index e12d61ce34..7b30e41db1 100644 --- a/src/gl/scene/gl_drawinfo.cpp +++ b/src/gl/scene/gl_drawinfo.cpp @@ -547,7 +547,7 @@ inline int GLDrawList::CompareSprites(SortNode * a,SortNode * b) // //========================================================================== static GLDrawList * gd; -int __cdecl CompareSprite(const void * a,const void * b) +int CompareSprite(const void * a,const void * b) { return gd->CompareSprites(*(SortNode**)a,*(SortNode**)b); } @@ -838,7 +838,7 @@ void GLDrawList::DrawDecals() //========================================================================== static GLDrawList * sortinfo; -static int __cdecl diwcmp (const void *a, const void *b) +static int diwcmp (const void *a, const void *b) { const GLDrawItem * di1 = (const GLDrawItem *)a; GLWall * w1=&sortinfo->walls[di1->index]; @@ -850,7 +850,7 @@ static int __cdecl diwcmp (const void *a, const void *b) return ((w1->flags & 3) - (w2->flags & 3)); } -static int __cdecl difcmp (const void *a, const void *b) +static int difcmp (const void *a, const void *b) { const GLDrawItem * di1 = (const GLDrawItem *)a; GLFlat * w1=&sortinfo->flats[di1->index]; diff --git a/src/gl/system/gl_system.h b/src/gl/system/gl_system.h index ed52ab7efc..e9e3c53576 100644 --- a/src/gl/system/gl_system.h +++ b/src/gl/system/gl_system.h @@ -84,7 +84,6 @@ typedef unsigned char byte; typedef float FLOAT; template inline T max( T a, T b) { return (((a)>(b)) ? (a) : (b)); } -#define __cdecl #define _access(a,b) access(a,b) #endif #ifndef _WIN32