Skip to content

Commit

Permalink
Fix rect x-offset
Browse files Browse the repository at this point in the history
  • Loading branch information
ceski-1 committed Oct 3, 2024
1 parent 95b317c commit 0327b41
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,14 @@ static void M_ReadSaveString(char *name, int menu_slot, int save_slot,
SetLoadSlotStatus(menu_slot, 1);
}

static void UpdateRectX(menu_t *menu, int x)
{
for (int i = 0; i < menu->numitems; i++)
{
menu->menuitems[i].rect.x = x;
}
}

//
// M_ReadSaveStrings
// read the strings from the savegame files
Expand All @@ -1223,8 +1231,11 @@ static void M_ReadSaveStrings(void)
{
// [FG] shift savegame descriptions a bit to the right
// to make room for the snapshots on the left
SaveDef.x = LoadDef.x = LoadAutoSaveDef.x =
M_X_LOADSAVE + MIN(M_LOADSAVE_WIDTH / 2, video.deltaw);
const int x = M_X_LOADSAVE + MIN(M_LOADSAVE_WIDTH / 2, video.deltaw);
SaveDef.x = LoadDef.x = LoadAutoSaveDef.x = x;
UpdateRectX(&SaveDef, x);
UpdateRectX(&LoadDef, x);
UpdateRectX(&LoadAutoSaveDef, x);

// [FG] fit the snapshots into the resulting space
snapshot_width = MIN((video.deltaw + SaveDef.x + 2 * SKULLXOFF) & ~7,
Expand Down

0 comments on commit 0327b41

Please sign in to comment.