Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Core/Libraries/Source/WWVegas/WW3D2/coltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool AABoxCollisionTestClass::Cull(const AABoxClass & box)
void AABoxCollisionTestClass::Rotate(ROTATION_TYPE rotation)
{

#ifndef NDEBUG
#ifdef RTS_DEBUG

int i;
Matrix3D tm(1);
Expand Down Expand Up @@ -156,9 +156,7 @@ void AABoxCollisionTestClass::Rotate(ROTATION_TYPE rotation)
if (realmax.Z <= pts[i].Z) realmax.Z = pts[i].Z;
}


#endif

#endif // RTS_DEBUG

// rotate the test by the desired rotation about the Z axis, special cased for
// 90 degree rotations about Z. arbitrary rotations cause the axis aligned
Expand Down Expand Up @@ -216,13 +214,13 @@ void AABoxCollisionTestClass::Rotate(ROTATION_TYPE rotation)
break;
}

#ifndef NDEBUG
#ifdef RTS_DEBUG

assert((Box.Center - realcenter).Length() < 0.001f);
assert((SweepMin - realmin).Length() < 0.001f);
assert((SweepMax - realmax).Length() < 0.001f);

#endif
#endif // RTS_DEBUG
}


Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/ini.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@ void INIClass::DuplicateCRCError(const char *message, const char *section, const
OutputDebugString(buffer);
assert(0);

#ifdef NDEBUG
#ifdef RTS_RELEASE
#ifdef _WINDOWS
MessageBox(0, buffer, "Duplicate CRC in INI file.", MB_ICONSTOP | MB_OK);
#endif
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/lzo_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
/* Help the optimizer with register allocation.
* Don't activate this macro for a fair comparision with other algorithms.
*/
#if 1 && defined(NDEBUG) && !defined(__BOUNDS_CHECKING_ON)
#if 1 && defined(RTS_RELEASE) && !defined(__BOUNDS_CHECKING_ON)
# if defined(__GNUC__) && defined(__i386__)
# if !defined(LZO_OPTIMIZE_GNUC_i386_IS_BUGGY)
# define LZO_OPTIMIZE_GNUC_i386
Expand Down
11 changes: 2 additions & 9 deletions Core/Libraries/Source/WWVegas/WWLib/refcount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// TheSuperHackers @build feliwir 17/04/2025 include __debugbreak macros
#include <Utility/intrin_compat.h>

#ifndef NDEBUG
#ifdef RTS_DEBUG

// #define PARANOID_REFCOUNTS

Expand Down Expand Up @@ -161,14 +161,12 @@ void RefCountClass::Inc_Total_Refs(const RefCountClass * obj)
assert(Validate_Active_Ref(obj));
#endif
TotalRefs++;

}

// SKB 7/21/99 Set BreakOnRefernce to a pointer and it will break when called.
// This is used for debugging, please do not deleted.
RefCountClass* BreakOnReference = 0;

#ifndef NDEBUG
void RefCountClass::Add_Ref(void) const
{
NumRefs++;
Expand All @@ -179,7 +177,6 @@ void RefCountClass::Add_Ref(void) const
}
Inc_Total_Refs(this);
}
#endif

/***********************************************************************************************
* RefCountClass::Validate_Active_Ref -- decrements the total reference count *
Expand All @@ -206,8 +203,4 @@ void RefCountClass::Dec_Total_Refs(const RefCountClass * obj)
}
}



#endif


#endif // RTS_DEBUG
64 changes: 33 additions & 31 deletions Core/Libraries/Source/WWVegas/WWLib/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
class RefCountClass;


#ifndef NDEBUG
#ifdef RTS_DEBUG

struct ActiveRefStruct
{
Expand All @@ -59,7 +59,7 @@ struct ActiveRefStruct
#define NEW_REF( C, P ) ( W3DNEW C P )
#define SET_REF_OWNER( P ) P

#endif
#endif // RTS_DEBUG


/*
Expand Down Expand Up @@ -101,31 +101,31 @@ class RefCountClass
{
public:

RefCountClass(void) :
NumRefs(1)
#ifndef NDEBUG
,ActiveRefNode(this)
#endif
RefCountClass(void)
: NumRefs(1)
#ifdef RTS_DEBUG
, ActiveRefNode(this)
#endif
{
#ifndef NDEBUG
#ifdef RTS_DEBUG
Add_Active_Ref(this);
Inc_Total_Refs(this);
#endif
#endif
}

/*
** The reference counter value cannot be copied.
*/
RefCountClass(const RefCountClass & ) :
NumRefs(1)
#ifndef NDEBUG
,ActiveRefNode(this)
#endif
RefCountClass(const RefCountClass & )
: NumRefs(1)
#ifdef RTS_DEBUG
, ActiveRefNode(this)
#endif
{
#ifndef NDEBUG
#ifdef RTS_DEBUG
Add_Active_Ref(this);
Inc_Total_Refs(this);
#endif
#endif
}

