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
4 changes: 3 additions & 1 deletion Core/GameEngine/Include/Common/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

#pragma once

#include <Utility/CppMacros.h>

class AsciiString;

#define NO_RELEASE_DEBUG_LOGGING
Expand Down Expand Up @@ -190,7 +192,7 @@ class AsciiString;
if (!ignoreCrash) { \
TheCurrentIgnoreCrashPtr = &ignoreCrash; \
DebugCrash m ; \
TheCurrentIgnoreCrashPtr = NULL; \
TheCurrentIgnoreCrashPtr = nullptr; \
} \
} \
} while (0)
Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/aabtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#pragma once

#include "always.h"
#include "refcount.h"
#include "simplevec.h"
#include "vector3.h"
#include "Vector3i.h"
Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/font3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#pragma once

#include "always.h"
#include "refcount.h"
#include "vector4.h"
#include "widestring.h"
#include "rect.h"
Expand Down
2 changes: 0 additions & 2 deletions Core/Libraries/Source/WWVegas/WW3D2/hanim.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@

#include "always.h"
#include "quat.h"
#include "refcount.h"
#include "w3d_file.h"
#include "hash.h"
#include "mempool.h"
#include <refcount.h>
#include <SLIST.h>
#include <Vector.h>

Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/hcanim.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#include "always.h"
#include "quat.h"
#include "refcount.h"
#include "w3d_file.h"
#include "SLIST.h"
#include "Vector.h"
Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/projector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

#include "projector.h"
#include "refcount.h"
#include "matrixmapper.h"


Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

#pragma once

#include "always.h"
#include "render2d.h"
#include "refcount.h"
#include "Vector.h"
#include "vector2i.h"
#include "wwstring.h"
Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/rendobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#pragma once

#include "always.h"
#include "refcount.h"
#include "sphere.h"
#include "coltype.h"
#include "aabox.h"
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/snapPts.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#pragma once

#include "refcount.h"
#include "always.h"
#include "Vector.h"
#include "vector3.h"
#include "w3derr.h"
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

#pragma once

#include "always.h"
#include "ww3dformat.h"
#include "refcount.h"

struct IDirect3DSurface8;
class Vector2i;
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWAudio/AudibleSound.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
#pragma warning (pop)

//#include <malloc.h>
#include "always.h"
#include "vector3.h"
#include "matrix3d.h"
#include "refcount.h"
#include "RAWFILE.h"
#include "SoundSceneObj.h"
#include "Vector.h"
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWAudio/SoundBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "mss.h"
#pragma warning (pop)

#include "refcount.h"
#include "always.h"


// Forward declarations
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWAudio/SoundCullObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

#pragma once

#include "always.h"
#include "SoundSceneObj.h"
#include "cullsys.h"
#include "refcount.h"
#include "mempool.h"
#include "multilist.h"

Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#pragma once

#include "refcount.h"
#include "always.h"
#include "WWAudio.h"
#include "bittype.h"
#include "persist.h"
Expand Down
4 changes: 1 addition & 3 deletions Core/Libraries/Source/WWVegas/WWAudio/Threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */


#include "always.h"
#include "Threads.h"
#include "refcount.h"
#include "Utils.h"
#include <process.h>
#include "wwdebug.h"


///////////////////////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 4 additions & 4 deletions Core/Libraries/Source/WWVegas/WWDebug/wwdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@
#include <Utility/intrin_compat.h>
#endif

#include "../../../../../Core/GameEngine/Include/Common/Debug.h"

