mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 06:41:58 +00:00
Delete obsolete glsl folder on startup
This commit is contained in:
parent
c01c8b3484
commit
33e4bc37ad
1 changed files with 22 additions and 0 deletions
|
@ -124,10 +124,15 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
||||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pakQ3Q.pk3", true);
|
copy_asset("/sdcard/ioquake3Quest/baseq3", "pakQ3Q.pk3", true);
|
||||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "pakQ3Q.pk3", true);
|
copy_asset("/sdcard/ioquake3Quest/missionpack", "pakQ3Q.pk3", true);
|
||||||
|
|
||||||
|
// cleanup incompatible shaders
|
||||||
|
delete_asset("/sdcard/ioquake3Quest/baseq3/glsl");
|
||||||
|
delete_asset("/sdcard/ioquake3Quest/missionpack/glsl");
|
||||||
|
|
||||||
//If open arena is installed then copy necessary stuff
|
//If open arena is installed then copy necessary stuff
|
||||||
if (new File("/sdcard/ioquake3Quest/baseoa").exists()) {
|
if (new File("/sdcard/ioquake3Quest/baseoa").exists()) {
|
||||||
copy_asset("/sdcard/ioquake3Quest/baseoa", "autoexec_oa.cfg", "autoexec.cfg", false);
|
copy_asset("/sdcard/ioquake3Quest/baseoa", "autoexec_oa.cfg", "autoexec.cfg", false);
|
||||||
copy_asset("/sdcard/ioquake3Quest/baseoa", "pakQ3Q.pk3", true);
|
copy_asset("/sdcard/ioquake3Quest/baseoa", "pakQ3Q.pk3", true);
|
||||||
|
delete_asset("/sdcard/ioquake3Quest/baseoa/glsl");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Read these from a file and pass through
|
//Read these from a file and pass through
|
||||||
|
@ -191,6 +196,23 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void delete_asset(String path) {
|
||||||
|
File file = new File(path);
|
||||||
|
delete_asset(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void delete_asset(File file) {
|
||||||
|
if (!file.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
for (File nestedFile : file.listFiles()) {
|
||||||
|
delete_asset(nestedFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
|
||||||
public void _copy_asset(String name_in, String name_out) {
|
public void _copy_asset(String name_in, String name_out) {
|
||||||
AssetManager assets = this.getAssets();
|
AssetManager assets = this.getAssets();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue