-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1549 from dgelessus/plkeydata_old_debug_fields
Remove old debug-only fields from `plKeyData`
- Loading branch information
Showing
8 changed files
with
17 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,11 +46,11 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "HeadSpin.h" | ||
#include "hsRefCnt.h" | ||
|
||
#include <string_theory/string> | ||
|
||
#include "pnKeyedObject/plKey.h" | ||
#include "pnNetBase/pnNetBase.h" | ||
|
||
namespace ST { class string; } | ||
|
||
// TODO: Rank List (seems to be unused in regular gameplay though...) | ||
// That's some strange stuff... | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#ifndef plTimerCallbackManager_Defined | ||
#define plTimerCallbackManager_Defined | ||
|
||
#include <vector> | ||
|
||
#include "pnKeyedObject/hsKeyedObject.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,12 +44,12 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
|
||
#include "HeadSpin.h" | ||
#include "plRefFlags.h" | ||
#include <string_theory/string> | ||
|
||
class hsKeyedObject; | ||
class plRefMsg; | ||
class plUoid; | ||
class hsBitVector; | ||
namespace ST { class string; } | ||
|
||
//// plKey /////////////////////////////////////////////////////////////////// | ||
// Pointer to a plKeyData struct, which is a handle to a keyedObject | ||
|
@@ -141,12 +141,6 @@ class plKeyData | |
plKeyData(); | ||
virtual ~plKeyData(); | ||
|
||
#ifdef HS_DEBUGGING | ||
// Debugging info fields | ||
ST::string fIDName; | ||
const char* fClassType; | ||
#endif | ||
|
||
//// RefCount Stuff ////////////////////////////////////////////////////////// | ||
// The refcounts on plKeyData/plKeyImps are zero-based. When you first create | ||
// a new plKeyImp (which should ONLY ever be done inside the resMgr), it gets | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "plgDispatch.h" | ||
|
||
#if defined(HS_DEBUGGING) || defined(LOG_ACTIVE_REFS) | ||
#include <string_theory/format> | ||
#include "pnFactory/plFactory.h" | ||
#endif | ||
|
||
|
@@ -88,11 +89,7 @@ plKeyImp::plKeyImp() : | |
fDataLen(-1), | ||
fNumActiveRefs(), | ||
fPendingRefs(1) | ||
{ | ||
#ifdef HS_DEBUGGING | ||
fClassType = nullptr; | ||
#endif | ||
} | ||
{} | ||
|
||
plKeyImp::plKeyImp(plUoid u, uint32_t pos,uint32_t len): | ||
fUoid(std::move(u)), | ||
|
@@ -103,24 +100,12 @@ plKeyImp::plKeyImp(plUoid u, uint32_t pos,uint32_t len): | |
fPendingRefs(1) | ||
{ | ||
plProfile_NewMem(KeyMem, CalcKeySize(this)); | ||
|
||
#ifdef HS_DEBUGGING | ||
fIDName = fUoid.GetObjectName(); | ||
fClassType = plFactory::GetNameOfClass( fUoid.GetClassType() ); | ||
#endif | ||
} | ||
|
||
plKeyImp::~plKeyImp() | ||
{ | ||
plProfile_DelMem(KeyMem, CalcKeySize(this)); | ||
|
||
#if defined(HS_DEBUGGING) && 0 | ||
// Colin debugging | ||
char buf[512]; | ||
sprintf(buf, "0x%x %s %s\n", this, fIDName, fClassType); | ||
hsStatusMessage(buf); | ||
#endif | ||
|
||
hsAssert(fObjectPtr == nullptr, "Deleting non-nil key! Bad idea!"); | ||
|
||
if (fCloneOwner != nullptr) | ||
|
@@ -144,10 +129,6 @@ plKeyImp::~plKeyImp() | |
void plKeyImp::SetUoid(const plUoid& uoid) | ||
{ | ||
fUoid = uoid; | ||
#ifdef HS_DEBUGGING | ||
fIDName = fUoid.GetObjectName(); | ||
fClassType = plFactory::GetNameOfClass(fUoid.GetClassType()); | ||
#endif | ||
} | ||
|
||
ST::string plKeyImp::GetName() const | ||
|
@@ -171,11 +152,6 @@ void plKeyImp::CopyForClone(const plKeyImp *p, uint32_t playerID, uint32_t clone | |
fObjectPtr = nullptr; // the clone object start as nil | ||
fUoid = p->GetUoid(); // we will set the UOID the same to start | ||
|
||
#ifdef HS_DEBUGGING | ||
fIDName = fUoid.GetObjectName(); | ||
fClassType = plFactory::GetNameOfClass( fUoid.GetClassType() ); | ||
#endif | ||
|
||
fStartPos = p->GetStartPos(); | ||
fDataLen = p->GetDataLen(); | ||
fUoid.SetClone(playerID, cloneID); | ||
|
@@ -200,11 +176,6 @@ void plKeyImp::Read(hsStream* s) | |
s->ReadLE32(&fDataLen); | ||
|
||
plProfile_NewMem(KeyMem, CalcKeySize(this)); | ||
|
||
#ifdef HS_DEBUGGING | ||
fIDName = fUoid.GetObjectName(); | ||
fClassType = plFactory::GetNameOfClass(fUoid.GetClassType()); | ||
#endif | ||
} | ||
|
||
void plKeyImp::SkipRead(hsStream* s) | ||
|
@@ -310,14 +281,9 @@ hsKeyedObject* plKeyImp::SetObjectPtr(hsKeyedObject* p) | |
if (p) | ||
{ | ||
#ifdef HS_DEBUGGING | ||
if (fClassType) | ||
{ | ||
char str[2048]; | ||
sprintf(str, "Mismatch of class (we are a %s, given a %s)", fClassType, p->ClassName()); | ||
hsAssert(fClassType == p->ClassName() || strcmp(fClassType, p->ClassName()) == 0, str); // points to static | ||
if (fUoid.GetClassType() != p->ClassIndex()) { | ||
hsAssert(false, ST::format("Mismatch of class (we are a {}, given a {})", plFactory::GetNameOfClass(fUoid.GetClassType()), p->ClassName()).c_str()); | ||
} | ||
else | ||
fClassType = p->ClassName(); | ||
#endif | ||
|
||
hsAssert(!fObjectPtr, "Setting an ObjectPtr thats already Set!"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,9 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#ifndef plMessage_inc | ||
#define plMessage_inc | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "pnFactory/plCreatable.h" | ||
#include "pnKeyedObject/plKey.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
|
||
#include "plMessage.h" | ||
|
||
#include <string_theory/string> | ||
|
||
#include "hsGeometry3.h" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,9 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
|
||
#include "HeadSpin.h" | ||
#include "plTimerCallbackManager.h" | ||
|
||
#include <algorithm> | ||
|
||
#include "pnMessage/plTimeMsg.h" | ||
#include "plgDispatch.h" | ||
#include "pnKeyedObject/plFixedKey.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "pnInputCore/plControlDefinition.h" | ||
#include "hsGeometry3.h" | ||
|
||
#include <string_theory/string> | ||
#include <utility> | ||
|
||
class plKeyEventMsg; | ||
|