diff -r ed1d52c5aa94 -r 763d3961400b project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Frontlib.java --- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Frontlib.java Sat Aug 18 00:22:33 2012 +0200 +++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Frontlib.java Sat Aug 18 00:47:51 2012 +0200 @@ -12,7 +12,7 @@ import org.hedgewars.hedgeroid.Datastructures.MetaScheme.Mod; import org.hedgewars.hedgeroid.Datastructures.MetaScheme.Setting; import org.hedgewars.hedgeroid.Datastructures.GameConfig; -import org.hedgewars.hedgeroid.Datastructures.RoomlistRoom; +import org.hedgewars.hedgeroid.Datastructures.Room; import org.hedgewars.hedgeroid.Datastructures.Scheme; import org.hedgewars.hedgeroid.Datastructures.Team; import org.hedgewars.hedgeroid.Datastructures.TeamInGame; @@ -26,7 +26,6 @@ import com.sun.jna.Pointer; import com.sun.jna.PointerType; import com.sun.jna.Structure; -import com.sun.jna.ptr.IntByReference; /** * Here is an introduction to the most important aspects of the JNA code. @@ -51,14 +50,12 @@ * representing the data (e.g. SchemePtr.deref() will give you a Scheme object). * * Remember that you usually have to destroy structs that you receive from the - * library, because they are owned by the native code, not Java. For example, if - * you obtain a {@link MetaschemePtr} metaPtr using flib_metascheme_from_ini, - * you have to call flib_metascheme_release(metaPtr) after you are done using - * it. The recommended pattern for most cases is to call deref() on the pointer - * to get a Java object (that you can keep as long as you like), and then - * immediately destroy the struct if it needs destroying. To find out whether - * and how the struct needs to be destroyed, see the library's documentation of - * the function that you got the struct from. + * library, because they are owned by the native code, not Java. The recommended + * pattern for most cases is to call deref() on the pointer to get a Java object + * (that you can keep as long as you like), and then immediately destroy the + * struct if it needs destroying. To find out whether and how the struct needs + * to be destroyed, see the library's documentation of the function that you got + * the struct from. * * To pass new structs to the library, you can use the static createJavaOwned() * function in each PointerType, which creates a new struct from the Java object @@ -146,13 +143,13 @@ } public static class RoomArrayPtr extends PointerType { - public RoomlistRoom[] getRooms(int count) { + public Room[] getRooms(int count) { Pointer ptr = getPointer(); if(ptr == null) { - return new RoomlistRoom[0]; + return new Room[0]; } Pointer[] untypedPtrs = ptr.getPointerArray(0, count); - RoomlistRoom[] result = new RoomlistRoom[count]; + Room[] result = new Room[count]; for(int i=0; i list) { weaponsetCount = list.size(); - weaponsets = new WeaponsetPointerByReference(); - Structure[] structs = weaponsets.toArray(weaponsetCount); - - for(int i=0; i settingsMap = new HashMap(); - for(int i=0; i modsMap = new HashMap(); - for(int i=0; i schemeList) { schemeCount = schemeList.size(); - schemes = new SchemePointerByReference(); - Structure[] schemePtrStructs = schemes.toArray(schemeCount); - - for(int i=0; i teamList, WeaponsetStruct.ByRef weaponset, int initialHealth) { teamCount = teamList.size(); - teams = new TeamPointerByReference(); - Structure[] teamPtrStructs = teams.toArray(teamCount); - - for(int i=0; i