Skip to content

Commit

Permalink
Recalculate model position in character profile menu every tick, so i…
Browse files Browse the repository at this point in the history
…t adjusts when resizing the window.
  • Loading branch information
MaikelChan committed Aug 6, 2024
1 parent f0fe7f4 commit 48c294f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/game/trainingmenus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,36 @@ MenuDialogHandlerResult ciCharacterProfileMenuDialog(s32 operation, struct menud
f32 y;
f32 scale;

#ifndef PLATFORM_N64
#if VERSION == VERSION_PAL_FINAL
if (g_ViRes != VIRES_HI) {
x = -117;

if (optionsGetScreenRatio() == SCREENRATIO_16_9) {
x = -87;
}
} else {
x = -177;

if (optionsGetScreenRatio() == SCREENRATIO_16_9) {
x = -127;
}
}
#elif VERSION == VERSION_PAL_BETA
x = -117;

if (optionsGetScreenRatio() == SCREENRATIO_16_9) {
x = -87;
}
#else
x = -130;

if (optionsGetScreenRatio() == SCREENRATIO_16_9) {
x = -100;
}
#endif
#endif

switch (operation) {
case MENUOP_OPEN:
if (bodynum == BODY_DRCAROLL) {
Expand All @@ -1548,6 +1578,7 @@ MenuDialogHandlerResult ciCharacterProfileMenuDialog(s32 operation, struct menud
g_Menus[g_MpPlayerNum].menumodel.zoomtimer60 = TICKS(120);
g_Menus[g_MpPlayerNum].menumodel.removingpiece = false;

#ifdef PLATFORM_N64
#if VERSION == VERSION_PAL_FINAL
if (g_ViRes != VIRES_HI) {
x = -117;
Expand All @@ -1574,6 +1605,7 @@ MenuDialogHandlerResult ciCharacterProfileMenuDialog(s32 operation, struct menud
if (optionsGetScreenRatio() == SCREENRATIO_16_9) {
x = -100;
}
#endif
#endif

y = -15;
Expand Down Expand Up @@ -1603,6 +1635,11 @@ MenuDialogHandlerResult ciCharacterProfileMenuDialog(s32 operation, struct menud
case MENUOP_CLOSE:
break;
case MENUOP_TICK:
#ifndef PLATFORM_N64
x = (float)x * ((f32)SCREEN_WIDTH_LO / (f32)SCREEN_HEIGHT_LO) / videoGetAspect();
g_Menus[g_MpPlayerNum].menumodel.newposx = x;
#endif

if (bodynum == BODY_DRCAROLL) {
static struct modelpartvisibility vis[] = {
{ MODELPART_DRCAROLL_0001, false },
Expand Down

0 comments on commit 48c294f

Please sign in to comment.