* Update libGDX to 1.9.13
* Fix deprecated methods
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
gdxVersion = 1.9.13-SNAPSHOT
|
||||
gdxVersion = 1.9.13
|
||||
gdxVersionBeta = 1.9.13-SNAPSHOT
|
||||
box2dlightsVersion = 1.6-SNAPSHOT
|
||||
ashleyVersion = 1.7.3
|
||||
|
||||
@@ -70,7 +70,7 @@ public class VersionMigTo005 implements IVersionMigrator {
|
||||
FileHandle projectInfoFile = Gdx.files.internal(prjInfoFilePath);
|
||||
String projectInfoContents = null;
|
||||
try {
|
||||
projectInfoContents = FileUtils.readFileToString(projectInfoFile.file());
|
||||
projectInfoContents = FileUtils.readFileToString(projectInfoFile.file(), "utf-8");
|
||||
ProjectInfoVO currentProjectInfoVO = json.fromJson(ProjectInfoVO.class, projectInfoContents);
|
||||
projectManager.currentProjectInfoVO = currentProjectInfoVO;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class VersionMigTo005 implements IVersionMigrator {
|
||||
for (File entry : scenesDir.listFiles()) {
|
||||
if (!entry.isDirectory()) {
|
||||
try {
|
||||
String content = FileUtils.readFileToString(new FileHandle(entry).file());
|
||||
String content = FileUtils.readFileToString(new FileHandle(entry).file(), "utf-8");
|
||||
content = content.replaceAll("\"slights\":", "\"sLights\":");
|
||||
FileUtils.writeStringToFile(new File(entry.getAbsolutePath()), content, "utf-8");
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class VersionMigTo009 implements IVersionMigrator {
|
||||
for (File entry : scenesDir.listFiles()) {
|
||||
if (!entry.isDirectory()) {
|
||||
try {
|
||||
String content = FileUtils.readFileToString(new FileHandle(entry).file());
|
||||
String content = FileUtils.readFileToString(new FileHandle(entry).file(), "utf-8");
|
||||
JsonValue value = jsonReader.parse(content);
|
||||
fixAnimations(value.get("composite"));
|
||||
if(value.get("libraryItems") != null) {
|
||||
@@ -105,7 +105,7 @@ public class VersionMigTo009 implements IVersionMigrator {
|
||||
String prjInfoFilePath = projectPath + "/project.dt";
|
||||
FileHandle projectInfoFile = Gdx.files.internal(prjInfoFilePath);
|
||||
try {
|
||||
String projectInfoContents = FileUtils.readFileToString(projectInfoFile.file());
|
||||
String projectInfoContents = FileUtils.readFileToString(projectInfoFile.file(), "utf-8");
|
||||
JsonValue value = jsonReader.parse(projectInfoContents);
|
||||
JsonValue newVal = jsonReader.parse(libraryArrayJsonString);
|
||||
newVal.name = "libraryItems";
|
||||
|
||||
@@ -1259,7 +1259,7 @@ public class ProjectManager extends Proxy {
|
||||
Json json = new Json();
|
||||
String projectInfoContents = null;
|
||||
try {
|
||||
projectInfoContents = FileUtils.readFileToString(handle.file());
|
||||
projectInfoContents = FileUtils.readFileToString(handle.file(), "utf-8");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ public class ImportUtils {
|
||||
int type = TYPE_UNKNOWN;
|
||||
|
||||
try {
|
||||
String contents = FileUtils.readFileToString(file);
|
||||
String contents = FileUtils.readFileToString(file, "utf-8");
|
||||
|
||||
// checking for atlas file
|
||||
if (contents.contains("format: ") && contents.contains("filter: ") && contents.contains("xy: ")) {
|
||||
|
||||
@@ -24,6 +24,8 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.badlogic.ashley.core.Component;
|
||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||
import com.badlogic.gdx.utils.reflect.ReflectionException;
|
||||
|
||||
/**
|
||||
* Created by azakhary on 6/3/2015.
|
||||
@@ -34,7 +36,7 @@ public class ComponentCloner {
|
||||
Class<?> eClass = source.getClass();
|
||||
E target = null;
|
||||
try {
|
||||
target = (E) eClass.newInstance();
|
||||
target = (E) ClassReflection.newInstance(eClass);
|
||||
Field[] sourceFields = source.getClass().getDeclaredFields();
|
||||
Field[] targetFields = target.getClass().getDeclaredFields();
|
||||
for(int i = 0; i < targetFields.length; i++) {
|
||||
@@ -42,10 +44,8 @@ public class ComponentCloner {
|
||||
targetFields[i].set(target, sourceFields[i].get(source));
|
||||
}
|
||||
}
|
||||
} catch (InstantiationException e) {
|
||||
//e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
//e.printStackTrace();
|
||||
} catch (IllegalAccessException | ReflectionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return target;
|
||||
|
||||
@@ -188,7 +188,7 @@ public class TransformTool extends SelectionTool implements FollowerTransformati
|
||||
Vector2 originPoint = new Vector2(transformComponent.x + transformComponent.originX, transformComponent.y + transformComponent.originY);
|
||||
mousePoint.sub(originPoint);
|
||||
//origin related
|
||||
lastTransformAngle = mousePoint.angle();
|
||||
lastTransformAngle = mousePoint.angleDeg();
|
||||
lastEntityAngle = transformComponent.rotation;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user