// The macro MESSAGE allows user to put:
// #pragma MESSAGE("Hello world")
// anywhere in a source file. The message:
// sourcefname.cpp (123) : Hello world
// would be printed if put in sourcefname.cpp on line 123 in compile window like an error.
// You can then use next/prev error hot keys to see where comment is. It is not an error and
// will be printed everytime it is compiled. Very useful to put comments in code that cannot
// be forgoten.
// will be printed every time it is compiled. Very useful to put comments in code that cannot
// be forgotten.
#define STRING_IT(a) #a
#define TOKEN_IT(a) STRING_IT(,##a)
#define MESSAGE(a) message (__FILE__ "(" TOKEN_IT(__LINE__) ") : " a)
Expand Down Expand Up @@ -105,8 +107,6 @@ void WWDebug_DBWin32_Message_Handler( const char * message);
** WWDEBUG_SAY(("dir = %f",dir));
*/

#include "../../../../../Core/GameEngine/Include/Common/Debug.h"

#ifdef DEBUG_LOGGING
#define WWDEBUG_SAY(x) DEBUG_LOG(x)
#define WWDEBUG_WARNING(x) DEBUG_LOG(x)
Expand Down
1 change: 1 addition & 0 deletions Core/Libraries/Source/WWVegas/WWLib/WWCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#pragma once

#include "refcount.h"
#include "STLUtils.h"
#include "stringex.h"
#include <Utility/stdio_adapter.h>
Expand Down
9 changes: 8 additions & 1 deletion Core/Libraries/Source/WWVegas/WWLib/always.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,20 @@
#define MSGW3DNEWARRAY(MSG) new( MSG, 0 )
#define W3DNEW new("W3D_" __FILE__, 0)
#define W3DNEWARRAY new("W3A_" __FILE__, 0)

#define NEW_REF( C, P ) ( (C*)RefCountClass::Set_Ref_Owner( W3DNEW C P, __FILE__, __LINE__ ) )
#define SET_REF_OWNER( P ) ( RefCountClass::Set_Ref_Owner( P, __FILE__, __LINE__ ) )
#else
#define MSGW3DNEW(MSG) new
#define MSGW3DNEWARRAY(MSG) new
#define W3DNEW new
#define W3DNEWARRAY new

#define NEW_REF( C, P ) ( W3DNEW C P )
#define SET_REF_OWNER( P ) P
#endif


// ----------------------------------------------------------------------------
extern void* createW3DMemPool(const char *poolName, int allocationSize);
extern void* allocateFromW3DMemPool(void* p, int allocationSize);
Expand Down Expand Up @@ -187,7 +194,7 @@ class W3DMPO
** Define the MIN and MAX macros.
** NOTE: Joe used to #include <minmax.h> in the various compiler header files. This
** header defines 'min' and 'max' macros which conflict with the surrender code so
** I'm relpacing all occurances of 'min' and 'max with 'MIN' and 'MAX'. For code which
** I'm replacing all occurrences of 'min' and 'max with 'MIN' and 'MAX'. For code which
** is out of our domain (e.g. Max sdk) I'm declaring template functions for 'min' and 'max'
*/
#define NOMINMAX
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/ntree.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#pragma once

#include "refcount.h"
#include "always.h"
#include "wwstring.h"


Expand Down
18 changes: 5 additions & 13 deletions Core/Libraries/Source/WWVegas/WWLib/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

#pragma once

#include "always.h"
#include "LISTNODE.h"
#include "wwdebug.h"
#include "WWDebug/wwdebug.h"


class RefCountClass;

Expand All @@ -51,14 +51,6 @@
int Line;
};

#define NEW_REF( C, P ) ( (C*)RefCountClass::Set_Ref_Owner( W3DNEW C P, __FILE__, __LINE__ ) )
#define SET_REF_OWNER( P ) ( RefCountClass::Set_Ref_Owner( P, __FILE__, __LINE__ ) )

#else

#define NEW_REF( C, P ) ( W3DNEW C P )
#define SET_REF_OWNER( P ) P

#endif // RTS_DEBUG


