mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user