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

Implement DoEndSummary2 (aka Damage Gallery) #152

Merged
merged 2 commits into from
Sep 16, 2022

Conversation

madebr
Copy link
Collaborator

@madebr madebr commented Sep 9, 2022

This pr implements the post-race "Damage Gallery".

Screenshot from 2022-09-09 15-32-46
Screenshot from 2022-09-09 15-32-01

Comment on lines +777 to +781
sel_actor = BrActorAllocate(BR_ACTOR_MODEL, NULL);
sel_actor->render_style = BR_RSTYLE_BOUNDING_EDGES;
sel_actor->render_style = BR_RSTYLE_NONE; // FIXME: remove this line once BR_RSTYLE_BOUNDING_EDGES rener style has been implemente
sel_actor->model = gWreck_array[gWreck_selected].actor->model;
BrActorAdd(gWreck_array[gWreck_selected].actor, sel_actor);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line:

sel_actor->render_style = BR_RSTYLE_NONE;

is the only difference with Carmageddon, because rendering bounding boxes is not implemented (yet) by the opengl renderern.

@dethrace-labs
Copy link
Owner

dethrace-labs commented Sep 11, 2022

I'm getting some compiler warnings on this new code -

few of these ones:

src/DETHRACE/common/racesumm.c:1005:34: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                    difference = abs(gWreck_array[i].pos_x - gWreck_array[gWreck_selected].pos_x);
                                 ^
src/DETHRACE/common/racesumm.c:1046:9: warning: variable 'old_mouse_x' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (gWreck_zoomed_in < 0) {

for things like old_mouse_x, in the past I've just initialized them to 0 in their declaration to get a clean build

@madebr
Copy link
Collaborator Author

madebr commented Sep 11, 2022

I'm getting some compiler warnings on this new code -

We really need to reduce the number of warnings to 0.
Because right now potential critical warnings are drown in silly warnings.
Right now, CI is just there to signal fail/no fail.
For rec2, I make it a point to have 0 warnings so every warning gets my full attention.

src/DETHRACE/common/racesumm.c:1005:34: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                    difference = abs(gWreck_array[i].pos_x - gWreck_array[gWreck_selected].pos_x);
                                 ^

This one is intentional, to silence the warning an explicit (int) needs to be added.

src/DETHRACE/common/racesumm.c:1046:9: warning: variable 'old_mouse_x' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (gWreck_zoomed_in < 0) {

for things like old_mouse_x, in the past I've just initialized them to 0 in their declaration to get a clean build

This indeed needs an explicit initialization.

I don't think there is a general way of tagging variables to say they are written by a function. Microsoft has SAL annotations but idk about other compilers.

@dethrace-labs
Copy link
Owner

dethrace-labs commented Sep 12, 2022

We really need to reduce the number of warnings to 0.

Agree. We used to have this, but over time the number has crept up. Its not bad on gcc/clang, but I think on windows (where I don't spend much time) is worse.

Need to be more intentional with the warnings we enable probably, things like "variable initialized but not used" shouldn't be flagged - we are replicating existing logic rather than writing everything as cleanly as possible.

@dethrace-labs dethrace-labs merged commit 9ec9fb0 into dethrace-labs:main Sep 16, 2022
@madebr madebr deleted the damage-gallery branch September 16, 2022 03:29
@dethrace-labs dethrace-labs added the enhancement New feature or request label Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants