-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add Speedometer #598
base: master
Are you sure you want to change the base?
Add Speedometer #598
Conversation
Jbudone
commented
Dec 17, 2022
- Introduced speedometer similar to JoeQuake, useful for speedrunners
- Updated character draws to allow size specification
- Added helpful calls -- find best matching color in palette; find hud size for offsetting
- Introduced speedometer similar to JoeQuake, useful for speedrunners - Updated character draws to allow size specification - Added helpful calls -- find best matching color in palette; find hud size for offsetting
@@ -566,6 +566,33 @@ void TexMgr_LoadPalette (void) | |||
((byte *)&d_8to24table_conchars[0])[3] = 0; | |||
} | |||
|
|||
/* | |||
================ | |||
TexMgr_NearestColor |
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.
This doesn't belong here. Has nothing to do with texture management.
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.
Agreed -- what would be a better spot for this? gl_draw.c maybe?
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.
Or maybe common.c?
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.
Are there plans to allow for changing colors? This seems to be only ever called with the pair of values (20, 20, 0), (40, 30, 15), so you could assume the default Quake palette is used and do bgColor = 51; fillColor = 19;
. Otherwise gl_draw.c
may be the best place.
A few general comments:
|
The abstractions (_WithSize, _NearestColor) were intentional :) its only called here yes, but helpful for future newcomers like myself to not have to hardcode (eg. looking up palette and deciding color, or not being able to scale text) |
I like the idea. scr_showspeed is the only reason I use my own fork. My implementation is simpler - just print the speed under crosshair. |
Poke @Novum -- Is there anything else that needs to change?
|
static int fillColor = -1; | ||
if (bgColor == -1) | ||
{ | ||
bgColor = TexMgr_NearestColor (20, 20, 0); |
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.
What's the point of this? Can't you just hard code the closest color from the palette? The palette is fixed as far as I know? Why does it even have to be a palette color?
7b55369
to
87b39c2
Compare