diff --git a/source/src/editing.cpp b/source/src/editing.cpp index e331dfba..43cee263 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -100,12 +100,8 @@ void makesel() VAR(flrceil,0,0,2); -float sheight(sqr *s, sqr *t, float z) // finds out z height when cursor points at wall -{ - return !flrceil //z-s->floorceil-z - ? (s->type==FHF ? s->floor-t->vdelta/4.0f : (float)s->floor) - : (s->type==CHF ? s->ceil+t->vdelta/4.0f : (float)s->ceil); -}; +// VC8 optimizer screws up rendering somehow if this is an actual function +#define sheight(s,t,z) (!flrceil ? (s->type==FHF ? s->floor-t->vdelta/4.0f : (float)s->floor) : (s->type==CHF ? s->ceil+t->vdelta/4.0f : (float)s->ceil)) void cursorupdate() // called every frame from hud { @@ -144,6 +140,7 @@ void cursorupdate() // called every frame fr for(int ix = cx-GRIDSIZE; ix<=cx+GRIDSIZE; ix++) for(int iy = cy-GRIDSIZE; iy<=cy+GRIDSIZE; iy++) { + if(OUTBORD(ix, iy)) continue; sqr *s = S(ix,iy); if(SOLID(s)) continue; diff --git a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp index 25e5fb3f..fa462085 100644 --- a/source/src/rendercubes.cpp +++ b/source/src/rendercubes.cpp @@ -15,10 +15,13 @@ void setarraypointers() // leaves of all these functions, and are part of the cpu bottleneck on really slow // machines, hence the macros. -#define vertf(v1, v2, v3, ls, t1, t2) { vertex &v = verts.add(); \ +#define vertf(v1, v2, v3, ls, t1, t2) { \ + vertex *buf = verts.getbuf(), &v = verts.add(); \ + if(buf!=verts.getbuf()) setarraypointers(); \ v.u = t1; v.v = t2; \ v.x = v1; v.y = v2; v.z = v3; \ - v.r = ls->r; v.g = ls->g; v.b = ls->b; v.a = 255; }; + v.r = ls->r; v.g = ls->g; v.b = ls->b; v.a = 255; \ +}; #define vert(v1, v2, v3, ls, t1, t2) { vertf((float)(v1), (float)(v2), (float)(v3), ls, t1, t2); } diff --git a/source/src/tools.h b/source/src/tools.h index 0354e1d5..e1aa6706 100644 --- a/source/src/tools.h +++ b/source/src/tools.h @@ -424,16 +424,5 @@ struct databuf typedef databuf charbuf; typedef databuf ucharbuf; -#ifndef __GNUC__ -#ifdef _DEBUG -//#define _CRTDBG_MAP_ALLOC -#include -inline void *__cdecl operator new(size_t n, const char *fn, int l) { return ::operator new(n, 1, fn, l); }; -inline void __cdecl operator delete(void *p, const char *fn, int l) { ::operator delete(p, 1, fn, l); }; -#define new new(__FILE__,__LINE__) -#endif -#endif - - #endif diff --git a/source/vcpp/cube.suo b/source/vcpp/cube.suo index 972a5781..b64f5d68 100644 Binary files a/source/vcpp/cube.suo and b/source/vcpp/cube.suo differ