RefCountClass& operator=(const RefCountClass&) { return *this; }
Expand All @@ -134,24 +134,26 @@ class RefCountClass
** Add_Ref, call this function if you are going to keep a pointer
** to this object.
*/
#ifdef NDEBUG
WWINLINE void Add_Ref(void) const { NumRefs++; }
#else
#ifdef RTS_DEBUG
void Add_Ref(void) const;
#else
WWINLINE void Add_Ref(void) const { NumRefs++; }
#endif

/*
** Release_Ref, call this function when you no longer need the pointer
** to this object.
*/
WWINLINE void Release_Ref(void) const {
#ifndef NDEBUG
Dec_Total_Refs(this);
#endif
NumRefs--;
WWASSERT(NumRefs >= 0);
if (NumRefs == 0) const_cast<RefCountClass*>(this)->Delete_This();
}
WWINLINE void Release_Ref(void) const
{
#ifdef RTS_DEBUG
Dec_Total_Refs(this);
#endif
NumRefs--;
WWASSERT(NumRefs >= 0);
if (NumRefs == 0)
const_cast<RefCountClass*>(this)->Delete_This();
}


/*
Expand Down Expand Up @@ -180,9 +182,9 @@ class RefCountClass
*/
virtual ~RefCountClass(void)
{
#ifndef NDEBUG
#ifdef RTS_DEBUG
Remove_Active_Ref(this);
#endif
#endif
WWASSERT(NumRefs == 0);
}

Expand Down Expand Up @@ -211,7 +213,7 @@ class RefCountClass

public:

#ifndef NDEBUG // Debugging stuff
#ifdef RTS_DEBUG // Debugging stuff

/*
** Node in the Active Refs List
Expand Down Expand Up @@ -248,7 +250,7 @@ class RefCountClass
*/
static bool Validate_Active_Ref(RefCountClass * obj);

#endif // NDEBUG
#endif // RTS_DEBUG

};

Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/debug/test3/test3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//
// Debug module - Test 3 (Checking FLAT I/O, logging)
//////////////////////////////////////////////////////////////////////////////
#ifdef NDEBUG

#include "../debug.h"

unsigned divByNull;
Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/Autorun/TTFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ int TTFontClass::Set_YSpacing( int y )
* 06/20/1887 BNA : Modified to handle new fonts. *
*=============================================================================================*/

#if(NDEBUG)
#ifdef RTS_RELEASE

Point2D TTFontClass::Print(
HDC hdc,
Expand Down Expand Up @@ -772,7 +772,7 @@ Point2D TTFontClass::Print(
return( point );
}

#endif
#endif // RTS_RELEASE

/***********************************************************************************************
* TTFontClass::Print -- Print text to the surface specified. CHAR version. *
Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/W3DView/W3DView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void CW3DViewApp::OnAppAbout()
*/
void Debug_Refs(void)
{
#ifndef NDEBUG
#ifdef RTS_DEBUG
TRACE("Detecting Active Refs...\r\n");
//ODS("At time %s", cMiscUtil::Get_Text_Time());
RefCountNodeClass * first = RefCountClass::ActiveRefList.First();
Expand Down Expand Up @@ -368,7 +368,7 @@ void Debug_Refs(void)
}
TRACE("Done.\r\n");
//ODS("At time %s", cMiscUtil::Get_Text_Time());
#endif
#endif // RTS_DEBUG
}


Expand Down
8 changes: 4 additions & 4 deletions Core/Tools/textureCompress/textureCompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void logStuff(const char *fmt, ...)
::MessageBox(NULL, buffer, "textureCompress", MB_OK);
}

#ifndef NDEBUG
#ifdef RTS_DEBUG

class DebugMunkee
{
Expand Down Expand Up @@ -96,7 +96,7 @@ static void debugLog(const char *fmt, ...)

#define DEBUG_LOG(x) {}

#endif // NDEBUG
#endif // RTS_DEBUG


static void usage(const char *progname)
Expand Down Expand Up @@ -619,7 +619,7 @@ int main(int argc, const char **argv)
const char *targetDir = argv[2];
const char *cacheDir = argv[3];

#ifndef NDEBUG
#ifdef RTS_DEBUG
theDebugMunkee = new DebugMunkee(argv[4]);
#endif

Expand All @@ -631,7 +631,7 @@ int main(int argc, const char **argv)
//printSet( hasAlpha, "Using Alpha Channel" );
//tearDownLoadWindow();

#ifndef NDEBUG
#ifdef RTS_DEBUG
delete theDebugMunkee;
theDebugMunkee = NULL;
#endif
Expand Down
2 changes: 1 addition & 1 deletion cmake/config-build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ endif()
if(RTS_BUILD_OPTION_DEBUG)
target_compile_definitions(core_config INTERFACE RTS_DEBUG WWDEBUG DEBUG)
else()
target_compile_definitions(core_config INTERFACE RTS_RELEASE)
target_compile_definitions(core_config INTERFACE RTS_RELEASE NDEBUG)
endif()

if(RTS_BUILD_OPTION_PROFILE)
Expand Down
Loading