Skip to content
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

"Special" hull color bugs #2

Closed
rherriman opened this issue Sep 9, 2018 · 3 comments
Closed

"Special" hull color bugs #2

rherriman opened this issue Sep 9, 2018 · 3 comments
Assignees
Labels
bug Something isn't working graphics Problems with OpenGL or generally rendering related

Comments

@rherriman
Copy link
Member

rherriman commented Sep 9, 2018

There are a couple issues that revolve around black and white hull colors:

  • Leg and scout shapes retain their true team color, and
  • The HUD improperly replaces the true team color with black or white

Code is in place that is meant to replace the color of the scout, but it is not working.

The parts for the legs appear in CWalkerActor, itself a subclass of CAbstractPlayer (which is normally where special colors are applied), so I'm not sure why this ever worked in the original source. Maybe a peculiarity with Think C?

The HUD simply reads the value of the longTeamColor property in CAbstractPlayer, so this will need to be set another way. I'd recommend ditching the property entirely if possible and replacing it with a method that converts teamColor to the corresponding long value. In that case we'd want to move it to CAbstractActor.

rherriman added a commit to rherriman/Avara that referenced this issue Sep 10, 2018
Everything in issue avaraline#2 is resolved, unfortunately we now have the
opposite problem! The HUD is correct, the leg and scout shapes are
correct, but the head retains the true team color.

I suspect the issues lies with CBSPPart::ReplaceColor itself, based on
how it seems to usually be called. The current implementation replaces
`origColor` with `newColor`, but only if `origColor` is actually
encountered. If the color (`kMarkerColor`, for example) was already
replaced, it won't work.
@rherriman
Copy link
Member Author

I managed to fix the issues I reported above, but it was at the expense of the head color replacement. I now believe CBSPPart::ReplaceColor may not working as intended. We usually see it written as ReplaceColor(kMarkerColor, ...) which suggests that it is meant to replace the color for any polygon that is or was originally set to kMarkerColor. Right now, ReplaceColor is naïve and only applies to polygons that currently match the first parameter.

@rherriman
Copy link
Member Author

I have since confirmed that CBSPPart::ReplaceColor is meant to behave in the way I described above by examining the original source. I intend on fixing the implementation myself, which I anticipate will resolve #3 as well as other small issues not formally catalogued at the moment.

@rherriman rherriman self-assigned this Sep 10, 2018
@rherriman rherriman added the bug Something isn't working label Sep 10, 2018
@rherriman
Copy link
Member Author

The problem persists even after #14, the issue being that CWalkerActor removes, replaces, and modifies the hull head color after SetSpecialColor is called. Need to either change the way special colors are implemented (and possibly alter the API just introduced in #14) or figure out how to fix CWalkerActor (and determine why it is doing what it is doing in the first place).

@assertivist assertivist added the graphics Problems with OpenGL or generally rendering related label Mar 3, 2019
@assertivist assertivist added this to To do in Avara port 1.0 May 8, 2020
assertivist pushed a commit to assertivist/Avara that referenced this issue May 28, 2020
First 2 gzr levelsets added + miscellaneous
assertivist pushed a commit to assertivist/Avara that referenced this issue Jul 8, 2020
@assertivist assertivist moved this from To do to Done in Avara port 1.0 Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working graphics Problems with OpenGL or generally rendering related
Projects
Status: Done
Development

No branches or pull requests

2 participants