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:
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user