diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-04-25 23:47:43 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-04-25 23:47:43 +0800 |
commit | c2b99f6321965b2c5b30a1b72b29119281c2d7e1 (patch) | |
tree | 949b2a1ad1d522df5e02dea75f174bc546d869f2 /extensions/smgrid.cpp | |
parent | 261bfb611a92c5dec13f65fb225a127a66a1b43b (diff) | |
download | SMELT-c2b99f6321965b2c5b30a1b72b29119281c2d7e1.tar.xz |
Compile with -fPIC to allow linkage to libraries.
Make several math functions static.
Elimate several warnings from the compiler.
Diffstat (limited to 'extensions/smgrid.cpp')
-rw-r--r-- | extensions/smgrid.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/smgrid.cpp b/extensions/smgrid.cpp index d78864f..5e00a6b 100644 --- a/extensions/smgrid.cpp +++ b/extensions/smgrid.cpp @@ -70,7 +70,7 @@ void smGrid::setBlend(int blend){quad.blend=blend;} void smGrid::setColor(int c,int r,DWORD col){if(c<cc&&r<rc)pos[r*cc+c].col=col;} void smGrid::setPos(int c,int r,float x,float y,float z,int ref) { - if(c<cc&&r<rc) + if(c>=0&&r>=0&&c<cc&&r<rc) { if(ref==GRID_REFCENTER)x+=cw*(cc-1)/2,y+=ch*(rc-1)/2; if(ref==GRID_REFNODE)x+=c*cw,y+=r*ch; |