AlisterT / openjazz

OpenJazz
GNU General Public License v2.0
275 stars 49 forks source link

Names of episodes are not alligned properly on X axis with original 320px wide resolution. #93

Open Apaczer opened 1 year ago

Apaczer commented 1 year ago

After https://github.com/AlisterT/openjazz/commit/2e32bac3a6120dc74191b83ff398d8bfe7281750, the stringEpisode overlap episodeScreens box, which results in following image when playing on native resolution: image

Preferably the distance between left side of drawRect to screen border should be the same as episodeScreens right side distance to screen border (that is 8px) on X axis. To accomodate I've made small patch for lowend ARM platform, which has 320x wide screen:

diff --git a/src/menu/gamemenu.cpp b/src/menu/gamemenu.cpp
index 8ca3b0f..3e47ebc 100644
--- a/src/menu/gamemenu.cpp
+++ b/src/menu/gamemenu.cpp
@@ -576,16 +576,16 @@ int GameMenu::newGameEpisode (GameModeType mode) {

                // black on white
                fontmn2->mapPalette(240, 8, 79, -80);
-               drawRect(episodeX - 2, (canvasH >> 1) + (count << 4) - 94,
+               drawRect(8, (canvasH >> 1) + (count << 4) - 94,
                    160, 15, 79);

            } else if (!exists[count])
                fontmn2->mapPalette(240, 8, 94, -16);

            // align both separately
-           fontmn2->showString(episodeTag[count], episodeX - (count < 6 ? 2 : 0),
+           fontmn2->showString(episodeTag[count], 10,
                (canvasH >> 1) + (count << 4) - 92);
-           fontmn2->showString(episodeTitle[count], episodeX + 16,
+           fontmn2->showString(episodeTitle[count], 26,
                (canvasH >> 1) + (count << 4) - 92);

            if ((count == episode) || (!exists[count]))

The effect is as expected, however I don't understand the code and how it alligns text in use with different/bigger resolutions on other platforms: image