diff --git a/common/include/fwd-gr.h b/common/include/fwd-gr.h index 0aa372967..2003b1799 100644 --- a/common/include/fwd-gr.h +++ b/common/include/fwd-gr.h @@ -33,7 +33,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #define GR_BLEND_ADDITIVE_A 1 // additive alpha blending #define GR_BLEND_ADDITIVE_C 2 // additive color blending -#define GWIDTH grd_curcanv->cv_bitmap.bm_w #define GHEIGHT grd_curcanv->cv_bitmap.bm_h #define SWIDTH (grd_curscreen->get_screen_width()) #define SHEIGHT (grd_curscreen->get_screen_height()) diff --git a/common/include/grdef.h b/common/include/grdef.h index bc63efd4d..b3e8a61e1 100644 --- a/common/include/grdef.h +++ b/common/include/grdef.h @@ -25,7 +25,6 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #define MINX 0 #define MINY 0 -#define MAXX (GWIDTH-1) #define MAXY (GHEIGHT-1) #define TYPE grd_curcanv->cv_bitmap.get_type() #define DATA grd_curcanv->cv_bitmap.get_bitmap_data() diff --git a/common/main/cli.cpp b/common/main/cli.cpp index 34bf520e8..0a05379ab 100644 --- a/common/main/cli.cpp +++ b/common/main/cli.cpp @@ -188,7 +188,7 @@ unsigned CLIState::draw(unsigned y, unsigned line_spacing) int prompt_width, h; gr_get_string_size(*grd_curcanv->cv_font, prompt_string, &prompt_width, &h, nullptr); y -= line_spacing; - const auto canvas_width = GWIDTH; + const auto canvas_width = grd_curcanv->cv_bitmap.bm_w; const unsigned max_pixels_per_line = canvas_width - (margin_width * 2) - prompt_width; const unsigned unknown_cursor_line = ~0u; const auto line_position = m_line_position; diff --git a/similar/main/automap.cpp b/similar/main/automap.cpp index a984be7ee..e33683d03 100644 --- a/similar/main/automap.cpp +++ b/similar/main/automap.cpp @@ -754,7 +754,11 @@ static void draw_automap(automap *am) #endif if (PlayerCfg.MouseFlightSim && PlayerCfg.MouseFSIndicator) - show_mousefs_indicator(am->controls.raw_mouse_axis[0], am->controls.raw_mouse_axis[1], am->controls.raw_mouse_axis[2], GWIDTH-(GHEIGHT/8), GHEIGHT-(GHEIGHT/8), GHEIGHT/5); + { + const auto gwidth = grd_curcanv->cv_bitmap.bm_w; + auto &raw_mouse_axis = am->controls.raw_mouse_axis; + show_mousefs_indicator(raw_mouse_axis[0], raw_mouse_axis[1], raw_mouse_axis[2], gwidth - (GHEIGHT / 8), GHEIGHT - (GHEIGHT / 8), GHEIGHT / 5); + } am->t2 = timer_query(); const auto vsync = CGameCfg.VSync; diff --git a/similar/main/gauges.cpp b/similar/main/gauges.cpp index 59f09aae4..157803936 100644 --- a/similar/main/gauges.cpp +++ b/similar/main/gauges.cpp @@ -3285,7 +3285,11 @@ void draw_hud(const object &plrobj) if (PlayerCfg.CockpitMode[1] != CM_LETTERBOX) show_reticle(player_info, PlayerCfg.ReticleType, 1); if (PlayerCfg.CockpitMode[1] != CM_LETTERBOX && Newdemo_state != ND_STATE_PLAYBACK && PlayerCfg.MouseFlightSim && PlayerCfg.MouseFSIndicator) - show_mousefs_indicator(Controls.raw_mouse_axis[0], Controls.raw_mouse_axis[1], Controls.raw_mouse_axis[2], GWIDTH/2, GHEIGHT/2, GHEIGHT/4); + { + const auto gwidth = grd_curcanv->cv_bitmap.bm_w; + auto &raw_mouse_axis = Controls.raw_mouse_axis; + show_mousefs_indicator(raw_mouse_axis[0], raw_mouse_axis[1], raw_mouse_axis[2], gwidth / 2, GHEIGHT / 2, GHEIGHT / 4); + } } if (Rear_view && PlayerCfg.CockpitMode[1]!=CM_REAR_VIEW) { diff --git a/similar/main/newmenu.cpp b/similar/main/newmenu.cpp index 46caa8176..7ed85add4 100644 --- a/similar/main/newmenu.cpp +++ b/similar/main/newmenu.cpp @@ -1370,7 +1370,7 @@ static void newmenu_create_structure( newmenu *menu ) menu->w += BORDERX*2; menu->h += BORDERY*2; - menu->x = (GWIDTH-menu->w)/2; + menu->x = (grd_curcanv->cv_bitmap.bm_w - menu->w) / 2; menu->y = (GHEIGHT-menu->h)/2; if ( menu->x < 0 ) menu->x = 0; diff --git a/similar/main/titles.cpp b/similar/main/titles.cpp index feef397af..6113774af 100644 --- a/similar/main/titles.cpp +++ b/similar/main/titles.cpp @@ -90,7 +90,7 @@ static color_t Erase_color; // added by Jan Bobrowski for variable-size menu screen static int rescale_x(int x) { - return x * GWIDTH / 320; + return x * grd_curcanv->cv_bitmap.bm_w / 320; } static int rescale_y(int y)