Add one-time OoB logs to tile-drawing functions

These functions will only complain once if they receive an out-of-bounds
tile. And it's only once because these functions are called frequently
in rendering code.

A macro WHINE_ONCE() has been added in order to not duplicate code.
This commit is contained in:
Misa
2020-06-30 15:01:30 -07:00
committed by Ethan Lee
parent 5201f67909
commit 07028d47d5
2 changed files with 17 additions and 0 deletions

View File

@@ -17,6 +17,14 @@ bool endsWith(const std::string& str, const std::string& suffix);
#define INBOUNDS(index, vector) ((int) index >= 0 && (int) index < (int) vector.size())
#define WHINE_ONCE(message) \
static bool whine = true; \
if (whine) \
{ \
whine = false; \
puts(message); \
}
//helperClass
class UtilityClass