mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
some warning for apple rosetta
This commit is contained in:
@@ -142,6 +142,12 @@ public class App implements ApplicationListener {
|
|||||||
|
|
||||||
public static final int GLOBAL_FRAMERATE_LIMIT = 300;
|
public static final int GLOBAL_FRAMERATE_LIMIT = 300;
|
||||||
|
|
||||||
|
private static String undesirableConditions;
|
||||||
|
|
||||||
|
public static String getUndesirableConditions() {
|
||||||
|
return undesirableConditions;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These languages won't distinguish regional differences (e.g. enUS and enUK, frFR and frCA)
|
* These languages won't distinguish regional differences (e.g. enUS and enUK, frFR and frCA)
|
||||||
*/
|
*/
|
||||||
@@ -346,10 +352,13 @@ public class App implements ApplicationListener {
|
|||||||
processorVendor = "Unknown CPU";
|
processorVendor = "Unknown CPU";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (processor.startsWith("Apple M") && Objects.equals(systemArch, "aarch64")) {
|
if (processor.startsWith("Apple M") && systemArch.equals("aarch64")) {
|
||||||
isAppleM = true;
|
isAppleM = true;
|
||||||
System.out.println("Apple Proprietary "+processor+" detected; don't expect smooth sailing...");
|
System.out.println("Apple Proprietary "+processor+" detected; don't expect smooth sailing...");
|
||||||
}
|
}
|
||||||
|
if (processor.startsWith("Apple M") && !systemArch.equals("aarch64")) {
|
||||||
|
undesirableConditions = "apple_execution_through_rosetta";
|
||||||
|
}
|
||||||
|
|
||||||
if (!IS_DEVELOPMENT_BUILD) {
|
if (!IS_DEVELOPMENT_BUILD) {
|
||||||
var p = UnsafeHelper.INSTANCE.allocate(64);
|
var p = UnsafeHelper.INSTANCE.allocate(64);
|
||||||
|
|||||||
@@ -332,11 +332,11 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
|
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
|
|
||||||
|
// warn: 32-bit
|
||||||
|
val linegap = 4
|
||||||
|
val imgTxtGap = 10
|
||||||
|
val yoff = App.scr.height - App.scr.tvSafeGraphicsHeight - 64 - (3*(20+linegap)) - imgTxtGap - 9
|
||||||
if (App.is32BitJVM && uiRemoCon.currentRemoConContents.parent == null) {
|
if (App.is32BitJVM && uiRemoCon.currentRemoConContents.parent == null) {
|
||||||
// if (uiRemoCon.currentRemoConContents.parent == null) {
|
|
||||||
val linegap = 4
|
|
||||||
val imgTxtGap = 10
|
|
||||||
val yoff = App.scr.height - App.scr.tvSafeGraphicsHeight - 64 - (3*(20+linegap)) - imgTxtGap - 9
|
|
||||||
Toolkit.drawCentered(batch, warning32bitJavaIcon, yoff)
|
Toolkit.drawCentered(batch, warning32bitJavaIcon, yoff)
|
||||||
for (i in 0..2) {
|
for (i in 0..2) {
|
||||||
val text = Lang.get("GAME_32BIT_WARNING${i+1}", (i != 2))
|
val text = Lang.get("GAME_32BIT_WARNING${i+1}", (i != 2))
|
||||||
@@ -344,6 +344,15 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
App.fontGame.draw(batch, text, ((drawWidth - App.fontGame.getWidth(text)) / 2).toFloat(), yoff + imgTxtGap + 64f + linegap + i*(20+linegap))
|
App.fontGame.draw(batch, text, ((drawWidth - App.fontGame.getWidth(text)) / 2).toFloat(), yoff + imgTxtGap + 64f + linegap + i*(20+linegap))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// warn: rosetta on Apple M-chips
|
||||||
|
else if (App.getUndesirableConditions() == "apple_execution_through_rosetta") {
|
||||||
|
listOf(
|
||||||
|
"It seems you are using a Mac with Apple Silicon but running the game through Rosetta.",
|
||||||
|
"A native build for the game is available which runs much faster than current version."
|
||||||
|
).forEachIndexed { i, text ->
|
||||||
|
App.fontGame.draw(batch, text, ((drawWidth - App.fontGame.getWidth(text)) / 2).toFloat(), yoff + imgTxtGap + 64f + linegap + i*(20+linegap))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pause() {
|
override fun pause() {
|
||||||
|
|||||||
Reference in New Issue
Block a user