-
Notifications
You must be signed in to change notification settings - Fork 119
bugfix(radar): Add hero radar objects into its own list to get rid of hero cache updates and its related issues #1893
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
base: main
Are you sure you want to change the base?
Conversation
98b5355 to
3bd7411
Compare
GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp
Outdated
Show resolved
Hide resolved
| Bool W3DRadar::canRenderObject( const RadarObject *rObj, const Player *localPlayer ) | ||
| { | ||
| if (rObj->isTemporarilyHidden()) | ||
| return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using if-brackets for every other if statement in this function, while the original code did not. For consistency, I would also use brackets here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| while( *list ) | ||
| { | ||
|
|
||
| // get next object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove comment as well. code is self-explanatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments removed.
| m_localObjectList->friend_getObject()->friend_setRadarData( NULL ); | ||
| (*list)->friend_getObject()->friend_setRadarData( NULL ); | ||
|
|
||
| // delete the head of the list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment for self-explanatory code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments removed.
| for( Object *obj = TheGameLogic->getFirstObject(); obj; obj = obj->getNextObject() ) | ||
| { | ||
|
|
||
| DEBUG_ASSERTCRASH( obj->friend_getRadarData() == NULL, ("oops") ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe take the opportunity for a more descriptive assert message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
3bd7411 to
41559c0
Compare
… hero cache updates and its related issues (#1893)
41559c0 to
fd63484
Compare
|
Rebased on main. |
Merge with Rebase
This change adds hero radar objects into its own list to get rid of hero cache updates and its related issues. As a side benefit the local radar object list render update is now also marginally cheaper because it no longer needs to update the hero objects cache.
This change contains 4 commits, of which 3 are refactors to simplify some Radar functions to make them reusable in other call sites.
TODO