Skip to content

Commit

Permalink
partialy revert 734c7ba to fix sidebar rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
stalkerg committed Dec 7, 2024
1 parent b9ef5ca commit b9161fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/road.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,11 @@ _MEM_STATISTIC_("AFTER TABLE OPEN -> ");
#ifdef ACTINT
if (XGR_Obj.get_screen_scale_x() == 1) {
curGMap = new iGameMap(aScrDisp -> curIbs -> CenterX,aScrDisp -> curIbs -> CenterY,XSIDE,YSIDE);
COMPAS_RIGHT = DEFAULT_COMPAS_RIGHT;
} else {
curGMap = new iGameMap(XGR_MAXX / 2, XGR_MAXY / 2, XGR_MAXX / 2, XGR_MAXY / 2);
COMPAS_RIGHT = HD_COMPAS_RIGHT;
}
COMPAS_RIGHT = DEFAULT_COMPAS_RIGHT;
#else
curGMap = new iGameMap(XGR_MAXX/2,XGR_MAXY/2,XSIDE,YSIDE);
#endif
Expand Down Expand Up @@ -1720,10 +1721,6 @@ iGameMap::iGameMap(int _x,int _y,int _xside,int _yside)
UcutRight = xc + xside;
VcutUp = yc - yside;
VcutDown = yc + yside;

if (XGR_Obj.get_screen_scale_x() == 1.6f) {
UcutRight = (XGR_MAXX - (800 - aScrDisp -> curIbs -> SizeX));
}

// focus = (xside*540)/180;
focus_flt = focus = 512;
Expand Down Expand Up @@ -1783,10 +1780,6 @@ void iGameMap::change(int Dx,int Dy,int mode,int xcenter,int ycenter)
UcutRight = xc + xside;
VcutUp = yc - yside;
VcutDown = yc + yside;

if (XGR_Obj.get_screen_scale_x() == 1.6f) {
UcutRight = (XGR_MAXX - (I_RES_X - aScrDisp -> curIbs -> SizeX));
}

TurnSecX = TurnSecX*xsize/xsize_old;
camera_zmin = camera_zmin*xsize/xsize_old;
Expand All @@ -1805,7 +1798,7 @@ void iGameMap::change(int Dx,int Dy,int mode,int xcenter,int ycenter)

void iGameMap::reset(void)
{
std::cout<<"iGameMap::reset"<<std::endl;
// std::cout<<"iGameMap::reset"<<std::endl;
// ViewX = PlayerInitData.x;
// ViewY = PlayerInitData.y;

Expand Down Expand Up @@ -2529,6 +2522,7 @@ void set_map_to_ibs(ibsObject* ibs)
COMPAS_RIGHT = DEFAULT_COMPAS_RIGHT;
} else {
set_map_to_fullscreen();
COMPAS_RIGHT = HD_COMPAS_RIGHT;
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/units/mechos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8197,6 +8197,11 @@ void ActionDispatcher::DrawResource(void)

y0 = VcutDown - RES_DRAW_DOWN;
x0 = UcutRight - RES_DRAW_RIGHT;
if (XGR_Obj.get_screen_scale_x() != 1) {
// Right sidebar size, magic number for HD version.
//
x0 -= 240;
}
x1 = UcutLeft + RES_DRAW_LEFT;

sx = x0 - x1;
Expand Down

0 comments on commit b9161fe

Please sign in to comment.