Skip to content

[GEN][ZH] Remove RTS_INTERNAL #1231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 7, 2025
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
83 changes: 0 additions & 83 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@
"RTS_BUILD_OPTION_PROFILE": "ON"
}
},
{
"name": "vc6-internal",
"displayName": "Windows 32bit VC6 Internal",
"inherits": "vc6",
"cacheVariables": {
"RTS_BUILD_OPTION_INTERNAL": "ON"
}
},
{
"name": "vc6-debug",
"displayName": "Windows 32bit VC6 Debug",
Expand Down Expand Up @@ -103,14 +95,6 @@
"RTS_BUILD_OPTION_PROFILE": "ON"
}
},
{
"name": "win32-internal",
"inherits": "win32",
"displayName": "Windows 32bit Internal",
"cacheVariables": {
"RTS_BUILD_OPTION_INTERNAL": "ON"
}
},
{
"name": "win32-debug",
"inherits": "win32",
Expand Down Expand Up @@ -145,14 +129,6 @@
"RTS_BUILD_OPTION_PROFILE": "ON"
}
},
{
"name": "win32-vcpkg-internal",
"inherits": "win32-vcpkg",
"displayName": "Windows 32bit VCPKG Internal",
"cacheVariables": {
"RTS_BUILD_OPTION_INTERNAL": "ON"
}
},
{
"name": "win32-vcpkg-debug",
"inherits": "win32-vcpkg",
Expand All @@ -175,12 +151,6 @@
"displayName": "Build Windows 32bit VC6 Release",
"description": "Build Windows 32bit VC6 Release"
},
{
"name": "vc6-internal",
"configurePreset": "vc6-internal",
"displayName": "Build Windows 32bit VC6 Internal",
"description": "Build Windows 32bit VC6 Internal"
},
{
"name": "vc6-profile",
"configurePreset": "vc6-profile",
Expand All @@ -200,13 +170,6 @@
"description": "Build Windows 32bit Release",
"configuration": "Release"
},
{
"name": "win32-internal",
"configurePreset": "win32-internal",
"displayName": "Build Windows 32bit Internal",
"description": "Build Windows 32bit Internal",
"configuration": "Release"
},
{
"name": "win32-profile",
"configurePreset": "win32-profile",
Expand All @@ -228,13 +191,6 @@
"description": "Build Windows 32bit VCPKG Release",
"configuration": "Release"
},
{
"name": "win32-vcpkg-internal",
"configurePreset": "win32-vcpkg-internal",
"displayName": "Build Windows 32bit VCPKG Internal",
"description": "Build Windows 32bit VCPKG Internal",
"configuration": "Release"
},
{
"name": "win32-vcpkg-profile",
"configurePreset": "win32-vcpkg-profile",
Expand Down Expand Up @@ -284,19 +240,6 @@
}
]
},
{
"name": "vc6-internal",
"steps": [
{
"type": "configure",
"name": "vc6-internal"
},
{
"type": "build",
"name": "vc6-internal"
}
]
},
{
"name": "vc6-profile",
"steps": [
Expand All @@ -323,19 +266,6 @@
}
]
},
{
"name": "win32-internal",
"steps": [
{
"type": "configure",
"name": "win32-internal"
},
{
"type": "build",
"name": "win32-internal"
}
]
},
{
"name": "win32-profile",
"steps": [
Expand Down Expand Up @@ -375,19 +305,6 @@
}
]
},
{
"name": "win32-vcpkg-internal",
"steps": [
{
"type": "configure",
"name": "win32-vcpkg-internal"
},
{
"type": "build",
"name": "win32-vcpkg-internal"
}
]
},
{
"name": "win32-vcpkg-profile",
"steps": [
Expand Down
5 changes: 0 additions & 5 deletions Core/GameEngine/Source/Common/System/Xfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
#include "Common/Xfer.h"
#include "Common/BitFlagsIO.h"

#ifdef RTS_INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
//#pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
#endif

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
Expand Down
5 changes: 0 additions & 5 deletions Core/Libraries/Source/Compression/CompressionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
#include "EAC/huffcodex.h"
#include "EAC/refcodex.h"

#ifdef RTS_INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
//#pragma message("************************************** WARNING, optimization disabled for debugging purposes")
#endif

// TheSuperHackers @todo Recover debug logging in this file?
#define DEBUG_LOG(x) {}
Expand Down
5 changes: 0 additions & 5 deletions Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
#include "NoxCompress.h"
#include "CompLibHeader/lzhl.h"

#ifdef RTS_INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
//#pragma message("************************************** WARNING, optimization disabled for debugging purposes")
#endif

#define BLOCKSIZE 500000
#define NoxRead fread
Expand Down
5 changes: 0 additions & 5 deletions Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
#include "wwmemlog.h"
#include "dx8wrapper.h"

#ifdef RTS_INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
//#pragma message("************************************** WARNING, optimization disabled for debugging purposes")
#endif

////////////////////////////////////////////////////////////////////////////////////
// Local constants
Expand Down
5 changes: 0 additions & 5 deletions Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@
#include "intersec.h"


#ifdef RTS_INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
//#pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
#endif

// Definitions of static members:
const float RenderObjClass::AT_MIN_LOD = FLT_MAX;
Expand Down
5 changes: 0 additions & 5 deletions Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
#define SEGLINE_CHUNK_SIZE (128)
#endif

#ifdef RTS_INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
//#pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
#endif

#define MAX_SEGLINE_POINT_BUFFER_SIZE (1 + SEGLINE_CHUNK_SIZE)
// This macro depends on the assumption that each line segment is two polys.
Expand Down
7 changes: 1 addition & 6 deletions Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
#include "RANDOM.H"
#include "v3_rnd.h"

#ifdef RTS_INTERNAL
// for occasional debugging...
// #pragma optimize("", off)
// #pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
#endif

/* We have chunking logic which handles N segments at a time. To simplify the subdivision logic,
** we will ensure that N is a power of two and that N >= 2^MAX_STREAK_SUBDIV_LEVELS, so that the
Expand Down Expand Up @@ -1414,7 +1409,7 @@ VertexFormatXYZUV1 *StreakRendererClass::getVertexBuffer(unsigned int number)
m_vertexBufferSize = numberToAlloc;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should look into why this wasn't enabled in debug builds originally before adding it to them

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it writes deadbeef bytes which clearly is meant to be for revieweing memory in debugger.

#ifdef RTS_INTERNAL
#ifdef RTS_DEBUG
for (unsigned i = 0; i < number; ++i)
{
m_vertexBuffer[i].x = m_vertexBuffer[i].y = m_vertexBuffer[i].z = m_vertexBuffer[i].u1 = m_vertexBuffer[i].v1 = (float)0xdeadbeef;
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/always.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

#endif

#if (defined(RTS_DEBUG) || defined(RTS_INTERNAL))
#if defined(RTS_DEBUG)
#define MSGW3DNEW(MSG) new( MSG, 0 )
#define MSGW3DNEWARRAY(MSG) new( MSG, 0 )
#define W3DNEW new("W3D_" __FILE__, 0)
Expand Down
6 changes: 3 additions & 3 deletions Core/Libraries/Source/WWVegas/WWLib/sharebuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ShareBufferClass : public W3DMPO, public RefCountClass

protected:

#if (defined(RTS_DEBUG) || defined(RTS_INTERNAL))
#if defined(RTS_DEBUG)
const char* Msg;
#endif
T * Array;
Expand All @@ -90,7 +90,7 @@ class ShareBufferClass : public W3DMPO, public RefCountClass
template <class T>
ShareBufferClass<T>::ShareBufferClass(int count, const char* msg) :
Count(count)
#if (defined(RTS_DEBUG) || defined(RTS_INTERNAL))
#if defined(RTS_DEBUG)
, Msg(msg)
#endif
{
Expand All @@ -103,7 +103,7 @@ ShareBufferClass<T>::ShareBufferClass(const ShareBufferClass<T> & that) :
Count(that.Count)
{
assert(Count > 0);
#if (defined(RTS_DEBUG) || defined(RTS_INTERNAL))
#if defined(RTS_DEBUG)
Msg = that.Msg;
#endif
Array = MSGW3DNEWARRAY(Msg) T[Count];
Expand Down
9 changes: 2 additions & 7 deletions Core/Libraries/Source/debug/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
/**
\page lib_var Library variants

Generally speaking there are four different library variants:
- Internal: all asserts/checks/logs, full optimizations (RTS_INTERNAL macro defined)
Generally speaking there are three different library variants:
- %Debug: all asserts/checks/logs, no optimizations (RTS_DEBUG macro defined)
- Profile: all asserts/checks/logs, full optimizations, profiling active (RTS_PROFILE macro defined)
- Release: no asserts/checks/logs, full optimizations
Expand Down Expand Up @@ -84,12 +83,8 @@
- Release: XXX.lib
*/

#if defined(RTS_DEBUG) && defined(RTS_INTERNAL)
#error "Only either RTS_DEBUG or RTS_INTERNAL should ever be defined"
#endif

// Define which libraries to use.
#if defined(RTS_INTERNAL) || defined(RTS_DEBUG) || defined(RTS_PROFILE)
#if defined(RTS_DEBUG) || defined(RTS_PROFILE)
# define HAS_ASSERTS
# define HAS_LOGS
#endif
Expand Down
4 changes: 1 addition & 3 deletions Core/Libraries/Source/debug/debug_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1437,9 +1437,7 @@ void Debug::WriteBuildInfo(void)
(*this) << " " << m_version;
if (*m_intVersion)
(*this) << " internal " << m_intVersion;
#if defined(RTS_INTERNAL)
operator<<(" internal");
#elif defined(RTS_DEBUG)
#if defined(RTS_DEBUG)
operator<<(" debug");
#elif defined(RTS_PROFILE)
operator<<(" profile");
Expand Down
8 changes: 4 additions & 4 deletions Core/Libraries/Source/debug/debug_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
This module defines a number of macros. Usually only these macros should be
used to access any debug functionality.

All these macros are defined if either RTS_DEBUG or RTS_INTERNAL is defined. Otherwise
All these macros are defined if RTS_DEBUG is defined. Otherwise
all of them (with the exception of DCHECK and DCHECK_MSG) will be removed.
*/
///@{
Expand All @@ -57,7 +57,7 @@
returns false. The user will then have the choice of aborting the program,
continuing once or continuing with completely ignoring that specific assertion.

Assertions are completely removed if neither RTS_DEBUG nor RTS_INTERNAL are defined.
Assertions are completely removed if RTS_DEBUG is not defined.

\param expr expression, trigger assert window if false
*/
Expand All @@ -73,7 +73,7 @@
\endcode
For more information see the \ref debug_stream page.

Assertions are completely removed if neither RTS_DEBUG nor RTS_INTERNAL are defined.
Assertions are completely removed if RTS_DEBUG is not defined.

\param expr expression, trigger assert window if false
\param msg custom message stream, see \ref debug_stream
Expand Down Expand Up @@ -282,7 +282,7 @@ DFAIL_IF_MSG(!ptrval,"pointer must not be NULL") return;

///@}

#elif defined(RTS_DEBUG) || defined(RTS_INTERNAL)
#elif defined(RTS_DEBUG)

#define DASSERT(expr) \
((void)( Debug::SkipNext() || \
Expand Down
4 changes: 0 additions & 4 deletions Core/Libraries/Source/profile/profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
#ifndef PROFILE_H // Include guard
#define PROFILE_H

#if defined(RTS_DEBUG) && defined(RTS_INTERNAL)
#error "Only either RTS_DEBUG or RTS_INTERNAL should ever be defined"
#endif

// include all our public header files (use double quotes here)
#include "profile_doc.h"
#include "profile_highlevel.h"
Expand Down
5 changes: 0 additions & 5 deletions Core/Tools/MapCacheBuilder/Source/WinMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@

// PRIVATE TYPES //////////////////////////////////////////////////////////////

#ifdef RTS_INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
//#pragma message("************************************** WARNING, optimization disabled for debugging purposes")
#endif

// PRIVATE DATA ///////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/Common/AsciiString.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AsciiString
// add a ctor/dtor, 'cuz they won't ever be called.
struct AsciiStringData
{
#if defined(RTS_DEBUG) || defined(RTS_INTERNAL)
#if defined(RTS_DEBUG)
const char* m_debugptr; // just makes it easier to read in the debugger
#endif
unsigned short m_refCount; // reference count
Expand Down
Loading
Loading