Expand All @@ -69,7 +61,7 @@
** point it at the new object, and add-ref the new object (if its not null...)
*/
#define REF_PTR_SET(dst,src) { if (src) (src)->Add_Ref(); if (dst) (dst)->Release_Ref(); (dst) = (src); }
#define REF_PTR_RELEASE(x) { if (x) x->Release_Ref(); x = NULL; }
#define REF_PTR_RELEASE(x) { if (x) x->Release_Ref(); x = nullptr; }


/*
Expand Down Expand Up @@ -104,7 +96,7 @@
RefCountClass(void)
: NumRefs(1)
#ifdef RTS_DEBUG
, ActiveRefNode(this)

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 99 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list
#endif
{
#ifdef RTS_DEBUG
Expand All @@ -119,7 +111,7 @@
RefCountClass(const RefCountClass & )
: NumRefs(1)
#ifdef RTS_DEBUG
, ActiveRefNode(this)

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list

Check warning on line 114 in Core/Libraries/Source/WWVegas/WWLib/refcount.h

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'this' : used in base member initializer list
#endif
{
#ifdef RTS_DEBUG
Expand All @@ -137,14 +129,14 @@
#ifdef RTS_DEBUG
void Add_Ref(void) const;
#else
WWINLINE void Add_Ref(void) const { NumRefs++; }
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
void Release_Ref(void) const
{
#ifdef RTS_DEBUG
Dec_Total_Refs(this);
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/sharebuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#pragma once

#include "refcount.h"
#include "always.h"


/*
Expand Down
3 changes: 1 addition & 2 deletions Core/Libraries/Source/WWVegas/WWMath/cullsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@

#pragma once

#include "wwdebug.h"
#include "always.h"
#include "stdlib.h"
#include "refcount.h"
#include "aabox.h"

class CullableClass;
Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WWMath/lookuptable.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "always.h"
#include "simplevec.h"
#include "wwstring.h"
#include "refcount.h"
#include "multilist.h"
#include "wwmath.h"

Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WWSaveLoad/persist.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#pragma once

#include "always.h"
#include "refcount.h"
#include "postloadable.h"

class PersistFactoryClass;
Expand Down
1 change: 0 additions & 1 deletion Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@


#include "pointerremap.h"
#include "refcount.h"
#include "wwdebug.h"


Expand Down
9 changes: 5 additions & 4 deletions Dependencies/Utility/Utility/CppMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
#endif

#if __cplusplus >= 201103L
#define CPP_11(code) code
#define CPP_11(code) code
#else
#define CPP_11(code)
#define static_assert(expr, msg)
#define constexpr
#define CPP_11(code)
#define static_assert(expr, msg)
#define constexpr
#define nullptr 0
#endif
2 changes: 0 additions & 2 deletions Generals/Code/GameEngine/Include/Common/StateMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#include "Common/Snapshot.h"
#include "Common/Xfer.h"

#include "refcount.h"

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion Generals/Code/GameEngine/Include/GameLogic/AI.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "Common/GameType.h"
#include "GameLogic/Damage.h"
#include "Common/STLTypedefs.h"
#include "refcount.h"
#include "ref_ptr.h"

class AIGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#include "always.h"
#include "wwdebug.h"
#include "refcount.h"
#include "sphere.h"

class DX8Wrapper;
Expand Down
1 change: 0 additions & 1 deletion Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "always.h"
#include "wwstring.h"
#include "simplevec.h"
#include "refcount.h"
#include "Vector.h"
#include "dx8list.h"
#include "shader.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#include "always.h"
#include "wwdebug.h"
#include "refcount.h"
#include "dx8fvf.h"

const unsigned dynamic_fvf_type=D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX2|D3DFVF_DIFFUSE;
Expand Down
3 changes: 1 addition & 2 deletions Generals/Code/Libraries/Source/WWVegas/WW3D2/mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@

#pragma once

#include "refcount.h"
#include "always.h"
#include "w3d_file.h"
#include "w3derr.h"
#include "wwdebug.h"
#include "vector2.h"
#include "vector3.h"
#include "ww3d.h"
Expand Down
Loading
Loading