Renamed IF_DEBUG_IS to DEBUG_IF, slightly different behavior and added some safety checking for auto creating AABBs from models.

This commit is contained in:
William Moberg
2015-12-17 17:08:47 +01:00
parent 46ae2d39af
commit 0f59b863ee
5 changed files with 146 additions and 26 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ public:
: m_Origin(origin)
, m_Direction(glm::normalize(dir))
{
IF_DEBUG_IS(true) {
DEBUG_IF(true) {
if (glm::any(glm::isnan(m_Direction))) {
LOG_WARNING("Ray Direction was set to the zero-vector, expect unknown side effects and/or crashes.");
}
+8 -13
View File
@@ -1,17 +1,12 @@
//Example:
//IF_DEBUG_IS(true) {
// //Stuff done only in debug mode.
//}
//
//IF_DEBUG_IS(false) {
// //Stuff done only in release mode.
//} else {
// //Stuff only in debug.
//}
#ifndef IF_DEBUG_IS
// Example:
// DEBUG_IF(condition) {
// // This code is executed only in debug mode and if condition is true.
// }
// NOTE: condition statement is not executed at all in release mode.
#ifndef DEBUG_IF
#ifndef DEBUG
#define IF_DEBUG_IS(c) if(c)
#define DEBUG_IF(c) if(c)
#else
#define IF_DEBUG_IS(c) if(!c)
#define DEBUG_IF(c) if(false)
#endif
#endif