diff --git a/src/game/activemenu.c b/src/game/activemenu.c index c6ea26928..1c1093f36 100644 --- a/src/game/activemenu.c +++ b/src/game/activemenu.c @@ -804,7 +804,7 @@ void amCalculateSlotPosition(s16 column, s16 row, s16 *x, s16 *y) *y = (*y * 3) / 5; } - *x += viGetViewLeft() / g_ScaleX + viGetViewWidth() / (g_ScaleX * 2); + *x += viGetViewLeft() + viGetViewWidth() / 2; *y += viGetViewTop() + viGetViewHeight() / 2; if ((playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) || playercount >= 3) { @@ -874,8 +874,8 @@ Gfx *amRenderAibotInfo(Gfx *gdl, s32 buddynum) textMeasure(&textheight, &textwidth, aibotname, g_AmFont1, g_AmFont2, 0); - x = viGetViewLeft() / g_ScaleX - + (s32)(viGetViewWidth() / g_ScaleX * 0.5f) + x = viGetViewLeft() + + (s32)(viGetViewWidth() * 0.5f) - (s32)(textwidth * 0.5f) + offset; @@ -886,7 +886,7 @@ Gfx *amRenderAibotInfo(Gfx *gdl, s32 buddynum) } if (wide) { - x = viGetViewLeft() / g_ScaleX + 32; + x = viGetViewLeft() + 32; } gdl = textRender(gdl, &x, &y, aibotname, g_AmFont1, g_AmFont2, -1, @@ -895,13 +895,13 @@ Gfx *amRenderAibotInfo(Gfx *gdl, s32 buddynum) y += (PLAYERCOUNT() >= 2) ? 0 : (s32)(textheight * 1.1f); textMeasure(&textheight, &textwidth, weaponname, g_AmFont1, g_AmFont2, 0); - x = viGetViewLeft() / g_ScaleX - + (s32)(viGetViewWidth() / g_ScaleX * 0.5f) + x = viGetViewLeft() + + (s32)(viGetViewWidth() * 0.5f) - (s32)(textwidth * 0.5f) + offset; if (wide) { - x = viGetViewLeft() / g_ScaleX + 32; + x = viGetViewLeft() + 32; } gdl = textRender(gdl, &x, &y, weaponname, g_AmFont1, g_AmFont2, -1, @@ -913,8 +913,8 @@ Gfx *amRenderAibotInfo(Gfx *gdl, s32 buddynum) textMeasure(&textheight, &textwidth, title, g_AmFont1, g_AmFont2, 0); - x = viGetViewLeft() / g_ScaleX - + (s32)(viGetViewWidth() / g_ScaleX * 0.5f) + x = viGetViewLeft() + + (s32)(viGetViewWidth() * 0.5f) - (s32)(textwidth * 0.5f) + offset; @@ -925,7 +925,7 @@ Gfx *amRenderAibotInfo(Gfx *gdl, s32 buddynum) } if (wide) { - x = viGetViewLeft() / g_ScaleX + 32; + x = viGetViewLeft() + 32; } gdl = textRender(gdl, &x, &y, title, g_AmFont1, g_AmFont2, -1, @@ -1079,8 +1079,6 @@ Gfx *amRender(Gfx *gdl) s16 tmp1; s16 tmp2; - g_ScaleX = g_ViRes == VIRES_HI ? 2 : 1; - g_AmIndex = g_Vars.currentplayernum; g_Vars.currentplayer->commandingaibot = NULL; @@ -1373,10 +1371,10 @@ Gfx *amRender(Gfx *gdl) } if (PLAYERCOUNT() == 1 && optionsGetEffectiveScreenSize() != SCREENSIZE_FULL) { - part1left = viGetViewLeft() / g_ScaleX + 32; + part1left = viGetViewLeft() + 32; } else { - part1left = (s32) ((viGetViewWidth() / g_ScaleX) * 0.5f) - + (s32) (viGetViewLeft() / g_ScaleX) + part1left = (s32) (viGetViewWidth() * 0.5f) + + (s32) (viGetViewLeft()) - (s32) (barwidth * 0.5f) + xoffset; } @@ -1443,7 +1441,5 @@ Gfx *amRender(Gfx *gdl) gDPFillRectangleScaled(gdl++, a2, y, part1left + barwidth, y + barheight); } - g_ScaleX = 1; - return gdl; } diff --git a/src/game/bondgun.c b/src/game/bondgun.c index 6a6e3fe25..9db4b20a0 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -9094,12 +9094,6 @@ Gfx *bgunDrawHud(Gfx *gdl) return gdl; } -#if PAL - g_ScaleX = 1; -#else - g_ScaleX = g_ViRes == VIRES_HI ? 2 : 1; -#endif - gdl = text0f153628(gdl); if (playercount >= 2) { @@ -9135,7 +9129,7 @@ Gfx *bgunDrawHud(Gfx *gdl) funcnum = tmpfuncnum; } - xpos = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - barwidth - 24; + xpos = (viGetViewLeft() + viGetViewWidth()) - barwidth - 24; if (playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && playernum == 0) { xpos += 15; @@ -9299,7 +9293,6 @@ Gfx *bgunDrawHud(Gfx *gdl) if (ammoindex == -1) { gdl = text0f153780(gdl); - g_ScaleX = 1; return gdl; } } @@ -9315,7 +9308,7 @@ Gfx *bgunDrawHud(Gfx *gdl) if (lefthand->inuse && weapon->ammos[ammoindex] != NULL && lefthand->gset.weaponnum != WEAPON_REMOTEMINE) { - xpos = viGetViewLeft() / g_ScaleX + 24; + xpos = viGetViewLeft() + 24; if (playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && playernum == 1) { xpos -= 14; @@ -9341,7 +9334,7 @@ Gfx *bgunDrawHud(Gfx *gdl) ammotype = player->gunctrl.ammotypes[ammoindex]; - xpos = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - barwidth - 24; + xpos = (viGetViewLeft() + viGetViewWidth()) - barwidth - 24; if (playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && playernum == 0) { xpos += 15; @@ -9404,8 +9397,6 @@ Gfx *bgunDrawHud(Gfx *gdl) gdl = text0f153780(gdl); - g_ScaleX = 1; - return gdl; } diff --git a/src/game/bondview.c b/src/game/bondview.c index d9b5418b6..d02a3e26a 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -1833,10 +1833,6 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl) strcpy(var800a41c0, "BinocularViewGfx"); - if (!PAL && g_ViRes == VIRES_HI) { - scale = 2; - } - if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && PLAYERCOUNT() >= 2) { vsplit = true; } diff --git a/src/game/credits.c b/src/game/credits.c index beabcabef..4441e56ea 100644 --- a/src/game/credits.c +++ b/src/game/credits.c @@ -1548,8 +1548,6 @@ Gfx *creditsDraw(Gfx *gdl) text0f1531dc(false); - g_ScaleX = 1; - gdl = vi0000b280(gdl); gdl = vi0000b1d0(gdl); gdl = creditsFillFramebuffer(gdl, 0x000000ff); diff --git a/src/game/filemgr.c b/src/game/filemgr.c index 911eed5d8..9b5e475fc 100644 --- a/src/game/filemgr.c +++ b/src/game/filemgr.c @@ -2144,11 +2144,11 @@ s32 filemgrChooseAgentListMenuHandler(s32 operation, struct menuitem *item, unio TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0); gSPTextureRectangle(gdl++, - ((renderdata->x + 4) << 2) * g_ScaleX, + ((renderdata->x + 4) << 2), (renderdata->y + 2) << 2, - ((renderdata->x + 60) << 2) * g_ScaleX, + ((renderdata->x + 60) << 2), (renderdata->y + 38) << 2, - G_TX_RENDERTILE, 0, 1152, 1024 / g_ScaleX, -1024); + G_TX_RENDERTILE, 0, 1152, 1024, -1024); x = renderdata->x + 62; y = renderdata->y + 4; diff --git a/src/game/game_1531a0.c b/src/game/game_1531a0.c index 57d17caea..8a2ef52ff 100644 --- a/src/game/game_1531a0.c +++ b/src/game/game_1531a0.c @@ -57,7 +57,6 @@ Gfx *var800a4634; Gfx *var800a4638; u32 var800a463c; -s32 g_ScaleX = 1; s32 var8007fac4 = 0; bool g_TextRotated90 = false; s32 g_WrapIndentCount = 0; @@ -894,7 +893,7 @@ Gfx *text0f15568c(Gfx *gdl, s32 *x, s32 *y, struct fontchar *curchar, struct fon gDPPipeSync(gdl++); if (g_Blend.types) { - gdl = text0f154ecc(gdl, *x / g_ScaleX, *y + arg10); + gdl = text0f154ecc(gdl, *x, *y + arg10); } if (1); @@ -928,7 +927,7 @@ Gfx *text0f15568c(Gfx *gdl, s32 *x, s32 *y, struct fontchar *curchar, struct fon if (var8007fb9c) { text0f153b6c(*y + arg10); - if (var8007fba0 >= *x / g_ScaleX && *x / g_ScaleX + curchar->width * var8007fad0 >= var8007fba0) { + if (var8007fba0 >= *x && *x + curchar->width * var8007fad0 >= var8007fba0) { var800a4634 = menugfxDrawPlane(var800a4634, var8007fba0, curchar->baseline + sp90, @@ -939,7 +938,7 @@ Gfx *text0f15568c(Gfx *gdl, s32 *x, s32 *y, struct fontchar *curchar, struct fon MENUPLANE_00); } - if (var8007fba0 - 3 >= *x / g_ScaleX && *x / g_ScaleX + curchar->width * var8007fad0 >= var8007fba0 - 3) { + if (var8007fba0 - 3 >= *x && *x + curchar->width * var8007fad0 >= var8007fba0 - 3) { var800a4634 = menugfxDrawPlane(var800a4634, var8007fba0, curchar->baseline + sp90, @@ -1014,15 +1013,12 @@ Gfx *textRenderProjected(Gfx *gdl, s32 *x, s32 *y, char *text, struct fontchar * spb0 = var8007fad0; if (g_TextRotated90) { - *y *= g_ScaleX; spb0 = 1; - } else { - *x *= g_ScaleX; } if (var8007fbd8) { alpha = (1.0f - menuGetSinOscFrac(40.0f)) * 100.0f + 150.0f; - newx = *x / g_ScaleX; + newx = *x; newy = *y; tmpcolour = var800a463c; colour2 = (colour & 0xffffff00) | (u32) alpha; @@ -1097,12 +1093,6 @@ Gfx *textRenderProjected(Gfx *gdl, s32 *x, s32 *y, char *text, struct fontchar * } } - if (g_TextRotated90) { - *y = *y / g_ScaleX; - } else { - *x = *x / g_ScaleX; - } - return gdl; } @@ -1146,7 +1136,7 @@ Gfx *textRenderChar(Gfx *gdl, s32 *x, s32 *y, struct fontchar *char1, struct fon && *x >= arg6 && sp38 + char1->baseline + char1->height >= arg7) { if (g_Blend.types) { - gdl = text0f1566cc(gdl, *x / g_ScaleX, *y + arg10); + gdl = text0f1566cc(gdl, *x, *y + arg10); } gDPSetTextureImage(gdl++, G_IM_FMT_CI, G_IM_SIZ_16b, 1, char1->pixeldata); @@ -1231,8 +1221,6 @@ Gfx *textRender(Gfx *gdl, s32 *x, s32 *y, char *text, s32 savedy; s32 prevchar; - *x *= g_ScaleX; - savedx = *x; savedy = *y; prevchar = 'H'; @@ -1309,8 +1297,6 @@ Gfx *textRender(Gfx *gdl, s32 *x, s32 *y, char *text, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - *x = *x / g_ScaleX; - return gdl; } @@ -1375,9 +1361,7 @@ void textMeasure(s32 *textheight, s32 *textwidth, char *text, struct fontchar *f } // @bug? Shouldn't this go at the very end of the function? - if (g_ScaleX == 1) { - *textwidth *= var8007fad0; - } + *textwidth *= var8007fad0; if (longest > *textwidth) { *textwidth = longest; diff --git a/src/game/gamefile.c b/src/game/gamefile.c index 1bc4585ba..cbb2ba29c 100644 --- a/src/game/gamefile.c +++ b/src/game/gamefile.c @@ -73,12 +73,6 @@ void gamefileApplyOptions(struct gamefile *file) g_Vars.langfilteron = pakHasBitflag(GAMEFILEFLAG_LANGFILTERON, file->flags); - if (pakHasBitflag(GAMEFILEFLAG_HIRES, file->flags)) { - playerSetHiResEnabled(true); - } else { - playerSetHiResEnabled(false); - } - optionsSetScreenSplit(pakHasBitflag(GAMEFILEFLAG_SCREENSPLIT, file->flags)); optionsSetScreenRatio(pakHasBitflag(GAMEFILEFLAG_SCREENRATIO, file->flags)); @@ -346,7 +340,7 @@ s32 gamefileSave(s32 device, s32 fileid, u16 deviceserial) pakSetBitflag(GAMEFILEFLAG_SCREENSIZE_WIDE, g_GameFile.flags, optionsGetScreenSize() == SCREENSIZE_WIDE); pakSetBitflag(GAMEFILEFLAG_SCREENSIZE_CINEMA, g_GameFile.flags, optionsGetScreenSize() == SCREENSIZE_CINEMA); - pakSetBitflag(GAMEFILEFLAG_HIRES, g_GameFile.flags, g_ViRes == VIRES_HI); + pakSetBitflag(GAMEFILEFLAG_HIRES, g_GameFile.flags, 0); pakSetBitflag(GAMEFILEFLAG_INGAMESUBTITLES, g_GameFile.flags, optionsGetInGameSubtitles()); pakSetBitflag(GAMEFILEFLAG_CUTSCENESUBTITLES, g_GameFile.flags, optionsGetCutsceneSubtitles()); pakSetBitflag(GAMEFILEFLAG_LANGFILTERON, g_GameFile.flags, g_Vars.langfilteron); diff --git a/src/game/hudmsg.c b/src/game/hudmsg.c index 7f3eec422..d6e58dcbe 100644 --- a/src/game/hudmsg.c +++ b/src/game/hudmsg.c @@ -97,7 +97,7 @@ Gfx *hudmsgRenderMissionTimer(Gfx *gdl, u32 alpha) textcolour = alpha; - viewleft = viGetViewLeft() / g_ScaleX; + viewleft = viGetViewLeft(); viewtop = viGetViewTop(); viewheight = viGetViewHeight(); playercount = PLAYERCOUNT(); @@ -184,8 +184,8 @@ Gfx *hudmsgRenderZoomRange(Gfx *gdl, u32 alpha) colour = (alpha * 0xa0 / 255) | 0x00ff0000; viewtop = viGetViewTop(); - viewleft = viGetViewLeft() / g_ScaleX; - viewhalfwidth = (viGetViewWidth() / g_ScaleX) >> 1; + viewleft = viGetViewLeft(); + viewhalfwidth = viGetViewWidth() >> 1; viewheight = viGetViewHeight(); texty = viewheight + viewtop - 1; maxzoom = 1.0f; @@ -300,9 +300,9 @@ Gfx *hudmsgRenderBox(Gfx *gdl, s32 x1, s32 y1, s32 x2, s32 y2, f32 bgopacity, u3 f32 height = (y1 + y2) * 0.5f; gdl = text0f153a34(gdl, - (s32)((width - f22) + 1.0f) * g_ScaleX, + (s32)((width - f22) + 1.0f), (height - f20) + 1.0f, - (s32)(width + f22) * g_ScaleX, + (s32)(width + f22), height + f20, 128.0f * textopacity); } @@ -312,7 +312,7 @@ Gfx *hudmsgRenderBox(Gfx *gdl, s32 x1, s32 y1, s32 x2, s32 y2, f32 bgopacity, u3 s32 hudmsg0f0ddb1c(s32 *arg0, s32 arg1) { - s32 viewwidth = g_Vars.currentplayer->viewwidth / g_ScaleX; + s32 viewwidth = g_Vars.currentplayer->viewwidth; s32 result = 0; *arg0 = 24; @@ -708,9 +708,9 @@ void hudmsgCalculatePosition(struct hudmessage *msg) { s32 x; s32 y; - s32 viewleft = g_Vars.players[msg->playernum]->viewleft / g_ScaleX; + s32 viewleft = g_Vars.players[msg->playernum]->viewleft; s32 viewtop = g_Vars.players[msg->playernum]->viewtop; - s32 viewwidth = g_Vars.players[msg->playernum]->viewwidth / g_ScaleX; + s32 viewwidth = g_Vars.players[msg->playernum]->viewwidth; s32 viewheight = g_Vars.players[msg->playernum]->viewheight; s32 v0; @@ -857,12 +857,6 @@ void hudmsgCreateFromArgs(char *text, s32 type, s32 conf00, s32 conf01, s32 conf } } -#if PAL - g_ScaleX = 1; -#else - g_ScaleX = g_ViRes == VIRES_HI ? 2 : 1; -#endif - // Find an unused index for the new message for (index = 0; index < g_NumHudMessages; index++) { if (g_HudMessages[index].state == HUDMSGSTATE_FREE) { @@ -954,8 +948,6 @@ void hudmsgCreateFromArgs(char *text, s32 type, s32 conf00, s32 conf01, s32 conf g_HudmsgsActive = true; } - - g_ScaleX = 1; } } @@ -974,8 +966,6 @@ void hudmsgsTick(void) f32 fadeouttime; bool anyactive = false; - g_ScaleX = (g_ViRes == VIRES_HI) ? 2 : 1; - prevplayernum = g_Vars.currentplayernum; for (k = 0; k < g_NumHudMessages; k++) { @@ -1162,8 +1152,6 @@ void hudmsgsTick(void) break; } } - - g_ScaleX = 1; } void hudmsgsSetOn(u32 reason) @@ -1202,12 +1190,6 @@ Gfx *hudmsgsRender(Gfx *gdl) s32 timerthing = 255; s32 spdc = true; -#if PAL - g_ScaleX = 1; -#else - g_ScaleX = g_ViRes == VIRES_HI ? 2 : 1; -#endif - if (g_HudmsgsActive) { gdl = text0f153628(gdl); @@ -1268,8 +1250,8 @@ Gfx *hudmsgsRender(Gfx *gdl) if (msg->type == HUDMSGTYPE_CUTSCENESUBTITLE) { gDPSetScissor(gdl++, 0, - (x - 4) * g_ScaleX, 0, - (x + msg->width + 3) * g_ScaleX, viGetBufHeight()); + (x - 4), 0, + (x + msg->width + 3), viGetBufHeight()); } switch (msg->state) { @@ -1431,8 +1413,6 @@ Gfx *hudmsgsRender(Gfx *gdl) } } - g_ScaleX = 1; - return gdl; } diff --git a/src/game/lv.c b/src/game/lv.c index 266bfe6ff..cfb5d09df 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -1005,14 +1005,10 @@ Gfx *lvPrint(Gfx *gdl) lvRecordRate(); if (g_LvShowStats && g_LvStatsPage == 0) { - g_ScaleX = g_ViRes == VIRES_HI ? 2 : 1; - gdl = text0f153628(gdl); gdl = lvPrintRateGraph(gdl); gdl = lvPrintRateText(gdl); gdl = text0f153780(gdl); - - g_ScaleX = 1; } return gdl; diff --git a/src/game/mainmenu.c b/src/game/mainmenu.c index 3ab258850..1f8d1d63a 100644 --- a/src/game/mainmenu.c +++ b/src/game/mainmenu.c @@ -400,26 +400,6 @@ s32 menuhandlerAlternativeTitle(s32 operation, struct menuitem *item, union hand return 0; } -s32 menuhandlerHiRes(s32 operation, struct menuitem *item, union handlerdata *data) -{ - switch (operation) { - case MENUOP_CHECKHIDDEN: - if (g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) { - if (PLAYERCOUNT() >= 2) { - return true; - } - } - break; - case MENUOP_GET: - return g_HiResEnabled == true; - case MENUOP_SET: - playerSetHiResEnabled(data->checkbox.value ? 1 : 0); - g_Vars.modifiedfiles |= MODFILE_GAME; - } - - return 0; -} - s32 menuhandlerAmmoOnScreen(s32 operation, struct menuitem *item, union handlerdata *data) { u32 mpchrnum; @@ -1893,9 +1873,9 @@ s32 menuhandlerMissionList(s32 operation, struct menuitem *item, union handlerda gDPSetEnvColorViaWord(gdl++, 0xffffff00 | ((renderdata->colour & 0xff) * 255 / 256)); gSPTextureRectangle(gdl++, - ((renderdata->x + 4) << 2) * g_ScaleX, (renderdata->y + 3) << 2, - ((renderdata->x + 60) << 2) * g_ScaleX, (renderdata->y + 39) << 2, - G_TX_RENDERTILE, 0, 0x0480, 1024 / g_ScaleX, -1024); + ((renderdata->x + 4) << 2), (renderdata->y + 3) << 2, + ((renderdata->x + 60) << 2), (renderdata->y + 39) << 2, + G_TX_RENDERTILE, 0, 0x0480, 1024, -1024); if (g_MissionConfig.isanti) { // No stars @@ -1919,9 +1899,9 @@ s32 menuhandlerMissionList(s32 operation, struct menuitem *item, union handlerda } gSPTextureRectangle(gdl++, - ((renderdata->x + relx) << 2) * g_ScaleX, (renderdata->y + 25) << 2, - ((renderdata->x + relx + 14) << 2) * g_ScaleX, (renderdata->y + 39) << 2, - G_TX_RENDERTILE, 0x0010, 0x01c0, 1024 / g_ScaleX, -1024); + ((renderdata->x + relx) << 2), (renderdata->y + 25) << 2, + ((renderdata->x + relx + 14) << 2), (renderdata->y + 39) << 2, + G_TX_RENDERTILE, 0x0010, 0x01c0, 1024, -1024); } } else { texSelect(&gdl, &g_TexGeneralConfigs[34], 2, 0, 2, true, NULL); @@ -1950,9 +1930,9 @@ s32 menuhandlerMissionList(s32 operation, struct menuitem *item, union handlerda } gSPTextureRectangle(gdl++, - ((renderdata->x + relx) << 2) * g_ScaleX, (renderdata->y + 25) << 2, - ((renderdata->x + relx + 14) << 2) * g_ScaleX, (renderdata->y + 39) << 2, - G_TX_RENDERTILE, 0x0010, 0x01c0, 1024 / g_ScaleX, -1024); + ((renderdata->x + relx) << 2), (renderdata->y + 25) << 2, + ((renderdata->x + relx + 14) << 2), (renderdata->y + 39) << 2, + G_TX_RENDERTILE, 0x0010, 0x01c0, 1024, -1024); } } @@ -2360,14 +2340,6 @@ struct menuitem g_VideoOptionsMenuItems[] = { 0, menuhandlerScreenRatio, }, - { - MENUITEMTYPE_CHECKBOX, - 0, - 0, - L_OPTIONS_217, // "Hi-Res" - 0, - menuhandlerHiRes, - }, #if PAL { MENUITEMTYPE_DROPDOWN, @@ -2422,14 +2394,6 @@ struct menuitem g_2PMissionVideoOptionsMenuItems[] = { 0, menuhandlerScreenRatio, }, - { - MENUITEMTYPE_CHECKBOX, - 0, - 0, - L_OPTIONS_217, // "Hi-Res" - 0, - menuhandlerHiRes, - }, #if PAL { MENUITEMTYPE_DROPDOWN, diff --git a/src/game/menu.c b/src/game/menu.c index e08c4d946..3f9ab4b52 100644 --- a/src/game/menu.c +++ b/src/game/menu.c @@ -1789,13 +1789,6 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2) } sp430 = thing->unk510; - -#if !PAL - if (g_ViRes == VIRES_HI) { - sp430 *= 2.0f; - } -#endif - sp42c = thing->unk514; sp428 = thing->unk518; sp424 = thing->unk51c; @@ -1906,10 +1899,10 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2) sp30c[0] = -100.0f + sp428; if (arg2 == 1) { - sp390[0] = thing->unk510 * g_ScaleX; + sp390[0] = thing->unk510; sp390[1] = thing->unk514; } else { - sp390[0] = sp430 * g_ScaleX + viGetViewLeft() + viGetViewWidth() * 0.5f; + sp390[0] = sp430 + viGetViewLeft() + viGetViewWidth() * 0.5f; sp390[1] = sp42c + viGetViewTop() + viGetViewHeight() * 0.5f; } @@ -1995,8 +1988,8 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2) gdl = func0f0d49c8(gdl); - viSetViewPosition(g_MenuScissorX1 * g_ScaleX, g_MenuScissorY1); - viSetFovAspectAndSize(g_Vars.currentplayer->fovy, aspect, (g_MenuScissorX2 - g_MenuScissorX1) * g_ScaleX, g_MenuScissorY2 - g_MenuScissorY1); + viSetViewPosition(g_MenuScissorX1, g_MenuScissorY1); + viSetFovAspectAndSize(g_Vars.currentplayer->fovy, aspect, (g_MenuScissorX2 - g_MenuScissorX1), g_MenuScissorY2 - g_MenuScissorY1); gdl = vi0000af00(gdl, var800a2048[g_MpPlayerNum]); gdl = vi0000aca4(gdl, znear, zfar); @@ -2096,7 +2089,7 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2) spd0.z = sp3b4[index].m[3][2]; cam0f0b4d04(&spd0, spc8); - var8009de98 = ((s32)spc8[0] - viGetWidth() / 2) / g_ScaleX; + var8009de98 = (s32)spc8[0] - viGetWidth() / 2; var8009de9c = (s32)spc8[1] - viGetHeight() / 2; } } @@ -2173,8 +2166,8 @@ Gfx *menuApplyScissor(Gfx *gdl) { gDPPipeSync(gdl++); - g_ScissorX1 = g_MenuScissorX1 * g_ScaleX; - g_ScissorX2 = g_MenuScissorX2 * g_ScaleX; + g_ScissorX1 = g_MenuScissorX1; + g_ScissorX2 = g_MenuScissorX2; g_ScissorY1 = g_MenuScissorY1; g_ScissorY2 = g_MenuScissorY2; @@ -2458,9 +2451,9 @@ Gfx *dialogRender(Gfx *gdl, struct menudialog *dialog, struct menu *menu, bool l { struct menulayer *layer; - s32 viewleft = viGetViewLeft() / g_ScaleX; + s32 viewleft = viGetViewLeft(); s32 viewtop = viGetViewTop(); - s32 viewright = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX; + s32 viewright = (viGetViewLeft() + viGetViewWidth()); s32 viewbottom = viGetViewTop() + viGetViewHeight(); g_MenuScissorX1 = dialogleft + 2; @@ -2923,9 +2916,9 @@ void func0f0f7594(s32 arg0, s32 *vdir, s32 *hdir) */ void menuFindAvailableSize(s32 *leftptr, s32 *topptr, s32 *rightptr, s32 *bottomptr) { - s32 left = viGetViewLeft() / g_ScaleX + 20; + s32 left = viGetViewLeft() + 20; s32 top = viGetViewTop() + 4; - s32 right = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - 20; + s32 right = (viGetViewLeft() + viGetViewWidth()) - 20; s32 bottom = viGetViewTop() + viGetViewHeight() - 4; s32 playernum; u32 stack[2]; @@ -3018,9 +3011,9 @@ void menuFindAvailableSize(s32 *leftptr, s32 *topptr, s32 *rightptr, s32 *bottom case MENUROOT_MPENDSCREEN: case MENUROOT_PICKTARGET: case MENUROOT_4MBFILEMGR: - *leftptr = g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewleft / g_ScaleX; + *leftptr = g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewleft; *topptr = g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewtop; - *rightptr = (g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewleft + g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewwidth) / g_ScaleX; + *rightptr = (g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewleft + g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewwidth); *bottomptr = g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewtop + g_Vars.players[g_Menus[g_MpPlayerNum].playernum]->viewheight; if (PLAYERCOUNT() > 2) { @@ -3085,7 +3078,7 @@ void dialogCalculatePosition(struct menudialog *dialog) } if (hdir > 0) { - dialog->dstx = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX + 4; + dialog->dstx = (viGetViewLeft() + viGetViewWidth()) + 4; } if (vdir < 0) { @@ -3310,7 +3303,7 @@ Gfx *menuRenderDialogs(Gfx *gdl) if (g_MenuData.root == MENUROOT_MPPAUSE || g_MenuData.root == MENUROOT_PICKTARGET || g_MenuData.root == MENUROOT_MPENDSCREEN) { - var8009de98 = g_Menus[g_MpPlayerNum].curdialog->x + g_Menus[g_MpPlayerNum].curdialog->width / 2 - viGetWidth() / (g_ScaleX * 2); + var8009de98 = g_Menus[g_MpPlayerNum].curdialog->x + g_Menus[g_MpPlayerNum].curdialog->width / 2 - viGetWidth() / 2; var8009de9c = g_Menus[g_MpPlayerNum].curdialog->y + g_Menus[g_MpPlayerNum].curdialog->height / 2 - viGetHeight() / 2; gdl = menuRenderDialog(gdl, g_Menus[g_MpPlayerNum].curdialog, &g_Menus[g_MpPlayerNum], 0); @@ -3359,9 +3352,9 @@ Gfx *menuRenderDialogs(Gfx *gdl) gdl = menuRenderBanner(gdl, xmin, ymin, xmax, ymax, false, g_Menus[g_MpPlayerNum].bannernum, 0, 0); } else { - s32 xmin = viGetViewLeft() / g_ScaleX; + s32 xmin = viGetViewLeft(); s32 ymin = viGetViewTop(); - s32 xmax = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX; + s32 xmax = (viGetViewLeft() + viGetViewWidth()); s32 ymax = viGetViewTop() + viGetViewHeight(); gdl = menuRenderBanner(gdl, xmin, ymin, xmax, ymax, true, g_Menus[g_MpPlayerNum].bannernum, 0, 0); @@ -4761,8 +4754,6 @@ Gfx *menuRender(Gfx *gdl) { g_MpPlayerNum = 0; - g_ScaleX = g_ViRes == VIRES_HI ? 2 : 1; - gdl = func0f0d479c(gdl); gSPDisplayList(gdl++, var800613a0); @@ -4903,9 +4894,9 @@ Gfx *menuRender(Gfx *gdl) if (g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU) { s32 i; s32 j; - s32 viewleft = viGetViewLeft() / g_ScaleX + 20; + s32 viewleft = viGetViewLeft() + 20; s32 viewtop = viGetViewTop() + 4; - s32 viewright = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - 20; + s32 viewright = (viGetViewLeft() + viGetViewWidth()) - 20; s32 viewbottom = viGetViewTop() + viGetViewHeight() - 4; s32 textheight; s32 textwidth; @@ -5023,9 +5014,9 @@ Gfx *menuRender(Gfx *gdl) // Render banner messages, such as "Please Wait...", // "Checking Controller Pak" and some unused game boy camera texts. if (g_MenuData.bannernum != -1) { - s32 x1 = viGetViewLeft() / g_ScaleX; + s32 x1 = viGetViewLeft(); s32 y1 = viGetViewTop(); - s32 x2 = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX; + s32 x2 = viGetViewLeft() + viGetViewWidth(); s32 y2 = viGetViewTop() + viGetViewHeight(); s32 left = 0; @@ -5052,12 +5043,9 @@ Gfx *menuRender(Gfx *gdl) gdl = func0f0d49c8(gdl); - g_ScaleX = 1; - return gdl; } - u32 menuChooseMusic(void) { s32 missionsuccess = MUSIC_MISSION_SUCCESS; diff --git a/src/game/menugfx.c b/src/game/menugfx.c index b5c1db976..808f2ce41 100644 --- a/src/game/menugfx.c +++ b/src/game/menugfx.c @@ -60,12 +60,6 @@ void menugfxCreateBlur(void) u32 b; u16 colour; -#if PAL - g_ScaleX = 1; -#else - g_ScaleX = (g_ViRes == VIRES_HI) ? 2 : 1; -#endif - fb = (u8 *) viGetFrontBuffer(); for (dsty = 0; dsty < BLURIMG_HEIGHT; dsty++) { @@ -76,7 +70,7 @@ void menugfxCreateBlur(void) #if PAL s32 samplestartindex = (((s32) ((f32) dstx * 2 * 4 * 2 * scale) + (s32) (dsty * fbwidthinbytes * 8)) & 0xfffffffe); #else - s32 samplestartindex = PXTOBYTES(dstx * SAMPLE_WIDTH) * g_ScaleX + dsty * fbwidthinbytes * SAMPLE_HEIGHT; + s32 samplestartindex = PXTOBYTES(dstx * SAMPLE_WIDTH) + dsty * fbwidthinbytes * SAMPLE_HEIGHT; #endif r = g = b = 0; @@ -86,7 +80,7 @@ void menugfxCreateBlur(void) #if PAL s32 index = (samplestartindex + (s32) (PXTOBYTES((f32) srcx) * scale) + srcy * fbwidthinbytes) & 0xfffffffe; #else - s32 index = samplestartindex + PXTOBYTES(srcx) * g_ScaleX + srcy * fbwidthinbytes; + s32 index = samplestartindex + PXTOBYTES(srcx) + srcy * fbwidthinbytes; #endif colour = fb[index] << 8 | fb[index + 1]; @@ -105,8 +99,6 @@ void menugfxCreateBlur(void) g_BlurBuffer[dstindex + 1] = ((g << 6) | ((b & 0x1f) << 1)) & 0xffff; } } - - g_ScaleX = 1; } Gfx *menugfxRenderBgBlur(Gfx *gdl, u32 colour, s16 arg2, s16 arg3) diff --git a/src/game/menuitem.c b/src/game/menuitem.c index 302fd4020..b4690aea0 100644 --- a/src/game/menuitem.c +++ b/src/game/menuitem.c @@ -223,8 +223,8 @@ Gfx *menuitemListRender(Gfx *gdl, struct menurendercontext *context) width = context->width; } - g_ScissorX1 = context->x * g_ScaleX; - g_ScissorX2 = (context->x + width) * g_ScaleX; + g_ScissorX1 = context->x; + g_ScissorX2 = (context->x + width); g_ScissorY1 = context->y; g_ScissorY2 = context->y + context->height; @@ -480,19 +480,18 @@ Gfx *menuitemListRender(Gfx *gdl, struct menurendercontext *context) sp8cright = 0; } - // This logic doesn't look right... - if (sp94left / g_ScaleX > viGetWidth()) { - sp94left = viGetWidth() / g_ScaleX; + if (sp94left > viGetWidth()) { + sp94left = viGetWidth(); } - if (sp8cright / g_ScaleX > viGetWidth()) { - sp8cright = viGetWidth() / g_ScaleX; + if (sp8cright > viGetWidth()) { + sp8cright = viGetWidth(); } gDPPipeSync(gdl++); - g_ScissorX1 = sp94left * g_ScaleX; - g_ScissorX2 = sp8cright * g_ScaleX; + g_ScissorX1 = sp94left; + g_ScissorX2 = sp8cright; g_ScissorY1 = sp90top; g_ScissorY2 = sp88bottom; @@ -2910,8 +2909,8 @@ Gfx *menuitemMarqueeRender(Gfx *gdl, struct menurendercontext *context) } } - g_ScissorX1 = context->x * g_ScaleX; - g_ScissorX2 = (context->x + context->width) * g_ScaleX; + g_ScissorX1 = context->x; + g_ScissorX2 = context->x + context->width; g_ScissorY1 = context->y; g_ScissorY2 = context->y + context->height - 1; @@ -3143,8 +3142,8 @@ Gfx *menuitemRankingRender(Gfx *gdl, struct menurendercontext *context) gDPPipeSync(gdl++); - g_ScissorX1 = context->x * g_ScaleX; - g_ScissorX2 = (context->x + context->width) * g_ScaleX; + g_ScissorX1 = context->x; + g_ScissorX2 = context->x + context->width; g_ScissorY1 = context->y + 10; g_ScissorY2 = context->y + context->height - 1; @@ -3391,8 +3390,8 @@ Gfx *menuitemPlayerStatsRender(Gfx *gdl, struct menurendercontext *context) gDPPipeSync(gdl++); - g_ScissorX1 = context->x * g_ScaleX; - g_ScissorX2 = (context->x + context->width) * g_ScaleX; + g_ScissorX1 = context->x; + g_ScissorX2 = context->x + context->width; g_ScissorY1 = context->y + ypos; g_ScissorY2 = context->y + context->height; @@ -3523,12 +3522,12 @@ Gfx *menuitemControllerRenderLine(Gfx *gdl, s32 speed, s32 x1, s32 y1, s32 x2, s speed = speed + (x1 % 4); gSPTextureRectangle(gdl++, - x1 * 4 * g_ScaleX, y1 * 4, - x2 * 4 * g_ScaleX, y2 * 4, + x1 * 4, y1 * 4, + x2 * 4, y2 * 4, G_TX_RENDERTILE, speed * 32, (y1 % 4) * 32, - 1024 / g_ScaleX, 1024); + 1024, 1024); return gdl; } @@ -3556,9 +3555,9 @@ Gfx *menuitemControllerRenderTexture(Gfx *gdl, s32 x, s32 y, s32 texturenum, u32 gDPSetColor(gdl++, G_SETENVCOLOR, 0xffffff00 | alpha); gSPTextureRectangle(gdl++, - (x << 2) * g_ScaleX, y << 2, - ((x + 32) << 2) * g_ScaleX, (y + 32) << 2, - 0, 16, 1008, 1024 / g_ScaleX, 0xfc00); + (x << 2), y << 2, + ((x + 32) << 2), (y + 32) << 2, + 0, 16, 1008, 1024, 0xfc00); return gdl; } diff --git a/src/game/menutick.c b/src/game/menutick.c index 8701d327f..13b80d867 100644 --- a/src/game/menutick.c +++ b/src/game/menutick.c @@ -55,12 +55,6 @@ void menuTick(void) s32 sp340 = true; s32 anyopen = false; -#if PAL - g_ScaleX = 1; -#else - g_ScaleX = g_ViRes == VIRES_HI ? 2 : 1; -#endif - menuTickTimers(); if (g_MenuData.count) { @@ -711,6 +705,5 @@ void menuTick(void) } } - g_ScaleX = 1; g_MenuData.unk5d5_06 = sp344 ? true : false; } diff --git a/src/game/mplayer/ingame.c b/src/game/mplayer/ingame.c index c1a4068b8..c4b352fca 100644 --- a/src/game/mplayer/ingame.c +++ b/src/game/mplayer/ingame.c @@ -574,11 +574,11 @@ s32 mpAwardsMenuHandler(s32 operation, struct menuitem *item, union handlerdata gDPSetEnvColorViaWord(gdl++, colour); gSPTextureRectangle(gdl++, - (x << 2) * g_ScaleX, + x << 2, (renderdata->y - 2) << 2, - ((x + 11) << 2) * g_ScaleX, + (x + 11) << 2, (renderdata->y + 9) << 2, - G_TX_RENDERTILE, 0x0010, 0x0150, 1024 / g_ScaleX, -1024); + G_TX_RENDERTILE, 0x0010, 0x0150, 1024, -1024); x -= 14; } diff --git a/src/game/mplayer/setup.c b/src/game/mplayer/setup.c index c777cde21..0c8ac8d05 100644 --- a/src/game/mplayer/setup.c +++ b/src/game/mplayer/setup.c @@ -648,12 +648,12 @@ s32 mpChallengesListHandler(s32 operation, struct menuitem *item, union handlerd TEXEL0, 0, ENVIRONMENT, 0); gSPTextureRectangle(gdl++, - ((renderdata->x + loopx) << 2) * g_ScaleX, + (renderdata->x + loopx) << 2, (renderdata->y + size) << 2, - ((renderdata->x + size + loopx) << 2) * g_ScaleX, + (renderdata->x + size + loopx) << 2, (renderdata->y + size * 2) << 2, G_TX_RENDERTILE, - 0, 0x0160, 0x0400 / g_ScaleX, 0xfc00); + 0, 0x0160, 0x0400, 0xfc00); loopx += 13; } @@ -869,9 +869,9 @@ s32 mpMedalMenuHandler(s32 operation, struct menuitem *item, union handlerdata * TEXEL0, 0, ENVIRONMENT, 0); gSPTextureRectangle(gdl++, - ((renderdata->x + 9) << 2) * g_ScaleX, renderdata->y << 2, - ((renderdata->x + 20) << 2) * g_ScaleX, (renderdata->y + 11) << 2, - G_TX_RENDERTILE, 0, 0x0160, 1024 / g_ScaleX, -1024); + ((renderdata->x + 9) << 2), renderdata->y << 2, + ((renderdata->x + 20) << 2), (renderdata->y + 11) << 2, + G_TX_RENDERTILE, 0, 0x0160, 1024, -1024); return (s32) gdl; } @@ -4210,9 +4210,9 @@ s32 mpChallengesListMenuHandler(s32 operation, struct menuitem *item, union hand TEXEL0, 0, ENVIRONMENT, 0); gSPTextureRectangle(gdl++, - ((renderdata->x + marginleft) << 2) * g_ScaleX, (renderdata->y + 11) << 2, - ((renderdata->x + marginleft + 11) << 2) * g_ScaleX, (renderdata->y + 22) << 2, - G_TX_RENDERTILE, 0, 0x0160, 1024 / g_ScaleX, -1024); + ((renderdata->x + marginleft) << 2), (renderdata->y + 11) << 2, + ((renderdata->x + marginleft + 11) << 2), (renderdata->y + 22) << 2, + G_TX_RENDERTILE, 0, 0x0160, 1024, -1024); marginleft += 13; } diff --git a/src/game/player.c b/src/game/player.c index 368e33e28..7ab09175f 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -121,8 +121,6 @@ struct vimode g_ViModes[] = { { 400, 300, 400, 1, 2, 300, 0, 300, 0, 300, 0 }, // unused }; -s32 g_ViRes = VIRES_LO; -bool g_HiResEnabled = false; u32 var800706d0 = 0x00000000; u32 var800706d4 = 0x00000000; u32 var800706d8 = 0x00000000; @@ -2546,20 +2544,15 @@ void playerTickExplode(void) } } -void playerSetHiResEnabled(bool enable) -{ - g_HiResEnabled = enable; -} - s16 playerGetFbWidth(void) { - s16 width = g_ViModes[g_ViRes].fbwidth; + s16 width = g_ViModes[VIRES_LO].fbwidth; return width; } s16 playerGetFbHeight(void) { - s16 height = g_ViModes[g_ViRes].fbheight; + s16 height = g_ViModes[VIRES_LO].fbheight; return height; } @@ -2582,7 +2575,7 @@ s16 playerGetViewportWidth(void) if (!playerHasSharedViewport()) { if (PLAYERCOUNT() >= 3) { // 3/4 players - width = g_ViModes[g_ViRes].width / 2; + width = g_ViModes[VIRES_LO].width / 2; if (g_Vars.currentplayernum == 0 || g_Vars.currentplayernum == 2) { width--; @@ -2590,22 +2583,22 @@ s16 playerGetViewportWidth(void) } else if (PLAYERCOUNT() == 2) { if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) { // 2 players vsplit - width = g_ViModes[g_ViRes].width / 2; + width = g_ViModes[VIRES_LO].width / 2; if (g_Vars.currentplayernum == 0) { width--; } } else { // 2 players full width - width = g_ViModes[g_ViRes].width; + width = g_ViModes[VIRES_LO].width; } } else { // 1 player - width = g_ViModes[g_ViRes].width; + width = g_ViModes[VIRES_LO].width; } } else { // Probably cutscene - width = g_ViModes[g_ViRes].width; + width = g_ViModes[VIRES_LO].width; } return width; @@ -2619,27 +2612,27 @@ s16 playerGetViewportLeft(void) if (PLAYERCOUNT() >= 3 && something != 0) { if (g_Vars.currentplayernum == 1 || g_Vars.currentplayernum == 3) { // 3/4 players - right side - left = g_ViModes[g_ViRes].width / 2 + g_ViModes[g_ViRes].fbwidth - g_ViModes[g_ViRes].width; + left = g_ViModes[VIRES_LO].width / 2 + g_ViModes[VIRES_LO].fbwidth - g_ViModes[VIRES_LO].width; } else { // 3/4 players - left side - left = g_ViModes[g_ViRes].fbwidth - g_ViModes[g_ViRes].width; + left = g_ViModes[VIRES_LO].fbwidth - g_ViModes[VIRES_LO].width; } } else if (PLAYERCOUNT() == 2 && something != 0) { if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) { if (g_Vars.currentplayernum == 1) { // 2 players vsplit - right side - left = (g_ViModes[g_ViRes].width / 2) + g_ViModes[g_ViRes].fbwidth - g_ViModes[g_ViRes].width; + left = (g_ViModes[VIRES_LO].width / 2) + g_ViModes[VIRES_LO].fbwidth - g_ViModes[VIRES_LO].width; } else { // 2 players vsplit - left side - left = g_ViModes[g_ViRes].fbwidth - g_ViModes[g_ViRes].width; + left = g_ViModes[VIRES_LO].fbwidth - g_ViModes[VIRES_LO].width; } } else { // 2 players - full width - left = g_ViModes[g_ViRes].fbwidth - g_ViModes[g_ViRes].width; + left = g_ViModes[VIRES_LO].fbwidth - g_ViModes[VIRES_LO].width; } } else { // Full screen - left = g_ViModes[g_ViRes].fbwidth - g_ViModes[g_ViRes].width; + left = g_ViModes[VIRES_LO].fbwidth - g_ViModes[VIRES_LO].width; } return left; @@ -2650,7 +2643,7 @@ s16 playerGetViewportHeight(void) s16 height; if (PLAYERCOUNT() >= 2 && !playerHasSharedViewport()) { - s16 tmp = g_ViModes[g_ViRes].fullheight; + s16 tmp = g_ViModes[VIRES_LO].fullheight; height = tmp / 2; @@ -2665,21 +2658,21 @@ s16 playerGetViewportHeight(void) } } else { if (optionsGetEffectiveScreenSize() == SCREENSIZE_WIDE) { - height = g_ViModes[g_ViRes].wideheight; + height = g_ViModes[VIRES_LO].wideheight; } else if (optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { - height = g_ViModes[g_ViRes].cinemaheight; + height = g_ViModes[VIRES_LO].cinemaheight; } else if (g_InCutscene && !var8009dfc0) { if (var8009de2c >= 1) { - f32 a = g_ViModes[g_ViRes].wideheight; - f32 b = g_ViModes[g_ViRes].fullheight; + f32 a = g_ViModes[VIRES_LO].wideheight; + f32 b = g_ViModes[VIRES_LO].fullheight; a = a * (1.0f - g_CutsceneBarFrac); b = b * g_CutsceneBarFrac; height = a + b; } else { - height = g_ViModes[g_ViRes].wideheight; + height = g_ViModes[VIRES_LO].wideheight; } } else { - height = g_ViModes[g_ViRes].fullheight; + height = g_ViModes[VIRES_LO].fullheight; } } @@ -2691,50 +2684,50 @@ s16 playerGetViewportTop(void) s16 top; if (PLAYERCOUNT() >= 2 && !playerHasSharedViewport()) { - top = g_ViModes[g_ViRes].fulltop; + top = g_ViModes[VIRES_LO].fulltop; if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL || PLAYERCOUNT() != 2) { if (PLAYERCOUNT() == 2 && g_Vars.currentplayernum == 1 && optionsGetScreenSplit() != SCREENSPLIT_VERTICAL) { // 2 players hsplit - bottom side - top = g_ViModes[g_ViRes].fulltop + g_ViModes[g_ViRes].fullheight / 2; + top = g_ViModes[VIRES_LO].fulltop + g_ViModes[VIRES_LO].fullheight / 2; } else if (g_Vars.currentplayernum == 2 || g_Vars.currentplayernum == 3) { // 3/4 players - bottom side - top = g_ViModes[g_ViRes].fulltop + g_ViModes[g_ViRes].fullheight / 2; + top = g_ViModes[VIRES_LO].fulltop + g_ViModes[VIRES_LO].fullheight / 2; } } } else { if (optionsGetEffectiveScreenSize() == SCREENSIZE_WIDE) { if (g_InCutscene && optionsGetCutsceneSubtitles() && g_Vars.stagenum != STAGE_CITRAINING) { if (var8009de2c >= 1) { - f32 a = g_ViModes[g_ViRes].fulltop; - f32 b = g_ViModes[g_ViRes].widetop; + f32 a = g_ViModes[VIRES_LO].fulltop; + f32 b = g_ViModes[VIRES_LO].widetop; a = a * (1.0f - g_CutsceneBarFrac); b = b * g_CutsceneBarFrac; top = a + b; } else { - top = g_ViModes[g_ViRes].fulltop; + top = g_ViModes[VIRES_LO].fulltop; } } else { - top = g_ViModes[g_ViRes].widetop; + top = g_ViModes[VIRES_LO].widetop; } } else if (optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { - top = g_ViModes[g_ViRes].cinematop; + top = g_ViModes[VIRES_LO].cinematop; } else { if (g_InCutscene && !var8009dfc0 && (!optionsGetCutsceneSubtitles() || g_Vars.stagenum == STAGE_CITRAINING)) { if (var8009de2c >= 1) { - f32 a = g_ViModes[g_ViRes].widetop; - f32 b = g_ViModes[g_ViRes].fulltop; + f32 a = g_ViModes[VIRES_LO].widetop; + f32 b = g_ViModes[VIRES_LO].fulltop; a = a * (1.0f - g_CutsceneBarFrac); b = b * g_CutsceneBarFrac; top = a + b; } else { - top = g_ViModes[g_ViRes].widetop; + top = g_ViModes[VIRES_LO].widetop; } } else { - return g_ViModes[g_ViRes].fulltop; + return g_ViModes[VIRES_LO].fulltop; } } } @@ -2750,7 +2743,7 @@ f32 player0f0bd358(void) s16 width = playerGetViewportWidth(); result = (f32)width / (f32)height; - result = g_ViModes[g_ViRes].yscale * result; + result = g_ViModes[VIRES_LO].yscale * result; return result; } @@ -2861,7 +2854,6 @@ void playerTickTeleport(f32 *aspectratio) void playerConfigureVi(void) { f32 ratio = player0f0bd358(); - g_ViRes = VIRES_LO; text0f1531dc(false); @@ -2870,7 +2862,7 @@ void playerConfigureVi(void) playermgrSetViewSize(playerGetViewportWidth(), playerGetViewportHeight()); playermgrSetViewPosition(playerGetViewportLeft(), playerGetViewportTop()); - viSetMode(g_ViModes[g_ViRes].xscale); + viSetMode(g_ViModes[VIRES_LO].xscale); viSetFovAspectAndSize(60, ratio, playerGetViewportWidth(), playerGetViewportHeight()); @@ -2884,21 +2876,7 @@ void playerTick(bool arg0) f32 aspectratio; f32 f20; - g_ViRes = g_HiResEnabled; - - if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) && PLAYERCOUNT() > 1) { - g_ViRes = VIRES_LO; - } - -#if PAL text0f1531dc(false); -#else - if (g_ViRes == VIRES_HI) { - text0f1531dc(true); - } else { - text0f1531dc(false); - } -#endif if (optionsGetScreenRatio() == SCREENRATIO_16_9) { aspectratio = player0f0bd358() * 1.33333333f; @@ -2919,7 +2897,7 @@ void playerTick(bool arg0) playermgrSetViewSize(playerGetViewportWidth(), playerGetViewportHeight()); playermgrSetViewPosition(playerGetViewportLeft(), playerGetViewportTop()); - viSetMode(g_ViModes[g_ViRes].xscale); + viSetMode(g_ViModes[VIRES_LO].xscale); viSetFovAspectAndSize(60, aspectratio, playerGetViewportWidth(), playerGetViewportHeight()); viSetViewPosition(playerGetViewportLeft(), playerGetViewportTop()); viSetSize(playerGetFbWidth(), playerGetFbHeight()); diff --git a/src/game/propobj.c b/src/game/propobj.c index 54e95473f..5a3617b19 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -18192,12 +18192,6 @@ Gfx *countdownTimerRender(Gfx *gdl) } } -#if !PAL - if (g_ViRes == VIRES_HI) { - viewright = viewright / 2; - } -#endif - if (value60 < 0) { value60 = -value60; } diff --git a/src/game/radar.c b/src/game/radar.c index 511199ead..a2caeb5e1 100644 --- a/src/game/radar.c +++ b/src/game/radar.c @@ -60,15 +60,11 @@ Gfx *radarRenderBackground(Gfx *gdl, struct textureconfig *tconfig, s32 arg2, s3 gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetPrimColorViaWord(gdl++, 0, 0, 0x00000000); - gDPFillRectangle(gdl++, - arg2 * g_ScaleX, - arg3, - (arg2 + tconfig->width) * g_ScaleX, - arg3 + tconfig->width); + gDPFillRectangle(gdl++, arg2, arg3, (arg2 + tconfig->width), arg3 + tconfig->width); - spb0[0] = arg2 * g_ScaleX; + spb0[0] = arg2; spb0[1] = arg3; - spa8[0] = arg4 * g_ScaleX; + spa8[0] = arg4; spa8[1] = arg4; texSelect(&gdl, tconfig, 2, 0, 0, 1, NULL); @@ -264,17 +260,7 @@ Gfx *radarRender(Gfx *gdl) return gdl; } -#if PAL - g_ScaleX = 1; -#else - if (g_ViRes == VIRES_HI) { - g_ScaleX = 2; - } else { - g_ScaleX = 1; - } -#endif - - g_RadarX = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - 41; + g_RadarX = (viGetViewLeft() + viGetViewWidth()) - 41; if (playercount == 2) { if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) { @@ -398,8 +384,6 @@ Gfx *radarRender(Gfx *gdl) gdl = radarDrawDot(gdl, g_Vars.currentplayer->prop, &pos, colour, 0, 0); } - g_ScaleX = 1; - return gdl; } diff --git a/src/game/savebuffer.c b/src/game/savebuffer.c index 934ce2478..2b843a022 100644 --- a/src/game/savebuffer.c +++ b/src/game/savebuffer.c @@ -36,10 +36,6 @@ void func0f0d4690(Mtxf *mtx) mtx4SetTranslation(&pos, mtx); mtx00015e4c(-1, mtx); - - if (g_ScaleX == 2) { - mtx00015df0(2, mtx); - } } void func0f0d475c(Mtxf *mtx) diff --git a/src/game/sight.c b/src/game/sight.c index 57a10092b..786e5e56d 100644 --- a/src/game/sight.c +++ b/src/game/sight.c @@ -333,9 +333,9 @@ s32 sightCalculateBoxBound(s32 targetx, s32 viewleft, s32 timeelapsed, s32 timee */ Gfx *sightDrawTargetBox(Gfx *gdl, struct trackedprop *trackedprop, s32 textid, s32 time) { - s32 viewleft = viGetViewLeft() / g_ScaleX; + s32 viewleft = viGetViewLeft(); s32 viewtop = viGetViewTop(); - s32 viewwidth = viGetViewWidth() / g_ScaleX; + s32 viewwidth = viGetViewWidth(); s32 viewheight = viGetViewHeight(); s32 viewright = viewleft + viewwidth - 1; s32 viewbottom = viewtop + viewheight - 1; @@ -350,9 +350,9 @@ Gfx *sightDrawTargetBox(Gfx *gdl, struct trackedprop *trackedprop, s32 textid, s time = TICKS(512); } - boxleft = sightCalculateBoxBound(trackedprop->x1 / g_ScaleX, viewleft, time, TICKS(80)); + boxleft = sightCalculateBoxBound(trackedprop->x1, viewleft, time, TICKS(80)); boxtop = sightCalculateBoxBound(trackedprop->y1, viewtop, time, TICKS(80)); - boxright = sightCalculateBoxBound(trackedprop->x2 / g_ScaleX, viewright, time, TICKS(80)); + boxright = sightCalculateBoxBound(trackedprop->x2, viewright, time, TICKS(80)); boxbottom = sightCalculateBoxBound(trackedprop->y2, viewbottom, time, TICKS(80)); if (trackedprop->prop) { @@ -417,9 +417,9 @@ Gfx *sightDrawTargetBox(Gfx *gdl, struct trackedprop *trackedprop, s32 textid, s Gfx *sightDrawAimer(Gfx *gdl, s32 x, s32 y, s32 radius, s32 cornergap, u32 colour) { - s32 viewleft = viGetViewLeft() / g_ScaleX; + s32 viewleft = viGetViewLeft(); s32 viewtop = viGetViewTop(); - s32 viewwidth = viGetViewWidth() / g_ScaleX; + s32 viewwidth = viGetViewWidth(); s32 viewheight = viGetViewHeight(); s32 viewright = viewleft + viewwidth - 1; s32 viewbottom = viewtop + viewheight - 1; @@ -468,7 +468,7 @@ Gfx *sightDrawDefault(Gfx *gdl, bool sighton) s32 radius; s32 cornergap; u32 colour; - s32 x = (s32) g_Vars.currentplayer->crosspos[0] / g_ScaleX; + s32 x = (s32) g_Vars.currentplayer->crosspos[0]; s32 y = g_Vars.currentplayer->crosspos[1]; struct trackedprop *trackedprop; s32 i; @@ -682,7 +682,7 @@ Gfx *sightDrawClassic(Gfx *gdl, bool sighton) spc4[0] = x; spc4[1] = y; - spbc[0] = (tconfig->width >> 1) * (f32)g_ScaleX; + spbc[0] = tconfig->width >> 1; spbc[1] = tconfig->height >> 1; texSelect(&gdl, tconfig, 2, 0, 0, 1, NULL); @@ -796,15 +796,15 @@ Gfx *sightDrawSkedarTriangle(Gfx *gdl, s32 x, s32 y, s32 dir, u32 colour) Gfx *sightDrawSkedar(Gfx *gdl, bool sighton) { - s32 viewleft = viGetViewLeft() / g_ScaleX; + s32 viewleft = viGetViewLeft(); s32 viewtop = viGetViewTop(); - s32 viewwidth = viGetViewWidth() / g_ScaleX; + s32 viewwidth = viGetViewWidth(); s32 viewheight = viGetViewHeight(); s32 viewright = viewleft + viewwidth - 1; s32 viewbottom = viewtop + viewheight - 1; s32 paddingy = viewheight / 4; s32 paddingx = viewwidth / 4; - s32 x = (s32) (g_Vars.currentplayer->crosspos[0] / g_ScaleX); + s32 x = (s32) (g_Vars.currentplayer->crosspos[0]); s32 trix1; s32 trix2; s32 y = g_Vars.currentplayer->crosspos[1]; @@ -980,9 +980,9 @@ Gfx *sightDrawSkedar(Gfx *gdl, bool sighton) Gfx *sightDrawZoom(Gfx *gdl, bool sighton) { - s32 viewleft = viGetViewLeft() / g_ScaleX; + s32 viewleft = viGetViewLeft(); s32 viewtop = viGetViewTop(); - s32 viewhalfwidth = (viGetViewWidth() / g_ScaleX) >> 1; + s32 viewhalfwidth = viGetViewWidth() >> 1; s32 viewhalfheight = viGetViewHeight() >> 1; s32 viewright = viewleft + viewhalfwidth * 2 - 1; s32 viewbottom = viewtop + viewhalfheight * 2 - 1; @@ -1118,13 +1118,13 @@ Gfx *sightDrawZoom(Gfx *gdl, bool sighton) Gfx *sightDrawMaian(Gfx *gdl, bool sighton) { - s32 viewleft = viGetViewLeft() / g_ScaleX; + s32 viewleft = viGetViewLeft(); s32 viewtop = viGetViewTop(); - s32 viewwidth = viGetViewWidth() / g_ScaleX; + s32 viewwidth = viGetViewWidth(); s32 viewheight = viGetViewHeight(); s32 viewright = viewleft + viewwidth - 1; s32 viewbottom = viewtop + viewheight - 1; - s32 x = (s32)g_Vars.currentplayer->crosspos[0] / g_ScaleX; + s32 x = (s32)g_Vars.currentplayer->crosspos[0]; s32 y = g_Vars.currentplayer->crosspos[1]; struct gfxvtx *vertices; u32 *colours; @@ -1215,7 +1215,7 @@ Gfx *sightDrawMaian(Gfx *gdl, bool sighton) Gfx *sightDrawTarget(Gfx *gdl) { - s32 x = (s32)g_Vars.currentplayer->crosspos[0] / g_ScaleX; + s32 x = (s32)g_Vars.currentplayer->crosspos[0]; s32 y = g_Vars.currentplayer->crosspos[1]; gdl = textSetPrimColour(gdl, 0x00ff0028); @@ -1258,16 +1258,6 @@ Gfx *sightDraw(Gfx *gdl, bool sighton, s32 sight) return gdl; } -#if PAL - g_ScaleX = 1; -#else - if (g_ViRes == VIRES_HI) { - g_ScaleX = 2; - } else { - g_ScaleX = 1; - } -#endif - if (PLAYERCOUNT() >= 2 && g_Vars.coopplayernum < 0 && g_Vars.antiplayernum < 0) { sight = SIGHT_DEFAULT; } @@ -1310,7 +1300,5 @@ Gfx *sightDraw(Gfx *gdl, bool sighton, s32 sight) } } - g_ScaleX = 1; - return gdl; } diff --git a/src/game/sky.c b/src/game/sky.c index eba9551bf..69bb52c1a 100644 --- a/src/game/sky.c +++ b/src/game/sky.c @@ -2428,12 +2428,6 @@ Gfx *skyRenderSuns(Gfx *gdl, bool xray) return gdl; } -#if !PAL - if (g_ViRes == 1) { - xscale = 2; - } -#endif - viewleft = viGetViewLeft(); viewtop = viGetViewTop(); viewwidth = viGetViewWidth(); @@ -2615,12 +2609,6 @@ Gfx *sky0f126384(Gfx *gdl, f32 x, f32 y, f32 arg3, f32 size, s32 arg5, f32 arg6) scale = 1; -#if !PAL - if (g_ViRes == VIRES_HI) { - scale = 2; - } -#endif - sp128 = (x - viGetViewWidth() / 2.0f) * 0.01f; sp124 = (y - viGetViewHeight() / 2.0f) * 0.01f; diff --git a/src/game/trainingmenus.c b/src/game/trainingmenus.c index bface2bfb..494097fa1 100644 --- a/src/game/trainingmenus.c +++ b/src/game/trainingmenus.c @@ -188,9 +188,9 @@ s32 frWeaponListMenuHandler(s32 operation, struct menuitem *item, union handlerd TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0); gSPTextureRectangle(gdl++, - (((renderdata->x + i * 13) + 125) << 2) * g_ScaleX, (renderdata->y) << 2, - (((renderdata->x + i * 13) + 136) << 2) * g_ScaleX, (renderdata->y + 11) << 2, - G_TX_RENDERTILE, 0, 0x0160, 1024 / g_ScaleX, -1024); + (((renderdata->x + i * 13) + 125) << 2), (renderdata->y) << 2, + (((renderdata->x + i * 13) + 136) << 2), (renderdata->y + 11) << 2, + G_TX_RENDERTILE, 0, 0x0160, 1024, -1024); } return (s32)gdl; @@ -539,27 +539,27 @@ s32 frScoringMenuHandler(s32 operation, struct menuitem *item, union handlerdata // Top left quarter of target gSPTextureRectangle(gdl++, - ((renderdata->x + 10) << 2) * g_ScaleX, (renderdata->y + 5) << 2, - ((renderdata->x + 42) << 2) * g_ScaleX, (renderdata->y + 37) << 2, - G_TX_RENDERTILE, 16, 1024, 1024 / g_ScaleX, -1024); + ((renderdata->x + 10) << 2), (renderdata->y + 5) << 2, + ((renderdata->x + 42) << 2), (renderdata->y + 37) << 2, + G_TX_RENDERTILE, 16, 1024, 1024, -1024); // Top right quarter of target gSPTextureRectangle(gdl++, - ((renderdata->x + 41) << 2) * g_ScaleX, (renderdata->y + 5) << 2, - ((renderdata->x + 73) << 2) * g_ScaleX, (renderdata->y + 37) << 2, - G_TX_RENDERTILE, 16, 1024, -1024 / g_ScaleX, -1024); + ((renderdata->x + 41) << 2), (renderdata->y + 5) << 2, + ((renderdata->x + 73) << 2), (renderdata->y + 37) << 2, + G_TX_RENDERTILE, 16, 1024, -1024, -1024); // Bottom left quarter of target gSPTextureRectangle(gdl++, - ((renderdata->x + 10) << 2) * g_ScaleX, (renderdata->y + 36) << 2, - ((renderdata->x + 42) << 2) * g_ScaleX, (renderdata->y + 68) << 2, - G_TX_RENDERTILE, 16, 1024, 1024 / g_ScaleX, 1024); + ((renderdata->x + 10) << 2), (renderdata->y + 36) << 2, + ((renderdata->x + 42) << 2), (renderdata->y + 68) << 2, + G_TX_RENDERTILE, 16, 1024, 1024, 1024); // Bottom right quarter of target gSPTextureRectangle(gdl++, - ((renderdata->x + 41) << 2) * g_ScaleX, (renderdata->y + 36) << 2, - ((renderdata->x + 73) << 2) * g_ScaleX, (renderdata->y + 68) << 2, - G_TX_RENDERTILE, 16, 1024, -1024 / g_ScaleX, 1024); + ((renderdata->x + 41) << 2), (renderdata->y + 36) << 2, + ((renderdata->x + 73) << 2), (renderdata->y + 68) << 2, + G_TX_RENDERTILE, 16, 1024, -1024, 1024); gdl = textSetPrimColour(gdl, ((failed ? 0xff000055 : 0x00ff0055) & 0xffffff00) | (((failed ? 0xff000055 : 0x00ff0055) & 0xff) * (renderdata->colour & 0xff) >> 8)); colour = ((failed ? 0xff6969aa : renderdata->colour) & 0xffffff00) | ((((failed ? 0xff6969aa : renderdata->colour) & 0xff) * (renderdata->colour & 0xff)) >> 8); @@ -2327,9 +2327,9 @@ s32 ciHangarTitleMenuHandler(s32 operation, struct menuitem *item, union handler gDPSetEnvColorViaWord(gdl++, 0xffffff00 | ((renderdata->colour & 0xff) * 255) >> 8); gSPTextureRectangle(gdl++, - ((renderdata->x + 6) << 2) * g_ScaleX, (renderdata->y + 3) << 2, - ((renderdata->x + 60) << 2) * g_ScaleX, (renderdata->y + 39) << 2, - G_TX_RENDERTILE, 0, 0x0480, 1024 / g_ScaleX, -1024); + ((renderdata->x + 6) << 2), (renderdata->y + 3) << 2, + ((renderdata->x + 60) << 2), (renderdata->y + 39) << 2, + G_TX_RENDERTILE, 0, 0x0480, 1024, -1024); leftmargin = -1; } else { diff --git a/src/include/data.h b/src/include/data.h index ef6917081..b67ba60a6 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -301,8 +301,6 @@ extern s32 g_ModelMostType2; extern s32 g_ModelMostType3; extern s32 g_ModelMostModels; extern s32 g_ModelMostAnims; -extern s32 g_ViRes; -extern bool g_HiResEnabled; extern s32 var8007072c; extern u32 var80070738; extern u32 var8007073c; @@ -470,7 +468,6 @@ extern bool g_ShardsActive; extern bool g_WoodShardsActive; extern bool g_GlassShardsActive; extern s32 var800800f0jf; -extern s32 g_ScaleX; extern s32 var80080108jf; extern s32 var8007fad0; extern struct font *g_FontNumeric; diff --git a/src/include/game/player.h b/src/include/game/player.h index 3982b944d..d07c9916a 100644 --- a/src/include/game/player.h +++ b/src/include/game/player.h @@ -95,7 +95,6 @@ void playerAdjustFade(f32 maxfadetime, s32 r, s32 g, s32 b, f32 frac); void playerSetFadeFrac(f32 maxfadetime, f32 frac); bool playerIsFadeComplete(void); void playerStartChrFade(f32 duration60, f32 targetfrac); -void playerSetHiResEnabled(bool enable); void playerAutoWalk(s16 aimpad, u8 walkspeed, u8 turnspeed, u8 lookup, u8 dist); void playerLaunchSlayerRocket(struct weaponobj *rocket); void playerSetGlobalDrawWorldOffset(s32 room); diff --git a/src/include/gbiex.h b/src/include/gbiex.h index a980033f2..7eb2732de 100644 --- a/src/include/gbiex.h +++ b/src/include/gbiex.h @@ -120,14 +120,8 @@ #define gDPSetEnvColorViaWord(pkt, rgba) gDPSetColor(pkt, G_SETENVCOLOR, rgba) #define gDPSetFogColorViaWord(pkt, rgba) gDPSetColor(pkt, G_SETFOGCOLOR, rgba) -/** - * gDPFillRectangle - a wrapper around gDPFillRectangle which applies - * g_ScaleX to the X coordinates. - * - * g_ScaleX is normally 1, but 2 when using hi-res. - */ -#define gDPFillRectangleScaled(pkt, x1, y1, x2, y2) gDPFillRectangle(pkt, (x1) * g_ScaleX, y1, (x2) * g_ScaleX, y2) +#define gDPFillRectangleScaled gDPFillRectangle -#define gDPHudRectangle(pkt, x1, y1, x2, y2) gDPFillRectangle(pkt, (x1) * g_ScaleX, y1, ((x2 + 1)) * g_ScaleX, (y2) + 1) +#define gDPHudRectangle(pkt, x1, y1, x2, y2) gDPFillRectangle(pkt, (x1), y1, ((x2 + 1)), (y2) + 1) #endif diff --git a/src/lib/vi.c b/src/lib/vi.c index 113dac89d..3612d1436 100644 --- a/src/lib/vi.c +++ b/src/lib/vi.c @@ -161,14 +161,7 @@ void viReset(s32 stagenum) fbsize = g_ViModeWidths[2] * g_ViModeHeights[2] * 2; } else { viSetMode(VIMODE_LO); - - if (1); - - fbsize = 640 * 220 * 2; - - if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) && PLAYERCOUNT() == 2) { - fbsize = 320 * 220 * 2; - } + fbsize = 320 * 220 * 2; } ptr = mempAlloc(fbsize * 2 + 0x40, MEMPOOL_STAGE);