Improve diagnostic printing of slopalookup overflows

git-svn-id: https://svn.eduke32.com/eduke32@8419 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-12-09 06:02:28 +00:00 committed by Christoph Oelckers
parent b71ef4a140
commit 0d7fc1263e

View file

@ -3527,7 +3527,7 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
shy1 = y1+(shoffs>>15);
if ((unsigned)shy1 >= SLOPALOOKUPSIZ-1)
{
OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum);
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
return;
}
@ -3542,10 +3542,15 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
shy1 = y1+(shoffs>>15);
shy2 = y2+(shoffs>>15);
if ((unsigned)shy1 >= SLOPALOOKUPSIZ || (unsigned)shy2 >= SLOPALOOKUPSIZ)
// Ridiculously steep gradient?
if ((unsigned)shy1 >= SLOPALOOKUPSIZ)
{
// Ridiculously steep gradient?
OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum);
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
goto next_most;
}
if ((unsigned)shy2 >= SLOPALOOKUPSIZ)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy2, sectnum);
goto next_most;
}
@ -3832,7 +3837,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
shy1 = y1+(shoffs>>15);
if ((unsigned)shy1 >= SLOPALOOKUPSIZ - 1)
{
OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum);
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
return;
}
@ -3847,10 +3852,15 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
shy1 = y1+(shoffs>>15);
shy2 = y2+(shoffs>>15);
if ((unsigned)shy1 >= SLOPALOOKUPSIZ || (unsigned)shy2 >= SLOPALOOKUPSIZ)
// Ridiculously steep gradient?
if ((unsigned)shy1 >= SLOPALOOKUPSIZ)
{
// Ridiculously steep gradient?
OSD_Printf("%s:%d: slopalookup[] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, sectnum);
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
goto next_most;
}
if ((unsigned)shy2 >= SLOPALOOKUPSIZ)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy2, sectnum);
goto next_most;
}