DEADSOFTWARE

Lower min android api
authorfredboy <fredboy@protonmail.com>
Wed, 15 May 2024 16:59:04 +0000 (23:59 +0700)
committerfredboy <fredboy@protonmail.com>
Wed, 15 May 2024 16:59:04 +0000 (23:59 +0700)
android/build.gradle
core/build.gradle
core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java
core/src/ru/deadsoftware/cavedroid/game/objects/drop/DropController.java
core/src/ru/deadsoftware/cavedroid/misc/Assets.java

index bf1af009dae215b66422a87bff325fc37e8d50f4..d52b9e92d650e7802b3bdfd545bedb0fbbeb6301 100644 (file)
@@ -37,10 +37,12 @@ android {
     }
     defaultConfig {
         applicationId "ru.deadsoftware.cavedroid"
-        minSdkVersion 24
+        minSdkVersion 19
         targetSdkVersion 34
         versionCode 25
         versionName "alpha0.9.2"
+
+        multiDexEnabled true
     }
     applicationVariants.all { variant ->
         variant.outputs.all {
index 7aff46869013359c2ca4852bfeddb3d84f7d9783..3b061a7b46e305818b0cc302409847fc593d016a 100644 (file)
@@ -22,5 +22,5 @@ dependencies {
     implementation 'org.jetbrains:annotations:23.1.0'
     implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
     implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion"
-    annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
+    ksp "com.google.dagger:dagger-compiler:$daggerVersion"
 }
\ No newline at end of file
index 0dcbefcc575e7d3c2c0a1ded8b533bc5278dd3a6..93dc8b95f233bd1abb8ac5e01c9efbece0498a30 100644 (file)
@@ -82,7 +82,12 @@ public class GameRenderer extends Renderer {
         mMobsController = mobsController;
         mGameWorld = gameWorld;
         mRenderers = new ArrayList<>(renderers);
-        mRenderers.sort(Comparator.comparingInt(IGameRenderer::getRenderLayer));
+        kotlin.collections.CollectionsKt.sortWith(mRenderers, new Comparator<IGameRenderer>() {
+            @Override
+            public int compare(IGameRenderer o1, IGameRenderer o2) {
+                return o1.getRenderLayer() - o2.getRenderLayer();
+            }
+        });
         mCursorMouseInputHandler = cursorMouseInputHandler;
         mMouseInputActionMapper = mouseInputActionMapper;
         mKeyboardInputActionMapper = keyboardInputActionMapper;
@@ -375,7 +380,9 @@ public class GameRenderer extends Renderer {
         Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
 
         spriter.begin();
-        mRenderers.forEach(iGameRenderer -> iGameRenderer.draw(spriter, shaper, getCameraViewport(), delta));
+        for (IGameRenderer iGameRenderer : mRenderers) {
+            iGameRenderer.draw(spriter, shaper, getCameraViewport(), delta);
+        }
         handleMousePosition();
         spriter.end();
 
index 6666fc8f64b7edcc75fddf22ea701403b7ea5b5f..0213c971cbed124b6787a9fec6c570636ff8e47b 100644 (file)
@@ -25,7 +25,9 @@ public class DropController implements Serializable {
     }
 
     public void initDrops(GameItemsHolder gameItemsHolder) {
-        mDrops.forEach((drop) -> drop.initItem(gameItemsHolder));
+        for (Drop drop : mDrops) {
+            drop.initItem(gameItemsHolder);
+        }
     }
 
     public void addDrop(float x, float y, Item item) {
@@ -48,7 +50,9 @@ public class DropController implements Serializable {
     }
 
     public void forEach(Callback callback) {
-        mDrops.forEach(callback::run);
+        for (Drop drop : mDrops) {
+            callback.run(drop);
+        }
     }
 
     public Iterator<Drop> getIterator() {
index 71cad7a2d69eac9226114ef607735d099bd579ca..893414ba61c3aa3c5ee1700cbcec121aeef457fc 100644 (file)
@@ -49,7 +49,9 @@ public class Assets {
 
     public static void dispose() {
         minecraftFont.dispose();
-        loadedTextures.forEach(Texture::dispose);
+        for (Texture texture : loadedTextures) {
+            texture.dispose();
+        }
         loadedTextures.clear();
     }