v0.7.5: corrected some issues caused by LibGDX

This commit is contained in:
Evan Debenham
2019-08-23 18:58:50 -04:00
parent de10df7866
commit 20f49ac600
5 changed files with 19 additions and 51 deletions

View File

@@ -23,6 +23,7 @@ package com.watabou.utils;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.GdxRuntimeException;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -81,7 +82,16 @@ public class FileUtils {
//only works for base path
public static void bundleToFile( String fileName, Bundle bundle ) throws IOException{
bundleToStream( Gdx.files.local(fileName).write(false), bundle);
try {
bundleToStream(Gdx.files.local(fileName).write(false), bundle);
} catch (GdxRuntimeException e){
if (e.getCause() instanceof IOException){
//we want to throw the underlying IOException, not the GdxRuntimeException
throw (IOException)e.getCause();
} else {
throw e;
}
}
}
private static void bundleToStream( OutputStream output, Bundle bundle ) throws IOException{

View File

@@ -1,34 +0,0 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2019 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.watabou.utils;
import com.badlogic.gdx.utils.TimeUtils;
public class SystemTime {
public static long now;
public static void tick() {
now = TimeUtils.millis();
}
}