DEADSOFTWARE

Android: hack-fix bug #31 and #32
[d2df-sdl.git] / android / src / org / d2df / app / Doom2DF.java
index 175f4e48925150adb5fdc4e8857d9957dea6a556..48bd752ca23c487640eab7904ec620e24b124b56 100644 (file)
@@ -3,6 +3,7 @@ package org.d2df.app;
 import android.app.Activity;
 import android.os.Bundle;
 
+import org.libsdl.app.SDL;
 import org.libsdl.app.SDLActivity;
 
 public class Doom2DF extends SDLActivity {
@@ -18,4 +19,26 @@ public class Doom2DF extends SDLActivity {
                        "Doom2DF"
                };
        }
+
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+
+               CopyAssets.copyAssets(SDL.getContext(), "");
+               CopyAssets.copyAssets(SDL.getContext(), "data");
+               CopyAssets.copyAssets(SDL.getContext(), "data/models");
+               CopyAssets.copyAssets(SDL.getContext(), "maps");
+               CopyAssets.copyAssets(SDL.getContext(), "maps/megawads");
+               CopyAssets.copyAssets(SDL.getContext(), "wads");
+               CopyAssets.copyAssets(SDL.getContext(), "instruments");
+               CopyAssets.copyAssets(SDL.getContext(), "timidity.cfg");
+       }
+
+       @Override
+       protected void onDestroy() {
+               super.onDestroy();
+
+               /* This will fix bug #31 and may be #32 */
+               System.exit(0);
+       }
 }