Skip to content
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

Fixed oxygen bar offset #647

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions src/road.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,10 @@ _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 @@ -1697,6 +1696,10 @@ 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) {
stalkerg marked this conversation as resolved.
Show resolved Hide resolved
UcutRight = (XGR_MAXX - (800 - aScrDisp -> curIbs -> SizeX));
}

// focus = (xside*540)/180;
focus_flt = focus = 512;
Expand Down Expand Up @@ -1756,6 +1759,10 @@ 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 Down Expand Up @@ -2485,21 +2492,10 @@ void set_map_to_ibs(ibsObject* ibs)
ibs->CenterX,
ibs->CenterY);
Redraw = 1;

COMPAS_RIGHT = DEFAULT_COMPAS_RIGHT;
} else if (ibs->ID == 2 /* INVENTORY HD*/) {
stalkerg marked this conversation as resolved.
Show resolved Hide resolved
auto inventoryWidth = 800 - ibs->SizeX;
curGMap -> change(
(XGR_MAXX - inventoryWidth) / 2,
XGR_MAXY / 2,
0,
(XGR_MAXX - inventoryWidth) / 2,
XGR_MAXY / 2);
Redraw = 1;

COMPAS_RIGHT = DEFAULT_COMPAS_RIGHT;
} else {
set_map_to_fullscreen();
COMPAS_RIGHT = HD_COMPAS_RIGHT;
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/units/mechos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8169,17 +8169,19 @@ void ActionDispatcher::DrawResource(void)
XGR_SetClip(UcutLeft,VcutUp,UcutRight,VcutDown);

y0 = VcutDown - RES_DRAW_DOWN;
x0 = UcutRight - RES_DRAW_LEFT;
x0 = UcutRight - RES_DRAW_RIGHT;
x1 = UcutLeft + RES_DRAW_LEFT;

sx = x0 - x1;
int sizeX = sx * DrawResourceValue / DrawResourceMaxValue;

if(DrawResourceValue > 0){
XGR_Rectangle(x0 - sx * DrawResourceValue / DrawResourceMaxValue,y0,sx * DrawResourceValue / DrawResourceMaxValue,RES_DRAW_STEP_Y,228,228,XGR_FILLED);
XGR_Rectangle(x0 - sizeX, y0, sizeX, RES_DRAW_STEP_Y, 228, 228, XGR_FILLED);
DrawResourceValue = -DrawResourceValue;
DrawResourceTime = 130;
}else{
if(DrawResourceTime > 0){
XGR_Rectangle(x0 + sx * DrawResourceValue / DrawResourceMaxValue,y0,-sx * DrawResourceValue / DrawResourceMaxValue,RES_DRAW_STEP_Y,228,228,XGR_FILLED);
XGR_Rectangle(x0 + sizeX, y0, -sizeX, RES_DRAW_STEP_Y, 228, 228, XGR_FILLED);
DrawResourceTime -= 128 / 20;
};
};
Expand Down
3 changes: 2 additions & 1 deletion src/units/mechos.h
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,8 @@ struct CompasObject
//const int SPEETLE_AMMO = 0;
//const int CRUSTEST_AMMO = 1;

const int RES_DRAW_LEFT = 150;
const int RES_DRAW_LEFT = 80;
const int RES_DRAW_RIGHT = 100;
const int RES_DRAW_DOWN = 80;
const int RES_DRAW_STEP_Y = 10;
const int RES_DRAW_MAX_SIZE = 300;
Expand Down
Loading