diff --git a/code/hud/hud.cpp b/code/hud/hud.cpp index b205a2fe817..59862334db9 100644 --- a/code/hud/hud.cpp +++ b/code/hud/hud.cpp @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; diff --git a/code/hud/hud.h b/code/hud/hud.h index 19f58e9ca61..81213683e20 100644 --- a/code/hud/hud.h +++ b/code/hud/hud.h @@ -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); diff --git a/code/hud/hudtargetbox.cpp b/code/hud/hudtargetbox.cpp index adc08733540..6971ffa1f94 100644 --- a/code/hud/hudtargetbox.cpp +++ b/code/hud/hudtargetbox.cpp @@ -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); } } @@ -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 diff --git a/code/mission/missiontraining.cpp b/code/mission/missiontraining.cpp index 3f9a9ce5ea2..5bda669bed0 100644 --- a/code/mission/missiontraining.cpp +++ b/code/mission/missiontraining.cpp @@ -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; diff --git a/code/radar/radardradis.h b/code/radar/radardradis.h index 9480219b542..8924366955c 100644 --- a/code/radar/radardradis.h +++ b/code/radar/radardradis.h @@ -11,6 +11,7 @@ #include "globalincs/pstypes.h" #include "radar/radarsetup.h" +#include "gamesnd/gamesnd.h" class object; struct blip;