From f495f8e833eda4dc022a7b77152fb3752ae013ea Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 6 Nov 2006 20:13:56 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@508 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/editing.cpp | 9 +++------ source/src/rendercubes.cpp | 7 +++++-- source/src/tools.h | 11 ----------- source/vcpp/cube.suo | Bin 68608 -> 72704 bytes 4 files changed, 8 insertions(+), 19 deletions(-) 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 972a5781855a582bfbf54a633b9ad8d62d458477..b64f5d689bcd1421fb80572bee9e29551b602d1b 100644 GIT binary patch delta 3192 zcmZ{mYfx2H7>3t6?sLRz-Vn6`QSpi*7z!Ln1(du3qN!9?f|QmT8a0Vcho1 zW~#Bj<(N2`mW}3Z8fy^kN0;ehH8sxEWJNYvLGQcIyVV-|nCEet17qQ z5hxuNFR5;hy5g?m+;1<mH@;q=Wm=6|!g`g6&ZC(80zBbPrxd8+41b7lW1=fM}U?bo~ zHX%2H%?G-L>^Zx`v&F7BF>7a?XUifc9cKzSRy$igJI@xg8A-wQ9}Btqsx+JFTD(E- z$opQn5S4xW(<5*?)jM!GY$Fl3e|9vv#w;<*OdVKh?ll>v+SKCDn8UTZdm8sfdhggE z99hs43RsLPWpl%3cqtTcvd0SkX?#Q>x zRm<^kiQH1T-pI@3n&f!6U+zsg)*S*7@UC16@&OaWC*la;e|G~o3K%Cr;7<9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