Skip to content

Commit

Permalink
fixes and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MjnMixael committed Dec 29, 2024
1 parent d39391c commit 74ccc32
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions code/hud/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ void HudGauge::renderPrintfWithGauge(int x, int y, int gauge_id, float scale, bo
renderString(x, y, gauge_id, tmp, scale, config);
}

void HudGauge::renderBitmapColor(int frame, int x, int y, float scale, bool config)
void HudGauge::renderBitmapColor(int frame, int x, int y, float scale, bool config) const
{
int nx = 0, ny = 0;

Expand Down Expand Up @@ -921,7 +921,7 @@ void HudGauge::renderBitmapColor(int frame, int x, int y, float scale, bool conf
gr_reset_screen_scale();
}

void HudGauge::renderBitmap(int x, int y, float scale, bool config)
void HudGauge::renderBitmap(int x, int y, float scale, bool config) const
{
int nx = 0, ny = 0;

Expand Down Expand Up @@ -957,14 +957,14 @@ void HudGauge::renderBitmap(int x, int y, float scale, bool config)
gr_reset_screen_scale();
}

void HudGauge::renderBitmap(int frame, int x, int y, float scale, bool config)
void HudGauge::renderBitmap(int frame, int x, int y, float scale, bool config) const
{
gr_set_bitmap(frame);
renderBitmap(x, y, scale, config);
}

// Note that w, h, sx, and sy whould be unscaled values!
void HudGauge::renderBitmapEx(int frame, int x, int y, int w, int h, int sx, int sy, float scale, bool config)
void HudGauge::renderBitmapEx(int frame, int x, int y, int w, int h, int sx, int sy, float scale, bool config) const
{
int nx = 0, ny = 0;

Expand Down Expand Up @@ -1002,7 +1002,7 @@ void HudGauge::renderBitmapEx(int frame, int x, int y, int w, int h, int sx, int
gr_reset_screen_scale();
}

void HudGauge::renderLine(int x1, int y1, int x2, int y2, bool config)
void HudGauge::renderLine(int x1, int y1, int x2, int y2, bool config) const
{
int nx = 0, ny = 0;

Expand Down Expand Up @@ -1031,7 +1031,7 @@ void HudGauge::renderLine(int x1, int y1, int x2, int y2, bool config)
gr_reset_screen_scale();
}

void HudGauge::renderGradientLine(int x1, int y1, int x2, int y2, bool config)
void HudGauge::renderGradientLine(int x1, int y1, int x2, int y2, bool config) const
{
int nx = 0, ny = 0;

Expand Down Expand Up @@ -1060,7 +1060,7 @@ void HudGauge::renderGradientLine(int x1, int y1, int x2, int y2, bool config)
gr_reset_screen_scale();
}

void HudGauge::renderRect(int x, int y, int w, int h, bool config)
void HudGauge::renderRect(int x, int y, int w, int h, bool config) const
{
int nx = 0, ny = 0;

Expand Down Expand Up @@ -1089,7 +1089,7 @@ void HudGauge::renderRect(int x, int y, int w, int h, bool config)
gr_reset_screen_scale();
}

void HudGauge::renderCircle(int x, int y, int diameter, bool filled, bool config)
void HudGauge::renderCircle(int x, int y, int diameter, bool filled, bool config) const
{
int nx = 0, ny = 0;

Expand Down
21 changes: 10 additions & 11 deletions code/hud/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,19 @@ class HudGauge
void setGaugeFrame(int frame_offset);

// rendering functions
void renderBitmap(int x, int y, float scale = 1.0f, bool config = false);
void renderBitmap(int frame, int x, int y, float scale = 1.0f, bool config = false);
void renderBitmapColor(int frame, int x, int y, float scale = 1.0f, bool config = false);
void renderBitmapUv(int frame, int x, int y, int w, int h, float u0, float v0, float u1, float v1);
void renderBitmapEx(int frame, int x, int y, int w, int h, int sx, int sy, float scale = 1.0f, bool config = false);
void renderBitmap(int x, int y, float scale = 1.0f, bool config = false) const;
void renderBitmap(int frame, int x, int y, float scale = 1.0f, bool config = false) const;
void renderBitmapColor(int frame, int x, int y, float scale = 1.0f, bool config = false) const;
void renderBitmapEx(int frame, int x, int y, int w, int h, int sx, int sy, float scale = 1.0f, bool config = false) const;
void renderString(int x, int y, const char *str, float scale = 1.0f, bool config = false);
void renderString(int x, int y, int gauge_id, const char *str, float scale = 1.0f, bool config = false);
void renderStringAlignCenter(int x, int y, int area_width, const char *s, float scale = 1.0f, bool config = false);
void renderPrintf(int x, int y, float scale, bool config, SCP_FORMAT_STRING const char* format, ...) SCP_FORMAT_STRING_ARGS(4, 5);
void renderPrintfWithGauge(int x, int y, int gauge_id, float scale, bool config, SCP_FORMAT_STRING const char* format, ...) SCP_FORMAT_STRING_ARGS(5, 6);
void renderLine(int x1, int y1, int x2, int y2, bool config = false);
void renderGradientLine(int x1, int y1, int x2, int y2, bool config = false);
void renderRect(int x, int y, int w, int h, bool config = false);
void renderCircle(int x, int y, int diameter, bool filled = true, bool config = false);
void renderPrintf(int x, int y, float scale, bool config, SCP_FORMAT_STRING const char* format, ...) SCP_FORMAT_STRING_ARGS(6, 7);
void renderPrintfWithGauge(int x, int y, int gauge_id, float scale, bool config, SCP_FORMAT_STRING const char* format, ...) SCP_FORMAT_STRING_ARGS(7, 8);
void renderLine(int x1, int y1, int x2, int y2, bool config = false) const;
void renderGradientLine(int x1, int y1, int x2, int y2, bool config = false) const;
void renderRect(int x, int y, int w, int h, bool config = false) const;
void renderCircle(int x, int y, int diameter, bool filled = true, bool config = false) const;

void unsize(int *x, int *y);
void unsize(float *x, float *y);
Expand Down
4 changes: 2 additions & 2 deletions code/hud/hudtargetbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ void HudGaugeTargetBox::renderTargetJumpNode(object *target_objp)
hud_num_make_mono(outstr, font_num);
gr_get_string_size(&w,&h,outstr);

renderPrintf(position[0] + Dist_offsets[0]+hx, position[1] + Dist_offsets[1]+hy, EG_TBOX_DIST, "%s", outstr);
renderPrintfWithGauge(position[0] + Dist_offsets[0]+hx, position[1] + Dist_offsets[1]+hy, EG_TBOX_DIST, 1.0f, false, "%s", outstr);
}
}

Expand Down Expand Up @@ -1713,7 +1713,7 @@ void HudGaugeTargetBox::renderTargetShipInfo(object *target_objp)
maybeFlashElement(TBOX_FLASH_HULL);
}

