Skip to content

Rebuild with gdx-liftoff#22

Open
SonicGDX wants to merge 3 commits intolibgdx:masterfrom
SonicGDX:liftoff-rebuild
Open

Rebuild with gdx-liftoff#22
SonicGDX wants to merge 3 commits intolibgdx:masterfrom
SonicGDX:liftoff-rebuild

Conversation

@SonicGDX
Copy link

@SonicGDX SonicGDX commented Nov 15, 2024

First commit pins dependency versions in the existing build files to fix the build issues caused by the script trying to use the latest versions. I pinned the versions to what they were in April 2021 (which was a few months before the time of the last commit to this repo) to do this. I would recommend not merging this PR with squash and merge as people may find it useful to checkout this commit if they want to build the older version without issues. (It doesn't work with JDK 17 or 21 due to the gradle version used, but if you use JDK 11, for example, it works.)

The second commit rebuilds the project with gdx-liftoff 1.12.1.16 (created by generating a new project with liftoff and copying the relevant files into that generation). To match things up I also generated icon sizes for the desktop and android versions (note that the desktop ones were scaled bilinearly and so don't look very good, but have consistent pixel proportions).

For iOS I couldn't figure out how to use the existing launch images so I created a launch screen instead by cropping out the text from the launch images and using that standalone for the foreground, and adding the background part of the image as a color.

I also changed a few other minor things like adding a white background color to android's color.xml, so do review carefully and thoroughly.

The build was broken because it tried to pull the latest versions of everything which caused issues e.g. with Android complaining about the gradle version.

The old versions were found from the DependencyBank in an old commit (8de163186d0d6ebf6f35810ff090fbbd0984744e) in the libGDX repo (around the time the previous PR was merged).

https://github.com/libgdx/libgdx/blob/d4e51cc278e2ee5f954a714d9003762417b4fac7/extensions/gdx-setup/src/com/badlogic/gdx/setup/DependencyBank.java
…creen for iOS

The rebuild now includes lwjgl3 as the desktop backend while still keeping the legacy lwjgl2 as a separate backend.

Couldn't figure out how to port over the existing launch image, so I recreated it as a launch screen

Similarly for the icons, I added some additional hdpi versions for android and various scaled desktop icons (note that the desktop ones are scaled just using bilinear filtering and hence low-res ones don't look very good)

There are various minor changes such as adding a white background colour to color.xml in android as well, so do review carefully.
@SonicGDX
Copy link
Author

SonicGDX commented Nov 15, 2024

One issue I noticed is that the help images don't scale properly and for some screen sizes they're just displayed in the bottom left corner with just a red background using the rest of the window.
image

But I can reproduce this with the pre-rebuild version as well, so I guess it's just an issue that's always been there.

@SonicGDX
Copy link
Author

SonicGDX commented Nov 15, 2024

I think @obigu would be best-suited to reviewing this, if they have free time of course, as they had updated this repo a few years ago and seem very knowledgeable about iOS (I made a few changes to the iOS assets such as the icon scaling and the launch screen).

@SonicGDX
Copy link
Author

SonicGDX commented Nov 15, 2024

Just realised the existing superjumper code I moved over is indented with tabs, but liftoff generated files and the editorconfig it added has indenting with spaces. Not sure if I should reindent the superjumper code, or just remove the .editorconfig.

@tommyettinger thoughts?

@tommyettinger
Copy link
Member

tommyettinger commented Nov 16, 2024

I would edit the .editorconfig file and tell it to match the existing formatting used, personally. I'll look through this, but IMO there's no reason to have this use an old Gradle version that isn't compatible with the currently required tools, like Java 17. I'm not sure if the second commit helped there, or what...

EDIT: OK, now I read the changes and understand, only the first commit used an old Gradle version, and the second updated to 8.10.2 .

@Frosty-J
Copy link

One issue I noticed is that the help images don't scale properly and for some screen sizes they're just displayed in the bottom left corner with just a red background using the rest of the window.

Mmm... HDPI, always an Apple issue for some reason. It probably needs Gdx.graphics.getWidth() replaced with Gdx.graphics.getBackBufferWidth() or some crap. Or, you know, do viewports properly.

Makes it consistent with the core code files using tab for indentation as opposed to 4 spaces (as they were carried over without changes, the indentation was kept intact).

(Used IntelliJ Idea's Edit->Convert Indents feature to do this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants