Move #define PI from to build.h, add bound-checking assertion in dosetaspect().

git-svn-id: https://svn.eduke32.com/eduke32@2987 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-09-02 14:07:36 +00:00
parent 52bb35361b
commit 5bca5f59ad
3 changed files with 3 additions and 1 deletions

View file

@ -16,6 +16,8 @@
extern "C" {
#endif
#define PI 3.14159265358979323
#define MAXSECTORSV8 4096
#define MAXWALLSV8 16384
#define MAXSPRITESV8 16384

View file

@ -13,7 +13,6 @@ extern int32_t lastcullcheck;
extern char cullmodel[MAXSPRITES];
extern int32_t cullcheckcnt;
#define PI 3.14159265358979323
extern char TEXCACHEFILE[BMAX_PATH];
typedef struct { char r, g, b, a; } coltype;

View file

@ -7470,6 +7470,7 @@ static void dosetaspect(void)
for (i=0; i<xdimen; i++)
{
j = (x&65535); k = (x>>16); x += xinc;
Bassert(k >= 0 && k < (int32_t)(sizeof(radarang)/sizeof(radarang[0]))-1);
if (j != 0) j = mulscale16(radarang[k+1]-radarang[k], j);
radarang2[i] = (int16_t)((radarang[k]+j)>>6);
}