Skip to content

Commit

Permalink
Adding initial support to permanent mission information inside bug se…
Browse files Browse the repository at this point in the history
…ctors
  • Loading branch information
vitor251093 committed Feb 6, 2025
1 parent ee19774 commit 9f934ac
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/plugins/PluginKingdomHeartsReCoded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,20 @@ void PluginKingdomHeartsReCoded::gpu3DOpenGLCompute_applyChangesToPolygon(int Sc
}
else
{
if (GameScene == gameScene_InGameWithMap)
{
// Bug sector SP score
float bugSectorSpScoreTopMargin = 18.0;
float bugSectorSpScoreScale = (4.0)/UIScale;

if ((_x >= 0 && _x <= (2.0/5)*(ScreenWidth) &&
_y >= 0 && _y <= (1.0/4)*(ScreenHeight) &&
_z < 0)) {
_x = (_x)/(bugSectorSpScoreScale*aspectRatio);
_y = (_y)/(bugSectorSpScoreScale) + bugSectorSpScoreTopMargin*resolutionScale;
}
}

if (GameScene == gameScene_InGameWithMap || GameScene == gameScene_PauseMenu || GameScene == gameScene_InGameOlympusBattle)
{
if (_x >= 0 && _x <= (5.0/16)*(ScreenWidth) &&
Expand Down
20 changes: 18 additions & 2 deletions src/plugins/PluginKingdomHeartsReCoded_GPU_OpenGL_shaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,7 @@ vec2 getIngameHudTextureCoordinates(float xpos, float ypos)
float sourceMissionInfoWidth = 256.0;
float missionInfoHeight = sourceMissionInfoHeight;
float missionInfoWidth = sourceMissionInfoWidth*heightScale;
float missionInfoY1 = 0;
float missionInfoY2 = missionInfoHeight;
float missionInfoDetailsLeftMargin = -5.4*heightScale;
if (texPosition3d.x >= 0 &&
texPosition3d.x < missionInfoWidth &&
Expand Down Expand Up @@ -485,6 +483,24 @@ vec2 getIngameHudTextureCoordinates(float xpos, float ypos)
vec2(enemies2LeftMargin, 192.0*iuTexScale - enemies2Height - enemiesBottomMargin))) +
vec2(0, 192.0) + vec2(bottomEnemiesLeftMargin, 0);
}
// mission information
float sourceMissionInfoHeight = 26.0;
float sourceMissionInfoWidth = 247.0;
float sourceMissionInfoLeftMargin = 5.0;
float sourceMissionInfoTopMargin = 166.0;
float missionInfoHeight = sourceMissionInfoHeight;
float missionInfoWidth = sourceMissionInfoWidth*heightScale;
float missionInfoLeftMargin = 3.0;
float missionInfoTopMargin = 6.0;
if (texPosition3d.x >= missionInfoLeftMargin &&
texPosition3d.x < missionInfoLeftMargin + missionInfoWidth &&
texPosition3d.y >= missionInfoTopMargin &&
texPosition3d.y < missionInfoTopMargin + missionInfoHeight) {
return fixStretch*(texPosition3d - vec2(missionInfoLeftMargin, missionInfoTopMargin)) +
vec2(0, 192.0) + vec2(sourceMissionInfoLeftMargin, sourceMissionInfoTopMargin);
}
}
}
Expand Down

0 comments on commit 9f934ac

Please sign in to comment.