renderPrintf(position[0] + Hull_offsets[0]-w, position[1] + Hull_offsets[1], EG_TBOX_HULL, "%s", outstr);
renderPrintfWithGauge(position[0] + Hull_offsets[0]-w, position[1] + Hull_offsets[1], EG_TBOX_HULL, 1.0f, false, "%s", outstr);
setGaugeColor();

// print out the targeted sub-system and % integrity
Expand Down
2 changes: 1 addition & 1 deletion code/mission/missiontraining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void HudGaugeDirectives::render(float /*frametime*/, bool /*config*/)
renderBitmap(directives_top.first_frame, position[0], position[1]);

// print out title
renderPrintf(position[0] + header_offsets[0], position[1] + header_offsets[1], EG_OBJ_TITLE, "%s", XSTR( "directives", 422));
renderPrintfWithGauge(position[0] + header_offsets[0], position[1] + header_offsets[1], EG_OBJ_TITLE, 1.0f, false, "%s", XSTR( "directives", 422));

bx = position[0];
by = position[1] + middle_frame_offset_y;
Expand Down
1 change: 1 addition & 0 deletions code/radar/radardradis.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "globalincs/pstypes.h"
#include "radar/radarsetup.h"
#include "gamesnd/gamesnd.h"

class object;
struct blip;
Expand Down

0 comments on commit 74ccc32

Please sign in to comment.