Skip to content

[GEN][ZH] Fix DEBUG_CRC compile errors #778

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 1 commit into from
Apr 29, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Generals/Code/GameEngine/Include/GameLogic/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,8 @@ class Object : public Thing, public Snapshot

}; // end class Object

#ifdef DEBUG_LOGGING
// describe an object as an AsciiString: e.g. "Object 102 (KillerBuggy) [GLARocketBuggy, owned by player 2 (GLAIntroPlayer)]"
AsciiString DescribeObject(const Object *obj);
#endif // DEBUG_LOGGING
AsciiString DebugDescribeObject(const Object *obj);

#if defined(_DEBUG) || defined(_INTERNAL)
#define DEBUG_OBJECT_ID_EXISTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ void Path::computePointOnPath(
ClosestPointOnPathInfo& out
)
{
CRCDEBUG_LOG(("Path::computePointOnPath() fzor %s\n", DescribeObject(obj).str()));
CRCDEBUG_LOG(("Path::computePointOnPath() for %s\n", DebugDescribeObject(obj).str()));

out.layer = LAYER_GROUND;
out.posOnPath.zero();
Expand Down
4 changes: 1 addition & 3 deletions Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ extern void addIcon(const Coord3D *pos, Real width, Int numFramesDuration, RGBCo

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
#ifdef DEBUG_LOGGING
AsciiString DescribeObject(const Object *obj)
AsciiString DebugDescribeObject(const Object *obj)
{
if (!obj)
return "<No Object>";
Expand All @@ -167,7 +166,6 @@ AsciiString DescribeObject(const Object *obj)

return ret;
}
#endif // DEBUG_LOGGING

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ UpdateSleepTime AIUpdateInterface::doLocomotor( void )
// obstacles, and follow the intermediate path points.
ClosestPointOnPathInfo info;
CRCDEBUG_LOG(("AIUpdateInterface::doLocomotor() - calling computePointOnPath() for %s\n",
DescribeObject(getObject()).str()));
DebugDescribeObject(getObject()).str()));
getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info);
onPathDistToGoal = info.distAlongPath;
goalPos = info.posOnPath;
Expand Down
4 changes: 1 addition & 3 deletions GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,8 @@ class Object : public Thing, public Snapshot

}; // end class Object

#ifdef DEBUG_LOGGING
// describe an object as an AsciiString: e.g. "Object 102 (KillerBuggy) [GLARocketBuggy, owned by player 2 (GLAIntroPlayer)]"
AsciiString DescribeObject(const Object *obj);
#endif // DEBUG_LOGGING
AsciiString DebugDescribeObject(const Object *obj);

#if defined(_DEBUG) || defined(_INTERNAL)
#define DEBUG_OBJECT_ID_EXISTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ void Path::computePointOnPath(
ClosestPointOnPathInfo& out
)
{
CRCDEBUG_LOG(("Path::computePointOnPath() fzor %s\n", DescribeObject(obj).str()));
CRCDEBUG_LOG(("Path::computePointOnPath() for %s\n", DebugDescribeObject(obj).str()));

out.layer = LAYER_GROUND;
out.posOnPath.zero();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ extern void addIcon(const Coord3D *pos, Real width, Int numFramesDuration, RGBCo

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
#ifdef DEBUG_LOGGING
AsciiString DescribeObject(const Object *obj)
AsciiString DebugDescribeObject(const Object *obj)
{
if (!obj)
return "<No Object>";
Expand All @@ -177,7 +176,6 @@ AsciiString DescribeObject(const Object *obj)

return ret;
}
#endif // DEBUG_LOGGING

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ UpdateSleepTime AIUpdateInterface::doLocomotor( void )
// obstacles, and follow the intermediate path points.
ClosestPointOnPathInfo info;
CRCDEBUG_LOG(("AIUpdateInterface::doLocomotor() - calling computePointOnPath() for %s\n",
DescribeObject(getObject()).str()));
DebugDescribeObject(getObject()).str()));
getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info);
onPathDistToGoal = info.distAlongPath;
goalPos = info.posOnPath;
Expand Down
Loading