--- a/.hgignore Fri Aug 19 17:25:30 2011 +0400
+++ b/.hgignore Fri Aug 19 17:22:12 2011 +0200
@@ -36,3 +36,15 @@
glob:*.orig
glob:*.bak
glob:*.rej
+glob:project_files/Android-build/SDL-android-project/jni/**
+glob:project_files/Android-build/SDL-android-project/obj
+glob:project_files/Android-build/SDL-android-project/libs
+glob:project_files/Android-build/SDL-android-project/bin
+glob:project_files/Android-build/SDL-android-project/gen
+glob:project_files/Android-build/SDL-android-project/local.properties
+glob:project_files/Android-build/SDL-android-project/default.properties
+glob:project_files/Android-build/SDL-android-project/.*
+glob:project_files/Android-build/complete_build.sh
+glob:project_files/Android-build/pushToDevice.sh
+glob:project_files/Android-build/Makefile.android
+glob:project_files/Android-build/out
--- a/CMakeLists.txt Fri Aug 19 17:25:30 2011 +0400
+++ b/CMakeLists.txt Fri Aug 19 17:22:12 2011 +0200
@@ -191,6 +191,9 @@
add_subdirectory(misc/liblua)
add_subdirectory(hedgewars)
+#Xeli: Should if/endif this one too?
+add_subdirectory(project_files/Android-build)
+
if(NOT BUILD_ENGINE_LIBRARY)
add_subdirectory(bin)
add_subdirectory(QTfrontend)
--- a/hedgewars/PascalExports.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/PascalExports.pas Fri Aug 19 17:22:12 2011 +0200
@@ -32,6 +32,9 @@
{$INCLUDE "config.inc"}
procedure HW_versionInfo(netProto: PLongInt; versionStr: PPChar); cdecl; export;
+function HW_getNumberOfWeapons:LongInt; cdecl; export;
+function HW_getMaxNumberOfTeams:LongInt; cdecl; export;
+function HW_getMaxNumberOfHogs:LongInt; cdecl; export;
implementation
{$IFDEF HWLIBRARY}
--- a/hedgewars/SDLh.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/SDLh.pas Fri Aug 19 17:22:12 2011 +0200
@@ -35,13 +35,15 @@
{$ENDIF}
{$IFDEF UNIX}
- {$IFNDEF DARWIN}
+ {$IFNDEF DARWIN}
{$linklib c}
{$ENDIF}
{$IFDEF HAIKU}
{$linklib root}
{$ELSE}
- {$linklib pthread}
+ {$IFNDEF ANDROID}
+ {$linklib pthread}
+ {$ENDIF}
{$ENDIF}
{$ENDIF}
@@ -81,11 +83,19 @@
SDL_ImageLibName = 'SDL_image';
SDL_NetLibName = 'SDL_net';
{$ELSE}
- SDLLibName = 'libSDL.so';
- SDL_TTFLibName = 'libSDL_ttf.so';
- SDL_MixerLibName = 'libSDL_mixer.so';
- SDL_ImageLibName = 'libSDL_image.so';
- SDL_NetLibName = 'libSDL_net.so';
+ {$IFDEF ANDROID}
+ SDLLibName = 'SDL';
+ SDL_TTFLibName = 'libSDL_ttf.so';
+ SDL_MixerLibName = 'libSDL_mixer.so';
+ SDL_ImageLibName = 'libSDL_image.so';
+ SDL_NetLibName = 'libSDL_net.so';
+ {$ELSE}
+ SDLLibName = 'SDL';
+ SDL_TTFLibName = 'libSDL_ttf.so';
+ SDL_MixerLibName = 'libSDL_mixer.so';
+ SDL_ImageLibName = 'libSDL_image.so';
+ SDL_NetLibName = 'libSDL_net.so';
+ {$ENDIF}
{$ENDIF}
{$ENDIF}
@@ -136,6 +146,9 @@
SDL_JOYHATMOTION = $602;
SDL_JOYBUTTONDOWN = $603;
SDL_JOYBUTTONUP = $604;
+ SDL_FINGERDOWN = $700;
+ SDL_FINGERUP = $701;
+ SDL_FINGERMOTION = $702;
//TODO: implement otheer event types
SDL_USEREVENT = $8000;
SDL_LASTEVENT = $FFFF;
@@ -346,7 +359,8 @@
alpha: Byte;
{$ENDIF}
end;
-
+
+ SDL_eventaction = (SDL_ADDEVENT = 0, SDL_PEEPEVENT, SDL_GETEVENT);
PSDL_Surface = ^TSDL_Surface;
TSDL_Surface = record
@@ -474,7 +488,7 @@
type_: LongInt;
windowID: LongInt;
padding1, padding2: byte;
- x, y, z, xrel, yrel : LongInt;
+ x, y, z,xrel, yrel : LongInt;
pressure, pressure_max, pressure_min,
rotation, tilt, cursor: LongInt;
{$ELSE}
@@ -553,6 +567,19 @@
{$ENDIF}
end;
+ SDL_TouchID = Int32;
+ SDL_FingerID = Int32;
+
+ TSDL_TouchFingerEvent = record
+ type_: UInt32;
+ windowId: UInt32;
+ touchId: SDL_TouchID;
+ fingerId: SDL_FingerID;
+ state, padding1, padding2, padding3: UInt8;
+ x,y: UInt16;
+ dx,dy: Int16;
+ pressure: UInt16;
+ end;
//TODO: implement SDL_TouchButtonEvent, SDL_MultiGestureEvent, SDL_DollarGestureEvent
TSDL_QuitEvent = record
@@ -589,6 +616,9 @@
SDL_JOYHATMOTION: (jhat: TSDL_JoyHatEvent);
SDL_JOYBUTTONDOWN,
SDL_JOYBUTTONUP: (jbutton: TSDL_JoyButtonEvent);
+ SDL_FINGERMOTION,
+ SDL_FINGERUP,
+ SDL_FINGERDOWN:(tfinger: TSDL_TouchFingerEvent);
SDL_QUITEV: (quit: TSDL_QuitEvent);
SDL_USEREVENT: (user: TSDL_UserEvent);
//TODO: implement other events
@@ -791,8 +821,13 @@
function SDL_GetNumMice: LongInt; cdecl; external SDLLibName;
function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName;
-procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName;
-function SDL_SetHint(name, value: PChar): boolean; cdecl; external SDLLibName;
+
+procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName ;
+
+function SDL_SetHint(name, value: PChar): boolean; cdecl; external SDLLibName;
+
+function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongInt): LongInt; cdecl; external SDLLibName;
+
{$ENDIF}
function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
@@ -808,6 +843,8 @@
procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName;
function SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
+function SDL_CreateThread(fn: pointer; data: pointer): PSDL_Thread; cdecl; external SDLLibName;
+procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
function SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP';
@@ -859,7 +896,6 @@
function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName;
function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName;
function TTF_RenderUTF8_Shaded(font: PTTF_Font; const text: PChar; fg, bg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName;
-
function TTF_OpenFont(const filename: PChar; size: LongInt): PTTF_Font; cdecl; external SDL_TTFLibName;
procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName;
@@ -990,6 +1026,4 @@
(PByteArray(buf)^[1] shl 16) or
(PByteArray(buf)^[0] shl 24)
end;
-
end.
-
--- a/hedgewars/hwLibrary.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/hwLibrary.pas Fri Aug 19 17:22:12 2011 +0200
@@ -18,14 +18,45 @@
Library hwLibrary;
+{$IFDEF fpc}
+{$MODE delphi}
+{$ENDIF}
+
+{$IFDEF ANDROID}
+ {$MACRO ON}
+ {$DEFINE Java_Prefix := 'Java_org_hedgewars_mobile_EngineProtocol_PascalExports_'}
+{$ENDIF}
+
// Add all your Pascal units to the "uses" clause below to add them to the program.
// Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using
// "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for
// these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group)
// to make these functions available in the C/C++/Objective-C source files
// (add "#include PascalImports.h" near the top of these files if it's not there yet)
-uses PascalExports, hwengine;
-exports Game, HW_versionInfo;
+uses PascalExports, hwengine{$IFDEF ANDROID},jni{$ENDIF};
+exports Game{$IFNDEF ANDROID}, HW_versionInfo{$ENDIF};
+
+function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl;
+begin
+ JNI_HW_versionInfoNet := cNetProtoVersion;
+end;
+
+function JNI_HW_versionInfoVersion(env: PJNIEnv; obj: JObject):JString; cdecl;
+begin
+ JNI_HW_versionInfoVersion := env^.NewStringUTF(env, PChar(cVersionString));
+end;
+
+
+{$IFDEF ANDROID}
+ exports
+ JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto',
+ JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion',
+ GenLandPreview name Java_Prefix + 'GenLandPreview',
+ HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons',
+ HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs',
+ HW_getMaxNumberOfTeams name Java_Prefix + 'HWgetMaxNumberOfTeams';
+{$ENDIF}
+
begin
end.
--- a/hedgewars/hwengine.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/hwengine.pas Fri Aug 19 17:22:12 2011 +0200
@@ -31,12 +31,13 @@
uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uKeys, uSound,
uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions,
- sysutils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted;
+ sysutils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted,uTouch {$IFDEF ANDROID}, GLUnit {$ENDIF};
{$IFDEF HWLIBRARY}
procedure initEverything(complete:boolean);
procedure freeEverything(complete:boolean);
procedure Game(gameArgs: PPChar); cdecl; export;
+procedure GenLandPreview(port: Longint); cdecl; export;
implementation
{$ELSE}
@@ -150,8 +151,12 @@
PrevTime:= SDL_GetTicks;
while isTerminated = false do
begin
-
- while SDL_PollEvent(@event) <> 0 do
+{$IFDEF ANDROID}
+ SDL_PumpEvents();
+ while SDL_PeepEvents(@event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) > 0 do
+{$ELSE}
+ while SDL_PollEvent(@event) <> 0 do
+{$ENDIF}
begin
case event.type_ of
SDL_KEYDOWN: if GameState = gsChat then
@@ -164,6 +169,9 @@
cHasFocus:= true;
onFocusStateChanged()
end;
+ SDL_FINGERMOTION: onTouchMotion(event.tfinger.x, event.tfinger.y,event.tfinger.dx, event.tfinger.dy, event.tfinger.fingerId);
+ SDL_FINGERDOWN: onTouchDown(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId);
+ SDL_FINGERUP: onTouchUp(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId);
{$ELSE}
KeyPressChat(event.key.keysym.unicode);
SDL_MOUSEBUTTONDOWN: if event.button.button = SDL_BUTTON_WHEELDOWN then wheelDown:= true;
@@ -211,9 +219,14 @@
begin
{$IFDEF HWLIBRARY}
cBits:= 32;
+ cTimerInterval:= 8;
+{$IFDEF ANDROID}
+ PathPrefix:= gameArgs[11];
+ cFullScreen:= true;
+{$ELSE}
+ PathPrefix:= 'Data';
cFullScreen:= false;
- cTimerInterval:= 8;
- PathPrefix:= 'Data';
+{$ENDIF}
UserPathPrefix:= '.';
cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF};
val(gameArgs[0], ipcPort);
@@ -231,7 +244,6 @@
{$ENDIF}
initEverything(true);
-
WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')');
AddFileLog('Prefix: "' + PathPrefix +'"');
AddFileLog('UserPrefix: "' + UserPathPrefix +'"');
@@ -339,7 +351,11 @@
if complete then
begin
- uAI.initModule;
+{$IFDEF ANDROID}
+ GLUnit.init;
+{$ENDIF}
+ uTouch.initModule;
+ uAI.initModule;
//uAIActions does not need initialization
//uAIAmmoTests does not need initialization
uAIMisc.initModule;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/jni.pas Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,536 @@
+unit jni;
+{$ifdef fpc}
+ {$mode delphi}
+ {$packrecords c}
+{$endif}
+
+interface
+
+(*
+ * Manifest constants.
+ *)
+const JNI_FALSE=0;
+ JNI_TRUE=1;
+
+ JNI_VERSION_1_1=$00010001;
+ JNI_VERSION_1_2=$00010002;
+ JNI_VERSION_1_4=$00010004;
+ JNI_VERSION_1_6=$00010006;
+
+ JNI_OK=0; // no error
+ JNI_ERR=-1; // generic error
+ JNI_EDETACHED=-2; // thread detached from the VM
+ JNI_EVERSION=-3; // JNI version error
+
+ JNI_COMMIT=1; // copy content, do not free buffer
+ JNI_ABORT=2; // free buffer w/o copying back
+
+(*
+ * Type definitions.
+ *)
+type va_list=pointer;
+
+ jboolean=byte; // unsigned 8 bits
+ jbyte=shortint; // signed 8 bits
+ jchar=word; // unsigned 16 bits
+ jshort=smallint; // signed 16 bits
+ jint=longint; // signed 32 bits
+ jlong=int64; // signed 64 bits
+ jfloat=single; // 32-bit IEEE 754
+ jdouble=double; // 64-bit IEEE 754
+
+ jsize=jint; // "cardinal indices and sizes"
+
+ Pjboolean=^jboolean;
+ Pjbyte=^jbyte;
+ Pjchar=^jchar;
+ Pjshort=^jshort;
+ Pjint=^jint;
+ Pjlong=^jlong;
+ Pjfloat=^jfloat;
+ Pjdouble=^jdouble;
+
+ Pjsize=^jsize;
+
+ // Reference type
+ jobject=pointer;
+ jclass=jobject;
+ jstring=jobject;
+ jarray=jobject;
+ jobjectArray=jarray;
+ jbooleanArray=jarray;
+ jbyteArray=jarray;
+ jcharArray=jarray;
+ jshortArray=jarray;
+ jintArray=jarray;
+ jlongArray=jarray;
+ jfloatArray=jarray;
+ jdoubleArray=jarray;
+ jthrowable=jobject;
+ jweak=jobject;
+ jref=jobject;
+
+ PPointer=^pointer;
+ Pjobject=^jobject;
+ Pjclass=^jclass;
+ Pjstring=^jstring;
+ Pjarray=^jarray;
+ PjobjectArray=^jobjectArray;
+ PjbooleanArray=^jbooleanArray;
+ PjbyteArray=^jbyteArray;
+ PjcharArray=^jcharArray;
+ PjshortArray=^jshortArray;
+ PjintArray=^jintArray;
+ PjlongArray=^jlongArray;
+ PjfloatArray=^jfloatArray;
+ PjdoubleArray=^jdoubleArray;
+ Pjthrowable=^jthrowable;
+ Pjweak=^jweak;
+ Pjref=^jref;
+
+ _jfieldID=record // opaque structure
+ end;
+ jfieldID=^_jfieldID;// field IDs
+ PjfieldID=^jfieldID;
+
+ _jmethodID=record // opaque structure
+ end;
+ jmethodID=^_jmethodID;// method IDs
+ PjmethodID=^jmethodID;
+
+ PJNIInvokeInterface=^JNIInvokeInterface;
+
+ Pjvalue=^jvalue;
+ jvalue={$ifdef packedrecords}packed{$endif} record
+ case integer of
+ 0:(z:jboolean);
+ 1:(b:jbyte);
+ 2:(c:jchar);
+ 3:(s:jshort);
+ 4:(i:jint);
+ 5:(j:jlong);
+ 6:(f:jfloat);
+ 7:(d:jdouble);
+ 8:(l:jobject);
+ end;
+
+ jobjectRefType=(
+ JNIInvalidRefType=0,
+ JNILocalRefType=1,
+ JNIGlobalRefType=2,
+ JNIWeakGlobalRefType=3);
+
+ PJNINativeMethod=^JNINativeMethod;
+ JNINativeMethod={$ifdef packedrecords}packed{$endif} record
+ name:pchar;
+ signature:pchar;
+ fnPtr:pointer;
+ end;
+
+ PJNINativeInterface=^JNINativeInterface;
+
+ _JNIEnv={$ifdef packedrecords}packed{$endif} record
+ functions:PJNINativeInterface;
+ end;
+
+ _JavaVM={$ifdef packedrecords}packed{$endif} record
+ functions:PJNIInvokeInterface;
+ end;
+
+ C_JNIEnv=^JNINativeInterface;
+ JNIEnv=^JNINativeInterface;
+ JavaVM=^JNIInvokeInterface;
+
+ PPJNIEnv=^PJNIEnv;
+ PJNIEnv=^JNIEnv;
+
+ PPJavaVM=^PJavaVM;
+ PJavaVM=^JavaVM;
+
+ JNINativeInterface={$ifdef packedrecords}packed{$endif} record
+ reserved0:pointer;
+ reserved1:pointer;
+ reserved2:pointer;
+ reserved3:pointer;
+
+ GetVersion:function(Env:PJNIEnv):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ DefineClass:function(Env:PJNIEnv;const Name:pchar;Loader:JObject;const Buf:PJByte;Len:JSize):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ FindClass:function(Env:PJNIEnv;const Name:pchar):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // Reflection Support
+ FromReflectedMethod:function(Env:PJNIEnv;Method:JObject):JMethodID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ FromReflectedField:function(Env:PJNIEnv;Field:JObject):JFieldID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ToReflectedMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;IsStatic:JBoolean):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetSuperclass:function(Env:PJNIEnv;Sub:JClass):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ IsAssignableFrom:function(Env:PJNIEnv;Sub:JClass;Sup:JClass):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // Reflection Support
+ ToReflectedField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;IsStatic:JBoolean):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ Throw:function(Env:PJNIEnv;Obj:JThrowable):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ThrowNew:function(Env:PJNIEnv;AClass:JClass;const Msg:pchar):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ExceptionOccurred:function(Env:PJNIEnv):JThrowable;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ExceptionDescribe:procedure(Env:PJNIEnv);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ExceptionClear:procedure(Env:PJNIEnv);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ FatalError:procedure(Env:PJNIEnv;const Msg:pchar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // Local Reference Management
+ PushLocalFrame:function(Env:PJNIEnv;Capacity:JInt):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ PopLocalFrame:function(Env:PJNIEnv;Result:JObject):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ NewGlobalRef:function(Env:PJNIEnv;LObj:JObject):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ DeleteGlobalRef:procedure(Env:PJNIEnv;GRef:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ DeleteLocalRef:procedure(Env:PJNIEnv;Obj:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ IsSameObject:function(Env:PJNIEnv;Obj1:JObject;Obj2:JObject):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // Local Reference Management
+ NewLocalRef:function(Env:PJNIEnv;Ref:JObject):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ EnsureLocalCapacity:function(Env:PJNIEnv;Capacity:JInt):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ AllocObject:function(Env:PJNIEnv;AClass:JClass):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewObject:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewObjectV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewObjectA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetObjectClass:function(Env:PJNIEnv;Obj:JObject):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ IsInstanceOf:function(Env:PJNIEnv;Obj:JObject;AClass:JClass):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetMethodID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JMethodID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallObjectMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallObjectMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallObjectMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallBooleanMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallBooleanMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallBooleanMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallByteMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallByteMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallByteMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallCharMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallCharMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallCharMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallShortMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallShortMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallShortMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallIntMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallIntMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallIntMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallLongMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallLongMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallLongMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallFloatMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallFloatMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallFloatMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallDoubleMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallDoubleMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallDoubleMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallVoidMethod:procedure(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallVoidMethodV:procedure(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallVoidMethodA:procedure(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualObjectMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualObjectMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualObjectMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualBooleanMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualBooleanMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualBooleanMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualByteMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualByteMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualByteMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualCharMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualCharMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualCharMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualShortMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualShortMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualShortMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualIntMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualIntMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualIntMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualLongMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualLongMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualLongMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualFloatMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualFloatMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualFloatMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualDoubleMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualDoubleMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualDoubleMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallNonvirtualVoidMethod:procedure(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualVoidMethodV:procedure(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallNonvirtualVoidMethodA:procedure(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetFieldID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JFieldID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetObjectField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetBooleanField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetByteField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetCharField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetShortField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetIntField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetLongField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetFloatField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetDoubleField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ SetObjectField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetBooleanField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetByteField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetCharField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetShortField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetIntField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetLongField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetFloatField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetDoubleField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetStaticMethodID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JMethodID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticObjectMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticObjectMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticObjectMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticBooleanMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticBooleanMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticBooleanMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticByteMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticByteMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticByteMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticCharMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticCharMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticCharMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticShortMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticShortMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticShortMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticIntMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticIntMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticIntMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticLongMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticLongMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticLongMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticFloatMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticFloatMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticFloatMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticDoubleMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticDoubleMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticDoubleMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ CallStaticVoidMethod:procedure(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticVoidMethodV:procedure(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ CallStaticVoidMethodA:procedure(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetStaticFieldID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JFieldID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticObjectField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticBooleanField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticByteField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticCharField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticShortField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticIntField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticLongField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticFloatField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStaticDoubleField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ SetStaticObjectField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticBooleanField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticByteField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticCharField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticShortField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticIntField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticLongField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticFloatField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetStaticDoubleField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ NewString:function(Env:PJNIEnv;const Unicode:PJChar;Len:JSize):JString;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStringLength:function(Env:PJNIEnv;Str:JString):JSize;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStringChars:function(Env:PJNIEnv;Str:JString;IsCopy:PJBoolean):PJChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseStringChars:procedure(Env:PJNIEnv;Str:JString;const Chars:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ NewStringUTF:function(Env:PJNIEnv;const UTF:pchar):JString;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStringUTFLength:function(Env:PJNIEnv;Str:JString):JSize;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStringUTFChars:function(Env:PJNIEnv;Str:JString;IsCopy:PJBoolean):pchar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseStringUTFChars:procedure(Env:PJNIEnv;Str:JString;const Chars:pchar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetArrayLength:function(Env:PJNIEnv;AArray:JArray):JSize;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ NewObjectArray:function(Env:PJNIEnv;Len:JSize;AClass:JClass;Init:JObject):JObjectArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetObjectArrayElement:function(Env:PJNIEnv;AArray:JObjectArray;Index:JSize):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetObjectArrayElement:procedure(Env:PJNIEnv;AArray:JObjectArray;Index:JSize;Val:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ NewBooleanArray:function(Env:PJNIEnv;Len:JSize):JBooleanArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewByteArray:function(Env:PJNIEnv;Len:JSize):JByteArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewCharArray:function(Env:PJNIEnv;Len:JSize):JCharArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewShortArray:function(Env:PJNIEnv;Len:JSize):JShortArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewIntArray:function(Env:PJNIEnv;Len:JSize):JIntArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewLongArray:function(Env:PJNIEnv;Len:JSize):JLongArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewFloatArray:function(Env:PJNIEnv;Len:JSize):JFloatArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ NewDoubleArray:function(Env:PJNIEnv;Len:JSize):JDoubleArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetBooleanArrayElements:function(Env:PJNIEnv;AArray:JBooleanArray;IsCopy:PJBoolean):PJBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetByteArrayElements:function(Env:PJNIEnv;AArray:JByteArray;IsCopy:PJBoolean):PJByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetCharArrayElements:function(Env:PJNIEnv;AArray:JCharArray;IsCopy:PJBoolean):PJChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetShortArrayElements:function(Env:PJNIEnv;AArray:JShortArray;IsCopy:PJBoolean):PJShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetIntArrayElements:function(Env:PJNIEnv;AArray:JIntArray;IsCopy:PJBoolean):PJInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetLongArrayElements:function(Env:PJNIEnv;AArray:JLongArray;IsCopy:PJBoolean):PJLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetFloatArrayElements:function(Env:PJNIEnv;AArray:JFloatArray;IsCopy:PJBoolean):PJFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetDoubleArrayElements:function(Env:PJNIEnv;AArray:JDoubleArray;IsCopy:PJBoolean):PJDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ ReleaseBooleanArrayElements:procedure(Env:PJNIEnv;AArray:JBooleanArray;Elems:PJBoolean;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseByteArrayElements:procedure(Env:PJNIEnv;AArray:JByteArray;Elems:PJByte;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseCharArrayElements:procedure(Env:PJNIEnv;AArray:JCharArray;Elems:PJChar;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseShortArrayElements:procedure(Env:PJNIEnv;AArray:JShortArray;Elems:PJShort;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseIntArrayElements:procedure(Env:PJNIEnv;AArray:JIntArray;Elems:PJInt;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseLongArrayElements:procedure(Env:PJNIEnv;AArray:JLongArray;Elems:PJLong;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseFloatArrayElements:procedure(Env:PJNIEnv;AArray:JFloatArray;Elems:PJFloat;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseDoubleArrayElements:procedure(Env:PJNIEnv;AArray:JDoubleArray;Elems:PJDouble;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetBooleanArrayRegion:procedure(Env:PJNIEnv;AArray:JBooleanArray;Start:JSize;Len:JSize;Buf:PJBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetByteArrayRegion:procedure(Env:PJNIEnv;AArray:JByteArray;Start:JSize;Len:JSize;Buf:PJByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetCharArrayRegion:procedure(Env:PJNIEnv;AArray:JCharArray;Start:JSize;Len:JSize;Buf:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetShortArrayRegion:procedure(Env:PJNIEnv;AArray:JShortArray;Start:JSize;Len:JSize;Buf:PJShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetIntArrayRegion:procedure(Env:PJNIEnv;AArray:JIntArray;Start:JSize;Len:JSize;Buf:PJInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetLongArrayRegion:procedure(Env:PJNIEnv;AArray:JLongArray;Start:JSize;Len:JSize;Buf:PJLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetFloatArrayRegion:procedure(Env:PJNIEnv;AArray:JFloatArray;Start:JSize;Len:JSize;Buf:PJFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetDoubleArrayRegion:procedure(Env:PJNIEnv;AArray:JDoubleArray;Start:JSize;Len:JSize;Buf:PJDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ SetBooleanArrayRegion:procedure(Env:PJNIEnv;AArray:JBooleanArray;Start:JSize;Len:JSize;Buf:PJBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetByteArrayRegion:procedure(Env:PJNIEnv;AArray:JByteArray;Start:JSize;Len:JSize;Buf:PJByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetCharArrayRegion:procedure(Env:PJNIEnv;AArray:JCharArray;Start:JSize;Len:JSize;Buf:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetShortArrayRegion:procedure(Env:PJNIEnv;AArray:JShortArray;Start:JSize;Len:JSize;Buf:PJShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetIntArrayRegion:procedure(Env:PJNIEnv;AArray:JIntArray;Start:JSize;Len:JSize;Buf:PJInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetLongArrayRegion:procedure(Env:PJNIEnv;AArray:JLongArray;Start:JSize;Len:JSize;Buf:PJLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetFloatArrayRegion:procedure(Env:PJNIEnv;AArray:JFloatArray;Start:JSize;Len:JSize;Buf:PJFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ SetDoubleArrayRegion:procedure(Env:PJNIEnv;AArray:JDoubleArray;Start:JSize;Len:JSize;Buf:PJDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ RegisterNatives:function(Env:PJNIEnv;AClass:JClass;const Methods:PJNINativeMethod;NMethods:JInt):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ UnregisterNatives:function(Env:PJNIEnv;AClass:JClass):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ MonitorEnter:function(Env:PJNIEnv;Obj:JObject):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ MonitorExit:function(Env:PJNIEnv;Obj:JObject):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ GetJavaVM:function(Env:PJNIEnv;VM:PJavaVM):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // String Operations
+ GetStringRegion:procedure(Env:PJNIEnv;Str:JString;Start:JSize;Len:JSize;Buf:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetStringUTFRegion:procedure(Env:PJNIEnv;Str:JString;Start:JSize;Len:JSize;Buf:pchar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // Array Operations
+ GetPrimitiveArrayCritical:function(Env:PJNIEnv;AArray:JArray;IsCopy:PJBoolean):pointer;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleasePrimitiveArrayCritical:procedure(Env:PJNIEnv;AArray:JArray;CArray:pointer;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // String Operations
+ GetStringCritical:function(Env:PJNIEnv;Str:JString;IsCopy:PJBoolean):PJChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ ReleaseStringCritical:procedure(Env:PJNIEnv;Str:JString;CString:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // Weak Global References
+ NewWeakGlobalRef:function(Env:PJNIEnv;Obj:JObject):JWeak;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ DeleteWeakGlobalRef:procedure(Env:PJNIEnv;Ref:JWeak);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // Exceptions
+ ExceptionCheck:function(Env:PJNIEnv):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // J2SDK1_4
+ NewDirectByteBuffer:function(Env:PJNIEnv;Address:pointer;Capacity:JLong):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetDirectBufferAddress:function(Env:PJNIEnv;Buf:JObject):pointer;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetDirectBufferCapacity:function(Env:PJNIEnv;Buf:JObject):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+ // added in JNI 1.6
+ GetObjectRefType:function(Env:PJNIEnv;AObject:JObject):jobjectRefType;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ end;
+
+ JNIInvokeInterface={$ifdef packedrecords}packed{$endif} record
+ reserved0:pointer;
+ reserved1:pointer;
+ reserved2:pointer;
+
+ DestroyJavaVM:function(PVM:PJavaVM):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ AttachCurrentThread:function(PVM:PJavaVM;PEnv:PPJNIEnv;Args:pointer):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ DetachCurrentThread:function(PVM:PJavaVM):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ GetEnv:function(PVM:PJavaVM;PEnv:Ppointer;Version:JInt):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ AttachCurrentThreadAsDaemon:function(PVM:PJavaVM;PEnv:PPJNIEnv;Args:pointer):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+ end;
+
+ JavaVMAttachArgs={$ifdef packedrecords}packed{$endif} record
+ version:jint; // must be >= JNI_VERSION_1_2
+ name:pchar; // NULL or name of thread as modified UTF-8 str
+ group:jobject; // global ref of a ThreadGroup object, or NULL
+ end;
+
+(**
+ * JNI 1.2+ initialization. (As of 1.6, the pre-1.2 structures are no
+ * longer supported.)
+ *)
+
+ PJavaVMOption=^JavaVMOption;
+ JavaVMOption={$ifdef packedrecords}packed{$endif} record
+ optionString:pchar;
+ extraInfo:pointer;
+ end;
+
+ JavaVMInitArgs={$ifdef packedrecords}packed{$endif} record
+ version:jint; // use JNI_VERSION_1_2 or later
+ nOptions:jint;
+ options:PJavaVMOption;
+ ignoreUnrecognized:Pjboolean;
+ end;
+
+(*
+ * VM initialization functions.
+ *
+ * Note these are the only symbols exported for JNI by the VM.
+ *)
+{$ifdef jniexternals}
+function JNI_GetDefaultJavaVMInitArgs(p:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}external 'jni' name 'JNI_GetDefaultJavaVMInitArgs';
+function JNI_CreateJavaVM(vm:PPJavaVM;AEnv:PPJNIEnv;p:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}external 'jni' name 'JNI_CreateJavaVM';
+function JNI_GetCreatedJavaVMs(vm:PPJavaVM;ASize:jsize;p:Pjsize):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}external 'jni' name 'JNI_GetCreatedJavaVMs';
+{$endif}
+
+(*
+ * Prototypes for functions exported by loadable shared libs. These are
+ * called by JNI, not provided by JNI.
+ *)
+
+const curVM:PJavaVM=nil;
+ curEnv:PJNIEnv=nil;
+
+(*
+function JNI_OnLoad(vm:PJavaVM;reserved:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+procedure JNI_OnUnload(vm:PJavaVM;reserved:pointer);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+*)
+implementation
+
+function JNI_OnLoad(vm:PJavaVM;reserved:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+begin
+ curVM:=vm;
+ result:=JNI_VERSION_1_6;
+end;
+
+procedure JNI_OnUnload(vm:PJavaVM;reserved:pointer);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+begin
+end;
+
+end.
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/log.pas Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,28 @@
+unit log;
+{$ifdef fpc}
+ {$mode delphi}
+{$endif}
+
+interface
+
+const libname='liblog.so';
+
+ ANDROID_LOG_UNKNOWN=0;
+ ANDROID_LOG_DEFAULT=1;
+ ANDROID_LOG_VERBOSE=2;
+ ANDROID_LOG_DEBUG=3;
+ ANDROID_LOG_INFO=4;
+ ANDROID_LOG_WARN=5;
+ ANDROID_LOG_ERROR=6;
+ ANDROID_LOG_FATAL=7;
+ ANDROID_LOG_SILENT=8;
+
+type android_LogPriority=integer;
+
+function __android_log_write(prio:longint;tag,text:pchar):longint; cdecl; external libname name '__android_log_write';
+
+//function __android_log_print(prio:longint;tag,print:pchar;params:array of pchar):longint; cdecl; external libname name '__android_log_print';
+
+implementation
+
+end.
--- a/hedgewars/options.inc Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/options.inc Fri Aug 19 17:22:12 2011 +0200
@@ -27,16 +27,25 @@
{$DEFINE GLunit:=GL}
+{$IFDEF ANDROID}
+ {$DEFINE SDL13}
+ {$DEFINE HWLIBRARY}
+ {$DEFINE S3D_DISABLED}
+ {$DEFINE GLunit:=gles11}
+ {$DEFINE DEBUGFILE}
+ {$DEFINE MOBILE}
+{$ENDIF}
+
{$IFDEF IPHONEOS}
{$DEFINE SDL13}
{$DEFINE HWLIBRARY}
{$DEFINE S3D_DISABLED}
{$DEFINE GLunit:=gles11}
-{$ELSE}
- {$DEFINE DEBUGFILE}
- //{$DEFINE TRACEAIACTIONS}
- //{$DEFINE COUNTTICKS}
+ {$DEFINE MOBILE}
{$ENDIF}
+{$DEFINE DEBUGFILE}
+//{$DEFINE TRACEAIACTIONS}
+//{$DEFINE COUNTTICKS}
//also available LUA_DISABLED
--- a/hedgewars/uAI.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uAI.pas Fri Aug 19 17:22:12 2011 +0200
@@ -30,13 +30,13 @@
implementation
uses uConsts, SDLh, uAIMisc, uAIAmmoTests, uAIActions,
- uAmmos, SysUtils{$IFDEF UNIX}, cthreads{$ENDIF}, uTypes,
- uVariables, uCommands, uUtils, uDebug;
+ uAmmos, SysUtils{$IFDEF UNIX}{$IFNDEF ANDROID}, cthreads{$ENDIF}{$ENDIF}, uTypes,
+ uVariables, uCommands, uUtils, uDebug, uConsole;
var BestActions: TActions;
CanUseAmmo: array [TAmmoType] of boolean;
StopThinking: boolean;
- ThinkThread: TThreadID;
+ ThinkThread: PSDL_Thread = nil;
hasThread: LongInt;
procedure FreeActionsList;
@@ -74,8 +74,8 @@
with CurrentHedgehog^ do
a:= CurAmmoType;
aa:= a;
-
- ThreadSwitch();
+SDL_delay(0);
+// ThreadSwitch();
repeat
if (CanUseAmmo[a]) and
@@ -265,9 +265,11 @@
if (PGear(Me)^.State and gstAttacked) = 0 then
if Targets.Count > 0 then
begin
+
WalkMe:= BackMe;
Walk(@WalkMe);
if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(1000);
+
if BestActions.Score < -1023 then
begin
BestActions.Count:= 0;
@@ -285,7 +287,9 @@
end;
PGear(Me)^.State:= PGear(Me)^.State and not gstHHThinking;
Think:= 0;
-InterlockedDecrement(hasThread)
+
+InterlockedDecrement(hasThread);
+
end;
procedure StartThink(Me: PGear);
@@ -316,7 +320,9 @@
for a:= Low(TAmmoType) to High(TAmmoType) do
CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(Me^.Hedgehog^, a);
AddFileLog('Enter Think Thread');
-BeginThread(@Think, Me, ThinkThread)
+//BeginThread(@Think, Me, ThinkThread)
+ThinkThread := SDL_CreateThread(@Think, Me);
+AddFileLog('Thread started');
end;
procedure ProcessBot;
--- a/hedgewars/uConsole.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uConsole.pas Fri Aug 19 17:22:12 2011 +0200
@@ -26,9 +26,10 @@
procedure WriteToConsole(s: shortstring);
procedure WriteLnToConsole(s: shortstring);
function GetLastConsoleLine: shortstring;
+function ShortStringAsPChar(s: shortstring): PChar;
implementation
-uses Types, uVariables, uUtils;
+uses Types, uVariables, uUtils {$IFDEF ANDROID}, log in 'log.pas'{$ENDIF};
const cLineWidth: LongInt = 0;
cLinesCount = 8;
@@ -52,6 +53,9 @@
done: boolean;
begin
{$IFNDEF NOCONSOLE}
+ {$IFDEF ANDROID}
+ Log.__android_log_write(Log.Android_LOG_DEBUG, 'HW_Engine', ShortStringAsPChar('[Con]' + s));
+{$ELSE}
AddFileLog('[Con] ' + s);
Write(stderr, s);
done:= false;
@@ -70,18 +74,21 @@
done:= (Length(s) = 0);
end;
{$ENDIF}
+{$ENDIF}
end;
procedure WriteLnToConsole(s: shortstring);
begin
{$IFNDEF NOCONSOLE}
WriteToConsole(s);
+{$IFNDEF ANDROID}
WriteLn(stderr);
inc(CurrLine);
if CurrLine = cLinesCount then
CurrLine:= 0;
PByte(@ConsoleLines[CurrLine].s)^:= 0
{$ENDIF}
+{$ENDIF}
end;
@@ -118,4 +125,12 @@
end;
+Function ShortStringAsPChar(S: ShortString) : PChar;
+Var NewString : String;
+Begin
+if Length(S) = High(S) then Dec(S[0]);
+s[Ord(Length(s))+1] := #0;
+Result := @S[1];
+End;
+
end.
--- a/hedgewars/uConsts.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uConsts.pas Fri Aug 19 17:22:12 2011 +0200
@@ -156,7 +156,7 @@
// do not change this value
cDefaultZoomLevel = 2.0;
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
cMaxZoomLevel = 0.5;
cMinZoomLevel = 3.5;
cZoomDelta = 0.20;
@@ -166,6 +166,8 @@
cZoomDelta = 0.25;
{$ENDIF}
+ cMinMaxZoomLevelDelta = cMaxZoomLevel - cMinZoomLevel;
+
cSendEmptyPacketTime = 1000;
trigTurns = $80000001;
--- a/hedgewars/uFloat.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uFloat.pas Fri Aug 19 17:22:12 2011 +0200
@@ -62,6 +62,7 @@
// The implemented operators
+operator = (const z1, z2: hwFloat) z:boolean; inline;
operator + (const z1, z2: hwFloat) z : hwFloat; inline;
operator - (const z1, z2: hwFloat) z : hwFloat; inline;
operator - (const z1: hwFloat) z : hwFloat; inline;
@@ -88,7 +89,7 @@
function AngleCos(const Angle: Longword): hwFloat;
function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum.
function hwSign(r: hwFloat): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
-
+function isZero(const z: hwFloat): boolean; inline;
{$IFDEF FPC}
{$J-}
{$ENDIF}
@@ -158,10 +159,13 @@
_40: hwFloat = (isNegative: false; QWordValue: 4294967296 * 40);
_50: hwFloat = (isNegative: false; QWordValue: 4294967296 * 50);
_70: hwFloat = (isNegative: false; QWordValue: 4294967296 * 70);
+ _90: hwFloat = (isNegative: false; QWordValue: 4294967296 * 90);
_128: hwFloat = (isNegative: false; QWordValue: 4294967296 * 128);
+ _180: hwFloat = (isNegative: false; QWordValue: 4294967296 * 180);
_250: hwFloat = (isNegative: false; QWordValue: 4294967296 * 250);
_256: hwFloat = (isNegative: false; QWordValue: 4294967296 * 256);
_300: hwFloat = (isNegative: false; QWordValue: 4294967296 * 300);
+ _360: hwFloat = (isNegative: false; QWordValue: 4294967296 * 360);
_450: hwFloat = (isNegative: false; QWordValue: 4294967296 * 450);
_1000: hwFloat = (isNegative: false; QWordValue: 4294967296 * 1000);
_1024: hwFloat = (isNegative: false; QWordValue: 4294967296 * 1024);
@@ -197,6 +201,14 @@
if i.isNegative then hwFloat2Float:= -hwFloat2Float;
end;
+operator = (const z1, z2: hwFloat) z:boolean; inline;
+begin
+ z:= true;
+ z:= z and (z1.isNegative = z2.isNegative);
+ z:= z and (z1.QWordValue = z2.QWordValue);
+end;
+
+
operator + (const z1, z2: hwFloat) z : hwFloat;
begin
if z1.isNegative = z2.isNegative then
@@ -403,6 +415,10 @@
else AngleCos.QWordValue:= SinTable[Angle - 1024]
end;
+function isZero(const z: hwFloat): boolean; inline;
+begin
+ isZero := z.QWordValue = 0;
+end;
{$ENDIF}
end.
--- a/hedgewars/uGame.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uGame.pas Fri Aug 19 17:22:12 2011 +0200
@@ -26,7 +26,7 @@
////////////////////
implementation
////////////////////
-uses uKeys, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables;
+uses uKeys, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables, uTouch;
procedure DoGameTick(Lag: LongInt);
var i: LongInt;
@@ -52,7 +52,8 @@
if not CurrentTeam^.ExtDriven then
begin
if CurrentHedgehog^.BotLevel <> 0 then ProcessBot;
- ProcessGears
+ ProcessGears;
+ ProcessTouch;
end else
begin
NetGetNextCmd;
--- a/hedgewars/uLand.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uLand.pas Fri Aug 19 17:22:12 2011 +0200
@@ -1385,7 +1385,7 @@
if digest = '' then
digest:= s
else
- TryDo(s = digest, 'Different maps generated, sorry', true);
+// TryDo(s = digest, 'Different maps generated, sorry', true);
end;
procedure chSendLandDigest(var s: shortstring);
--- a/hedgewars/uScript.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uScript.pas Fri Aug 19 17:22:12 2011 +0200
@@ -44,6 +44,9 @@
function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
function ScriptExists(fname : shortstring) : boolean;
+
+function ParseCommandOverride(key, value : shortstring) : shortstring;
+
procedure initModule;
procedure freeModule;
@@ -1647,6 +1650,25 @@
GetGlobals;
end;
+function ParseCommandOverride(key, value : shortstring) : shortstring;
+begin
+ParseCommandOverride:= value;
+if not ScriptExists('ParseCommandOverride') then exit;
+lua_getglobal(luaState, Str2PChar('ParseCommandOverride'));
+lua_pushstring(luaState, Str2PChar(key));
+lua_pushstring(luaState, Str2PChar(value));
+if lua_pcall(luaState, 2, 1, 0) <> 0 then
+ begin
+ LuaError('Lua: Error while calling ParseCommandOverride: ' + lua_tostring(luaState, -1));
+ lua_pop(luaState, 1)
+ end
+else
+ begin
+ ParseCommandOverride:= lua_tostring(luaState, -1);
+ lua_pop(luaState, 1)
+ end;
+end;
+
function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
begin
ScriptCall:= ScriptCall(fname, par1, 0, 0, 0)
@@ -1998,6 +2020,11 @@
ScriptExists:= false
end;
+function ParseCommandOverride(key, value : shortstring) : shortstring;
+begin
+ParseCommandOverride:= value
+end;
+
procedure initModule;
begin
end;
--- a/hedgewars/uStore.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uStore.pas Fri Aug 19 17:22:12 2011 +0200
@@ -536,7 +536,7 @@
SDL_GL_SetSwapInterval(1);
{$ENDIF}
-{$IFDEF IPHONEOS}
+{$IFDEF IHPONE}
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);
SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1);
vendor:= vendor; // avoid hint
@@ -957,7 +957,7 @@
y:= SDL_WINDOWPOS_CENTERED_MASK;
flags:= SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN;
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
// make the sdl window appear on the second monitor when present
x:= x or (SDL_GetNumVideoDisplays() - 1);
y:= y or (SDL_GetNumVideoDisplays() - 1);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uTouch.pas Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,418 @@
+{$INCLUDE "options.inc"}
+
+unit uTouch;
+
+interface
+
+uses sysutils, math, uConsole, uVariables, SDLh, uTypes, uFloat, uConsts, uIO, uCommands, GLUnit, uCommandHandlers;
+
+type
+ Touch_Finger = record
+ id : SDL_FingerId;
+ x,y : LongInt;
+ historicalX, historicalY : LongInt;
+ timeSinceDown : Longword;
+ end;
+
+procedure initModule;
+
+
+procedure ProcessTouch;
+procedure onTouchDown(x,y: Longword; pointerId: SDL_FingerId);
+procedure onTouchMotion(x,y: Longword; dx,dy: LongInt; pointerId: SDL_FingerId);
+procedure onTouchUp(x,y: Longword; pointerId: SDL_FingerId);
+function convertToCursor(scale: LongInt; xy: LongInt): LongInt;
+function addFinger(x,y: Longword; id: SDL_FingerId): Touch_Finger;
+procedure deleteFinger(id: SDL_FingerId);
+procedure onTouchClick(finger: Touch_Finger);
+
+function findFinger(id: SDL_FingerId): Touch_Finger;
+procedure aim(finger: Touch_Finger);
+function isOnCurrentHog(finger: Touch_Finger): boolean;
+function isOnFireButton(finger: Touch_Finger): boolean;
+procedure convertToWorldCoord(var x,y: hwFloat; finger: Touch_Finger);
+function fingerHasMoved(finger: Touch_Finger): boolean;
+function calculateDelta(finger1, finger2: Touch_Finger): hwFloat;
+function getSecondFinger(finger: Touch_Finger): Touch_Finger;
+implementation
+
+const
+ clicktime = 200;
+var
+ leftButtonBoundary : LongInt;
+ rightButtonBoundary : LongInt;
+ topButtonBoundary : LongInt;
+
+ pointerCount : Longword;
+ fingers: array of Touch_Finger;
+ moveCursor : boolean;
+
+ //Pinch to zoom
+ pinchSize : hwFloat;
+ baseZoomValue: GLFloat;
+
+ invertCursor : boolean;
+
+ //aiming
+ aiming, movingCrosshair: boolean;
+ crosshairCommand: ShortString;
+ targetAngle: LongInt;
+
+ stopFiring: boolean;
+
+ //moving
+ stopLeft, stopRight, walkingLeft, walkingRight : boolean;
+procedure printFinger(finger: Touch_Finger);
+begin
+ WriteToConsole(Format('id:%d, (%d,%d), (%d,%d), time: %d', [finger.id, finger.x, finger.y, finger.historicalX, finger.historicalY, finger.timeSinceDown]));
+end;
+
+
+procedure onTouchDown(x,y: Longword; pointerId: SDL_FingerId);
+var
+ finger: Touch_Finger;
+begin
+ finger:= addFinger(x,y,pointerId);
+ finger.x := convertToCursor(cScreenWidth,x);
+ finger.y := convertToCursor(cScreenHeight,y);
+
+ printFinger(finger);
+ case pointerCount of
+ 1:
+ begin
+ moveCursor:= false;
+ if bShowAmmoMenu then
+ begin
+ moveCursor := true;
+ exit;
+ end;
+
+ if isOnCurrentHog(finger) then
+ begin
+ aiming:= true;
+ exit;
+ end;
+
+ if isOnFireButton(finger) then
+ begin
+ stopFiring:= false;
+ ParseCommand('+attack', true);
+ exit;
+ end;
+ if finger.x < leftButtonBoundary then
+ begin
+ ParseCommand('+left', true);
+ walkingLeft := true;
+ exit;
+ end;
+ if finger.x > rightButtonBoundary then
+ begin
+ ParseCommand('+right', true);
+ walkingRight:= true;
+ exit;
+ end;
+ if finger.y < topButtonBoundary then
+ begin
+ ParseCommand('hjump', true);
+ exit;
+ end;
+ moveCursor:= true;
+ end;
+ 2:
+ begin
+ aiming:= false;
+ stopFiring:= true;
+
+ pinchSize := calculateDelta(finger, getSecondFinger(finger));
+ baseZoomValue := ZoomValue
+ end;
+ end;//end case pointerCount of
+end;
+
+procedure onTouchMotion(x,y: Longword;dx,dy: LongInt; pointerId: SDL_FingerId);
+var
+ finger, secondFinger: Touch_Finger;
+ currentPinchDelta, zoom : hwFloat;
+begin
+ finger:= findFinger(pointerId);
+ finger.x := convertToCursor(cScreenWidth, x);
+ finger.y := convertToCursor(cScreenHeight, y);
+
+ case pointerCount of
+ 1:
+ begin
+ if aiming then
+ begin
+ aim(finger);
+ exit
+ end;
+ if moveCursor then
+ if invertCursor then
+ begin
+ CursorPoint.X := CursorPoint.X - convertToCursor(cScreenWidth,dx);
+ CursorPoint.Y := CursorPoint.Y + convertToCursor(cScreenWidth,dy);
+ end
+ else
+ begin
+ CursorPoint.X := CursorPoint.X + convertToCursor(cScreenWidth,dx);
+ CursorPoint.Y := CursorPoint.Y - convertToCursor(cScreenWidth,dy);
+ end;
+ end;
+ 2:
+ begin
+ secondFinger := getSecondFinger(finger);
+ currentPinchDelta := calculateDelta(finger, secondFinger)- pinchSize;
+ zoom := currentPinchDelta/cScreenWidth;
+ ZoomValue := baseZoomValue - ((hwFloat2Float(zoom) * cMinMaxZoomLevelDelta));
+ if ZoomValue < cMaxZoomLevel then ZoomValue := cMaxZoomLevel;
+ if ZoomValue > cMinZoomLevel then ZoomValue := cMinZoomLevel;
+ end;
+ end; //end case pointerCount of
+end;
+
+procedure onTouchUp(x,y: Longword; pointerId: SDL_FingerId);
+begin
+ aiming:= false;
+ stopFiring:= true;
+ deleteFinger(pointerId);
+
+ if walkingLeft then
+ begin
+ ParseCommand('-left', true);
+ walkingLeft := false;
+ end;
+
+ if walkingRight then
+ begin
+ ParseCommand('-right', true);
+ walkingRight := false;
+ end;
+end;
+
+procedure onTouchClick(finger: Touch_Finger);
+begin
+ if bShowAmmoMenu then
+ begin
+ doPut(CursorPoint.X, CursorPoint.Y, false);
+ exit
+ end;
+
+ if isOnCurrentHog(finger) then
+ begin
+ bShowAmmoMenu := true;
+ exit;
+ end;
+
+ if finger.y < topButtonBoundary then
+ begin
+ ParseCommand('hjump', true);
+ exit;
+ end;
+end;
+
+function addFinger(x,y: Longword; id: SDL_FingerId): Touch_Finger;
+var
+ xCursor, yCursor, index : LongInt;
+begin
+ //Check array sizes
+ if length(fingers) < pointerCount then
+ begin
+ setLength(fingers, length(fingers)*2);
+ for index := length(fingers) div 2 to length(fingers) do fingers[index].id := -1;
+ end;
+
+
+ xCursor := convertToCursor(cScreenWidth, x);
+ yCursor := convertToCursor(cScreenHeight, y);
+
+ //on removing fingers all fingers are moved to the left, thus new fingers will be to the far right
+ //with dynamic arrays being zero based, 'far right' is the old pointerCount
+ fingers[pointerCount].id := id;
+ fingers[pointerCount].historicalX := xCursor;
+ fingers[pointerCount].historicalY := yCursor;
+ fingers[pointerCount].x := xCursor;
+ fingers[pointerCount].y := yCursor;
+ fingers[pointerCount].timeSinceDown:= SDL_GetTicks;
+
+ inc(pointerCount);
+ addFinger:= fingers[pointerCount];
+end;
+
+procedure deleteFinger(id: SDL_FingerId);
+var
+ index : Longint;
+begin
+
+ dec(pointerCount);
+ for index := 0 to pointerCount do
+ begin
+ if fingers[index].id = id then
+ begin
+ //Check for onTouchevent
+ if ((SDL_GetTicks - fingers[index].timeSinceDown) < clickTime) AND not(fingerHasMoved(fingers[index])) then
+ onTouchClick(fingers[index]);
+ fingers[index].id := -1;
+ break;
+ end;
+ end;
+ //put the last finger into the spot of the finger to be removed, so that all fingers are packed to the far left
+ if fingers[pointerCount].id = -1 then
+ begin
+ fingers[index] := fingers[pointerCount];
+ fingers[pointerCount].id := -1;
+ end;
+
+end;
+
+procedure ProcessTouch;
+var
+ deltaAngle: LongInt;
+begin
+ invertCursor := not(bShowAmmoMenu);
+ if aiming then
+ begin
+ if CurrentHedgehog^.Gear <> nil then
+ begin
+ deltaAngle:= CurrentHedgehog^.Gear^.Angle - targetAngle;
+ if (deltaAngle <> 0) and not(movingCrosshair) then
+ begin
+ ParseCommand('+' + crosshairCommand, true);
+ movingCrosshair := true;
+ end
+ else
+ if movingCrosshair then
+ begin
+ ParseCommand('-' + crosshairCommand, true);
+ movingCrosshair:= false;
+ end;
+ end;
+ end
+ else if movingCrosshair then
+ begin
+ ParseCommand('-' + crosshairCommand, true);
+ movingCrosshair := false;
+ end;
+
+ if stopFiring then
+ begin
+ ParseCommand('-attack', true);
+ stopFiring:= false;
+ end;
+
+ if stopRight then
+ begin
+ stopRight := false;
+ ParseCommand('-right', true);
+ end;
+
+ if stopLeft then
+ begin
+ stopLeft := false;
+ ParseCommand('-left', true);
+ end;
+
+end;
+
+function findFinger(id: SDL_FingerId): Touch_Finger;
+begin
+ for findFinger in fingers do
+ if (findFinger.id = -1) and (findFinger.id = id) then break;
+end;
+
+procedure aim(finger: Touch_Finger);
+var
+ hogX, hogY, touchX, touchY, deltaX, deltaY, tmpAngle: hwFloat;
+ tmp: ShortString;
+begin
+ if CurrentHedgehog^.Gear <> nil then
+ begin
+ hogX := CurrentHedgehog^.Gear^.X;
+ hogY := CurrentHedgehog^.Gear^.Y;
+
+ convertToWorldCoord(touchX, touchY, finger);
+ deltaX := hwAbs(TouchX-HogX);
+ deltaY := (TouchY-HogY);
+
+ tmpAngle:= DeltaY / Distance(deltaX, deltaY) *_2048;
+ targetAngle:= (hwRound(tmpAngle) + 2048) div 2;
+
+ tmp := crosshairCommand;
+ if CurrentHedgehog^.Gear^.Angle - targetAngle < 0 then crosshairCommand := 'down'
+ else crosshairCommand:= 'up';
+ if movingCrosshair and (tmp <> crosshairCommand) then
+ begin
+ ParseCommand('-' + tmp, true);
+ movingCrosshair := false;
+ end;
+
+ end; //if CurrentHedgehog^.Gear <> nil
+end;
+
+function convertToCursor(scale: LongInt; xy: LongInt): LongInt;
+begin
+ convertToCursor := round(xy/32768*scale)
+end;
+
+function isOnFireButton(finger: Touch_Finger): boolean;
+begin
+ isOnFireButton:= (finger.x < 150) and (finger.y > 390);
+end;
+
+function isOnCurrentHog(finger: Touch_Finger): boolean;
+var
+ x,y, fingerX, fingerY : hwFloat;
+begin
+ x := CurrentHedgehog^.Gear^.X;
+ y := CurrentHedgehog^.Gear^.Y;
+
+ convertToWorldCoord(fingerX, fingerY, finger);
+ isOnCurrentHog := Distance(fingerX-x, fingerY-y) < _20;
+end;
+
+procedure convertToWorldCoord(var x,y: hwFloat; finger: Touch_Finger);
+begin
+//if x <> nil then
+ x := int2hwFloat((finger.x-WorldDx) - (cScreenWidth div 2));
+//if y <> nil then
+ y := int2hwFloat(finger.y-WorldDy);
+end;
+
+//Method to calculate the distance this finger has moved since the downEvent
+function fingerHasMoved(finger: Touch_Finger): boolean;
+begin
+ fingerHasMoved := trunc(sqrt(Power(finger.X-finger.historicalX,2) + Power(finger.y-finger.historicalY, 2))) > 330;
+end;
+
+function calculateDelta(finger1, finger2: Touch_Finger): hwFloat;
+begin
+// calculateDelta := Distance(xyCoord[id2*2] - xyCoord[id1*2], xyCoord[id2*2+1] - xyCoord[id1*2+1]);
+ calculateDelta := int2hwFloat(trunc(sqrt(Power(finger2.x-finger1.x, 2) + Power(finger2.y-finger1.y, 2))));
+end;
+
+// Under the premise that all pointer ids in pointerIds:SDL_FingerId are pack to the far left.
+// If the pointer to be ignored is not pointerIds[0] the second must be there
+function getSecondFinger(finger: Touch_Finger): Touch_Finger;
+begin
+ if fingers[0].id = finger.id then getSecondFinger := fingers[0]
+ else getSecondFinger := fingers[1];
+end;
+
+procedure initModule;
+var
+ finger: Touch_Finger;
+begin
+ movingCrosshair := false;
+ stopFiring:= false;
+ walkingLeft := false;
+ walkingRight := false;
+
+ leftButtonBoundary := cScreenWidth div 4;
+ rightButtonBoundary := cScreenWidth div 4*3;
+ topButtonBoundary := cScreenHeight div 6;
+
+ setLength(fingers, 5);
+ for finger in fingers do finger.id := -1;
+end;
+
+begin
+end.
--- a/hedgewars/uUtils.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uUtils.pas Fri Aug 19 17:22:12 2011 +0200
@@ -21,7 +21,7 @@
unit uUtils;
interface
-uses uTypes, uFloat, GLunit;
+uses uTypes, uFloat, GLunit, uConsole;
procedure SplitBySpace(var a, b: shortstring);
procedure SplitByChar(var a, b: ansistring; c: char);
@@ -262,9 +262,13 @@
begin
s:= s;
{$IFDEF DEBUGFILE}
+{$IFDEF ANDROID}
+ WriteToConsole(s);
+{$ELSE}
writeln(f, GameTicks: 6, ': ', s);
flush(f)
{$ENDIF}
+{$ENDIF}
end;
--- a/hedgewars/uWorld.pas Fri Aug 19 17:25:30 2011 +0400
+++ b/hedgewars/uWorld.pas Fri Aug 19 17:22:12 2011 +0200
@@ -182,7 +182,7 @@
WorldDx:= - (LAND_WIDTH div 2) + cScreenWidth div 2;
WorldDy:= - (LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2);
AMSlotSize:= 33;
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
AMxOffset:= 10;
AMyOffset:= 10 + 123; // moved downwards
AMWidth:= (cMaxSlotAmmoIndex + 1) * AMSlotSize + AMxOffset;
@@ -247,7 +247,7 @@
SlotsNum:= 0;
x:= (cScreenWidth shr 1) - AMWidth + AMxShift;
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
Slot:= cMaxSlotIndex;
x:= x - cOffsetY;
y:= AMyOffset;
@@ -371,7 +371,7 @@
RenderWeaponTooltip(amSel)
end;
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
@@ -395,7 +395,7 @@
else
FreeWeaponTooltip;
if (WeaponTooltipTex <> nil) and (AMxShift = 0) then
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, AMyOffset - 1);
{$ELSE}
ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, Min(y + 1, cScreenHeight - WeaponTooltipTex^.h - 40));
@@ -879,7 +879,7 @@
SetScale(cDefaultZoomLevel);
// Turn time
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
offsetX:= cScreenHeight - 13;
{$ELSE}
offsetX:= 48;
@@ -981,7 +981,7 @@
if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
// Wind bar
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
offsetX:= cScreenHeight - 13;
offsetY:= (cScreenWidth shr 1) + 74;
{$ELSE}
@@ -1033,7 +1033,7 @@
end;
// fps
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
offsetX:= 8;
{$ELSE}
offsetX:= 10;
@@ -1176,7 +1176,7 @@
var EdgesDist, wdy, shs: LongInt;
PrevSentPointTime: LongWord = 0;
begin
-{$IFNDEF IPHONEOS}
+{$IFNDEF MOBILE}
if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
uCursor.updatePosition();
{$ENDIF}
@@ -1201,7 +1201,7 @@
if AMxShift < AMWidth then
begin
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
if CursorPoint.X < cScreenWidth div 2 + AMxShift - AMWidth then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMWidth;
if CursorPoint.X > cScreenWidth div 2 + AMxShift - AMxOffset then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMxOffset;
if CursorPoint.Y < cScreenHeight - AMyOffset - SlotsNum * AMSlotSize then CursorPoint.Y:= cScreenHeight - AMyOffset - SlotsNum * AMSlotSize;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/CMakeLists.txt Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,86 @@
+###################################################################################
+# Uncomment (remove the leading '#') and change the paths accordingly to your own
+# build environment, please do specify an absolute path (/home/richard/SoftDev
+# rather than ~/SoftDev).
+# You only need to change the three lines below, after that you can run 'cmake .'
+# from the hedgewars root directory
+#
+# optionally you can specify SDL_DIR this will move the required SDL libraries to
+# the correct place
+##################################################################################
+
+set(ANDROID_NDK /home/richard/SoftDev/android/android-ndk-r5b)
+set(ANDROID_SDK /home/richard/SoftDev/android/android-sdk-linux_86)
+set(FPC_DIR /home/richard/SoftDev/fpc-2.4.4)
+set(SDL_DIR /home/richard/Downloads/android-project)
+set(LUA_DIR /home/richard/Downloads/lua.5.1.4)
+
+if(ANDROID_NDK AND ANDROID_SDK AND FPC_DIR)
+
+ set(ANDROID_SDK_API_LVL 8)
+ set(ANDROID_NDK_API_LVL 5)
+
+ MESSAGE("Creating android scripts and configuration files")
+
+ configure_file(Templates/complete_build.sh .)
+ configure_file(Templates/default.properties SDL-android-project/)
+ configure_file(Templates/local.properties SDL-android-project/)
+ configure_file(Templates/Makefile.android .)
+ configure_file(Templates/pushToDevice.sh .)
+
+ if(SDL_DIR)
+
+ MESSAGE("Moving Android port of SDL to the proper directories")
+
+ set(DirsToCopy
+ SDL
+ SDL_image
+ SDL_mixer
+ SDL_ttf
+ jpeg
+ png
+ mikmod
+ tremor
+ freetype
+ )
+ foreach(DIR ${DirsToCopy})
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND}
+ -E copy_directory
+ ${SDL_DIR}/jni/${DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/${DIR}
+ )
+ endforeach(DIR)
+ exec_program(${HGCOMMAND}
+ ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp
+ )
+ exec_program(${HGCOMMAND}
+ ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp
+ )
+ else(SDL_DIR)
+ MESSAGE("Android port of SDL not moved..")
+ endif(SDL_DIR)
+
+ if(LUA_DIR)
+ EXECUTE_PROCESS(
+ ${CMAKE_COMMAND}
+ -E copy_directory
+ ${LUA_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4
+ )
+ exec_program(${HGCOMMAND}
+ ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4/Android.mk
+ )
+ exec_program(${HGCOMMAND}
+ ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4/llex.c
+ )
+ MESSAGE("Lua has been moved.")
+ else(LUA_DIR)
+ MESSAGE("Lua hasn't been moved..")
+ endif(LUA_DIR)
+
+else(ANDROID_AND AND ANDROID_SDK AND FPC_DIR)
+ MESSAGE("Android port files not created, edit top of ${CMAKE_CURRENT_SOURCE_DIR}/CMakeList.txt to created android specific files")
+endif(ANDROID_NDK AND ANDROID_SDK AND FPC_DIR)
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/AndroidManifest.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.hedgewars.mobile"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="5"></uses-sdk>
+ <uses-permission android:name="android.permission.INTERNET"></uses-permission>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
+ <application android:label="@string/app_name" android:icon="@drawable/icon">
+ <activity android:name=".MainActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:launchMode="singleTask">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".SDLActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:screenOrientation='landscape'>
+ </activity>
+
+ <activity android:name=".Downloader.DownloadActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.Dialog"
+ android:launchMode="singleTask">
+ </activity>
+
+ <activity android:name="StartGameActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:screenOrientation='landscape'>
+ </activity>
+ <activity android:name="TeamSelectionActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:screenOrientation='landscape'>
+ </activity>
+ <activity android:name="TeamCreatorActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:screenOrientation='landscape'>
+ </activity>
+
+ <service android:name=".Downloader.DownloadService"/>
+ </application>
+</manifest>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/build.properties Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/build.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="Hedgewars" default="help">
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked in in Version
+ Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The build.properties file can be created by you and is never touched
+ by the 'android' tool. This is the place to change some of the default property values
+ used by the Ant rules.
+ Here are some properties you may want to change/update:
+
+ application.package
+ the name of your application package as defined in the manifest. Used by the
+ 'uninstall' rule.
+ source.dir
+ the name of the source directory. Default is 'src'.
+ out.dir
+ the name of the output directory. Default is 'bin'.
+
+ Properties related to the SDK location or the project target should be updated
+ using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems.
+
+ -->
+ <property file="build.properties" />
+
+ <!-- The default.properties file is created and updated by the 'android' tool, as well
+ as ADT.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems. -->
+ <property file="default.properties" />
+
+ <!-- Custom Android task to deal with the project target, and import the proper rules.
+ This requires ant 1.6.0 or above. -->
+ <path id="android.antlibs">
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+ </path>
+
+ <taskdef name="setup"
+ classname="com.android.ant.SetupTask"
+ classpathref="android.antlibs" />
+
+ <!-- Execute the Android Setup task that will setup some properties specific to the target,
+ and import the build rules files.
+
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+ To customize some build steps for your project:
+ - copy the content of the main node <project> from android_rules.xml
+ - paste it in this build.xml below the <setup /> task.
+ - disable the import by changing the setup task below to <setup import="false" />
+
+ This will ensure that the properties are setup correctly but that your customized
+ build steps are used.
+ -->
+ <setup />
+
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/default.properties Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/Android.mk Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,2 @@
+include $(call all-subdir-makefiles)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,263 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2011 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+#include "SDL_stdinc.h"
+
+#include "SDL_android.h"
+
+extern "C" {
+#include "../../events/SDL_events_c.h"
+#include "../../video/android/SDL_androidkeyboard.h"
+#include "../../video/android/SDL_androidtouch.h"
+#include "../../video/android/SDL_androidvideo.h"
+
+/* Impelemented in audio/android/SDL_androidaudio.c */
+extern void Android_RunAudioThread();
+} // C
+
+/*******************************************************************************
+ This file links the Java side of Android with libsdl
+*******************************************************************************/
+#include <jni.h>
+#include <android/log.h>
+
+
+/*******************************************************************************
+ Globals
+*******************************************************************************/
+static JNIEnv* mEnv = NULL;
+static JNIEnv* mAudioEnv = NULL;
+
+// Main activity
+static jclass mActivityClass;
+
+// method signatures
+static jmethodID midCreateGLContext;
+static jmethodID midFlipBuffers;
+static jmethodID midAudioInit;
+static jmethodID midAudioWriteShortBuffer;
+static jmethodID midAudioWriteByteBuffer;
+static jmethodID midAudioQuit;
+
+// Accelerometer data storage
+static float fLastAccelerometer[3];
+
+
+/*******************************************************************************
+ Functions called by JNI
+*******************************************************************************/
+
+// Library init
+extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+ return JNI_VERSION_1_4;
+}
+
+// Called before SDL_main() to initialize JNI bindings
+extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls)
+{
+ __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
+
+ mEnv = env;
+ mActivityClass = cls;
+
+ midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass,
+ "createGLContext","(II)Z");
+ midFlipBuffers = mEnv->GetStaticMethodID(mActivityClass,
+ "flipBuffers","()V");
+ midAudioInit = mEnv->GetStaticMethodID(mActivityClass,
+ "audioInit", "(IZZI)Ljava/lang/Object;");
+ midAudioWriteShortBuffer = mEnv->GetStaticMethodID(mActivityClass,
+ "audioWriteShortBuffer", "([S)V");
+ midAudioWriteByteBuffer = mEnv->GetStaticMethodID(mActivityClass,
+ "audioWriteByteBuffer", "([B)V");
+ midAudioQuit = mEnv->GetStaticMethodID(mActivityClass,
+ "audioQuit", "()V");
+
+ if(!midCreateGLContext || !midFlipBuffers || !midAudioInit ||
+ !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) {
+ __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly");
+ }
+}
+
+// Resize
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_onNativeResize(
+ JNIEnv* env, jclass jcls,
+ jint width, jint height, jint format)
+{
+ Android_SetScreenResolution(width, height, format);
+}
+
+// Keydown
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_onNativeKeyDown(
+ JNIEnv* env, jclass jcls, jint keycode)
+{
+ Android_OnKeyDown(keycode);
+}
+
+// Keyup
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_onNativeKeyUp(
+ JNIEnv* env, jclass jcls, jint keycode)
+{
+ Android_OnKeyUp(keycode);
+}
+
+// Touch
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_onNativeTouch(
+ JNIEnv* env, jclass jcls,
+ jint action, jint pointerId, jfloat x, jfloat y, jfloat p)
+{
+ Android_OnTouch(action, pointerId, x, y, p);
+}
+
+// Accelerometer
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_onNativeAccel(
+ JNIEnv* env, jclass jcls,
+ jfloat x, jfloat y, jfloat z)
+{
+ fLastAccelerometer[0] = x;
+ fLastAccelerometer[1] = y;
+ fLastAccelerometer[2] = z;
+}
+
+// Quit
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_nativeQuit(
+ JNIEnv* env, jclass cls)
+{
+ // Inject a SDL_QUIT event
+ SDL_SendQuit();
+}
+
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_nativeRunAudioThread(
+ JNIEnv* env, jclass cls)
+{
+ /* This is the audio thread, with a different environment */
+ mAudioEnv = env;
+
+ Android_RunAudioThread();
+}
+
+
+/*******************************************************************************
+ Functions called by SDL into Java
+*******************************************************************************/
+extern "C" SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion)
+{
+ if (mEnv->CallStaticBooleanMethod(mActivityClass, midCreateGLContext, majorVersion, minorVersion)) {
+ return SDL_TRUE;
+ } else {
+ return SDL_FALSE;
+ }
+}
+
+extern "C" void Android_JNI_SwapWindow()
+{
+ mEnv->CallStaticVoidMethod(mActivityClass, midFlipBuffers);
+}
+
+extern "C" void Android_JNI_SetActivityTitle(const char *title)
+{
+ jmethodID mid;
+
+ mid = mEnv->GetStaticMethodID(mActivityClass,"setActivityTitle","(Ljava/lang/String;)V");
+ if (mid) {
+ mEnv->CallStaticVoidMethod(mActivityClass, mid, mEnv->NewStringUTF(title));
+ }
+}
+
+extern "C" void Android_JNI_GetAccelerometerValues(float values[3])
+{
+ int i;
+ for (i = 0; i < 3; ++i) {
+ values[i] = fLastAccelerometer[i];
+ }
+}
+
+//
+// Audio support
+//
+static jboolean audioBuffer16Bit = JNI_FALSE;
+static jboolean audioBufferStereo = JNI_FALSE;
+static jobject audioBuffer = NULL;
+static void* audioBufferPinned = NULL;
+
+extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
+{
+ int audioBufferFrames;
+
+ __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
+ audioBuffer16Bit = is16Bit;
+ audioBufferStereo = channelCount > 1;
+
+ audioBuffer = mEnv->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
+
+ if (audioBuffer == NULL) {
+ __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: didn't get back a good audio buffer!");
+ return 0;
+ }
+ audioBuffer = mEnv->NewGlobalRef(audioBuffer);
+
+ jboolean isCopy = JNI_FALSE;
+ if (audioBuffer16Bit) {
+ audioBufferPinned = mEnv->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
+ audioBufferFrames = mEnv->GetArrayLength((jshortArray)audioBuffer);
+ } else {
+ audioBufferPinned = mEnv->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
+ audioBufferFrames = mEnv->GetArrayLength((jbyteArray)audioBuffer);
+ }
+ if (audioBufferStereo) {
+ audioBufferFrames /= 2;
+ }
+
+ return audioBufferFrames;
+}
+
+extern "C" void * Android_JNI_GetAudioBuffer()
+{
+ return audioBufferPinned;
+}
+
+extern "C" void Android_JNI_WriteAudioBuffer()
+{
+ if (audioBuffer16Bit) {
+ mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT);
+ mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer);
+ } else {
+ mAudioEnv->ReleaseByteArrayElements((jbyteArray)audioBuffer, (jbyte *)audioBufferPinned, JNI_COMMIT);
+ mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteByteBuffer, (jbyteArray)audioBuffer);
+ }
+
+ /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */
+}
+
+extern "C" void Android_JNI_CloseAudioDevice()
+{
+ mEnv->CallStaticVoidMethod(mActivityClass, midAudioQuit);
+
+ if (audioBuffer) {
+ mEnv->DeleteGlobalRef(audioBuffer);
+ audioBuffer = NULL;
+ audioBufferPinned = NULL;
+ }
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,49 @@
+
+/* Include the SDL main definition header */
+#include "SDL_main.h"
+
+/*******************************************************************************
+ Functions called by JNI
+*******************************************************************************/
+#include <jni.h>
+
+// Called before SDL_main() to initialize JNI bindings in SDL library
+extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls);
+
+// Library init
+extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+ return JNI_VERSION_1_4;
+}
+
+// Start up the SDL app
+extern "C" void Java_org_hedgewars_mobile_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobjectArray strArray)
+{
+ /* This interface could expand with ABI negotiation, calbacks, etc. */
+ SDL_Android_Init(env, cls);
+
+ //Get the String array from java
+ int argc = env->GetArrayLength(strArray);
+ char *argv[argc];
+ jstring jstringArgv[argc];
+ for(int i = 0; i < argc; i++){
+ jstringArgv[i] = (jstring)env->GetObjectArrayElement(strArray, i); //get the element
+ argv[i] = (char*)malloc(sizeof(char) * env->GetStringLength(jstringArgv[i]));
+ strcpy(argv[i], env->GetStringUTFChars(jstringArgv[i], JNI_FALSE)); //copy it to a mutable location
+ //Don't release memory the JAVA GC will take care of it
+ //env->ReleaseStringChars(jstringArgv[i], (jchar*)argv[i]);
+ }
+
+ /* Run the application code! */
+ int status;
+ status = SDL_main(argc, argv);
+
+ //Clean up argv
+ for(int i = 0; i < argc; i++){
+ }
+
+ /* We exit here for consistency with other platforms. */
+ exit(status);
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.c Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,83 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2011 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <android/log.h>
+
+#include "SDL_events.h"
+#include "../../events/SDL_touch_c.h"
+
+#include "SDL_androidtouch.h"
+#include "stdlib.h"
+
+#define ACTION_DOWN 0
+#define ACTION_UP 1
+#define ACTION_MOVE 2
+#define ACTION_CANCEL 3
+#define ACTION_OUTSIDE 4
+#define ACTION_POINTER_DOWN 5
+#define ACTION_POINTER_UP 6
+
+
+void Android_OnTouch(int action, SDL_FingerID pointerId, float x, float y, float p)
+{
+ if (!Android_Window) {
+ return;
+ }
+
+ //The first event will provide the x, y and pressure max values,
+ if(!SDL_GetTouch(1)){
+ SDL_Touch touch;
+ touch.id = 1;
+ touch.x_min = 0;
+ touch.x_max = x;
+ touch.native_xres = touch.x_max - touch.x_min;
+ touch.y_min = 0;
+ touch.y_max = y;
+ touch.native_yres = touch.y_max - touch.y_min;
+ touch.pressure_min = 0;
+ touch.pressure_max = p;
+ touch.native_pressureres = touch.pressure_max - touch.pressure_min;
+
+ if(SDL_AddTouch(&touch, "") < 0) return;
+ }
+
+ switch(action){
+ case ACTION_DOWN:
+ case ACTION_POINTER_DOWN:
+ SDL_SetTouchFocus(pointerId, Android_Window);
+ SDL_SendFingerDown(1, pointerId, SDL_TRUE, x, y, p);
+ break;
+ case ACTION_CANCEL:
+ case ACTION_POINTER_UP:
+ case ACTION_UP:
+ SDL_SendFingerDown(1, pointerId, SDL_FALSE, x, y, p);
+ break;
+ case ACTION_MOVE:
+ SDL_SendTouchMotion(1, pointerId, 0, x, y, p);
+ break;
+ case ACTION_OUTSIDE:
+ break;
+ }
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.h Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2011 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_androidvideo.h"
+
+extern void Android_OnTouch(int action, SDL_FingerID pointerId, float x, float y, float p);
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/lua-5.1.4/Android.mk Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,10 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := lua5.1
+LOCAL_SRC_FILES := lapi.c lauxlib.c lbaselib.c lcode.c ldblib.c ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c ltable.c ltablib.c ltm.c lundump.c lvm.c lzio.c
+
+include $(BUILD_SHARED_LIBRARY)
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/lua-5.1.4/llex.c Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,462 @@
+/*
+** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
+** Lexical Analyzer
+** See Copyright Notice in lua.h
+*/
+
+
+#include <ctype.h>
+#include <locale.h>
+#include <string.h>
+
+#define llex_c
+#define LUA_CORE
+
+#include "lua.h"
+
+#include "ldo.h"
+#include "llex.h"
+#include "lobject.h"
+#include "lparser.h"
+#include "lstate.h"
+#include "lstring.h"
+#include "ltable.h"
+#include "lzio.h"
+
+
+
+#define next(ls) (ls->current = zgetc(ls->z))
+
+
+
+
+#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
+
+
+/* ORDER RESERVED */
+const char *const luaX_tokens [] = {
+ "and", "break", "do", "else", "elseif",
+ "end", "false", "for", "function", "if",
+ "in", "local", "nil", "not", "or", "repeat",
+ "return", "then", "true", "until", "while",
+ "..", "...", "==", ">=", "<=", "~=",
+ "<number>", "<name>", "<string>", "<eof>",
+ NULL
+};
+
+
+#define save_and_next(ls) (save(ls, ls->current), next(ls))
+
+
+static void save (LexState *ls, int c) {
+ Mbuffer *b = ls->buff;
+ if (b->n + 1 > b->buffsize) {
+ size_t newsize;
+ if (b->buffsize >= MAX_SIZET/2)
+ luaX_lexerror(ls, "lexical element too long", 0);
+ newsize = b->buffsize * 2;
+ luaZ_resizebuffer(ls->L, b, newsize);
+ }
+ b->buffer[b->n++] = cast(char, c);
+}
+
+
+void luaX_init (lua_State *L) {
+ int i;
+ for (i=0; i<NUM_RESERVED; i++) {
+ TString *ts = luaS_new(L, luaX_tokens[i]);
+ luaS_fix(ts); /* reserved words are never collected */
+ lua_assert(strlen(luaX_tokens[i])+1 <= TOKEN_LEN);
+ ts->tsv.reserved = cast_byte(i+1); /* reserved word */
+ }
+}
+
+
+#define MAXSRC 80
+
+
+const char *luaX_token2str (LexState *ls, int token) {
+ if (token < FIRST_RESERVED) {
+ lua_assert(token == cast(unsigned char, token));
+ return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) :
+ luaO_pushfstring(ls->L, "%c", token);
+ }
+ else
+ return luaX_tokens[token-FIRST_RESERVED];
+}
+
+
+static const char *txtToken (LexState *ls, int token) {
+ switch (token) {
+ case TK_NAME:
+ case TK_STRING:
+ case TK_NUMBER:
+ save(ls, '\0');
+ return luaZ_buffer(ls->buff);
+ default:
+ return luaX_token2str(ls, token);
+ }
+}
+
+
+void luaX_lexerror (LexState *ls, const char *msg, int token) {
+ char buff[MAXSRC];
+ luaO_chunkid(buff, getstr(ls->source), MAXSRC);
+ msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg);
+ if (token)
+ luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token));
+ luaD_throw(ls->L, LUA_ERRSYNTAX);
+}
+
+
+void luaX_syntaxerror (LexState *ls, const char *msg) {
+ luaX_lexerror(ls, msg, ls->t.token);
+}
+
+
+TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
+ lua_State *L = ls->L;
+ TString *ts = luaS_newlstr(L, str, l);
+ TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
+ if (ttisnil(o))
+ setbvalue(o, 1); /* make sure `str' will not be collected */
+ return ts;
+}
+
+
+static void inclinenumber (LexState *ls) {
+ int old = ls->current;
+ lua_assert(currIsNewline(ls));
+ next(ls); /* skip `\n' or `\r' */
+ if (currIsNewline(ls) && ls->current != old)
+ next(ls); /* skip `\n\r' or `\r\n' */
+ if (++ls->linenumber >= MAX_INT)
+ luaX_syntaxerror(ls, "chunk has too many lines");
+}
+
+
+void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {
+ ls->decpoint = '.';
+ ls->L = L;
+ ls->lookahead.token = TK_EOS; /* no look-ahead token */
+ ls->z = z;
+ ls->fs = NULL;
+ ls->linenumber = 1;
+ ls->lastline = 1;
+ ls->source = source;
+ luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */
+ next(ls); /* read first char */
+}
+
+
+
+/*
+** =======================================================
+** LEXICAL ANALYZER
+** =======================================================
+*/
+
+
+
+static int check_next (LexState *ls, const char *set) {
+ if (!strchr(set, ls->current))
+ return 0;
+ save_and_next(ls);
+ return 1;
+}
+
+
+static void buffreplace (LexState *ls, char from, char to) {
+ size_t n = luaZ_bufflen(ls->buff);
+ char *p = luaZ_buffer(ls->buff);
+ while (n--)
+ if (p[n] == from) p[n] = to;
+}
+
+
+static void trydecpoint (LexState *ls, SemInfo *seminfo) {
+ /* format error: try to update decimal point separator */
+ //struct lconv *cv = localeconv();
+ char old = ls->decpoint;
+ //ls->decpoint = (cv ? cv->decimal_point[0] : '.');
+ ls->decpoint = '.';
+ buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */
+ if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
+ /* format error with correct decimal point: no more options */
+ buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */
+ luaX_lexerror(ls, "malformed number", TK_NUMBER);
+ }
+}
+
+
+/* LUA_NUMBER */
+static void read_numeral (LexState *ls, SemInfo *seminfo) {
+ lua_assert(isdigit(ls->current));
+ do {
+ save_and_next(ls);
+ } while (isdigit(ls->current) || ls->current == '.');
+ if (check_next(ls, "Ee")) /* `E'? */
+ check_next(ls, "+-"); /* optional exponent sign */
+ while (isalnum(ls->current) || ls->current == '_')
+ save_and_next(ls);
+ save(ls, '\0');
+ buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
+ if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */
+ trydecpoint(ls, seminfo); /* try to update decimal point separator */
+}
+
+
+static int skip_sep (LexState *ls) {
+ int count = 0;
+ int s = ls->current;
+ lua_assert(s == '[' || s == ']');
+ save_and_next(ls);
+ while (ls->current == '=') {
+ save_and_next(ls);
+ count++;
+ }
+ return (ls->current == s) ? count : (-count) - 1;
+}
+
+
+static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
+ int cont = 0;
+ (void)(cont); /* avoid warnings when `cont' is not used */
+ save_and_next(ls); /* skip 2nd `[' */
+ if (currIsNewline(ls)) /* string starts with a newline? */
+ inclinenumber(ls); /* skip it */
+ for (;;) {
+ switch (ls->current) {
+ case EOZ:
+ luaX_lexerror(ls, (seminfo) ? "unfinished long string" :
+ "unfinished long comment", TK_EOS);
+ break; /* to avoid warnings */
+#if defined(LUA_COMPAT_LSTR)
+ case '[': {
+ if (skip_sep(ls) == sep) {
+ save_and_next(ls); /* skip 2nd `[' */
+ cont++;
+#if LUA_COMPAT_LSTR == 1
+ if (sep == 0)
+ luaX_lexerror(ls, "nesting of [[...]] is deprecated", '[');
+#endif
+ }
+ break;
+ }
+#endif
+ case ']': {
+ if (skip_sep(ls) == sep) {
+ save_and_next(ls); /* skip 2nd `]' */
+#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2
+ cont--;
+ if (sep == 0 && cont >= 0) break;
+#endif
+ goto endloop;
+ }
+ break;
+ }
+ case '\n':
+ case '\r': {
+ save(ls, '\n');
+ inclinenumber(ls);
+ if (!seminfo) luaZ_resetbuffer(ls->buff); /* avoid wasting space */
+ break;
+ }
+ default: {
+ if (seminfo) save_and_next(ls);
+ else next(ls);
+ }
+ }
+ } endloop:
+ if (seminfo)
+ seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep),
+ luaZ_bufflen(ls->buff) - 2*(2 + sep));
+}
+
+
+static void read_string (LexState *ls, int del, SemInfo *seminfo) {
+ save_and_next(ls);
+ while (ls->current != del) {
+ switch (ls->current) {
+ case EOZ:
+ luaX_lexerror(ls, "unfinished string", TK_EOS);
+ continue; /* to avoid warnings */
+ case '\n':
+ case '\r':
+ luaX_lexerror(ls, "unfinished string", TK_STRING);
+ continue; /* to avoid warnings */
+ case '\\': {
+ int c;
+ next(ls); /* do not save the `\' */
+ switch (ls->current) {
+ case 'a': c = '\a'; break;
+ case 'b': c = '\b'; break;
+ case 'f': c = '\f'; break;
+ case 'n': c = '\n'; break;
+ case 'r': c = '\r'; break;
+ case 't': c = '\t'; break;
+ case 'v': c = '\v'; break;
+ case '\n': /* go through */
+ case '\r': save(ls, '\n'); inclinenumber(ls); continue;
+ case EOZ: continue; /* will raise an error next loop */
+ default: {
+ if (!isdigit(ls->current))
+ save_and_next(ls); /* handles \\, \", \', and \? */
+ else { /* \xxx */
+ int i = 0;
+ c = 0;
+ do {
+ c = 10*c + (ls->current-'0');
+ next(ls);
+ } while (++i<3 && isdigit(ls->current));
+ if (c > UCHAR_MAX)
+ luaX_lexerror(ls, "escape sequence too large", TK_STRING);
+ save(ls, c);
+ }
+ continue;
+ }
+ }
+ save(ls, c);
+ next(ls);
+ continue;
+ }
+ default:
+ save_and_next(ls);
+ }
+ }
+ save_and_next(ls); /* skip delimiter */
+ seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1,
+ luaZ_bufflen(ls->buff) - 2);
+}
+
+
+static int llex (LexState *ls, SemInfo *seminfo) {
+ luaZ_resetbuffer(ls->buff);
+ for (;;) {
+ switch (ls->current) {
+ case '\n':
+ case '\r': {
+ inclinenumber(ls);
+ continue;
+ }
+ case '-': {
+ next(ls);
+ if (ls->current != '-') return '-';
+ /* else is a comment */
+ next(ls);
+ if (ls->current == '[') {
+ int sep = skip_sep(ls);
+ luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */
+ if (sep >= 0) {
+ read_long_string(ls, NULL, sep); /* long comment */
+ luaZ_resetbuffer(ls->buff);
+ continue;
+ }
+ }
+ /* else short comment */
+ while (!currIsNewline(ls) && ls->current != EOZ)
+ next(ls);
+ continue;
+ }
+ case '[': {
+ int sep = skip_sep(ls);
+ if (sep >= 0) {
+ read_long_string(ls, seminfo, sep);
+ return TK_STRING;
+ }
+ else if (sep == -1) return '[';
+ else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING);
+ }
+ case '=': {
+ next(ls);
+ if (ls->current != '=') return '=';
+ else { next(ls); return TK_EQ; }
+ }
+ case '<': {
+ next(ls);
+ if (ls->current != '=') return '<';
+ else { next(ls); return TK_LE; }
+ }
+ case '>': {
+ next(ls);
+ if (ls->current != '=') return '>';
+ else { next(ls); return TK_GE; }
+ }
+ case '~': {
+ next(ls);
+ if (ls->current != '=') return '~';
+ else { next(ls); return TK_NE; }
+ }
+ case '"':
+ case '\'': {
+ read_string(ls, ls->current, seminfo);
+ return TK_STRING;
+ }
+ case '.': {
+ save_and_next(ls);
+ if (check_next(ls, ".")) {
+ if (check_next(ls, "."))
+ return TK_DOTS; /* ... */
+ else return TK_CONCAT; /* .. */
+ }
+ else if (!isdigit(ls->current)) return '.';
+ else {
+ read_numeral(ls, seminfo);
+ return TK_NUMBER;
+ }
+ }
+ case EOZ: {
+ return TK_EOS;
+ }
+ default: {
+ if (isspace(ls->current)) {
+ lua_assert(!currIsNewline(ls));
+ next(ls);
+ continue;
+ }
+ else if (isdigit(ls->current)) {
+ read_numeral(ls, seminfo);
+ return TK_NUMBER;
+ }
+ else if (isalpha(ls->current) || ls->current == '_') {
+ /* identifier or reserved word */
+ TString *ts;
+ do {
+ save_and_next(ls);
+ } while (isalnum(ls->current) || ls->current == '_');
+ ts = luaX_newstring(ls, luaZ_buffer(ls->buff),
+ luaZ_bufflen(ls->buff));
+ if (ts->tsv.reserved > 0) /* reserved word? */
+ return ts->tsv.reserved - 1 + FIRST_RESERVED;
+ else {
+ seminfo->ts = ts;
+ return TK_NAME;
+ }
+ }
+ else {
+ int c = ls->current;
+ next(ls);
+ return c; /* single-char tokens (+ - / ...) */
+ }
+ }
+ }
+ }
+}
+
+
+void luaX_next (LexState *ls) {
+ ls->lastline = ls->linenumber;
+ if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */
+ ls->t = ls->lookahead; /* use this one */
+ ls->lookahead.token = TK_EOS; /* and discharge it */
+ }
+ else
+ ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */
+}
+
+
+void luaX_lookahead (LexState *ls) {
+ lua_assert(ls->lookahead.token == TK_EOS);
+ ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/Android.mk Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,19 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := SDL_net
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/../SDL/include $(LOCAL_PATH)/include
+LOCAL_CFLAGS := -O3
+
+LOCAL_CPP_EXTENSION := .cpp
+
+LOCAL_SRC_FILES := $(notdir $(wildcard $(LOCAL_PATH)/*.c))
+
+LOCAL_SHARED_LIBRARIES := SDL
+LOCAL_STATIC_LIBRARIES :=
+LOCAL_LDLIBS :=
+
+include $(BUILD_SHARED_LIBRARY)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/CHANGES Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,83 @@
+1.2.7:
+Joakim L. Gilje - Sat Jul 14 22:54:37 PDT 2007
+ * Set server TCP sockets to blocking mode on Mac OS X, Solaris, etc.
+
+1.2.6:
+Sam Lantinga - Sun Apr 30 01:48:40 PDT 2006
+ * Added gcc-fat.sh for generating Universal binaries on Mac OS X
+ * Updated libtool support to version 1.5.22
+Sam Lantinga - Wed Nov 19 00:23:44 PST 2003
+ * Updated libtool support for new mingw32 DLL build process
+Shard - Thu, 05 Jun 2003 09:30:20 -0500
+ * Fixed compiling on BeOS, which may not have SO_BROADCAST
+Kyle Davenport - Sat, 19 Apr 2003 17:13:31 -0500
+ * Added .la files to the development RPM, fixing RPM build on RedHat 8
+
+1.2.5:
+Luc-Olivier de Charrière - Sun, 05 Jan 2003 22:04:29 +0100
+ * Added support for sending UDP broadcast packets
+Sam Lantinga - Sun Oct 20 20:54:41 PDT 2002
+ * Added shared library support for MacOS X
+Sam Lantinga - Sat Aug 24 18:16:08 PDT 2002
+ * It is now safe to nest calls to SDLNet_Init() / SDLNet_Quit()
+Gaëtan de Menten - Sat Aug 24 18:08:39 PDT 2002
+ * Fixed UDP virtual address bind bug
+
+1.2.4:
+Sam Lantinga - Sat Apr 13 07:49:47 PDT 2002
+ * Updated autogen.sh for new versions of automake
+ * Specify the SDL API calling convention (C by default)
+Stephane Magnenat - Wed Feb 13 15:28:04 PST 2002
+ * Sockets are created with the SO_REUSEADDR flag by default
+Juergen Wind - Wed Feb 13 09:21:55 PST 2002
+ * Fixed data alignment problems on IRIX
+
+1.2.3:
+Sam Lantinga - Fri Oct 26 07:15:28 PDT 2001
+ * Fixed byte order read/write macros on sparc
+Jonathan Atkins - Sun Sep 23 10:44:27 PDT 2001
+ * Fixed non-blocking socket flags on Windows
+
+1.2.2:
+Sam Lantinga - Sun Jul 22 16:41:44 PDT 2001
+ * Added Project Builder projects for building MacOS X framework
+Masahiro Minami - Sun, 27 May 2001 02:10:35 +0900
+ * Added working MacOS Open Transport support
+
+1.2.1:
+Sam Lantinga - Tue Apr 17 11:42:13 PDT 2001
+ * Cleaned up swap function definitions in SDL_net.h
+ * Added the swap functions back in for binary compatibility
+Paul Jenner - Sat, 14 Apr 2001 09:20:38 -0700 (PDT)
+ * Added support for building RPM directly from tar archive
+
+1.2.0:
+Sam Lantinga - Wed Apr 4 12:42:20 PDT 2001
+ * Synchronized release version with SDL 1.2.0
+
+1.1.2:
+Sam Lantinga - Sat Feb 10 16:33:59 PST 2001
+ * SDL_net works with the sockets API out of the box on MacOS X.
+Paul S Jenner - Sun, 4 Feb 2001 03:58:44 -0800 (PST)
+ * Added an RPM spec file
+Patrick Levin - Mon, 8 Jan 2001 23:20:11 +0100
+ * Fixed non-blocking socket modes on Win32
+John Lawrence - Mon, 13 Nov 2000 10:39:48 -0800
+ * Fixed compile problem with MSVC++ (type casting)
+
+1.1.1:
+Sam Lantinga - Sat Jul 1 15:20:51 PDT 2000
+ * Modified chat example to work with GUIlib 1.1.0
+Roy Wood - Fri Jun 30 10:41:05 PDT 2000
+ * A few MacOS fixes (not yet complete)
+
+1.1.0:
+Andreas Umbach - Sat May 27 14:44:06 PDT 2000
+ * Suggested non-blocking server sockets
+ * Suggested setting TCP_NODELAY by default
+Roy Wood - Sat May 27 14:41:42 PDT 2000
+ * Ported to MacOS (not yet complete)
+
+1.0.2:
+Miguel Angel Blanch - Sat, 22 Apr 2000 23:06:05
+ * Implemented SDLNet_ResolveIP()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/COPYING Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,458 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/README Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,27 @@
+
+SDL_net 1.2
+
+The latest version of this library is available from:
+http://www.libsdl.org/projects/SDL_net/
+
+This is an example portable network library for use with SDL.
+It is available under the GNU Library General Public License.
+The API can be found in the file SDL_net.h
+This library supports UNIX, Windows, MacOS Classic, MacOS X,
+BeOS and QNX.
+
+The demo program is a chat client and server.
+The chat client requires the sample GUI library available at:
+http://www.libsdl.org/projects/GUIlib/
+The chat client connects to the server via TCP, registering itself.
+The server sends back a list of connected clients, and keeps the
+client updated with the status of other clients.
+Every line of text from a client is sent via UDP to every other client.
+
+Note that this isn't necessarily how you would want to write a chat
+program, but it demonstrates how to use the basic features of the
+network library.
+
+Enjoy!
+ -Sam Lantinga and Roy Wood
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/SDLnet.c Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,430 @@
+/*
+ SDL_net: An example cross-platform network library for use with SDL
+ Copyright (C) 1997-2004 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* $Id: SDLnet.c 2207 2006-04-20 16:48:25Z slouken $ */
+
+#include <string.h>
+
+#include "SDL_endian.h"
+
+#include "SDLnetsys.h"
+#include "SDL_net.h"
+
+
+const SDL_version *SDLNet_Linked_Version(void)
+{
+ static SDL_version linked_version;
+ SDL_NET_VERSION(&linked_version);
+ return(&linked_version);
+}
+
+/* Since the UNIX/Win32/BeOS code is so different from MacOS,
+ we'll just have two completely different sections here.
+*/
+static int SDLNet_started = 0;
+
+#ifdef MACOS_OPENTRANSPORT
+
+#include <Events.h>
+
+typedef struct
+{
+ Uint8 stat;
+ InetSvcRef dns;
+}DNSStatus, *DNSStatusRef;
+
+enum
+{
+ dnsNotReady = 0,
+ dnsReady = 1,
+ dnsResolved = 2,
+ dnsError = 255
+};
+
+//static InetSvcRef dns = 0;
+static DNSStatus dnsStatus;
+Uint32 OTlocalhost = 0;
+
+/* We need a notifier for opening DNS.*/
+/* ( 010311 masahiro minami<elsur@aaa.letter.co.jp>) */
+static pascal void OpenDNSNotifier(
+ void* context, OTEventCode code, OTResult result, void* cookie )
+{
+ switch( code )
+ {
+ case T_OPENCOMPLETE:
+ // DNS is ready now.
+ if( result == kOTNoError )
+ {
+ dnsStatus.dns = (InetSvcRef)cookie;
+ dnsStatus.stat = dnsReady;
+ }
+ else
+ {
+ SDLNet_SetError("T_DNRSTRINGTOADDRCOMPLETE event returned an error");
+ dnsStatus.dns = NULL;
+ dnsStatus.stat = dnsError;
+ }
+ break;
+ case T_DNRSTRINGTOADDRCOMPLETE:
+ // DNR resolved the name to address
+ // WORK IN PROGRESS (TODO )
+ dnsStatus.stat = dnsResolved;
+ break;
+ default:
+ if( result != kOTNoError )
+ dnsStatus.stat = dnsError;
+ }
+ // Is there anything else to be done here ???
+ // ( 010311 masahiro minami<elsur@aaa.letter.co.jp> )
+ // (TODO)
+}
+
+/* Local functions for initializing and cleaning up the DNS resolver */
+static int OpenDNS(void)
+{
+ int retval;
+ OSStatus status;
+
+ retval = 0;
+ status = OTAsyncOpenInternetServices(
+ kDefaultInternetServicesPath, 0, OpenDNSNotifier, NULL);
+ if ( status == noErr ) {
+ InetInterfaceInfo info;
+
+ dnsStatus.stat = dnsNotReady;
+
+ while( dnsStatus.stat != dnsError && dnsStatus.dns == NULL)
+ {
+ // what's to be done ? Yield ? WaitNextEvent ? or what ?
+ // ( 010311 masahiro minami<elsur@aaa.letter.co.jp> )
+ //YieldToAnyThread();
+ }
+ /* Get the address of the local system -
+ What should it be if ethernet is off?
+ */
+ OTInetGetInterfaceInfo(&info, kDefaultInetInterface);
+ OTlocalhost = info.fAddress;
+ } else {
+ SDLNet_SetError("Unable to open DNS handle");
+ retval = status;
+ }
+
+ return(retval);
+}
+
+static void CloseDNS(void)
+{
+ if ( dnsStatus.dns ) {
+ OTCloseProvider(dnsStatus.dns);
+ dnsStatus.dns = 0;
+ dnsStatus.stat = dnsNotReady;
+ }
+
+ OTlocalhost = 0;
+}
+
+/* Initialize/Cleanup the network API */
+int SDLNet_Init(void)
+{
+ OSStatus status;
+ int retval;
+
+ dnsStatus.stat = dnsNotReady;
+ dnsStatus.dns = 0;
+
+
+ retval = 0;
+ if ( ! SDLNet_started ) {
+ status = InitOpenTransport();
+ if ( status == noErr ) {
+ retval = OpenDNS();
+ if ( retval < 0 ) {
+ SDLNet_Quit();
+ }
+ } else {
+ SDLNet_SetError("Unable to initialize Open Transport");
+ retval = status;
+ }
+ }
+ if ( retval == 0 ) {
+ ++SDLNet_started;
+ }
+ return(retval);
+}
+
+void SDLNet_Quit(void)
+{
+ if ( SDLNet_started == 0 ) {
+ return;
+ }
+ if ( --SDLNet_started == 0 ) {
+ CloseDNS();
+ CloseOpenTransport();
+ }
+}
+
+/* Resolve a host name and port to an IP address in network form */
+int SDLNet_ResolveHost(IPaddress *address, const char *host, Uint16 port)
+{
+ int retval = 0;
+
+ /* Perform the actual host resolution */
+ if ( host == NULL ) {
+ address->host = INADDR_ANY;
+ } else {
+/* int a[4];
+
+ address->host = INADDR_NONE;
+
+ if ( sscanf(host, "%d.%d.%d.%d", a, a+1, a+2, a+3) == 4 ) {
+ if ( !(a[0] & 0xFFFFFF00) && !(a[1] & 0xFFFFFF00) &&
+ !(a[2] & 0xFFFFFF00) && !(a[3] & 0xFFFFFF00) ) {
+ address->host = ((a[0] << 24) |
+ (a[1] << 16) |
+ (a[2] << 8) | a[3]);
+ if ( address->host == 0x7F000001 ) {
+ address->host = OTlocalhost;
+ }
+ }
+ }
+
+ if ( address->host == INADDR_NONE ) {*/
+ InetHostInfo hinfo;
+
+ /* Check for special case - localhost */
+ if ( strcmp(host, "localhost") == 0 )
+ return(SDLNet_ResolveHost(address, "127.0.0.1", port));
+
+ /* Have OpenTransport resolve the hostname for us */
+ retval = OTInetStringToAddress(dnsStatus.dns, (char *)host, &hinfo);
+ if (retval == noErr) {
+ while( dnsStatus.stat != dnsResolved )
+ {WaitNextEvent(everyEvent, 0, 1, NULL );}
+ address->host = hinfo.addrs[0];
+ }
+ //}
+ }
+
+ address->port = SDL_SwapBE16(port);
+
+ /* Return the status */
+ return(retval);
+}
+
+/* Resolve an ip address to a host name in canonical form.
+ If the ip couldn't be resolved, this function returns NULL,
+ otherwise a pointer to a static buffer containing the hostname
+ is returned. Note that this function is not thread-safe.
+*/
+/* MacOS implementation by Roy Wood
+ */
+const char *SDLNet_ResolveIP(IPaddress *ip)
+{
+ if (ip != nil)
+ {
+ InetHost theIP;
+ static InetDomainName theInetDomainName;
+ OSStatus theOSStatus;
+
+
+ /* Default result will be null string */
+
+ theInetDomainName[0] = '\0';
+
+
+ /* Do a reverse DNS lookup */
+
+ theIP = ip->host;
+
+ theOSStatus = OTInetAddressToName(dnsStatus.dns,theIP,theInetDomainName);
+
+ /* If successful, return the result */
+
+ if (theOSStatus == kOTNoError)
+ {
+ while( dnsStatus.stat != dnsResolved )
+ { /*should we yield or what ? */ }
+ return(theInetDomainName);
+ }
+ }
+
+ SDLNet_SetError("Can't perform reverse DNS lookup");
+
+ return(NULL);
+}
+
+#else /* !MACOS_OPENTRANSPORT */
+
+#ifndef __USE_W32_SOCKETS
+#include <signal.h>
+#endif
+
+/* Initialize/Cleanup the network API */
+int SDLNet_Init(void)
+{
+ if ( !SDLNet_started ) {
+#ifdef __USE_W32_SOCKETS
+ /* Start up the windows networking */
+ WORD version_wanted = MAKEWORD(1,1);
+ WSADATA wsaData;
+
+ if ( WSAStartup(version_wanted, &wsaData) != 0 ) {
+ SDLNet_SetError("Couldn't initialize Winsock 1.1\n");
+ return(-1);
+ }
+#else
+ /* SIGPIPE is generated when a remote socket is closed */
+ void (*handler)(int);
+ handler = signal(SIGPIPE, SIG_IGN);
+ if ( handler != SIG_DFL ) {
+ signal(SIGPIPE, handler);
+ }
+#endif
+ }
+ ++SDLNet_started;
+ return(0);
+}
+void SDLNet_Quit(void)
+{
+ if ( SDLNet_started == 0 ) {
+ return;
+ }
+ if ( --SDLNet_started == 0 ) {
+#ifdef __USE_W32_SOCKETS
+ /* Clean up windows networking */
+ if ( WSACleanup() == SOCKET_ERROR ) {
+ if ( WSAGetLastError() == WSAEINPROGRESS ) {
+ WSACancelBlockingCall();
+ WSACleanup();
+ }
+ }
+#else
+ /* Restore the SIGPIPE handler */
+ void (*handler)(int);
+ handler = signal(SIGPIPE, SIG_DFL);
+ if ( handler != SIG_IGN ) {
+ signal(SIGPIPE, handler);
+ }
+#endif
+ }
+}
+
+/* Resolve a host name and port to an IP address in network form */
+int SDLNet_ResolveHost(IPaddress *address, const char *host, Uint16 port)
+{
+ int retval = 0;
+
+ /* Perform the actual host resolution */
+ if ( host == NULL ) {
+ address->host = INADDR_ANY;
+ } else {
+ address->host = inet_addr(host);
+ if ( address->host == INADDR_NONE ) {
+ struct hostent *hp;
+
+ hp = gethostbyname(host);
+ if ( hp ) {
+ memcpy(&address->host,hp->h_addr,hp->h_length);
+ } else {
+ retval = -1;
+ }
+ }
+ }
+ address->port = SDL_SwapBE16(port);
+
+ /* Return the status */
+ return(retval);
+}
+
+/* Resolve an ip address to a host name in canonical form.
+ If the ip couldn't be resolved, this function returns NULL,
+ otherwise a pointer to a static buffer containing the hostname
+ is returned. Note that this function is not thread-safe.
+*/
+/* Written by Miguel Angel Blanch.
+ * Main Programmer of Arianne RPG.
+ * http://come.to/arianne_rpg
+ */
+const char *SDLNet_ResolveIP(IPaddress *ip)
+{
+ struct hostent *hp;
+
+ hp = gethostbyaddr((char *)&ip->host, 4, AF_INET);
+ if ( hp != NULL ) {
+ return hp->h_name;
+ }
+ return NULL;
+}
+
+#endif /* MACOS_OPENTRANSPORT */
+
+#if !SDL_DATA_ALIGNED /* function versions for binary compatibility */
+
+/* Write a 16 bit value to network packet buffer */
+#undef SDLNet_Write16
+void SDLNet_Write16(Uint16 value, void *areap)
+{
+ (*(Uint16 *)(areap) = SDL_SwapBE16(value));
+}
+
+/* Write a 32 bit value to network packet buffer */
+#undef SDLNet_Write32
+void SDLNet_Write32(Uint32 value, void *areap)
+{
+ *(Uint32 *)(areap) = SDL_SwapBE32(value);
+}
+
+/* Read a 16 bit value from network packet buffer */
+#undef SDLNet_Read16
+Uint16 SDLNet_Read16(void *areap)
+{
+ return (SDL_SwapBE16(*(Uint16 *)(areap)));
+}
+
+/* Read a 32 bit value from network packet buffer */
+#undef SDLNet_Read32
+Uint32 SDLNet_Read32(void *areap)
+{
+ return (SDL_SwapBE32(*(Uint32 *)(areap)));
+}
+
+#endif /* !SDL_DATA_ALIGNED */
+
+
+#ifdef USE_GUSI_SOCKETS
+
+/* Configure Socket Factories */
+
+void GUSISetupFactories()
+{
+ GUSIwithInetSockets();
+}
+
+/* Configure File Devices */
+
+void GUSISetupDevices()
+{
+ return;
+}
+
+#endif /* USE_GUSI_SOCKETS */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/SDLnetTCP.c Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,953 @@
+/*
+ SDL_net: An example cross-platform network library for use with SDL
+ Copyright (C) 1997-2004 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* $Id: SDLnetTCP.c 3280 2007-07-15 05:55:42Z slouken $ */
+
+#include "SDLnetsys.h"
+#include "SDL_net.h"
+
+/* The network API for TCP sockets */
+
+/* Since the UNIX/Win32/BeOS code is so different from MacOS,
+ we'll just have two completely different sections here.
+*/
+
+#ifdef MACOS_OPENTRANSPORT
+
+#include <Events.h>
+#include <Threads.h>
+#include <OpenTransport.h>
+#include <OpenTptInternet.h>
+#include <OTDebug.h>
+
+struct _TCPsocket {
+ int ready;
+ SOCKET channel;
+
+ // These are taken from GUSI interface.
+ // I'm not sure if it's really necessary here yet
+ // ( masahiro minami<elsur@aaa.letter.co.jp> )
+ // ( 01/02/19 )
+ OTEventCode curEvent;
+ OTEventCode newEvent;
+ OTEventCode event;
+ OTEventCode curCompletion;
+ OTEventCode newCompletion;
+ OTEventCode completion;
+ OSStatus error;
+ TEndpointInfo info;
+ Boolean readShutdown;
+ Boolean writeShutdown;
+ Boolean connected;
+ OTConfigurationRef config; // Master configuration. you can clone this.
+ TCPsocket nextListener;
+ // ( end of new members --- masahiro minami<elsur@aaa.letter.co.jp>
+
+ IPaddress remoteAddress;
+ IPaddress localAddress;
+ int sflag;
+
+ // Maybe we don't need this---- it's from original SDL_net
+ // (masahiro minami<elsur@aaa.letter.co.jp>)
+ // ( 01/02/20 )
+ int rcvdPassConn;
+};
+
+// To be used in WaitNextEvent() here and there....
+// (010311 masahiro minami<elsur@aaa.letter.co.jp>)
+EventRecord macEvent;
+
+#if TARGET_API_MAC_CARBON
+/* for Carbon */
+OTNotifyUPP notifier;
+#endif
+
+/* Input: ep - endpointref on which to negotiate the option
+ enableReuseIPMode - desired option setting - true/false
+ Return: kOTNoError indicates that the option was successfully negotiated
+ OSStatus is an error if < 0, otherwise, the status field is
+ returned and is > 0.
+
+ IMPORTANT NOTE: The endpoint is assumed to be in synchronous more, otherwise
+ this code will not function as desired
+*/
+
+/*
+NOTE: As this version is written async way, we don't use this function...
+(010526) masahiro minami<elsur@aaa.letter.co.jp>
+*/
+/*
+OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode)
+
+{
+ UInt8 buf[kOTFourByteOptionSize]; // define buffer for fourByte Option size
+ TOption* opt; // option ptr to make items easier to access
+ TOptMgmt req;
+ TOptMgmt ret;
+ OSStatus err;
+
+ if (!OTIsSynchronous(ep))
+ {
+ return (-1);
+ }
+ opt = (TOption*)buf; // set option ptr to buffer
+ req.opt.buf = buf;
+ req.opt.len = sizeof(buf);
+ req.flags = T_NEGOTIATE; // negotiate for option
+
+ ret.opt.buf = buf;
+ ret.opt.maxlen = kOTFourByteOptionSize;
+
+ opt->level = INET_IP; // dealing with an IP Level function
+ opt->name = IP_REUSEADDR;
+ opt->len = kOTFourByteOptionSize;
+ opt->status = 0;
+ *(UInt32*)opt->value = enableReuseIPMode; // set the desired option level, true or false
+
+ err = OTOptionManagement(ep, &req, &ret);
+
+ // if no error then return the option status value
+ if (err == kOTNoError)
+ {
+ if (opt->status != T_SUCCESS)
+ err = opt->status;
+ else
+ err = kOTNoError;
+ }
+
+ return err;
+}
+*/
+
+/* A helper function for Mac OpenTransport support*/
+// This function is a complete copy from GUSI
+// ( masahiro minami<elsur@aaa.letter.co.jp> )
+// ( 01/02/19 )
+static __inline__ Uint32 CompleteMask(OTEventCode code)
+{
+ return 1 << (code & 0x1F);
+}
+
+/* Notifier for async OT calls */
+static pascal void AsyncTCPNotifier( TCPsocket sock, OTEventCode code,
+ OTResult result, void* cookie )
+{
+
+#ifdef DEBUG_NET
+ printf("AsyncTCPNotifier got an event : 0x%8.8x\n", code );
+#endif
+
+ switch( code & 0x7f000000L)
+ {
+ case 0:
+ sock->newEvent |= code;
+ result = 0;
+ break;
+ case kCOMPLETEEVENT:
+ if(!(code & 0x00FFFFE0 ))
+ sock->newCompletion |= CompleteMask( code );
+ if( code == T_OPENCOMPLETE )
+ sock->channel = (SOCKET)(cookie);
+ break;
+ default:
+ if( code != kOTProviderWillClose )
+ result = 0;
+ }
+ // Do we need these ???? TODO
+ // sock->SetAsyncMacError( result );
+ // sock->Wakeup();
+}
+
+/* Retrieve OT event */
+// This function is taken from GUSI interface.
+// ( 01/02/19 masahiro minami<elsur@aaa.letter.co.jp> )
+static void AsyncTCPPopEvent( TCPsocket sock )
+{
+ // Make sure OT calls are not interrupted
+ // Not sure if we really need this.
+ OTEnterNotifier( sock->channel );
+
+ sock->event |= (sock->curEvent = sock->newEvent );
+ sock->completion |= ( sock->curCompletion = sock->newCompletion );
+ sock->newEvent = sock->newCompletion = 0;
+
+ OTLeaveNotifier( sock->channel );
+
+ if( sock->curEvent & T_UDERR)
+ {
+ // We just clear the error.
+ // Should we feed this back to users ?
+ // (TODO )
+ OTRcvUDErr( sock->channel, NULL );
+
+#ifdef DEBUG_NET
+ printf("AsyncTCPPopEvent T_UDERR recognized");
+#endif
+ }
+
+ // Remote is disconnecting...
+ if( sock->curEvent & ( T_DISCONNECT | T_ORDREL ))
+ {
+ sock->readShutdown = true;
+ }
+
+ if( sock->curEvent &T_CONNECT )
+ {
+ // Ignore the info of remote (second parameter).
+ // Shoule we care ?
+ // (TODO)
+ OTRcvConnect( sock->channel, NULL );
+ sock->connected = 1;
+ }
+
+ if( sock->curEvent & T_ORDREL )
+ {
+ OTRcvOrderlyDisconnect( sock->channel );
+ }
+
+ if( sock->curEvent & T_DISCONNECT )
+ {
+ OTRcvDisconnect( sock->channel, NULL );
+ }
+
+ // Do we need to ?
+ // (masahiro minami<elsur@aaa.letter.co.jp>)
+ //YieldToAnyThread();
+}
+
+/* Create a new TCPsocket */
+// Because TCPsocket structure gets bigger and bigger,
+// I think we'd better have a constructor function and delete function.
+// ( 01/02/25 masahiro minami<elsur@aaa.letter.co.jp> )
+static TCPsocket AsyncTCPNewSocket()
+{
+ TCPsocket sock;
+
+ sock = (TCPsocket)malloc(sizeof(*sock));
+ if ( sock == NULL ) {
+ SDLNet_SetError("Out of memory");
+ return NULL;
+ }
+
+ sock->newEvent = 0;
+ sock->event = 0;
+ sock->curEvent = 0;
+ sock->newCompletion = 0;
+ sock->completion = 0;
+ sock->curCompletion = 0;
+ //sock->info = NULL;
+ sock->readShutdown = sock->writeShutdown = sock->connected = false;
+ sock->error = 0;
+ sock->config = NULL;
+ sock->nextListener = NULL;
+ sock->sflag = 0;
+ return sock;
+}
+
+// hmmm.... do we need this ???
+// ( 01/02/25 masahiro minami<elsur@aaa.letter.co.jp>)
+static void AsycnTCPDeleteSocket( TCPsocket sock )
+{
+ SDLNet_TCP_Close( sock );
+}
+/* Open a TCP network socket
+ If 'remote' is NULL, this creates a local server socket on the given port,
+ otherwise a TCP connection to the remote host and port is attempted.
+ The newly created socket is returned, or NULL if there was an error.
+
+ ( re-written by masahiro minami<elsur@aaa.letter.co.jp>
+ Now endpoint is created in Async mode.
+ 01/02/20 )
+*/
+TCPsocket SDLNet_TCP_Open(IPaddress *ip)
+{
+ EndpointRef dummy = NULL;
+
+ TCPsocket sock = AsyncTCPNewSocket();
+ if( ! sock)
+ return NULL;
+
+ // Determin whether bind locally, or connect to remote
+ if ( (ip->host != INADDR_NONE) && (ip->host != INADDR_ANY) )
+ {
+ // ######## Connect to remote
+ OTResult stat;
+ InetAddress inAddr;
+ TBind bindReq;
+
+ // Open endpoint
+ sock->error = OTAsyncOpenEndpoint(
+ OTCreateConfiguration(kTCPName), NULL, &(sock->info),
+ (OTNotifyProcPtr)(AsyncTCPNotifier),
+ sock );
+
+ AsyncTCPPopEvent( sock );
+ while( !sock->error && !( sock->completion & CompleteMask(T_OPENCOMPLETE)))
+ {
+ //SetThreadState( kCurrentThreadID, kReadyThreadState, kNoThreadID );
+ //YieldToAnyThread();
+ //WaitNextEvent(everyEvent, &macEvent, 1, NULL);
+ AsyncTCPPopEvent( sock );
+ }
+
+ if( !sock->channel )
+ {
+ SDLNet_SetError("OTAsyncOpenEndpoint failed --- client socket could not be opened");
+ goto error_return;
+ }
+
+ // Set blocking mode
+ // I'm not sure if this is a good solution....
+ // Check out Apple's sample code, OT Virtual Server
+ // ( 010314 masahiro minami<elsur@aaa.letter.co.jp>)
+
+ sock->error = OTSetBlocking( sock->channel );
+ if( sock->error != kOTNoError )
+ {
+ SDLNet_SetError("OTSetBlocking() returned an error");
+ goto error_return;
+ }
+
+ // Bind the socket
+ OTInitInetAddress(&inAddr, 0, 0 );
+ bindReq.addr.len = sizeof( InetAddress );
+ bindReq.addr.buf = (unsigned char*)&inAddr;
+ bindReq.qlen = 0;
+
+ sock->error = OTBind( sock->channel, &bindReq, NULL );
+ AsyncTCPPopEvent(sock);
+ while( !sock->error && !( sock->completion & CompleteMask(T_BINDCOMPLETE)))
+ {
+ //YieldToAnyThread();
+ //WaitNextEvent(everyEvent, &macEvent, 1, NULL);
+ AsyncTCPPopEvent(sock);
+ }
+
+
+ switch( stat = OTGetEndpointState( sock->channel ))
+ {
+ InetAddress inAddr;
+ TCall sndCall;
+ OTResult res;
+
+ case T_OUTCON:
+ SDLNet_SetError("SDLNet_Open() failed -- T_OUTCON");
+ goto error_return;
+ break;
+ case T_IDLE:
+ sock->readShutdown = false;
+ sock->writeShutdown = false;
+ sock->event &=~T_CONNECT;
+
+ OTMemzero(&sndCall, sizeof(TCall));
+ OTInitInetAddress(&inAddr, ip->port, ip->host );
+ sndCall.addr.len = sizeof(InetAddress);
+ sndCall.addr.buf = (unsigned char*)&inAddr;
+ sock->connected = 0;
+ res = OTConnect( sock->channel, &sndCall, NULL );
+ AsyncTCPPopEvent(sock);
+ while( sock->error == kOTNoDataErr || !sock->connected )
+ AsyncTCPPopEvent(sock);
+ break;
+ default:
+ // What's to be done ? (TODO)
+ SDLNet_SetError("SDLNet_TCP_Open() failed -- EndpointState not good");
+ goto error_return;
+
+ }
+ if( !(sock->event & (T_CONNECT|T_DISCONNECT)))
+ goto error_return;
+
+ AsyncTCPPopEvent( sock );
+ while( !(sock->event & (T_CONNECT|T_DISCONNECT)))
+ {
+ AsyncTCPPopEvent( sock );
+ }
+ // OTConnect successfull
+ if( sock->event & T_CONNECT)
+ {
+ sock->remoteAddress.host = inAddr.fHost;
+ sock->remoteAddress.port = inAddr.fPort;
+ sock->sflag = false;
+ }
+ else
+ {
+ // OTConnect failed
+ sock->event &= ~T_DISCONNECT;
+ goto error_return;
+ }
+ }
+ else
+ {
+ // ######## Bind locally
+ TBind bindReq;
+ InetAddress inAddr;
+
+ // First, get InetInterfaceInfo.
+ // I don't search for all of them.
+ // Does that matter ?
+
+ sock->error = OTAsyncOpenEndpoint(
+ OTCreateConfiguration("tilisten, tcp"), NULL, &(sock->info),
+ (OTNotifyProcPtr)(AsyncTCPNotifier),
+ sock);
+ AsyncTCPPopEvent( sock );
+ while( !sock->error && !( sock->completion & CompleteMask( T_OPENCOMPLETE)))
+ {
+ AsyncTCPPopEvent( sock );
+ }
+
+ if( ! sock->channel )
+ {
+ SDLNet_SetError("OTAsyncOpenEndpoint failed --- server socket could not be opened");
+ goto error_return;
+ }
+
+ // Create a master OTConfiguration
+ sock->config = OTCreateConfiguration(kTCPName);
+ if( ! sock->config )
+ {
+ SDLNet_SetError("Could not create master OTConfiguration");
+ goto error_return;
+ }
+
+ // Bind the socket
+ OTInitInetAddress(&inAddr, ip->port, 0 );
+ inAddr.fAddressType = AF_INET;
+ bindReq.addr.len = sizeof( InetAddress );
+ bindReq.addr.buf = (unsigned char*)&inAddr;
+ bindReq.qlen = 35; // This number is NOT well considered. (TODO)
+ sock->localAddress.host = inAddr.fHost;
+ sock->localAddress.port = inAddr.fPort;
+ sock->sflag = true;
+
+ sock->error = OTBind( sock->channel, &bindReq, NULL );
+ AsyncTCPPopEvent(sock);
+ while( !sock->error && !( sock->completion & CompleteMask(T_BINDCOMPLETE)))
+ {
+ AsyncTCPPopEvent(sock);
+ }
+ if( sock->error != kOTNoError )
+ {
+ SDLNet_SetError("Could not bind server socket");
+ goto error_return;
+ }
+
+ if( dummy )
+ OTCloseProvider( dummy );
+
+ }
+
+ sock->ready = 0;
+ return sock;
+
+ error_return:
+ if( dummy )
+ OTCloseProvider( dummy );
+ SDLNet_TCP_Close( sock );
+ return NULL;
+}
+
+/* Accept an incoming connection on the given server socket.
+ The newly created socket is returned, or NULL if there was an error.
+*/
+TCPsocket SDLNet_TCP_Accept(TCPsocket server)
+{
+
+ /* Only server sockets can accept */
+ if ( ! server->sflag ) {
+ SDLNet_SetError("Only server sockets can accept()");
+ return(NULL);
+ }
+ server->ready = 0;
+
+ /* Accept a new TCP connection on a server socket */
+ {
+ InetAddress peer;
+ TCall peerinfo;
+ TCPsocket sock = NULL;
+ Boolean mustListen = false;
+ OTResult err;
+
+ memset(&peerinfo, 0, (sizeof peerinfo ));
+ peerinfo.addr.buf = (Uint8 *) &peer;
+ peerinfo.addr.maxlen = sizeof(peer);
+
+ while( mustListen || !sock )
+ {
+ // OTListen
+ // We do NOT block ---- right thing ? (TODO)
+ err = OTListen( server->channel, &peerinfo );
+
+ if( err )
+ goto error_return;
+ else
+ {
+ mustListen = false;
+ sock = AsyncTCPNewSocket();
+ if( ! sock )
+ goto error_return;
+ }
+ }
+ if( sock )
+ {
+ // OTAsyncOpenEndpoint
+ server->error = OTAsyncOpenEndpoint( OTCloneConfiguration( server->config ),
+ NULL, &(sock->info), (OTNotifyProcPtr)AsyncTCPNotifier, sock );
+ AsyncTCPPopEvent( sock );
+ while( !sock->error && !( sock->completion & CompleteMask( T_OPENCOMPLETE)))
+ {
+ AsyncTCPPopEvent( sock );
+ }
+ if( ! sock->channel )
+ {
+ mustListen = false;
+ goto error_return;
+ }
+
+ // OTAccept
+ server->completion &= ~(CompleteMask(T_ACCEPTCOMPLETE));
+ server->error = OTAccept( server->channel, sock->channel, &peerinfo );
+ AsyncTCPPopEvent( server );
+ while( !(server->completion & CompleteMask(T_ACCEPTCOMPLETE)))
+ {
+ AsyncTCPPopEvent( server );
+ }
+
+ switch( server->error )
+ {
+ case kOTLookErr:
+ switch( OTLook(server->channel ))
+ {
+ case T_LISTEN:
+ mustListen = true;
+ break;
+ case T_DISCONNECT:
+ goto error_return;
+ }
+ break;
+ case 0:
+ sock->nextListener = server->nextListener;
+ server->nextListener = sock;
+ sock->remoteAddress.host = peer.fHost;
+ sock->remoteAddress.port = peer.fPort;
+ return sock;
+ // accept successful
+ break;
+ default:
+ free( sock );
+ }
+ }
+ sock->remoteAddress.host = peer.fHost;
+ sock->remoteAddress.port = peer.fPort;
+ sock->sflag = 0;
+ sock->ready = 0;
+
+ /* The socket is ready */
+ return(sock);
+
+ // Error; close the socket and return
+ error_return:
+ SDLNet_TCP_Close(sock);
+ return(NULL);
+ }
+}
+
+/* Get the IP address of the remote system associated with the socket.
+ If the socket is a server socket, this function returns NULL.
+*/
+IPaddress *SDLNet_TCP_GetPeerAddress(TCPsocket sock)
+{
+ if ( sock->sflag ) {
+ return(NULL);
+ }
+ return(&sock->remoteAddress);
+}
+
+/* Send 'len' bytes of 'data' over the non-server socket 'sock'
+ This function returns the actual amount of data sent. If the return value
+ is less than the amount of data sent, then either the remote connection was
+ closed, or an unknown socket error occurred.
+*/
+int SDLNet_TCP_Send(TCPsocket sock, const void *datap, int len)
+{
+ const Uint8 *data = (const Uint8 *)datap; /* For pointer arithmetic */
+ int sent, left;
+
+ /* Server sockets are for accepting connections only */
+ if ( sock->sflag ) {
+ SDLNet_SetError("Server sockets cannot send");
+ return(-1);
+ }
+
+ /* Keep sending data until it's sent or an error occurs */
+ left = len;
+ sent = 0;
+ errno = 0;
+ do {
+ len = OTSnd(sock->channel, (void *)data, left, 0);
+ if (len == kOTFlowErr)
+ len = 0;
+ if ( len > 0 ) {
+ sent += len;
+ left -= len;
+ data += len;
+ }
+ // Do we need to ?
+ // ( masahiro minami<elsur@aaa.letter.co.jp> )
+ // (TODO)
+ //WaitNextEvent(everyEvent, &macEvent, 1, NULL);
+ //AsyncTCPPopEvent(sock);
+ } while ( (left > 0) && (len > 0) );
+
+ return(sent);
+}
+
+/* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
+ and store them in the buffer pointed to by 'data'.
+ This function returns the actual amount of data received. If the return
+ value is less than or equal to zero, then either the remote connection was
+ closed, or an unknown socket error occurred.
+*/
+int SDLNet_TCP_Recv(TCPsocket sock, void *data, int maxlen)
+{
+ int len = 0;
+ OSStatus res;
+ /* Server sockets are for accepting connections only */
+ if ( sock->sflag ) {
+ SDLNet_SetError("Server sockets cannot receive");
+ return(-1);
+ }
+
+ do
+ {
+ res = OTRcv(sock->channel, data, maxlen-len, 0);
+ if (res > 0) {
+ len = res;
+ }
+
+#ifdef DEBUG_NET
+ if ( res != kOTNoDataErr )
+ printf("SDLNet_TCP_Recv received ; %d\n", res );
+#endif
+
+ AsyncTCPPopEvent(sock);
+ if( res == kOTLookErr )
+ {
+ res = OTLook(sock->channel );
+ continue;
+ }
+ } while ( (len == 0) && (res == kOTNoDataErr) );
+
+ sock->ready = 0;
+ if ( len == 0 ) { /* Open Transport error */
+#ifdef DEBUG_NET
+ printf("Open Transport error: %d\n", res);
+#endif
+ return(-1);
+ }
+ return(len);
+}
+
+/* Close a TCP network socket */
+void SDLNet_TCP_Close(TCPsocket sock)
+{
+ if ( sock != NULL ) {
+ if ( sock->channel != INVALID_SOCKET ) {
+ //closesocket(sock->channel);
+ OTSndOrderlyDisconnect( sock->channel );
+ }
+ free(sock);
+ }
+}
+
+#else /* !MACOS_OPENTRANSPORT */
+
+struct _TCPsocket {
+ int ready;
+ SOCKET channel;
+ IPaddress remoteAddress;
+ IPaddress localAddress;
+ int sflag;
+};
+
+/* Open a TCP network socket
+ If 'remote' is NULL, this creates a local server socket on the given port,
+ otherwise a TCP connection to the remote host and port is attempted.
+ The newly created socket is returned, or NULL if there was an error.
+*/
+TCPsocket SDLNet_TCP_Open(IPaddress *ip)
+{
+ TCPsocket sock;
+ struct sockaddr_in sock_addr;
+
+ /* Allocate a TCP socket structure */
+ sock = (TCPsocket)malloc(sizeof(*sock));
+ if ( sock == NULL ) {
+ SDLNet_SetError("Out of memory");
+ goto error_return;
+ }
+
+ /* Open the socket */
+ sock->channel = socket(AF_INET, SOCK_STREAM, 0);
+ if ( sock->channel == INVALID_SOCKET ) {
+ SDLNet_SetError("Couldn't create socket");
+ goto error_return;
+ }
+
+ /* Connect to remote, or bind locally, as appropriate */
+ if ( (ip->host != INADDR_NONE) && (ip->host != INADDR_ANY) ) {
+
+ // ######### Connecting to remote
+
+ memset(&sock_addr, 0, sizeof(sock_addr));
+ sock_addr.sin_family = AF_INET;
+ sock_addr.sin_addr.s_addr = ip->host;
+ sock_addr.sin_port = ip->port;
+
+ /* Connect to the remote host */
+ if ( connect(sock->channel, (struct sockaddr *)&sock_addr,
+ sizeof(sock_addr)) == SOCKET_ERROR ) {
+ SDLNet_SetError("Couldn't connect to remote host");
+ goto error_return;
+ }
+ sock->sflag = 0;
+ } else {
+
+ // ########## Binding locally
+
+ memset(&sock_addr, 0, sizeof(sock_addr));
+ sock_addr.sin_family = AF_INET;
+ sock_addr.sin_addr.s_addr = INADDR_ANY;
+ sock_addr.sin_port = ip->port;
+
+/*
+ * Windows gets bad mojo with SO_REUSEADDR:
+ * http://www.devolution.com/pipermail/sdl/2005-September/070491.html
+ * --ryan.
+ */
+#ifndef WIN32
+ /* allow local address reuse */
+ { int yes = 1;
+ setsockopt(sock->channel, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof(yes));
+ }
+#endif
+
+ /* Bind the socket for listening */
+ if ( bind(sock->channel, (struct sockaddr *)&sock_addr,
+ sizeof(sock_addr)) == SOCKET_ERROR ) {
+ SDLNet_SetError("Couldn't bind to local port");
+ goto error_return;
+ }
+ if ( listen(sock->channel, 5) == SOCKET_ERROR ) {
+ SDLNet_SetError("Couldn't listen to local port");
+ goto error_return;
+ }
+
+ /* Set the socket to non-blocking mode for accept() */
+#if defined(__BEOS__) && defined(SO_NONBLOCK)
+ /* On BeOS r5 there is O_NONBLOCK but it's for files only */
+ {
+ long b = 1;
+ setsockopt(sock->channel, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
+ }
+#elif defined(O_NONBLOCK)
+ {
+ fcntl(sock->channel, F_SETFL, O_NONBLOCK);
+ }
+#elif defined(WIN32)
+ {
+ unsigned long mode = 1;
+ ioctlsocket (sock->channel, FIONBIO, &mode);
+ }
+#elif defined(__OS2__)
+ {
+ int dontblock = 1;
+ ioctl(sock->channel, FIONBIO, &dontblock);
+ }
+#else
+#warning How do we set non-blocking mode on other operating systems?
+#endif
+ sock->sflag = 1;
+ }
+ sock->ready = 0;
+
+#ifdef TCP_NODELAY
+ /* Set the nodelay TCP option for real-time games */
+ { int yes = 1;
+ setsockopt(sock->channel, IPPROTO_TCP, TCP_NODELAY, (char*)&yes, sizeof(yes));
+ }
+#endif /* TCP_NODELAY */
+
+ /* Fill in the channel host address */
+ sock->remoteAddress.host = sock_addr.sin_addr.s_addr;
+ sock->remoteAddress.port = sock_addr.sin_port;
+
+ /* The socket is ready */
+ return(sock);
+
+error_return:
+ SDLNet_TCP_Close(sock);
+ return(NULL);
+}
+
+/* Accept an incoming connection on the given server socket.
+ The newly created socket is returned, or NULL if there was an error.
+*/
+TCPsocket SDLNet_TCP_Accept(TCPsocket server)
+{
+ TCPsocket sock;
+ struct sockaddr_in sock_addr;
+ int sock_alen;
+
+ /* Only server sockets can accept */
+ if ( ! server->sflag ) {
+ SDLNet_SetError("Only server sockets can accept()");
+ return(NULL);
+ }
+ server->ready = 0;
+
+ /* Allocate a TCP socket structure */
+ sock = (TCPsocket)malloc(sizeof(*sock));
+ if ( sock == NULL ) {
+ SDLNet_SetError("Out of memory");
+ goto error_return;
+ }
+
+ /* Accept a new TCP connection on a server socket */
+ sock_alen = sizeof(sock_addr);
+ sock->channel = accept(server->channel, (struct sockaddr *)&sock_addr,
+#ifdef USE_GUSI_SOCKETS
+ (unsigned int *)&sock_alen);
+#else
+ &sock_alen);
+#endif
+ if ( sock->channel == SOCKET_ERROR ) {
+ SDLNet_SetError("accept() failed");
+ goto error_return;
+ }
+#ifdef WIN32
+ {
+ /* passing a zero value, socket mode set to block on */
+ unsigned long mode = 0;
+ ioctlsocket (sock->channel, FIONBIO, &mode);
+ }
+#elif defined(O_NONBLOCK)
+ {
+ int flags = fcntl(sock->channel, F_GETFL, 0);
+ fcntl(sock->channel, F_SETFL, flags & ~O_NONBLOCK);
+ }
+#endif /* WIN32 */
+ sock->remoteAddress.host = sock_addr.sin_addr.s_addr;
+ sock->remoteAddress.port = sock_addr.sin_port;
+
+ sock->sflag = 0;
+ sock->ready = 0;
+
+ /* The socket is ready */
+ return(sock);
+
+error_return:
+ SDLNet_TCP_Close(sock);
+ return(NULL);
+}
+
+/* Get the IP address of the remote system associated with the socket.
+ If the socket is a server socket, this function returns NULL.
+*/
+IPaddress *SDLNet_TCP_GetPeerAddress(TCPsocket sock)
+{
+ if ( sock->sflag ) {
+ return(NULL);
+ }
+ return(&sock->remoteAddress);
+}
+
+/* Send 'len' bytes of 'data' over the non-server socket 'sock'
+ This function returns the actual amount of data sent. If the return value
+ is less than the amount of data sent, then either the remote connection was
+ closed, or an unknown socket error occurred.
+*/
+int SDLNet_TCP_Send(TCPsocket sock, const void *datap, int len)
+{
+ const Uint8 *data = (const Uint8 *)datap; /* For pointer arithmetic */
+ int sent, left;
+
+ /* Server sockets are for accepting connections only */
+ if ( sock->sflag ) {
+ SDLNet_SetError("Server sockets cannot send");
+ return(-1);
+ }
+
+ /* Keep sending data until it's sent or an error occurs */
+ left = len;
+ sent = 0;
+ errno = 0;
+ do {
+ len = send(sock->channel, (const char *) data, left, 0);
+ if ( len > 0 ) {
+ sent += len;
+ left -= len;
+ data += len;
+ }
+ } while ( (left > 0) && ((len > 0) || (errno == EINTR)) );
+
+ return(sent);
+}
+
+/* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
+ and store them in the buffer pointed to by 'data'.
+ This function returns the actual amount of data received. If the return
+ value is less than or equal to zero, then either the remote connection was
+ closed, or an unknown socket error occurred.
+*/
+int SDLNet_TCP_Recv(TCPsocket sock, void *data, int maxlen)
+{
+ int len;
+
+ /* Server sockets are for accepting connections only */
+ if ( sock->sflag ) {
+ SDLNet_SetError("Server sockets cannot receive");
+ return(-1);
+ }
+
+ errno = 0;
+ do {
+ len = recv(sock->channel, (char *) data, maxlen, 0);
+ } while ( errno == EINTR );
+
+ sock->ready = 0;
+ return(len);
+}
+
+/* Close a TCP network socket */
+void SDLNet_TCP_Close(TCPsocket sock)
+{
+ if ( sock != NULL ) {
+ if ( sock->channel != INVALID_SOCKET ) {
+ closesocket(sock->channel);
+ }
+ free(sock);
+ }
+}
+
+#endif /* MACOS_OPENTRANSPORT */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/SDLnetUDP.c Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,797 @@
+/*
+ SDL_net: An example cross-platform network library for use with SDL
+ Copyright (C) 1997-2004 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* $Id: SDLnetUDP.c 1192 2004-01-04 17:41:55Z slouken $ */
+
+#include "SDLnetsys.h"
+#include "SDL_net.h"
+#ifdef MACOS_OPENTRANSPORT
+#include <Events.h>
+#endif
+
+struct _UDPsocket {
+ int ready;
+ SOCKET channel;
+ IPaddress address;
+
+#ifdef MACOS_OPENTRANSPORT
+ OTEventCode newEvent;
+ OTEventCode event;
+ OTEventCode curEvent;
+ OTEventCode newCompletion;
+ OTEventCode completion;
+ OTEventCode curCompletion;
+ TEndpointInfo info;
+ Boolean readShutdown;
+ Boolean writeShutdown;
+ OSStatus error;
+ OTConfigurationRef config; // Master configuration. you can clone this.
+#endif /* MACOS_OPENTRANSPORT */
+
+ struct UDP_channel {
+ int numbound;
+ IPaddress address[SDLNET_MAX_UDPADDRESSES];
+ } binding[SDLNET_MAX_UDPCHANNELS];
+};
+
+#ifdef MACOS_OPENTRANSPORT
+
+/* A helper function for Mac OpenTransport support*/
+// This function is a complete copy from GUSI
+// ( masahiro minami<elsur@aaa.letter.co.jp> )
+// ( 01/02/19 )
+//
+// I guess this function should be put in SDLnet.c
+// ( 010315 masahiro minami<elsur@aaa.letter.co.jp>)
+// (TODO)
+static __inline__ Uint32 CompleteMask(OTEventCode code)
+{
+ return 1 << (code & 0x1F);
+}
+
+/* Notifier for async OT calls */
+// This function is completely same as AsyncTCPNotifier,
+// except for the argument, UDPsocket / TCPsocket
+// ( 010315 masahiro minami<elsur@aaa.letter.co.jp>)
+static pascal void AsyncUDPNotifier( UDPsocket sock, OTEventCode code,
+ OTResult result, void* cookie )
+{
+ switch( code & 0x7f000000L)
+ {
+ case 0:
+ sock->newEvent |= code;
+ result = 0;
+ break;
+ case kCOMPLETEEVENT:
+ if(!(code & 0x00FFFFE0 ))
+ sock->newCompletion |= CompleteMask( code );
+ if( code == T_OPENCOMPLETE )
+ sock->channel = (SOCKET)(cookie);
+ break;
+ default:
+ if( code != kOTProviderWillClose )
+ result = 0;
+ }
+ // Do we need these ???? TODO
+ // sock->SetAsyncMacError( result );
+ // sock->Wakeup();
+
+ // Do we need to ?
+ //YieldToAnyThread();
+}
+
+/* Retrieve OT event */
+// This function is completely same as AsyncTCPPopEvent,
+// except for the argument, UDPsocket / TCPsocket
+// ( 010315 masahiro minami<elsur@aaa.letter.co.jp>)
+static void AsyncUDPPopEvent( UDPsocket sock )
+{
+ // Make sure OT calls are not interrupted
+ // Not sure if we really need this.
+ OTEnterNotifier( sock->channel );
+
+ sock->event |= (sock->curEvent = sock->newEvent );
+ sock->completion |= ( sock->curCompletion = sock->newCompletion );
+ sock->newEvent = sock->newCompletion = 0;
+
+ OTLeaveNotifier( sock->channel );
+
+ if( sock->curEvent & T_UDERR)
+ {
+ // We just clear the error.
+ // Should we feed this back to users ?
+ // (TODO )
+ OTRcvUDErr( sock->channel, NULL );
+ }
+
+ // Remote is disconnecting...
+ if( sock->curEvent & ( T_DISCONNECT | T_ORDREL ))
+ {
+ sock->readShutdown = true;
+ }
+
+ if( sock->curEvent &T_CONNECT)
+ {
+ // Ignore the info of remote (second parameter).
+ // Shoule we care ?
+ // (TODO)
+ OTRcvConnect( sock->channel, NULL );
+ }
+
+ if( sock->curEvent & T_ORDREL )
+ {
+ OTRcvOrderlyDisconnect( sock->channel );
+ }
+
+ if( sock->curEvent & T_DISCONNECT )
+ {
+ OTRcvDisconnect( sock->channel, NULL );
+ }
+
+ // Should we ??
+ // (010318 masahiro minami<elsur@aaa.letter.co.jp>
+ //YieldToAnyThread();
+}
+
+/* Create a new UDPsocket */
+// Because TCPsocket structure gets bigger and bigger,
+// I think we'd better have a constructor function and delete function.
+// ( 01/02/25 masahiro minami<elsur@aaa.letter.co.jp> )
+/*static*/ UDPsocket AsyncUDPNewSocket()
+{
+ UDPsocket sock;
+
+ sock = (UDPsocket)malloc(sizeof(*sock));
+ if ( sock == NULL ) {
+ SDLNet_SetError("Out of memory");
+ return NULL;
+ }
+
+ sock->newEvent = 0;
+ sock->event = 0;
+ sock->curEvent = 0;
+ sock->newCompletion = 0;
+ sock->completion = 0;
+ sock->curCompletion = 0;
+ //sock->info = NULL;
+ sock->readShutdown = sock->writeShutdown = false;
+ sock->error = 0;
+ sock->config = NULL;
+
+ return sock;
+}
+
+#endif /* MACOS_OPENTRANSPORT */
+
+/* Allocate/free a single UDP packet 'size' bytes long.
+ The new packet is returned, or NULL if the function ran out of memory.
+ */
+extern UDPpacket *SDLNet_AllocPacket(int size)
+{
+ UDPpacket *packet;
+ int error;
+
+
+ error = 1;
+ packet = (UDPpacket *)malloc(sizeof(*packet));
+ if ( packet != NULL ) {
+ packet->maxlen = size;
+ packet->data = (Uint8 *)malloc(size);
+ if ( packet->data != NULL ) {
+ error = 0;
+ }
+ }
+ if ( error ) {
+ SDLNet_FreePacket(packet);
+ packet = NULL;
+ }
+ return(packet);
+}
+int SDLNet_ResizePacket(UDPpacket *packet, int newsize)
+{
+ Uint8 *newdata;
+
+ newdata = (Uint8 *)malloc(newsize);
+ if ( newdata != NULL ) {
+ free(packet->data);
+ packet->data = newdata;
+ packet->maxlen = newsize;
+ }
+ return(packet->maxlen);
+}
+extern void SDLNet_FreePacket(UDPpacket *packet)
+{
+ if ( packet ) {
+ if ( packet->data )
+ free(packet->data);
+ free(packet);
+ }
+}
+
+/* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets,
+ each 'size' bytes long.
+ A pointer to the packet array is returned, or NULL if the function ran out
+ of memory.
+ */
+UDPpacket **SDLNet_AllocPacketV(int howmany, int size)
+{
+ UDPpacket **packetV;
+
+ packetV = (UDPpacket **)malloc((howmany+1)*sizeof(*packetV));
+ if ( packetV != NULL ) {
+ int i;
+ for ( i=0; i<howmany; ++i ) {
+ packetV[i] = SDLNet_AllocPacket(size);
+ if ( packetV[i] == NULL ) {
+ break;
+ }
+ }
+ packetV[i] = NULL;
+
+ if ( i != howmany ) {
+ SDLNet_FreePacketV(packetV);
+ packetV = NULL;
+ }
+ }
+ return(packetV);
+}
+void SDLNet_FreePacketV(UDPpacket **packetV)
+{
+ if ( packetV ) {
+ int i;
+ for ( i=0; packetV[i]; ++i ) {
+ SDLNet_FreePacket(packetV[i]);
+ }
+ free(packetV);
+ }
+}
+
+/* Since the UNIX/Win32/BeOS code is so different from MacOS,
+ we'll just have two completely different sections here.
+*/
+
+/* Open a UDP network socket
+ If 'port' is non-zero, the UDP socket is bound to a fixed local port.
+*/
+extern UDPsocket SDLNet_UDP_Open(Uint16 port)
+{
+ UDPsocket sock;
+#ifdef MACOS_OPENTRANSPORT
+ EndpointRef dummy = NULL;
+#endif
+
+ /* Allocate a UDP socket structure */
+ sock = (UDPsocket)malloc(sizeof(*sock));
+ if ( sock == NULL ) {
+ SDLNet_SetError("Out of memory");
+ goto error_return;
+ }
+ memset(sock, 0, sizeof(*sock));
+
+ /* Open the socket */
+#ifdef MACOS_OPENTRANSPORT
+ {
+ sock->error = OTAsyncOpenEndpoint(
+ OTCreateConfiguration(kUDPName),0, &(sock->info),
+ (OTNotifyProcPtr)AsyncUDPNotifier, sock );
+ AsyncUDPPopEvent( sock );
+ while( !sock->error && !( sock->completion & CompleteMask(T_OPENCOMPLETE)))
+ {
+ AsyncUDPPopEvent( sock );
+ }
+ if( sock->error )
+ {
+ SDLNet_SetError("Could not open UDP socket");
+ goto error_return;
+ }
+ // Should we ??
+ // (01/05/03 minami<elsur@aaa.letter.co.jp>
+ OTSetBlocking( sock->channel );
+ }
+#else
+ sock->channel = socket(AF_INET, SOCK_DGRAM, 0);
+#endif /* MACOS_OPENTRANSPORT */
+
+ if ( sock->channel == INVALID_SOCKET )
+ {
+ SDLNet_SetError("Couldn't create socket");
+ goto error_return;
+ }
+
+#ifdef MACOS_OPENTRANSPORT
+ {
+ InetAddress required, assigned;
+ TBind req_addr, assigned_addr;
+ OSStatus status;
+ InetInterfaceInfo info;
+
+ memset(&assigned_addr, 0, sizeof(assigned_addr));
+ assigned_addr.addr.maxlen = sizeof(assigned);
+ assigned_addr.addr.len = sizeof(assigned);
+ assigned_addr.addr.buf = (UInt8 *) &assigned;
+
+ if ( port ) {
+ status = OTInetGetInterfaceInfo( &info, kDefaultInetInterface );
+ if( status != kOTNoError )
+ goto error_return;
+ OTInitInetAddress(&required, port, info.fAddress );
+ req_addr.addr.maxlen = sizeof( required );
+ req_addr.addr.len = sizeof( required );
+ req_addr.addr.buf = (UInt8 *) &required;
+
+ sock->error = OTBind(sock->channel, &req_addr, &assigned_addr);
+ } else {
+ sock->error = OTBind(sock->channel, nil, &assigned_addr );
+ }
+ AsyncUDPPopEvent(sock);
+
+ while( !sock->error && !(sock->completion & CompleteMask(T_BINDCOMPLETE)))
+ {
+ AsyncUDPPopEvent(sock);
+ }
+ if (sock->error != noErr)
+ {
+ SDLNet_SetError("Couldn't bind to local port, OTBind() = %d",(int) status);
+ goto error_return;
+ }
+
+ sock->address.host = assigned.fHost;
+ sock->address.port = assigned.fPort;
+
+#ifdef DEBUG_NET
+ printf("UDP open host = %d, port = %d\n", assigned.fHost, assigned.fPort );
+#endif
+ }
+#else
+ /* Bind locally, if appropriate */
+ if ( port )
+ {
+ struct sockaddr_in sock_addr;
+ memset(&sock_addr, 0, sizeof(sock_addr));
+ sock_addr.sin_family = AF_INET;
+ sock_addr.sin_addr.s_addr = INADDR_ANY;
+ sock_addr.sin_port = SDL_SwapBE16(port);
+
+ /* Bind the socket for listening */
+ if ( bind(sock->channel, (struct sockaddr *)&sock_addr,
+ sizeof(sock_addr)) == SOCKET_ERROR ) {
+ SDLNet_SetError("Couldn't bind to local port");
+ goto error_return;
+ }
+ /* Fill in the channel host address */
+ sock->address.host = sock_addr.sin_addr.s_addr;
+ sock->address.port = sock_addr.sin_port;
+ }
+
+#ifdef SO_BROADCAST
+ /* Allow LAN broadcasts with the socket */
+ { int yes = 1;
+ setsockopt(sock->channel, SOL_SOCKET, SO_BROADCAST, (char*)&yes, sizeof(yes));
+ }
+#endif
+#endif /* MACOS_OPENTRANSPORT */
+
+ /* The socket is ready */
+
+ return(sock);
+
+error_return:
+#ifdef MACOS_OPENTRANSPORT
+ if( dummy )
+ OTCloseProvider( dummy );
+#endif
+ SDLNet_UDP_Close(sock);
+
+ return(NULL);
+}
+
+/* Verify that the channel is in the valid range */
+static int ValidChannel(int channel)
+{
+ if ( (channel < 0) || (channel >= SDLNET_MAX_UDPCHANNELS) ) {
+ SDLNet_SetError("Invalid channel");
+ return(0);
+ }
+ return(1);
+}
+
+/* Bind the address 'address' to the requested channel on the UDP socket.
+ If the channel is -1, then the first unbound channel will be bound with
+ the given address as it's primary address.
+ If the channel is already bound, this new address will be added to the
+ list of valid source addresses for packets arriving on the channel.
+ If the channel is not already bound, then the address becomes the primary
+ address, to which all outbound packets on the channel are sent.
+ This function returns the channel which was bound, or -1 on error.
+*/
+int SDLNet_UDP_Bind(UDPsocket sock, int channel, IPaddress *address)
+{
+ struct UDP_channel *binding;
+
+ if ( channel == -1 ) {
+ for ( channel=0; channel < SDLNET_MAX_UDPCHANNELS; ++channel ) {
+ binding = &sock->binding[channel];
+ if ( binding->numbound < SDLNET_MAX_UDPADDRESSES ) {
+ break;
+ }
+ }
+ } else {
+ if ( ! ValidChannel(channel) ) {
+ return(-1);
+ }
+ binding = &sock->binding[channel];
+ }
+ if ( binding->numbound == SDLNET_MAX_UDPADDRESSES ) {
+ SDLNet_SetError("No room for new addresses");
+ return(-1);
+ }
+ binding->address[binding->numbound++] = *address;
+ return(channel);
+}
+
+/* Unbind all addresses from the given channel */
+void SDLNet_UDP_Unbind(UDPsocket sock, int channel)
+{
+ if ( (channel >= 0) && (channel < SDLNET_MAX_UDPCHANNELS) ) {
+ sock->binding[channel].numbound = 0;
+ }
+}
+
+/* Get the primary IP address of the remote system associated with the
+ socket and channel.
+ If the channel is not bound, this function returns NULL.
+ */
+IPaddress *SDLNet_UDP_GetPeerAddress(UDPsocket sock, int channel)
+{
+ IPaddress *address;
+
+ address = NULL;
+ switch (channel) {
+ case -1:
+ /* Return the actual address of the socket */
+ address = &sock->address;
+ break;
+ default:
+ /* Return the address of the bound channel */
+ if ( ValidChannel(channel) &&
+ (sock->binding[channel].numbound > 0) ) {
+ address = &sock->binding[channel].address[0];
+ }
+ break;
+ }
+ return(address);
+}
+
+/* Send a vector of packets to the the channels specified within the packet.
+ If the channel specified in the packet is -1, the packet will be sent to
+ the address in the 'src' member of the packet.
+ Each packet will be updated with the status of the packet after it has
+ been sent, -1 if the packet send failed.
+ This function returns the number of packets sent.
+*/
+int SDLNet_UDP_SendV(UDPsocket sock, UDPpacket **packets, int npackets)
+{
+ int numsent, i, j;
+ struct UDP_channel *binding;
+ int status;
+#ifndef MACOS_OPENTRANSPORT
+ int sock_len;
+ struct sockaddr_in sock_addr;
+
+ /* Set up the variables to send packets */
+ sock_len = sizeof(sock_addr);
+#endif
+
+ numsent = 0;
+ for ( i=0; i<npackets; ++i )
+ {
+ /* if channel is < 0, then use channel specified in sock */
+
+ if ( packets[i]->channel < 0 )
+ {
+#ifdef MACOS_OPENTRANSPORT
+ TUnitData OTpacket;
+ InetAddress address;
+
+ memset(&OTpacket, 0, sizeof(OTpacket));
+ OTpacket.addr.buf = (Uint8 *)&address;
+ OTpacket.addr.len = (sizeof address);
+ OTpacket.udata.buf = packets[i]->data;
+ OTpacket.udata.len = packets[i]->len;
+ OTInitInetAddress(&address, packets[i]->address.port, packets[i]->address.host);
+#ifdef DEBUG_NET
+ printf("Packet send address: 0x%8.8x:%d, length = %d\n", packets[i]->address.host, packets[i]->address.port, packets[i]->len);
+#endif
+
+ status = OTSndUData(sock->channel, &OTpacket);
+#ifdef DEBUG_NET
+ printf("SDLNet_UDP_SendV OTSndUData return value is ;%d\n", status );
+#endif
+
+ AsyncUDPPopEvent( sock );
+ packets[i]->status = status;
+
+ if (status == noErr)
+ {
+ ++numsent;
+ }
+#else
+ sock_addr.sin_addr.s_addr = packets[i]->address.host;
+ sock_addr.sin_port = packets[i]->address.port;
+ sock_addr.sin_family = AF_INET;
+ status = sendto(sock->channel,
+ packets[i]->data, packets[i]->len, 0,
+ (struct sockaddr *)&sock_addr,sock_len);
+ if ( status >= 0 )
+ {
+ packets[i]->status = status;
+ ++numsent;
+ }
+#endif /* MACOS_OPENTRANSPORT */
+ }
+ else
+ {
+ /* Send to each of the bound addresses on the channel */
+#ifdef DEBUG_NET
+ printf("SDLNet_UDP_SendV sending packet to channel = %d\n", packets[i]->channel );
+#endif
+
+ binding = &sock->binding[packets[i]->channel];
+
+ for ( j=binding->numbound-1; j>=0; --j )
+ {
+#ifdef MACOS_OPENTRANSPORT
+ TUnitData OTpacket;
+ InetAddress address;
+
+ OTInitInetAddress(&address, binding->address[j].port,binding->address[j].host);
+#ifdef DEBUG_NET
+ printf("Packet send address: 0x%8.8x:%d, length = %d\n", binding->address[j].host, binding->address[j].port, packets[i]->len);
+#endif
+ memset(&OTpacket, 0, sizeof(OTpacket));
+ OTpacket.addr.buf = (Uint8 *)&address;
+ OTpacket.addr.len = (sizeof address);
+ OTpacket.udata.buf = packets[i]->data;
+ OTpacket.udata.len = packets[i]->len;
+
+ status = OTSndUData(sock->channel, &OTpacket);
+#ifdef DEBUG_NET
+ printf("SDLNet_UDP_SendV OTSndUData returne value is;%d\n", status );
+#endif
+ AsyncUDPPopEvent(sock);
+ packets[i]->status = status;
+
+ if (status == noErr)
+ {
+ ++numsent;
+ }
+
+#else
+ sock_addr.sin_addr.s_addr = binding->address[j].host;
+ sock_addr.sin_port = binding->address[j].port;
+ sock_addr.sin_family = AF_INET;
+ status = sendto(sock->channel,
+ packets[i]->data, packets[i]->len, 0,
+ (struct sockaddr *)&sock_addr,sock_len);
+ if ( status >= 0 )
+ {
+ packets[i]->status = status;
+ ++numsent;
+ }
+#endif /* MACOS_OPENTRANSPORT */
+ }
+ }
+ }
+
+ return(numsent);
+}
+
+int SDLNet_UDP_Send(UDPsocket sock, int channel, UDPpacket *packet)
+{
+ /* This is silly, but... */
+ packet->channel = channel;
+ return(SDLNet_UDP_SendV(sock, &packet, 1));
+}
+
+/* Returns true if a socket is has data available for reading right now */
+static int SocketReady(SOCKET sock)
+{
+ int retval = 0;
+#ifdef MACOS_OPENTRANSPORT
+ OTResult status;
+#else
+ struct timeval tv;
+ fd_set mask;
+#endif
+
+#ifdef MACOS_OPENTRANSPORT
+ //status = OTGetEndpointState(sock);
+ status = OTLook(sock);
+ if( status > 0 )
+ retval = 1;
+
+/* switch( status )
+ {
+// case T_IDLE:
+ case T_DATAXFER:
+// case T_INREL:
+ retval = 1;
+ break;
+ default:
+ OTCountDataBytes( sock, &numBytes );
+ if( numBytes )
+ retval = 1;
+ }*/
+#else
+ /* Check the file descriptors for available data */
+ do {
+ errno = 0;
+
+ /* Set up the mask of file descriptors */
+ FD_ZERO(&mask);
+ FD_SET(sock, &mask);
+
+ /* Set up the timeout */
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+
+ /* Look! */
+ retval = select(sock+1, &mask, NULL, NULL, &tv);
+ } while ( errno == EINTR );
+#endif /* MACOS_OPENTRANSPORT */
+
+ return(retval == 1);
+}
+
+/* Receive a vector of pending packets from the UDP socket.
+ The returned packets contain the source address and the channel they arrived
+ on. If they did not arrive on a bound channel, the the channel will be set
+ to -1.
+ This function returns the number of packets read from the network, or -1
+ on error. This function does not block, so can return 0 packets pending.
+*/
+extern int SDLNet_UDP_RecvV(UDPsocket sock, UDPpacket **packets)
+{
+ int numrecv, i, j;
+ struct UDP_channel *binding;
+#ifdef MACOS_OPENTRANSPORT
+ TUnitData OTpacket;
+ OTFlags flags;
+ InetAddress address;
+#else
+ int sock_len;
+ struct sockaddr_in sock_addr;
+#endif
+
+ numrecv = 0;
+ while ( packets[numrecv] && SocketReady(sock->channel) )
+ {
+ UDPpacket *packet;
+
+ packet = packets[numrecv];
+
+#ifdef MACOS_OPENTRANSPORT
+ memset(&OTpacket, 0, sizeof(OTpacket));
+ OTpacket.addr.buf = (Uint8 *)&address;
+ OTpacket.addr.maxlen = (sizeof address);
+ OTpacket.udata.buf = packet->data;
+ OTpacket.udata.maxlen = packet->maxlen;
+
+ packet->status = OTRcvUData(sock->channel, &OTpacket, &flags);
+#ifdef DEBUG_NET
+ printf("Packet status: %d\n", packet->status);
+#endif
+ AsyncUDPPopEvent(sock);
+ if (packet->status == noErr)
+ {
+ packet->len = OTpacket.udata.len;
+ packet->address.host = address.fHost;
+ packet->address.port = address.fPort;
+#ifdef DEBUG_NET
+ printf("Packet address: 0x%8.8x:%d, length = %d\n", packet->address.host, packet->address.port, packet->len);
+#endif
+ }
+#else
+ sock_len = sizeof(sock_addr);
+ packet->status = recvfrom(sock->channel,
+ packet->data, packet->maxlen, 0,
+ (struct sockaddr *)&sock_addr,
+#ifdef USE_GUSI_SOCKETS
+ (unsigned int *)&sock_len);
+#else
+ &sock_len);
+#endif
+ if ( packet->status >= 0 ) {
+ packet->len = packet->status;
+ packet->address.host = sock_addr.sin_addr.s_addr;
+ packet->address.port = sock_addr.sin_port;
+ }
+#endif
+ if (packet->status >= 0)
+ {
+ packet->channel = -1;
+
+ for (i=(SDLNET_MAX_UDPCHANNELS-1); i>=0; --i )
+ {
+ binding = &sock->binding[i];
+
+ for ( j=binding->numbound-1; j>=0; --j )
+ {
+ if ( (packet->address.host == binding->address[j].host) &&
+ (packet->address.port == binding->address[j].port) )
+ {
+ packet->channel = i;
+ goto foundit; /* break twice */
+ }
+ }
+ }
+foundit:
+ ++numrecv;
+ }
+
+ else
+ {
+ packet->len = 0;
+ }
+ }
+
+ sock->ready = 0;
+
+ return(numrecv);
+}
+
+/* Receive a single packet from the UDP socket.
+ The returned packet contains the source address and the channel it arrived
+ on. If it did not arrive on a bound channel, the the channel will be set
+ to -1.
+ This function returns the number of packets read from the network, or -1
+ on error. This function does not block, so can return 0 packets pending.
+*/
+int SDLNet_UDP_Recv(UDPsocket sock, UDPpacket *packet)
+{
+ UDPpacket *packets[2];
+
+ /* Receive a packet array of 1 */
+ packets[0] = packet;
+ packets[1] = NULL;
+ return(SDLNet_UDP_RecvV(sock, packets));
+}
+
+/* Close a UDP network socket */
+extern void SDLNet_UDP_Close(UDPsocket sock)
+{
+ if ( sock != NULL )
+ {
+ if ( sock->channel != INVALID_SOCKET )
+ {
+#ifdef MACOS_OPENTRANSPORT
+ OTUnbind(sock->channel);
+ OTCloseProvider(sock->channel);
+#else
+ closesocket(sock->channel);
+#endif /* MACOS_OPENTRANSPORT */
+ }
+
+ free(sock);
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/SDLnetselect.c Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,226 @@
+/*
+ SDL_net: An example cross-platform network library for use with SDL
+ Copyright (C) 1997-2004 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* $Id: SDLnetselect.c 1192 2004-01-04 17:41:55Z slouken $ */
+
+#include "SDLnetsys.h"
+#include "SDL_net.h"
+
+/* The select() API for network sockets */
+
+struct SDLNet_Socket {
+ int ready;
+ SOCKET channel;
+#ifdef MACOS_OPENTRANSPORT
+ OTEventCode curEvent;
+#endif
+};
+
+struct _SDLNet_SocketSet {
+ int numsockets;
+ int maxsockets;
+ struct SDLNet_Socket **sockets;
+};
+
+/* Allocate a socket set for use with SDLNet_CheckSockets()
+ This returns a socket set for up to 'maxsockets' sockets, or NULL if
+ the function ran out of memory.
+ */
+SDLNet_SocketSet SDLNet_AllocSocketSet(int maxsockets)
+{
+ struct _SDLNet_SocketSet *set;
+ int i;
+
+ set = (struct _SDLNet_SocketSet *)malloc(sizeof(*set));
+ if ( set != NULL ) {
+ set->numsockets = 0;
+ set->maxsockets = maxsockets;
+ set->sockets = (struct SDLNet_Socket **)malloc
+ (maxsockets*sizeof(*set->sockets));
+ if ( set->sockets != NULL ) {
+ for ( i=0; i<maxsockets; ++i ) {
+ set->sockets[i] = NULL;
+ }
+ } else {
+ free(set);
+ set = NULL;
+ }
+ }
+ return(set);
+}
+
+/* Add a socket to a set of sockets to be checked for available data */
+int SDLNet_AddSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock)
+{
+ if ( sock != NULL ) {
+ if ( set->numsockets == set->maxsockets ) {
+ SDLNet_SetError("socketset is full");
+ return(-1);
+ }
+ set->sockets[set->numsockets++] = (struct SDLNet_Socket *)sock;
+ }
+ return(set->numsockets);
+}
+
+/* Remove a socket from a set of sockets to be checked for available data */
+int SDLNet_DelSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock)
+{
+ int i;
+
+ if ( sock != NULL ) {
+ for ( i=0; i<set->numsockets; ++i ) {
+ if ( set->sockets[i] == (struct SDLNet_Socket *)sock ) {
+ break;
+ }
+ }
+ if ( i == set->numsockets ) {
+ SDLNet_SetError("socket not found in socketset");
+ return(-1);
+ }
+ --set->numsockets;
+ for ( ; i<set->numsockets; ++i ) {
+ set->sockets[i] = set->sockets[i+1];
+ }
+ }
+ return(set->numsockets);
+}
+
+/* This function checks to see if data is available for reading on the
+ given set of sockets. If 'timeout' is 0, it performs a quick poll,
+ otherwise the function returns when either data is available for
+ reading, or the timeout in milliseconds has elapsed, which ever occurs
+ first. This function returns the number of sockets ready for reading,
+ or -1 if there was an error with the select() system call.
+*/
+#ifdef MACOS_OPENTRANSPORT
+int SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout)
+{
+Uint32 stop;
+int numReady;
+
+ /* Loop, polling the network devices */
+
+ stop = SDL_GetTicks() + timeout;
+
+ do
+ {
+ OTResult status;
+ size_t numBytes;
+ int i;
+
+ numReady = 0;
+
+ for (i = set->numsockets-1;i >= 0;--i)
+ {
+ status = OTLook( set->sockets[i]->channel );
+ if( status > 0 )
+ {
+ switch( status )
+ {
+ case T_UDERR:
+ OTRcvUDErr( set->sockets[i]->channel , nil);
+ break;
+ case T_DISCONNECT:
+ OTRcvDisconnect( set->sockets[i]->channel, nil );
+ break;
+ case T_ORDREL:
+ OTRcvOrderlyDisconnect(set->sockets[i]->channel );
+ break;
+ case T_CONNECT:
+ OTRcvConnect( set->sockets[i]->channel, nil );
+ break;
+
+
+ default:
+ set->sockets[i]->ready = 1;
+ ++numReady;
+ }
+ }
+ else if( OTCountDataBytes(set->sockets[i]->channel, &numBytes ) != kOTNoDataErr )
+ {
+ set->sockets[i]->ready = 1;
+ ++numReady;
+ }
+ else
+ set->sockets[i]->ready = 0;
+ }
+
+ } while (!numReady && (SDL_GetTicks() < stop));
+
+ return(numReady);
+}
+#else
+int SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout)
+{
+ int i;
+ SOCKET maxfd;
+ int retval;
+ struct timeval tv;
+ fd_set mask;
+
+ /* Find the largest file descriptor */
+ maxfd = 0;
+ for ( i=set->numsockets-1; i>=0; --i ) {
+ if ( set->sockets[i]->channel > maxfd ) {
+ maxfd = set->sockets[i]->channel;
+ }
+ }
+
+ /* Check the file descriptors for available data */
+ do {
+ errno = 0;
+
+ /* Set up the mask of file descriptors */
+ FD_ZERO(&mask);
+ for ( i=set->numsockets-1; i>=0; --i ) {
+ FD_SET(set->sockets[i]->channel, &mask);
+ }
+
+ /* Set up the timeout */
+ tv.tv_sec = timeout/1000;
+ tv.tv_usec = (timeout%1000)*1000;
+
+ /* Look! */
+ retval = select(maxfd+1, &mask, NULL, NULL, &tv);
+ } while ( errno == EINTR );
+
+ /* Mark all file descriptors ready that have data available */
+ if ( retval > 0 ) {
+ for ( i=set->numsockets-1; i>=0; --i ) {
+ if ( FD_ISSET(set->sockets[i]->channel, &mask) ) {
+ set->sockets[i]->ready = 1;
+ }
+ }
+ }
+ return(retval);
+}
+#endif /* MACOS_OPENTRANSPORT */
+
+/* Free a set of sockets allocated by SDL_NetAllocSocketSet() */
+extern void SDLNet_FreeSocketSet(SDLNet_SocketSet set)
+{
+ if ( set ) {
+ free(set->sockets);
+ free(set);
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/SDLnetsys.h Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,84 @@
+/*
+ SDL_net: An example cross-platform network library for use with SDL
+ Copyright (C) 1997-2004 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* $Id: SDLnetsys.h 1720 2005-11-23 07:57:10Z icculus $ */
+
+/* Include normal system headers */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef macintosh
+#ifndef USE_GUSI_SOCKETS
+#define MACOS_OPENTRANSPORT
+//#error Open Transport driver is broken
+#endif
+#endif /* macintosh */
+
+/* Include system network headers */
+#ifdef MACOS_OPENTRANSPORT
+#include <OpenTransport.h>
+#include <OpenTptInternet.h>
+#else
+#if defined(__WIN32__) || defined(WIN32)
+#define __USE_W32_SOCKETS
+#include <windows.h>
+#else /* UNIX */
+#ifdef __OS2__
+#include <types.h>
+#include <sys/ioctl.h>
+#endif
+#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#ifndef __BEOS__
+#include <arpa/inet.h>
+#endif
+#ifdef linux /* FIXME: what other platforms have this? */
+#include <netinet/tcp.h>
+#endif
+#include <netdb.h>
+#include <sys/socket.h>
+#endif /* WIN32 */
+#endif /* Open Transport */
+
+/* System-dependent definitions */
+#ifdef MACOS_OPENTRANSPORT
+//#define closesocket OTCloseProvider
+#define closesocket OTSndOrderlyDisconnect
+#define SOCKET EndpointRef
+#define INVALID_SOCKET kOTInvalidEndpointRef
+#else
+#ifndef __USE_W32_SOCKETS
+#ifdef __OS2__
+#define closesocket soclose
+#else /* !__OS2__ */
+#define closesocket close
+#endif /* __OS2__ */
+#define SOCKET int
+#define INVALID_SOCKET -1
+#define SOCKET_ERROR -1
+#endif /* __USE_W32_SOCKETS */
+#endif /* Open Transport */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/sdl_net/include/SDL_net.h Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,444 @@
+/*
+ SDL_net: An example cross-platform network library for use with SDL
+ Copyright (C) 1997-2004 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* $Id: SDL_net.h 3281 2007-07-15 05:58:56Z slouken $ */
+
+#ifndef _SDL_NET_H
+#define _SDL_NET_H
+
+#include "SDL.h"
+#include "SDL_endian.h"
+#include "SDL_version.h"
+#include "begin_code.h"
+
+
+
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
+*/
+#define SDL_NET_MAJOR_VERSION 1
+#define SDL_NET_MINOR_VERSION 2
+#define SDL_NET_PATCHLEVEL 7
+
+/* This macro can be used to fill a version structure with the compile-time
+ * version of the SDL_net library.
+ */
+#define SDL_NET_VERSION(X) \
+{ \
+ (X)->major = SDL_NET_MAJOR_VERSION; \
+ (X)->minor = SDL_NET_MINOR_VERSION; \
+ (X)->patch = SDL_NET_PATCHLEVEL; \
+}
+
+/* This function gets the version of the dynamically linked SDL_net library.
+ it should NOT be used to fill a version structure, instead you should
+ use the SDL_NET_VERSION() macro.
+ */
+extern DECLSPEC const SDL_version * SDLCALL SDLNet_Linked_Version(void);
+
+/* Initialize/Cleanup the network API
+ SDL must be initialized before calls to functions in this library,
+ because this library uses utility functions from the SDL library.
+*/
+extern DECLSPEC int SDLCALL SDLNet_Init(void);
+extern DECLSPEC void SDLCALL SDLNet_Quit(void);
+
+/***********************************************************************/
+/* IPv4 hostname resolution API */
+/***********************************************************************/
+
+typedef struct {
+ Uint32 host; /* 32-bit IPv4 host address */
+ Uint16 port; /* 16-bit protocol port */
+} IPaddress;
+
+/* Resolve a host name and port to an IP address in network form.
+ If the function succeeds, it will return 0.
+ If the host couldn't be resolved, the host portion of the returned
+ address will be INADDR_NONE, and the function will return -1.
+ If 'host' is NULL, the resolved host will be set to INADDR_ANY.
+ */
+#ifndef INADDR_ANY
+#define INADDR_ANY 0x00000000
+#endif
+#ifndef INADDR_NONE
+#define INADDR_NONE 0xFFFFFFFF
+#endif
+#ifndef INADDR_BROADCAST
+#define INADDR_BROADCAST 0xFFFFFFFF
+#endif
+extern DECLSPEC int SDLCALL SDLNet_ResolveHost(IPaddress *address, const char *host, Uint16 port);
+
+/* Resolve an ip address to a host name in canonical form.
+ If the ip couldn't be resolved, this function returns NULL,
+ otherwise a pointer to a static buffer containing the hostname
+ is returned. Note that this function is not thread-safe.
+*/
+extern DECLSPEC const char * SDLCALL SDLNet_ResolveIP(IPaddress *ip);
+
+
+/***********************************************************************/
+/* TCP network API */
+/***********************************************************************/
+
+typedef struct _TCPsocket *TCPsocket;
+
+/* Open a TCP network socket
+ If ip.host is INADDR_NONE or INADDR_ANY, this creates a local server
+ socket on the given port, otherwise a TCP connection to the remote
+ host and port is attempted. The address passed in should already be
+ swapped to network byte order (addresses returned from
+ SDLNet_ResolveHost() are already in the correct form).
+ The newly created socket is returned, or NULL if there was an error.
+*/
+extern DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Open(IPaddress *ip);
+
+/* Accept an incoming connection on the given server socket.
+ The newly created socket is returned, or NULL if there was an error.
+*/
+extern DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Accept(TCPsocket server);
+
+/* Get the IP address of the remote system associated with the socket.
+ If the socket is a server socket, this function returns NULL.
+*/
+extern DECLSPEC IPaddress * SDLCALL SDLNet_TCP_GetPeerAddress(TCPsocket sock);
+
+/* Send 'len' bytes of 'data' over the non-server socket 'sock'
+ This function returns the actual amount of data sent. If the return value
+ is less than the amount of data sent, then either the remote connection was
+ closed, or an unknown socket error occurred.
+*/
+extern DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket sock, const void *data,
+ int len);
+
+/* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
+ and store them in the buffer pointed to by 'data'.
+ This function returns the actual amount of data received. If the return
+ value is less than or equal to zero, then either the remote connection was
+ closed, or an unknown socket error occurred.
+*/
+extern DECLSPEC int SDLCALL SDLNet_TCP_Recv(TCPsocket sock, void *data, int maxlen);
+
+/* Close a TCP network socket */
+extern DECLSPEC void SDLCALL SDLNet_TCP_Close(TCPsocket sock);
+
+
+/***********************************************************************/
+/* UDP network API */
+/***********************************************************************/
+
+/* The maximum channels on a a UDP socket */
+#define SDLNET_MAX_UDPCHANNELS 32
+/* The maximum addresses bound to a single UDP socket channel */
+#define SDLNET_MAX_UDPADDRESSES 4
+
+typedef struct _UDPsocket *UDPsocket;
+typedef struct {
+ int channel; /* The src/dst channel of the packet */
+ Uint8 *data; /* The packet data */
+ int len; /* The length of the packet data */
+ int maxlen; /* The size of the data buffer */
+ int status; /* packet status after sending */
+ IPaddress address; /* The source/dest address of an incoming/outgoing packet */
+} UDPpacket;
+
+/* Allocate/resize/free a single UDP packet 'size' bytes long.
+ The new packet is returned, or NULL if the function ran out of memory.
+ */
+extern DECLSPEC UDPpacket * SDLCALL SDLNet_AllocPacket(int size);
+extern DECLSPEC int SDLCALL SDLNet_ResizePacket(UDPpacket *packet, int newsize);
+extern DECLSPEC void SDLCALL SDLNet_FreePacket(UDPpacket *packet);
+
+/* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets,
+ each 'size' bytes long.
+ A pointer to the first packet in the array is returned, or NULL if the
+ function ran out of memory.
+ */
+extern DECLSPEC UDPpacket ** SDLCALL SDLNet_AllocPacketV(int howmany, int size);
+extern DECLSPEC void SDLCALL SDLNet_FreePacketV(UDPpacket **packetV);
+
+
+/* Open a UDP network socket
+ If 'port' is non-zero, the UDP socket is bound to a local port.
+ The 'port' should be given in native byte order, but is used
+ internally in network (big endian) byte order, in addresses, etc.
+ This allows other systems to send to this socket via a known port.
+*/
+extern DECLSPEC UDPsocket SDLCALL SDLNet_UDP_Open(Uint16 port);
+
+/* Bind the address 'address' to the requested channel on the UDP socket.
+ If the channel is -1, then the first unbound channel will be bound with
+ the given address as it's primary address.
+ If the channel is already bound, this new address will be added to the
+ list of valid source addresses for packets arriving on the channel.
+ If the channel is not already bound, then the address becomes the primary
+ address, to which all outbound packets on the channel are sent.
+ This function returns the channel which was bound, or -1 on error.
+*/
+extern DECLSPEC int SDLCALL SDLNet_UDP_Bind(UDPsocket sock, int channel, IPaddress *address);
+
+/* Unbind all addresses from the given channel */
+extern DECLSPEC void SDLCALL SDLNet_UDP_Unbind(UDPsocket sock, int channel);
+
+/* Get the primary IP address of the remote system associated with the
+ socket and channel. If the channel is -1, then the primary IP port
+ of the UDP socket is returned -- this is only meaningful for sockets
+ opened with a specific port.
+ If the channel is not bound and not -1, this function returns NULL.
+ */
+extern DECLSPEC IPaddress * SDLCALL SDLNet_UDP_GetPeerAddress(UDPsocket sock, int channel);
+
+/* Send a vector of packets to the the channels specified within the packet.
+ If the channel specified in the packet is -1, the packet will be sent to
+ the address in the 'src' member of the packet.
+ Each packet will be updated with the status of the packet after it has
+ been sent, -1 if the packet send failed.
+ This function returns the number of packets sent.
+*/
+extern DECLSPEC int SDLCALL SDLNet_UDP_SendV(UDPsocket sock, UDPpacket **packets, int npackets);
+
+/* Send a single packet to the specified channel.
+ If the channel specified in the packet is -1, the packet will be sent to
+ the address in the 'src' member of the packet.
+ The packet will be updated with the status of the packet after it has
+ been sent.
+ This function returns 1 if the packet was sent, or 0 on error.
+
+ NOTE:
+ The maximum size of the packet is limited by the MTU (Maximum Transfer Unit)
+ of the transport medium. It can be as low as 250 bytes for some PPP links,
+ and as high as 1500 bytes for ethernet.
+*/
+extern DECLSPEC int SDLCALL SDLNet_UDP_Send(UDPsocket sock, int channel, UDPpacket *packet);
+
+/* Receive a vector of pending packets from the UDP socket.
+ The returned packets contain the source address and the channel they arrived
+ on. If they did not arrive on a bound channel, the the channel will be set
+ to -1.
+ The channels are checked in highest to lowest order, so if an address is
+ bound to multiple channels, the highest channel with the source address
+ bound will be returned.
+ This function returns the number of packets read from the network, or -1
+ on error. This function does not block, so can return 0 packets pending.
+*/
+extern DECLSPEC int SDLCALL SDLNet_UDP_RecvV(UDPsocket sock, UDPpacket **packets);
+
+/* Receive a single packet from the UDP socket.
+ The returned packet contains the source address and the channel it arrived
+ on. If it did not arrive on a bound channel, the the channel will be set
+ to -1.
+ The channels are checked in highest to lowest order, so if an address is
+ bound to multiple channels, the highest channel with the source address
+ bound will be returned.
+ This function returns the number of packets read from the network, or -1
+ on error. This function does not block, so can return 0 packets pending.
+*/
+extern DECLSPEC int SDLCALL SDLNet_UDP_Recv(UDPsocket sock, UDPpacket *packet);
+
+/* Close a UDP network socket */
+extern DECLSPEC void SDLCALL SDLNet_UDP_Close(UDPsocket sock);
+
+
+/***********************************************************************/
+/* Hooks for checking sockets for available data */
+/***********************************************************************/
+
+typedef struct _SDLNet_SocketSet *SDLNet_SocketSet;
+
+/* Any network socket can be safely cast to this socket type */
+typedef struct {
+ int ready;
+} *SDLNet_GenericSocket;
+
+/* Allocate a socket set for use with SDLNet_CheckSockets()
+ This returns a socket set for up to 'maxsockets' sockets, or NULL if
+ the function ran out of memory.
+ */
+extern DECLSPEC SDLNet_SocketSet SDLCALL SDLNet_AllocSocketSet(int maxsockets);
+
+/* Add a socket to a set of sockets to be checked for available data */
+#define SDLNet_TCP_AddSocket(set, sock) \
+ SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock)
+#define SDLNet_UDP_AddSocket(set, sock) \
+ SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock)
+extern DECLSPEC int SDLCALL SDLNet_AddSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock);
+
+/* Remove a socket from a set of sockets to be checked for available data */
+#define SDLNet_TCP_DelSocket(set, sock) \
+ SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
+#define SDLNet_UDP_DelSocket(set, sock) \
+ SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
+extern DECLSPEC int SDLCALL SDLNet_DelSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock);
+
+/* This function checks to see if data is available for reading on the
+ given set of sockets. If 'timeout' is 0, it performs a quick poll,
+ otherwise the function returns when either data is available for
+ reading, or the timeout in milliseconds has elapsed, which ever occurs
+ first. This function returns the number of sockets ready for reading,
+ or -1 if there was an error with the select() system call.
+*/
+extern DECLSPEC int SDLCALL SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout);
+
+/* After calling SDLNet_CheckSockets(), you can use this function on a
+ socket that was in the socket set, to find out if data is available
+ for reading.
+*/
+#define SDLNet_SocketReady(sock) \
+ ((sock != NULL) && ((SDLNet_GenericSocket)sock)->ready)
+
+/* Free a set of sockets allocated by SDL_NetAllocSocketSet() */
+extern DECLSPEC void SDLCALL SDLNet_FreeSocketSet(SDLNet_SocketSet set);
+
+
+/***********************************************************************/
+/* Platform-independent data conversion functions */
+/***********************************************************************/
+
+/* Write a 16/32 bit value to network packet buffer */
+extern DECLSPEC void SDLCALL SDLNet_Write16(Uint16 value, void *area);
+extern DECLSPEC void SDLCALL SDLNet_Write32(Uint32 value, void *area);
+
+/* Read a 16/32 bit value from network packet buffer */
+extern DECLSPEC Uint16 SDLCALL SDLNet_Read16(void *area);
+extern DECLSPEC Uint32 SDLCALL SDLNet_Read32(void *area);
+
+/***********************************************************************/
+/* Error reporting functions */
+/***********************************************************************/
+
+/* We'll use SDL's functions for error reporting */
+#define SDLNet_SetError SDL_SetError
+#define SDLNet_GetError SDL_GetError
+
+/* I'm eventually going to try to disentangle SDL_net from SDL, thus making
+ SDL_net an independent X-platform networking toolkit. Not today though....
+
+extern no_parse_DECLSPEC void SDLCALL SDLNet_SetError(const char *fmt, ...);
+extern no_parse_DECLSPEC char * SDLCALL SDLNet_GetError(void);
+*/
+
+
+/* Inline macro functions to read/write network data */
+
+/* Warning, some systems have data access alignment restrictions */
+#if defined(sparc) || defined(mips)
+#define SDL_DATA_ALIGNED 1
+#endif
+#ifndef SDL_DATA_ALIGNED
+#define SDL_DATA_ALIGNED 0
+#endif
+
+/* Write a 16 bit value to network packet buffer */
+#if !SDL_DATA_ALIGNED
+#define SDLNet_Write16(value, areap) \
+ (*(Uint16 *)(areap) = SDL_SwapBE16(value))
+#else
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define SDLNet_Write16(value, areap) \
+do \
+{ \
+ Uint8 *area = (Uint8 *)(areap); \
+ area[0] = (value >> 8) & 0xFF; \
+ area[1] = value & 0xFF; \
+} while ( 0 )
+#else
+#define SDLNet_Write16(value, areap) \
+do \
+{ \
+ Uint8 *area = (Uint8 *)(areap); \
+ area[1] = (value >> 8) & 0xFF; \
+ area[0] = value & 0xFF; \
+} while ( 0 )
+#endif
+#endif /* !SDL_DATA_ALIGNED */
+
+/* Write a 32 bit value to network packet buffer */
+#if !SDL_DATA_ALIGNED
+#define SDLNet_Write32(value, areap) \
+ *(Uint32 *)(areap) = SDL_SwapBE32(value);
+#else
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define SDLNet_Write32(value, areap) \
+do \
+{ \
+ Uint8 *area = (Uint8 *)(areap); \
+ area[0] = (value >> 24) & 0xFF; \
+ area[1] = (value >> 16) & 0xFF; \
+ area[2] = (value >> 8) & 0xFF; \
+ area[3] = value & 0xFF; \
+} while ( 0 )
+#else
+#define SDLNet_Write32(value, areap) \
+do \
+{ \
+ Uint8 *area = (Uint8 *)(areap); \
+ area[3] = (value >> 24) & 0xFF; \
+ area[2] = (value >> 16) & 0xFF; \
+ area[1] = (value >> 8) & 0xFF; \
+ area[0] = value & 0xFF; \
+} while ( 0 )
+#endif
+#endif /* !SDL_DATA_ALIGNED */
+
+/* Read a 16 bit value from network packet buffer */
+#if !SDL_DATA_ALIGNED
+#define SDLNet_Read16(areap) \
+ (SDL_SwapBE16(*(Uint16 *)(areap)))
+#else
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define SDLNet_Read16(areap) \
+ ((((Uint8 *)areap)[0] << 8) | ((Uint8 *)areap)[1] << 0)
+#else
+#define SDLNet_Read16(areap) \
+ ((((Uint8 *)areap)[1] << 8) | ((Uint8 *)areap)[0] << 0)
+#endif
+#endif /* !SDL_DATA_ALIGNED */
+
+/* Read a 32 bit value from network packet buffer */
+#if !SDL_DATA_ALIGNED
+#define SDLNet_Read32(areap) \
+ (SDL_SwapBE32(*(Uint32 *)(areap)))
+#else
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define SDLNet_Read32(areap) \
+ ((((Uint8 *)areap)[0] << 24) | (((Uint8 *)areap)[1] << 16) | \
+ (((Uint8 *)areap)[2] << 8) | ((Uint8 *)areap)[3] << 0)
+#else
+#define SDLNet_Read32(areap) \
+ ((((Uint8 *)areap)[3] << 24) | (((Uint8 *)areap)[2] << 16) | \
+ (((Uint8 *)areap)[1] << 8) | ((Uint8 *)areap)[0] << 0)
+#endif
+#endif /* !SDL_DATA_ALIGNED */
+
+#ifdef MACOS_OPENTRANSPORT
+#endif
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_NET_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/src/Android.mk Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := main
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/../SDL/include
+
+# Add your application source files here...
+LOCAL_SRC_FILES := ../SDL/src/main/android/SDL_android_main.cpp hedgewars_main.c
+
+LOCAL_SHARED_LIBRARIES := SDL
+
+LOCAL_LDLIBS := -llog -lGLESv1_CM
+
+include $(BUILD_SHARED_LIBRARY)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,40 @@
+
+#include "android/log.h"
+#include "SDL.h"
+#include "dlfcn.h"
+#include "GLES/gl.h"
+
+#define TAG "HWEngine Loader"
+
+typedef (*HWEngine_Game)(char**);
+
+main(int argc, char *argv[]){
+ void *handle;
+ char *error;
+ HWEngine_Game Game;
+
+
+ __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine being loaded");
+ handle = dlopen("libhwengine.so", RTLD_NOW|RTLD_GLOBAL);
+ if(!handle){
+ __android_log_print(ANDROID_LOG_INFO, "foo", dlerror());
+ __android_log_print(ANDROID_LOG_INFO, "foo", "error dlopen");
+ exit(EXIT_FAILURE);
+ }
+ dlerror();
+
+ __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine successfully loaded..");
+
+
+ Game = (HWEngine_Game) dlsym(handle,"Game");
+ if((error = dlerror()) != NULL){
+ __android_log_print(ANDROID_LOG_INFO, "foo", error);
+ __android_log_print(ANDROID_LOG_INFO, "foo", "error dlsym");
+ exit(EXIT_FAILURE);
+ }
+ __android_log_print(ANDROID_LOG_INFO, "foo", "dlsym succeeded");
+ Game(argv);
+ __android_log_print(ANDROID_LOG_INFO, "foo", "Game() succeeded");
+
+ dlclose(handle);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/local.properties Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must *NOT* be checked in Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk.dir=/home/richard/SoftDev/android/android-sdk-linux_86
Binary file project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/background.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/icon.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/backbutton.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/background.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot1.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot2.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot3.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot4.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot5.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/box.9.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/dice.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/dropdown.9.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/edit.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/fort.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/human.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/icon.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/playsound.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/savebutton.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/settings.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/startgamebutton.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/statusbar.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount0.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount1.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount2.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount3.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount4.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount5.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount6.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount7.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount8.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount9.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/background.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/fort.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/icon.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-normal-ldpi/icon.png has changed
Binary file project_files/Android-build/SDL-android-project/res/drawable-xlarge-mdpi/background.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/backbutton.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <ImageButton
+ android:id="@+id/btnBack"
+ android:layout_width="120dip"
+ android:layout_height="40dip"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:src="@drawable/backbutton"/>
+</merge>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/background.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+<ImageView
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:scaleType="center"
+ android:src="@drawable/background"/>
+</merge>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/config.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <ListView
+ android:id="@+id/listView"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"/>
+
+</RelativeLayout>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/download.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/container"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:padding="5dp">
+ <ProgressBar
+ android:id="@+id/progressbar"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignLeft="@+id/background"
+ android:layout_alignRight="@+id/cancelDownload"
+ android:progressDrawable="@android:drawable/progress_horizontal"
+ android:indeterminate="false" android:indeterminateOnly="false"/>
+ <TextView
+ android:id="@+id/progressbar_sub"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/progressbar"
+ android:layout_alignLeft="@+id/background"
+ android:layout_alignRight="@+id/cancelDownload"
+ android:text="@string/notification_title"
+ android:textColor="#FFF"
+ android:textSize="14dp"/>
+ <Button
+ android:id="@id/background"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/progressbar_sub"
+ android:text="@string/download_background"/>
+ <Button
+ android:id="@+id/cancelDownload"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/progressbar_sub"
+ android:layout_toRightOf="@id/background"
+ android:text="@string/download_cancel"/>
+
+</RelativeLayout>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/listview_item.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textSize="10dip"
+ android:textColor="#FFF"
+ android:gravity="center"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/main.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Press download on first every launch, then startGame"
+ />
+
+ <Button
+ android:id="@+id/downloader"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="downloader"/>
+
+ <Button
+ android:id="@+id/startGame"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="startgame"/>
+
+</LinearLayout>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/notification.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="3dp">
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:scaleType="centerInside"
+ android:src="@drawable/icon"/>
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/icon"
+ android:text="@string/notification_title"
+ android:textColor="#000"
+ android:textSize="17dp"
+ android:textStyle="bold"/>
+
+ <TextView
+ android:id="@+id/progressbar_sub"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/icon"
+ android:layout_alignParentBottom="true"
+ android:text="@string/notification_title"
+ android:textColor="#000"
+ android:textSize="10dp"/>
+ <ProgressBar
+ android:id="@+id/notification_progress"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/icon"
+ android:layout_below="@id/title"
+ android:layout_above="@id/progressbar_sub"
+ android:progressDrawable="@android:drawable/progress_horizontal"
+ android:indeterminate="false" android:indeterminateOnly="false"
+ android:paddingRight="5dp"
+ android:paddingTop="5dp"/>
+
+</RelativeLayout>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/savebutton.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <ImageButton
+ android:id="@+id/btnSave"
+ android:layout_width="120dip"
+ android:layout_height="40dip"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:src="@drawable/savebutton"/>
+</merge>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/spinner_textimg_entry.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal">
+ <ImageView
+ android:id="@+id/spinner_img"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:layout_marginRight="5dip"
+ />
+ <TextView
+ android:id="@+id/spinner_txt"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="14dip"
+ android:textColor="#FFF"
+ android:gravity="center"/>
+</LinearLayout>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/starting_game.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <include
+ layout="@layout/background"/>
+
+ <ImageView
+ android:id="@+id/mapPreview"
+ android:layout_width="256dip"
+ android:layout_height="128dip"
+ android:layout_margin="5dip"
+ android:scaleType="fitXY"
+ android:background="@drawable/box"
+ android:src="@drawable/backbutton"/>
+
+ <Spinner
+ android:id="@+id/spinMaps"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_below="@id/mapPreview"
+ android:layout_alignRight="@id/mapPreview"
+ android:layout_toRightOf="@+id/txtMap"
+ android:background="@drawable/dropdown"/>
+ <TextView
+ android:id="@id/txtMap"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/start_map"
+ android:layout_alignTop="@id/spinMaps"
+ android:layout_alignBottom="@id/spinMaps"
+ android:layout_alignLeft="@id/mapPreview"
+ android:gravity="center"/>
+
+ <TableLayout
+ android:id="@+id/gameOptions"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_toRightOf="@id/mapPreview"
+ android:layout_alignParentRight="true"
+ android:padding="3dip"
+ android:layout_margin="5dip"
+ android:background="@drawable/box"
+ android:stretchColumns="0,2"
+ android:shrinkColumns="1">
+
+ <TableRow>
+ <TextView
+ android:id="@+id/txtGameplay"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="@string/start_gameplay"/>
+ <Spinner
+ android:id="@+id/spinGameplay"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:background="@drawable/dropdown"
+ />
+ </TableRow>
+ <TableRow>
+ <TextView
+ android:id="@+id/txtGamescheme"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="@string/start_gamescheme"/>
+ <Spinner
+ android:id="@+id/spinGamescheme"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:background="@drawable/dropdown"/>
+ <ImageButton
+ android:id="@+id/btnGamescheme"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:background="@drawable/edit"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:layout_gravity="center"
+ android:padding="3dip"/>
+ </TableRow>
+ <TableRow>
+ <TextView
+ android:id="@+id/txtweapons"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_below="@id/txtGamescheme"
+ android:layout_marginTop="5dip"
+ android:text="@string/start_weapons"/>
+
+ <Spinner
+ android:id="@+id/spinweapons"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:background="@drawable/dropdown"/>
+
+ <ImageButton
+ android:id="@+id/btnweapons"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:background="@drawable/edit"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:layout_gravity="center"
+ android:padding="3dip"/>
+ </TableRow>
+ </TableLayout>
+
+ <ImageView
+ android:id="@+id/imgTheme"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_alignTop="@+id/spinTheme"
+ android:layout_alignBottom="@id/spinTheme"
+ android:layout_alignLeft="@id/gameOptions"
+ android:adjustViewBounds="true"/>
+
+ <Spinner
+ android:id="@id/spinTheme"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_toRightOf="@+id/imgTheme"
+ android:layout_alignParentRight="true"
+ android:layout_below="@id/gameOptions"
+ android:background="@drawable/dropdown"/>
+
+ <include layout="@layout/backbutton"/>
+ <ImageButton
+ android:id="@+id/btnTeams"
+ android:layout_width="120dip"
+ android:layout_height="40dip"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:src="@drawable/teams"/>
+ <ImageButton
+ android:id="@+id/btnStart"
+ android:layout_width="120dip"
+ android:layout_height="40dip"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:src="@drawable/startgamebutton"/>
+
+</RelativeLayout>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_creation.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <include layout="@layout/background"/>
+ <LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="3dp">
+
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1">
+ <include layout="@layout/backbutton"/>
+ <include layout="@layout/savebutton"/>
+ <ScrollView
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_above="@+id/btnBack"
+ android:background="@drawable/box"
+ android:scrollbarFadeDuration="0">
+ <TableLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:stretchColumns="1"
+ android:layout_marginRight="4dip">
+ <TableRow android:padding="2dip">
+ <TextView
+ android:id="@+id/nameTag"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/name"/>
+ <EditText
+ android:id="@+id/txtName"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="3dip"
+ android:background="@drawable/box"
+ android:text="@string/name_default"
+ android:textColor="#FFF"/>
+ </TableRow>
+ <TableRow android:padding="2dip">
+ <TextView
+ android:id="@+id/typeTag"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_alignTop="@+id/spinType"
+ android:layout_alignBottom="@id/spinType"
+ android:gravity="center"
+ android:text="@string/type"/>
+ <Spinner
+ android:id="@id/spinType"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="3dip"
+ android:background="@drawable/dropdown"/>
+ </TableRow>
+ <TableRow android:padding="2dip">
+ <TextView
+ android:id="@+id/graveTag"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_alignTop="@+id/spinGrave"
+ android:layout_alignBottom="@id/spinGrave"
+ android:gravity="center"
+ android:text="@string/grave"/>
+ <Spinner
+ android:id="@id/spinGrave"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="3dip"
+ android:background="@drawable/dropdown"/>
+ </TableRow>
+ <TableRow android:padding="2dip">
+ <TextView
+ android:id="@+id/FlagTag"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_alignTop="@+id/spinFlag"
+ android:layout_alignBottom="@id/spinFlag"
+ android:gravity="center"
+ android:text="@string/flag"/>
+ <Spinner
+ android:id="@id/spinFlag"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="3dip"
+ android:background="@drawable/dropdown"/>
+ </TableRow>
+ <TableRow android:padding="2dip">
+ <TextView
+ android:id="@+id/voiceTag"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_alignTop="@+id/spinVoice"
+ android:layout_alignBottom="@id/spinVoice"
+ android:gravity="center"
+ android:text="@string/voice"/>
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="3dip">
+ <ImageButton
+ android:id="@+id/btnPlay"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:src="@drawable/playsound"
+ android:background="@android:color/transparent"/>
+ <Spinner
+ android:id="@+id/spinVoice"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_centerVertical="true"
+ android:layout_alignParentLeft="true"
+ android:layout_toLeftOf="@id/btnPlay"
+ android:background="@drawable/dropdown"/>
+ </RelativeLayout>
+ </TableRow>
+ <TableRow android:padding="2dip">
+ <TextView
+ android:id="@+id/fortTag"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="2dip"
+ android:gravity="top"
+ android:text="@string/fort"/>
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="3dip">
+ <Spinner
+ android:id="@+id/spinFort"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:background="@drawable/dropdown"/>
+ <ImageView
+ android:id="@+id/imgFort"
+ android:layout_width="128dip"
+ android:layout_height="128dip"
+ android:layout_centerHorizontal="true"
+ android:layout_below="@id/spinFort"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:src="@drawable/fort"/>
+
+ </RelativeLayout>
+ </TableRow>
+ </TableLayout>
+ </ScrollView>
+ </RelativeLayout>
+
+ <ScrollView
+ android:id="@+id/scroller"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:background="@drawable/box"
+ android:scrollbarFadeDuration="0">
+ <LinearLayout
+ android:id="@+id/HogsContainer"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <include layout="@layout/team_creation_entry"/>
+ <include layout="@layout/team_creation_entry"/>
+ <include layout="@layout/team_creation_entry"/>
+ <include layout="@layout/team_creation_entry"/>
+ <include layout="@layout/team_creation_entry"/>
+ <include layout="@layout/team_creation_entry"/>
+ <include layout="@layout/team_creation_entry"/>
+ <include layout="@layout/team_creation_entry"/>
+ </LinearLayout>
+ </ScrollView>
+ </LinearLayout>
+</FrameLayout>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_creation_entry.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/box"
+ android:layout_margin="3dp">
+ <Spinner
+ android:id="@+id/spinTeam1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_toRightOf="@+id/btnTeam1"
+ android:background="@drawable/dropdown"/>
+ <EditText
+ android:id="@+id/txtTeam1"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/spinTeam1"
+ android:background="@drawable/box"
+ android:gravity="center"
+ android:textColor="#FFF"
+ android:text="Arnold"/>
+ <ImageButton
+ android:id="@id/btnTeam1"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_alignLeft="@id/txtTeam1"
+ android:layout_above="@id/txtTeam1"
+ android:layout_alignTop="@id/spinTeam1"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:src="@drawable/dice"/>
+ </RelativeLayout>
+</merge>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selection_dialog.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+ <TextView
+ android:id="@+id/team_selection_dialog_select"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/select"/>
+ <TextView
+ android:id="@+id/team_selection_dialog_edit"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/edit"/>
+ <TextView
+ android:id="@+id/team_selection_dialog_delete"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/delete"/>
+</LinearLayout>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selection_entry.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="#8FFF"
+ android:padding="3dip">
+
+ <ImageView
+ android:id="@+id/imgDifficulty"
+ android:layout_height="fill_parent"
+ android:layout_width="wrap_content"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"/>
+ <ImageView
+ android:id="@+id/teamColor"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:src="@drawable/box"
+ android:background="#FDA"/>
+ <ImageView
+ android:id="@+id/teamCount"
+ android:layout_height="fill_parent"
+ android:layout_width="wrap_content"
+ android:layout_toLeftOf="@id/teamColor"
+ android:layout_alignTop="@id/imgDifficulty"
+ android:layout_alignBottom="@id/imgDifficulty"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:src="@drawable/teamcount7"/>
+ <TextView
+ android:id="@+id/txtName"
+ android:layout_height="fill_parent"
+ android:layout_width="wrap_content"
+ android:layout_toRightOf="@id/imgDifficulty"
+ android:layout_toLeftOf="@id/teamCount"
+ android:layout_alignTop="@id/imgDifficulty"
+ android:layout_alignBottom="@id/imgDifficulty"
+ android:gravity="center"
+ android:textColor="#FFF"/>
+</RelativeLayout>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selector.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <include layout="@layout/background"/>
+
+ <include layout="@layout/backbutton"/>
+
+ <ImageButton
+ android:id="@+id/btnAdd"
+ android:layout_width="wrap_content"
+ android:layout_height="50dip"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:adjustViewBounds="true"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:src="@drawable/settings"/>
+ <TextView
+ android:id="@+id/txtInfo"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:layout_alignParentBottom="true"
+ android:layout_toRightOf="@id/btnBack"
+ android:layout_toLeftOf="@id/btnAdd"
+ android:layout_alignTop="@id/btnBack"
+ android:layout_margin="3dp"
+ android:gravity="center"
+ android:background="@drawable/box"
+ android:text="bla"/>
+
+
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_above="@id/txtInfo"
+ android:layout_margin="3dp">
+
+ <ListView
+ android:id="@+id/selectedTeams"
+ android:layout_height="fill_parent"
+ android:layout_width="wrap_content"
+ android:layout_margin="3dp"
+ android:background="@drawable/box"
+ android:layout_weight="1"/>
+
+ <ListView
+ android:id="@+id/availableTeams"
+ android:layout_height="fill_parent"
+ android:layout_width="wrap_content"
+ android:layout_margin="3dp"
+ android:background="@drawable/box"
+ android:layout_weight="1"/>
+ </LinearLayout>
+</RelativeLayout>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/basicflags.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<basicflags>
+ <tflag>
+ <default>
+ <integer>100</integer>
+ </default>
+ <image>
+ <string>Health</string>
+ </image>
+ <max>
+ <integer>200</integer>
+ </max>
+ <min>
+ <integer>50</integer>
+ </min>
+ <title>
+ <string>Initial Health</string>
+ </title>
+ </tflag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$damagepct</string>
+ </command>
+ <default>
+ <integer>100</integer>
+ </default>
+ <image>
+ <string>Damage</string>
+ </image>
+ <max>
+ <integer>300</integer>
+ </max>
+ <min>
+ <integer>10</integer>
+ </min>
+ <title>
+ <string>Damage Modifier</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>true</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>true</boolean>
+ </times1000>
+ <command>
+ <string>e$turntime</string>
+ </command>
+ <default>
+ <integer>45</integer>
+ </default>
+ <image>
+ <string>Time</string>
+ </image>
+ <max>
+ <integer>100</integer>
+ </max>
+ <min>
+ <integer>1</integer>
+ </min>
+ <title>
+ <string>Turn Time</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>true</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$sd_turns</string>
+ </command>
+ <default>
+ <integer>15</integer>
+ </default>
+ <image>
+ <string>SuddenDeath</string>
+ </image>
+ <max>
+ <integer>50</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Sudden Death Timeout</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$waterrise</string>
+ </command>
+ <default>
+ <integer>47</integer>
+ </default>
+ <image>
+ <string>SuddenDeath</string>
+ </image>
+ <max>
+ <integer>100</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Water Rise Amount</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$healthdec</string>
+ </command>
+ <default>
+ <integer>5</integer>
+ </default>
+ <image>
+ <string>SuddenDeath</string>
+ </image>
+ <max>
+ <integer>100</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Health Decrease</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$ropepct</string>
+ </command>
+ <default>
+ <integer>100</integer>
+ </default>
+ <image>
+ <string>Rope</string>
+ </image>
+ <max>
+ <integer>999</integer>
+ </max>
+ <min>
+ <integer>25</integer>
+ </min>
+ <title>
+ <string>Rope Length (%)</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$casefreq</string>
+ </command>
+ <default>
+ <integer>5</integer>
+ </default>
+ <image>
+ <string>Box</string>
+ </image>
+ <max>
+ <integer>9</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Crate Drop Turns</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$healthprob</string>
+ </command>
+ <default>
+ <integer>35</integer>
+ </default>
+ <image>
+ <string>Health</string>
+ </image>
+ <max>
+ <integer>100</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Health Kit Probability (%)</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$hcaseamount</string>
+ </command>
+ <default>
+ <integer>25</integer>
+ </default>
+ <image>
+ <string>Health</string>
+ </image>
+ <max>
+ <integer>200</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Health Amount in Kit</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>true</boolean>
+ </times1000>
+ <command>
+ <string>e$minestime</string>
+ </command>
+ <default>
+ <integer>3</integer>
+ </default>
+ <image>
+ <string>Time</string>
+ </image>
+ <max>
+ <integer>5</integer>
+ </max>
+ <min>
+ <integer>-1</integer>
+ </min>
+ <title>
+ <string>Mines Time</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$minesnum</string>
+ </command>
+ <default>
+ <integer>4</integer>
+ </default>
+ <image>
+ <string>Mine</string>
+ </image>
+ <max>
+ <integer>80</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Mines Number</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$minedudpct</string>
+ </command>
+ <default>
+ <integer>0</integer>
+ </default>
+ <image>
+ <string>Dud</string>
+ </image>
+ <max>
+ <integer>100</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Dud Mines Probability (%)</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$explosives</string>
+ </command>
+ <default>
+ <integer>2</integer>
+ </default>
+ <image>
+ <string>Damage</string>
+ </image>
+ <max>
+ <integer>40</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Explosives</string>
+ </title>
+ </flag>
+ <flag>
+ <checkOverMax>
+ <boolean>false</boolean>
+ </checkOverMax>
+ <times1000>
+ <boolean>false</boolean>
+ </times1000>
+ <command>
+ <string>e$getawaytime</string>
+ </command>
+ <default>
+ <integer>100</integer>
+ </default>
+ <image>
+ <string>Time</string>
+ </image>
+ <max>
+ <integer>999</integer>
+ </max>
+ <min>
+ <integer>0</integer>
+ </min>
+ <title>
+ <string>Get Away Time (%)</string>
+ </title>
+ </flag>
+</basicflags>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_barrelmayhem.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Barrel Mayhem</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>30</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>0</integer>
+ <integer>35</integer>
+ <integer>25</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>40</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_cleanslate.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Clean Slate</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>45</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>5</integer>
+ <integer>35</integer>
+ <integer>25</integer>
+ <integer>3</integer>
+ <integer>4</integer>
+ <integer>0</integer>
+ <integer>2</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_default_scheme.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Default</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>45</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>5</integer>
+ <integer>35</integer>
+ <integer>25</integer>
+ <integer>3</integer>
+ <integer>4</integer>
+ <integer>0</integer>
+ <integer>2</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_fortmode.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Fort Mode</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>45</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>5</integer>
+ <integer>35</integer>
+ <integer>25</integer>
+ <integer>3</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_kingmode.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>King Mode</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>45</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>5</integer>
+ <integer>35</integer>
+ <integer>25</integer>
+ <integer>3</integer>
+ <integer>4</integer>
+ <integer>0</integer>
+ <integer>2</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_minefield.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Minefield</name>
+ <basicflags>
+ <integer>50</integer>
+ <integer>150</integer>
+ <integer>30</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>0</integer>
+ <integer>35</integer>
+ <integer>25</integer>
+ <integer>0</integer>
+ <integer>80</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_promode.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Pro Mode</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>15</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>0</integer>
+ <integer>35</integer>
+ <integer>25</integer>
+ <integer>3</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>2</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_shoppa.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Shoppa</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>300</integer>
+ <integer>50</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>1</integer>
+ <integer>0</integer>
+ <integer>35</integer>
+ <integer>3</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ <integer>0</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_thinkingwithportals.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Thinking with Portals</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>45</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>2</integer>
+ <integer>25</integer>
+ <integer>25</integer>
+ <integer>4</integer>
+ <integer>5</integer>
+ <integer>0</integer>
+ <integer>5</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_timeless.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Timeless</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>5</integer>
+ <integer>35</integer>
+ <integer>30</integer>
+ <integer>5</integer>
+ <integer>3</integer>
+ <integer>10</integer>
+ <integer>2</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_tunnelhogs.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+ <name>Tunnelhogs</name>
+ <basicflags>
+ <integer>100</integer>
+ <integer>100</integer>
+ <integer>30</integer>
+ <integer>15</integer>
+ <integer>47</integer>
+ <integer>5</integer>
+ <integer>100</integer>
+ <integer>5</integer>
+ <integer>35</integer>
+ <integer>3</integer>
+ <integer>25</integer>
+ <integer>10</integer>
+ <integer>10</integer>
+ <integer>10</integer>
+ </basicflags>
+ <gamemod>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <true/>
+ <false/>
+ <false/>
+ <true/>
+ <true/>
+ <true/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ <false/>
+ </gamemod>
+</scheme>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_clean Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+ <name>Clean</name>
+ <QT>
+ 101000900001000001100000000000000000000000000000100000
+ </QT>
+ <probability>
+ 040504054160065554655446477657666666615551010111541111
+ </probability>
+ <delay>
+ 000000000000000000000000000000000000000000000000000000
+ </delay>
+ <crate>
+ 131111031211111112311411111111111111121111110111111111
+ </crate>
+</weapon>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_crazy Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+ <name>Crazy</name>
+ <QT>
+ 999999999999999999299999999999999929999999990999999229
+ </QT>
+ <probability>
+ 111111011111111111111111111111111111111111110111111111
+ </probability>
+ <delay>
+ 000000000000000000000000000000000000000000000000000000
+ </delay>
+ <crate>
+ 131111031211111112311411111111111111121111010111111111
+ </crate>
+</weapon>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_default Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+ <name>Default</name>
+ <QT>
+ 939192942219912103223511100120100000021111010101111991
+ </QT>
+ <probability>
+ 040504054160065554655446477657666666615551010111541111
+ </probability>
+ <delay>
+ 000000000000020550000004000700400000000022000000060000
+ </delay>
+ <crate>
+ 131111031211111112311411111111111111121111110111111111
+ </crate>
+</weapon>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_mines Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+ <name>Mines</name>
+ <QT>
+ 000000990009000000030000000000000000000000000000000000
+ </QT>
+ <probability>
+ 000000000000000000000000000000000000000000000000000000
+ </probability>
+ <delay>
+ 000000000000020550000004000700400000000020000000060000
+ </delay>
+ <crate>
+ 111111111111111111111111111111111111111111110111111111
+ </crate>
+</weapon>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_portals Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+ <name>Portals</name>
+ <QT>
+ 900000900200000000210000000000000011000009000000000000
+ </QT>
+ <probability>
+ 040504054160065554655446477657666666615551010111541111
+ </probability>
+ <delay>
+ 000000000000020550000004000700400000000020000000060000
+ </delay>
+ <crate>
+ 131111031211111112311411111111111111121111110111111111
+ </crate>
+</weapon>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_promode Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+ <name>Pro Mode</name>
+ <QT>
+ 909000900000000000000900000000000000000000000000000000
+ </QT>
+ <probability>
+ 000000000000000000000000000000000000000000000000000000
+ </probability>
+ <delay>
+ 000000000000020550000004000700400000000020000000000000
+ </delay>
+ <crate>
+ 111111111111111111111111111111111111111110010111111111
+ </crate>
+</weapon>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_shoppa Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+ <name>Shoppa</name>
+ <QT>
+ 000000990000000000000000000000000000000000000000000000
+ </QT>
+ <probability>
+ 444441004424440221011212122242200000000200040001001111
+ </probability>
+ <delay>
+ 000000000000000000000000000000000000000000000000000000
+ </delay>
+ <crate>
+ 111111111111111111111111111111111111111110110111111111
+ </crate>
+</weapon>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/values/frontend_data_pointers.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+<array name="schemes">
+ <item>@raw/basicflags</item>
+ <item>@raw/scheme_default_scheme</item>
+ <item>@raw/scheme_barrelmayhem</item>
+ <item>@raw/scheme_cleanslate</item>
+ <item>@raw/scheme_fortmode</item>
+ <item>@raw/scheme_kingmode</item>
+ <item>@raw/scheme_minefield</item>
+ <item>@raw/scheme_promode</item>
+ <item>@raw/scheme_shoppa</item>
+ <item>@raw/scheme_thinkingwithportals</item>
+ <item>@raw/scheme_timeless</item>
+ <item>@raw/scheme_tunnelhogs</item>
+</array>
+
+<array name="weapons">
+ <item>@raw/weapon_default</item>
+ <item>@raw/weapon_clean</item>
+ <item>@raw/weapon_crazy</item>
+ <item>@raw/weapon_mines</item>
+ <item>@raw/weapon_portals</item>
+ <item>@raw/weapon_promode</item>
+ <item>@raw/weapon_shoppa</item>
+</array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/values/strings.xml Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Hedgewars</string>
+
+ <string name="select">Select</string>
+ <string name="edit">Edit</string>
+ <string name="delete">Delete</string>
+
+ <!-- SDCARD -->
+ <string name="sdcard_not_mounted">There\'s been an error when accessing the sdcard, is it connected to another computer?</string>
+
+ <!-- Notification -->
+ <string name="notification_title">Downloading hedgewars files...</string>
+ <string name="notification_done">Success - Download complete</string>
+
+ <!-- Download Activity -->
+ <string name="download_background">Continue in background</string>
+ <string name="download_cancel">Cancel</string>
+ <string name="download_done">Done</string>
+ <string name="download_back">Back to main menu</string>
+
+ <!-- start game -->
+
+ <string name="start_gameplay">Style</string>
+ <string name="start_gamescheme">Game scheme</string>
+ <string name="start_weapons">Weapons</string>
+ <string name="start_map">Map</string>
+ <string name="start_filter">Filter</string>
+ <string name="start_themes">Themes</string>
+
+ <!-- Settings -->
+ <string name="name">Name</string>
+ <string name="name_default">Unnamed</string>
+ <string name="type">Type</string>
+ <string name="grave">Grave</string>
+ <string name="flag">Flag</string>
+ <string name="voice">Voice</string>
+ <string name="fort">Fort</string>
+
+ <!-- Difficulty levels -->
+ <string name="human">Human</string>
+ <string name="bot5">Level 5</string>
+ <string name="bot4">Level 4</string>
+ <string name="bot3">Level 3</string>
+ <string name="bot2">Level 2</string>
+ <string name="bot1">Level 1</string>
+
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/Downloader/DownloadActivity.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,141 @@
+package org.hedgewars.mobile.Downloader;
+
+import org.hedgewars.mobile.MainActivity;
+import org.hedgewars.mobile.R;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+public class DownloadActivity extends Activity{
+
+ private Messenger messageService;
+ private boolean boundToService = false;
+
+ private TextView progress_sub;
+ private ProgressBar progress;
+ private Button positive, negative;
+
+ public static final int MSG_START = 0;
+ public static final int MSG_UPDATE = 1;
+ public static final int MSG_DONE = 2;
+ private Handler.Callback messageCallback = new Handler.Callback() {
+
+ @Override
+ public boolean handleMessage(Message msg) {
+ switch(msg.what){
+ case MSG_START:
+ progress.setMax(msg.arg1);
+ progress_sub.setText(String.format("%dkb/%dkb\n%s", 0, msg.arg1, ""));
+ break;
+ case MSG_UPDATE:
+ progress_sub.setText(String.format("%d%% - %dkb/%dkb\n%s",(msg.arg1*100)/msg.arg2, msg.arg1, msg.arg2, msg.obj));
+ progress.setProgress(msg.arg1);
+ break;
+ case MSG_DONE:
+ progress.setProgress(progress.getMax());
+ progress_sub.setText(R.string.download_done);
+
+ positive.setText(R.string.download_back);
+ positive.setOnClickListener(doneClicker);
+ break;
+ }
+ return false;
+ }
+ };
+ private Handler messageHandler = new Handler(messageCallback);
+ private Messenger messenger = new Messenger(messageHandler);
+
+ public void onCreate(Bundle savedInstanceState){
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.download);
+
+ progress_sub = (TextView)findViewById(R.id.progressbar_sub);
+ progress = (ProgressBar)findViewById(R.id.progressbar);
+
+ positive = (Button) findViewById(R.id.background);
+ negative = (Button) findViewById(R.id.cancelDownload);
+ positive.setOnClickListener(backgroundClicker);
+ negative.setOnClickListener(cancelClicker);
+
+ }
+
+ private OnClickListener backgroundClicker = new OnClickListener(){
+ public void onClick(View v){
+ finish();
+ }
+ };
+ private OnClickListener cancelClicker = new OnClickListener(){
+ public void onClick(View v){
+ Intent i = new Intent(getApplicationContext(), DownloadService.class);
+ i.putExtra("taskID", DownloadService.TASKID_CANCEL);
+ startService(i);
+ finish();
+ }
+ };
+ private OnClickListener doneClicker = new OnClickListener(){
+ public void onClick(View v){
+ finish();
+ startActivity(new Intent(getApplicationContext(), MainActivity.class));
+ }
+ };
+
+ public void onStart(){
+ super.onStart();
+ bindToService();
+ }
+
+ public void onStop(){
+ super.onStop();
+ unBindFromService();
+ }
+
+ private ServiceConnection connection = new ServiceConnection(){
+
+ @Override
+ public void onServiceConnected(ComponentName name, IBinder service) {
+ messageService = new Messenger(service);
+
+ try{
+ Message msg = Message.obtain(null, DownloadService.MSG_REGISTER_CLIENT);
+ msg.replyTo = messenger;
+ messageService.send(msg);
+
+ }catch (RemoteException e){}
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName name) {
+ messageService = null;
+ }
+
+ };
+
+ private void bindToService(){
+ Intent i = new Intent(getApplicationContext(), DownloadService.class);
+ i.putExtra("taskID", DownloadService.TASKID_START);
+ startService(i);
+ bindService(new Intent(getApplicationContext(), DownloadService.class), connection, Context.BIND_AUTO_CREATE);
+ boundToService = true;
+ }
+
+ private void unBindFromService(){
+ if(boundToService){
+ boundToService = false;
+ unbindService(connection);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/Downloader/DownloadAsyncTask.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,115 @@
+package org.hedgewars.mobile.Downloader;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import android.os.AsyncTask;
+import android.util.Log;
+/**
+ * This is an AsyncTask which will download a zip from an URL and unzip it to a specified path
+ *
+ * a typical call to start the task would be new DownloadAsyncTask().execute(getExternalStorage(), "www.hedgewars.org/data.zip");
+ * @author Xeli
+ *
+ */
+public class DownloadAsyncTask extends AsyncTask<String, Object, Long> {
+
+ private DownloadService service;
+ private long lastUpdateMillis = 0;
+
+ public DownloadAsyncTask(DownloadService _service){
+ service = _service;
+ }
+
+ /**
+ *
+ * @param params - 2 Strings, first is the path where the unzipped files will be stored, second is the URL to download from
+ */
+ protected Long doInBackground(String... params) {
+ HttpURLConnection conn = null;
+ try {
+ String rootZipDest = params[0];
+
+ File rootDest = new File(rootZipDest);//TODO check for nullpointer, it hints to the absence of an sdcard
+ rootDest.mkdir();
+
+ URL url = new URL(params[1]);
+ conn = (HttpURLConnection)url.openConnection();
+ String contentType = conn.getContentType();
+
+ if(contentType == null || contentType.contains("zip")){ //Seeing as we provide the url if the contentType is unknown lets assume zips
+ ZipInputStream input = new ZipInputStream(conn.getInputStream());
+ int bytesDecompressed = 0;
+ final int kbytesToProcess = conn.getContentLength()/1024;
+
+ service.start(kbytesToProcess);
+
+ ZipEntry entry = null;
+ while((entry = input.getNextEntry()) != null){
+ String fileName = entry.getName();
+
+ if(isCancelled()) break;
+ else if(System.currentTimeMillis() - lastUpdateMillis > 1000){
+ lastUpdateMillis = System.currentTimeMillis();
+ publishProgress(bytesDecompressed, kbytesToProcess, fileName);
+ }
+
+ Log.e("bla", fileName);
+ bytesDecompressed += entry.getCompressedSize();
+
+ File f = new File(rootZipDest + fileName);
+
+ if(entry.isDirectory()){
+ f.mkdir();
+ }else{
+ if(f.exists()){
+ f.delete();
+ }
+
+ try {
+ f.createNewFile();
+ FileOutputStream out = new FileOutputStream(f);
+
+ byte[] buffer = new byte[1024];
+ int count = 0;
+ while((count = input.read(buffer)) != -1){
+ out.write(buffer, 0, count);
+ }
+ out.flush();
+ out.close();
+ input.closeEntry();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ input.close();
+ }else{
+ Log.e("bla", "contenttype = " + contentType);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }finally{
+ if(conn != null) conn.disconnect();
+ }
+ return null;
+ }
+
+ //TODO propper result handling
+ protected void onPostExecute(Long result){
+ service.done(true);
+ }
+
+ protected void onProgressUpdate(Object...objects){
+ service.update((Integer)objects[0], (Integer)objects[1], (String)objects[2]);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/Downloader/DownloadService.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,164 @@
+package org.hedgewars.mobile.Downloader;
+
+import java.util.ArrayList;
+
+import org.hedgewars.mobile.MainActivity;
+import org.hedgewars.mobile.R;
+import org.hedgewars.mobile.Utils;
+
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.Intent;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.util.Log;
+import android.widget.RemoteViews;
+
+public class DownloadService extends Service {
+
+ private final static String URL = "http://31.3.98.83/tmp/data.zip";
+ public static final int MSG_CANCEL = 0;
+ public static final int MSG_REGISTER_CLIENT = 1;
+ public static final int MSG_UNREGISTER_CLIENT = 2;
+
+ public static final int NOTIFICATION_PROCESSING = 0;
+ public static final int NOTIFICATION_DONE = 1;
+
+ private DownloadAsyncTask downloadTask;
+ private final Messenger messenger = new Messenger(new DownloadHandler());
+ private NotificationManager nM;
+ private RemoteViews contentView;
+ private Notification notification;
+
+ private ArrayList<Messenger> clientList = new ArrayList<Messenger>();
+ private Message onRegisterMessage = null;
+
+
+ class DownloadHandler extends Handler{
+
+ public void handleMessage(Message msg){
+ switch(msg.what){
+ case MSG_CANCEL:
+ downloadTask.cancel(false);
+ break;
+ case MSG_REGISTER_CLIENT:
+ clientList.add(msg.replyTo);
+ if(onRegisterMessage != null){
+ try {
+ msg.replyTo.send(Message.obtain(onRegisterMessage));
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ break;
+ case MSG_UNREGISTER_CLIENT:
+ clientList.remove(msg.replyTo);
+ break;
+ }
+ }
+ }
+
+ public final static int TASKID_START = 0;
+ public final static int TASKID_CANCEL = 1;
+
+ public int onStartCommand(Intent intent, int flags, int startId){
+ switch(intent.getIntExtra("taskID", TASKID_START)){
+ case TASKID_START:
+ nM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+
+ notification = new Notification(R.drawable.statusbar, getString(R.string.notification_title), System.currentTimeMillis());
+ //notification.flags |= Notification.FLAG_ONGOING_EVENT;// | Notification.FLAG_NO_CLEAR | Notification.FLAG_FOREGROUND_SERVICE;
+ notification.flags |= Notification.FLAG_ONGOING_EVENT;
+
+ contentView = new RemoteViews(getPackageName(), R.layout.notification);
+ contentView.setProgressBar(R.id.notification_progress, 100, 34, false);
+ notification.contentView = contentView;
+
+ PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, DownloadActivity.class), Intent.FLAG_ACTIVITY_NEW_TASK);
+ notification.contentIntent = contentIntent;
+
+ //nM.notify(NOTIFICATION_PROCESSING, notification);
+ startForeground(NOTIFICATION_PROCESSING, notification);
+
+ if(downloadTask == null){
+ downloadTask = new DownloadAsyncTask(this);
+ downloadTask.execute(Utils.getDownloadPath(this), URL);
+ }
+ break;
+ case TASKID_CANCEL:
+ downloadTask.cancel(false);
+ stopService();
+ break;
+ }
+ return 0;
+ }
+
+ public void onDestroy(){
+ Log.e("bla", "onDestroy");
+ downloadTask.cancel(false);
+ }
+
+ public IBinder onBind(Intent intent) {
+ return messenger.getBinder();
+ }
+
+ /*
+ * Thread safe method to let clients know the processing is starting and will process int max kbytes
+ *
+ */
+ public void start(int max){
+ onRegisterMessage = Message.obtain(null, DownloadActivity.MSG_START, max, -1);
+ sendMessageToClients(onRegisterMessage);
+ }
+
+ public void update(int progress, int max, String fileName){
+ progress = (progress/1024);
+ updateNotification(progress, max, fileName);
+
+ sendMessageToClients(Message.obtain(null, DownloadActivity.MSG_UPDATE, progress, max, fileName));
+ }
+ public void done(boolean succesful){
+ sendMessageToClients(Message.obtain(null, DownloadActivity.MSG_DONE));
+ stopService();//stopService clears all notifications and thus must be called before we show the ready notification
+ showDoneNotification();
+ }
+
+ private void stopService(){
+ nM.cancelAll();
+ stopForeground(true);
+ stopSelf();
+ }
+
+ private void updateNotification(int progress, int max, String fileName){
+
+ contentView.setProgressBar(R.id.notification_progress, max, progress, false);
+ contentView.setTextViewText(R.id.progressbar_sub, String.format("%dkb/%dkb (Compressed sizes)", progress, max));
+ nM.notify(NOTIFICATION_PROCESSING, notification);
+ }
+
+ private void showDoneNotification(){
+ nM.cancelAll();
+ stopForeground(true);
+
+ String title = getString(R.string.notification_title);
+
+ notification = new Notification(R.drawable.icon, title, System.currentTimeMillis());
+ notification.flags |= Notification.FLAG_AUTO_CANCEL;
+ PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), Intent.FLAG_ACTIVITY_NEW_TASK);
+ notification.setLatestEventInfo(this, title, getString(R.string.notification_done), contentIntent);
+ nM.notify(NOTIFICATION_DONE, notification);
+ }
+ private void sendMessageToClients(Message msg){
+ for(Messenger m : clientList){
+ try {
+ m.send(Message.obtain(msg));
+ } catch (RemoteException e) {}//TODO should we catch this properly?
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/Downloader/DownloadThread.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,13 @@
+package org.hedgewars.mobile.Downloader;
+
+public class DownloadThread extends Thread{
+
+ public DownloadThread(){
+
+ }
+
+ public void run(){
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/EngineProtocolNetwork.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,132 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+public class EngineProtocolNetwork implements Runnable{
+
+ public static final String GAMEMODE_LOCAL = "TL";
+ public static final String GAMEMODE_DEMO = "TD";
+ public static final String GAMEMODE_NET = "TN";
+ public static final String GAMEMODE_SAVE = "TS";
+
+ public static final int BUFFER_SIZE = 255; //From iOS code which got it from the origional frontend
+
+ public static final int MODE_GENLANDPREVIEW = 0;
+ public static final int MODE_GAME = 1;
+
+ private ServerSocket serverSocket;
+ private InputStream input;
+ private OutputStream output;
+ public int port;
+ private final GameConfig config;
+
+ public EngineProtocolNetwork(GameConfig _config){
+ config = _config;
+ try {
+ serverSocket = new ServerSocket(0);
+ port = serverSocket.getLocalPort();
+ Thread ipcThread = new Thread(this, "IPC - Thread");
+ ipcThread.start();
+ } catch (UnknownHostException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void run(){
+ //if(mode == MODE_GENLANDPREVIEW) genLandPreviewIPC();
+ /*else if (mode == MODE_GAME)*/ gameIPC();
+ }
+
+ private void gameIPC(){
+ try{
+ Socket sock = serverSocket.accept();
+ input = sock.getInputStream();
+ output = sock.getOutputStream();
+
+ boolean clientQuit = false;
+ int msgSize = 0;
+ byte[] buffer = new byte[BUFFER_SIZE];
+
+ while(!clientQuit){
+ msgSize = 0;
+
+ input.read(buffer, 0, 1);
+ msgSize = buffer[0];
+
+ input.read(buffer, 0, msgSize);
+
+ switch(buffer[0]){
+ case 'C'://game init
+ config.sendToEngine(this);
+ break;
+ case '?'://ping - pong
+ sendToEngine("!");
+ break;
+ case 'E'://error - quits game
+
+ break;
+ case 'e':
+
+ break;
+ case 'i'://game statistics
+ switch(buffer[1]){
+ case 'r'://winning team
+ break;
+ case 'D'://best shot
+ break;
+ case 'k'://best hedgehog
+ break;
+ case 'K'://# hogs killed
+ break;
+ case 'H'://team health graph
+ break;
+ case 'T':// local team stats
+ break;
+ case 'P'://teams ranking
+ break;
+ case 's'://self damage
+ break;
+ case 'S'://friendly fire
+ break;
+ case 'B'://turn skipped
+ break;
+ default:
+
+ }
+ break;
+ case 'q'://game ended remove save file
+
+ break;
+ case 'Q'://game ended but not finished
+
+ break;
+ }
+
+ }
+
+ }catch(IOException e){
+ e.printStackTrace();
+ }
+ }
+
+ public void sendToEngine(String s){
+ int length = s.length();
+
+ try {
+ output.write(length);
+ output.write(s.getBytes(), 0, length);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/FrontendDataUtils.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,196 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+
+import org.hedgewars.mobile.R;
+import org.hedgewars.mobile.Utils;
+import org.hedgewars.mobile.EngineProtocol.Map.MapType;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+
+public class FrontendDataUtils {
+
+
+ public static ArrayList<Map> getMaps(Context c){
+ File[] files = Utils.getFilesFromRelativeDir(c,"Maps");
+ ArrayList<Map> ret = new ArrayList<Map>();
+
+ for(File f : files){
+ if(Utils.hasFileWithSuffix(f, ".lua")){
+ ret.add(new Map(f,MapType.TYPE_MISSION, c));
+ }else{
+ ret.add(new Map(f, MapType.TYPE_DEFAULT,c));
+ }
+ }
+ Collections.sort(ret);
+
+ return ret;
+ }
+
+ public static String[] getGameplay(Context c){
+ String[] files = Utils.getFileNamesFromRelativeDir(c, "Scripts/Multiplayer");
+ int retCounter = 0;
+
+ for(int i = 0; i < files.length; i++){
+ if(files[i].endsWith(".lua")){
+ files[i] = files[i].replace('_', ' ').substring(0, files[i].length()-4); //replace _ by a space and removed the last four characters (.lua)
+ retCounter++;
+ }else files[i] = null;
+ }
+ String[] ret = new String[retCounter];
+ retCounter = 0;
+ for(String s : files){
+ if(s != null) ret[retCounter++] = s;
+ }
+ Arrays.sort(ret);
+
+ return ret;
+ }
+
+ public static String[] getThemes(Context c){
+ return Utils.getDirsWithFileSuffix(c, "Themes", "icon.png");
+ }
+
+ public static ArrayList<Scheme> getSchemes(Context c){
+ return Scheme.getSchemes(c);
+ }
+
+ public static ArrayList<Weapon> getWeapons(Context c){
+ return Weapon.getWeapons(c);
+ }
+
+ public static ArrayList<HashMap<String, ?>> getGraves(Context c){
+ String pathPrefix = Utils.getDownloadPath(c) + "Graphics/Graves/";
+ ArrayList<String> names = Utils.getFilesFromDirWithSuffix(c, "Graphics/Graves", ".png", true);
+ ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(names.size());
+
+ for(String s : names){
+ HashMap<String, Object> map = new HashMap<String, Object>();
+ map.put("txt", s);
+ Bitmap b = BitmapFactory.decodeFile(pathPrefix + s + ".png");//create a full path - decode to to a bitmap
+ int width = b.getWidth();
+ if(b.getHeight() > width){//some pictures contain more 'frames' underneath each other, if so we only use the first frame
+ Bitmap tmp = Bitmap.createBitmap(b, 0, 0, width, width);
+ b.recycle();
+ b = tmp;
+ }
+ map.put("img", b);
+ data.add(map);
+ }
+ return data;
+ }
+
+ public static ArrayList<HashMap<String, ?>> getFlags(Context c){
+ String pathPrefix = Utils.getDownloadPath(c) + "Graphics/Flags/";
+ ArrayList<String> names = Utils.getFilesFromDirWithSuffix(c, "Graphics/Flags", ".png", true);
+ ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(names.size());
+
+ for(String s : names){
+ HashMap<String, Object> map = new HashMap<String, Object>();
+ map.put("txt", s);
+ Bitmap b = BitmapFactory.decodeFile(pathPrefix + s + ".png");//create a full path - decode to to a bitmap
+ map.put("img", b);
+ data.add(map);
+ }
+ return data;
+ }
+
+ public static ArrayList<String> getVoices(Context c){
+ File[] files = Utils.getFilesFromRelativeDir(c, "Sounds/voices");
+ ArrayList<String> ret = new ArrayList<String>();
+
+ for(File f : files){
+ if(f.isDirectory()) ret.add(f.getName());
+ }
+ return ret;
+ }
+
+ public static ArrayList<String> getForts(Context c){
+ return Utils.getFilesFromDirWithSuffix(c, "Forts", "L.png", true);
+ }
+ public static ArrayList<HashMap<String, ?>> getTypes(Context c){
+ ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(6);
+ String[] levels = {c.getString(R.string.human), c.getString(R.string.bot5), c.getString(R.string.bot4), c.getString(R.string.bot3), c.getString(R.string.bot2), c.getString(R.string.bot1)};
+ int[] images = {R.drawable.human, R.drawable.bot5, R.drawable.bot4, R.drawable.bot3, R.drawable.bot2, R.drawable.bot1};
+
+ for(int i = 0; i < levels.length; i++){
+ HashMap<String, Object> map = new HashMap<String, Object>();
+ map.put("txt", levels[i]);
+ map.put("img", images[i]);
+ data.add(map);
+ }
+
+ return data;
+ }
+
+ public static ArrayList<HashMap<String, ?>> getHats(Context c){
+ ArrayList<String> files = Utils.getFilesFromDirWithSuffix(c, "Graphics/Hats", ".png", true);
+ String pathPrefix = Utils.getDownloadPath(c) + "Graphics/Hats/";
+ int size = files.size();
+ ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(size);
+
+ HashMap<String, Object> hashmap;
+ for(String s : files){
+ hashmap = new HashMap<String, Object>();
+ hashmap.put("txt", s);
+ Bitmap b = BitmapFactory.decodeFile(pathPrefix + s + ".png");//create a full path - decode to to a bitmap
+ b = Bitmap.createBitmap(b, 0,0,b.getWidth()/2, b.getWidth()/2);
+ hashmap.put("img", b);
+ data.add(hashmap);
+ }
+
+ return data;
+ }
+
+ public static ArrayList<HashMap<String, Object>> getTeams(Context c){
+ ArrayList<HashMap<String, Object>> ret = new ArrayList<HashMap<String, Object>>();
+
+ File teamsDir = new File(c.getFilesDir().getAbsolutePath() + '/' + Team.DIRECTORY_TEAMS);
+ File[] teamFileNames = teamsDir.listFiles();
+ if(teamFileNames != null){
+ for(File s : teamFileNames){
+ Team t = Team.getTeamFromXml(s.getAbsolutePath());
+ if(t != null){
+ ret.add(teamToHashMap(t));
+ }
+ }
+ }
+ return ret;
+ }
+
+ public static HashMap<String, Object> teamToHashMap(Team t){
+ HashMap<String, Object> hashmap = new HashMap<String, Object>();
+ hashmap.put("team", t);
+ hashmap.put("txt", t.name);
+ hashmap.put("color", t.color);
+ hashmap.put("count", t.hogCount);
+ switch(t.levels[0]){
+ case 0:
+ hashmap.put("img", R.drawable.human);
+ break;
+ case 1:
+ hashmap.put("img", R.drawable.bot5);
+ break;
+ case 2:
+ hashmap.put("img", R.drawable.bot4);
+ break;
+ case 3:
+ hashmap.put("img", R.drawable.bot3);
+ break;
+ case 4:
+ hashmap.put("img", R.drawable.bot2);
+ break;
+ default:
+ case 5:
+ hashmap.put("img", R.drawable.bot1);
+ break;
+ }
+ return hashmap;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/GameConfig.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,99 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.UUID;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+public class GameConfig implements Parcelable{
+
+ public GameMode mode = GameMode.MODE_LOCAL;
+ public Map map = null;
+ public String theme = null;
+ public Scheme scheme = null;
+ public Weapon weapon = null;
+
+ public String mission = null;
+ public String seed = null;
+
+ public ArrayList<Team> teams = new ArrayList<Team>();
+
+ public GameConfig(){
+
+ }
+
+ public GameConfig(Parcel in){
+ readFromParcel(in);
+ }
+
+
+
+ public void sendToEngine(EngineProtocolNetwork epn) throws IOException{
+ Log.d("HW_Frontend", "Sending Gameconfig...");
+ int teamCount = 4;
+ epn.sendToEngine("TL"); //Write game mode
+ if(mission != null) epn.sendToEngine(mission);
+
+ //seed info
+ epn.sendToEngine(String.format("eseed {%s}", UUID.randomUUID().toString()));
+
+ map.sendToEngine(epn);
+ //dimensions of the map
+ //templatefilter_command
+ //mapgen_command
+ //mazesize_command
+
+ epn.sendToEngine(String.format("etheme %s", theme));
+
+ scheme.sendToEngine(epn);
+
+ weapon.sendToEngine(epn, teamCount);
+
+ for(Team t : teams){
+ if(t != null)t.sendToEngine(epn, teamCount, 50);
+ }
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(mode.name());
+ dest.writeParcelable(map, flags);
+ dest.writeString(theme);
+ dest.writeParcelable(scheme, flags);
+ dest.writeParcelable(weapon, flags);
+ dest.writeString(mission);
+ dest.writeString(seed);
+ dest.writeParcelableArray((Team[])teams.toArray(new Team[1]), 0);
+ }
+
+ private void readFromParcel(Parcel src){
+ mode = GameMode.valueOf(src.readString());
+ map = src.readParcelable(Map.class.getClassLoader());
+ theme = src.readString();
+ scheme = src.readParcelable(Scheme.class.getClassLoader());
+ weapon = src.readParcelable(Weapon.class.getClassLoader());
+ mission = src.readString();
+ seed = src.readString();
+ Parcelable[] parcelables = src.readParcelableArray(Team[].class.getClassLoader());
+ for(Parcelable team : parcelables){
+ teams.add((Team)team);
+ }
+
+ }
+
+ public static final Parcelable.Creator<GameConfig> CREATOR = new Parcelable.Creator<GameConfig>() {
+ public GameConfig createFromParcel(Parcel source) {
+ return new GameConfig(source);
+ }
+ public GameConfig[] newArray(int size) {
+ return new GameConfig[size];
+ }
+ };
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/GameMode.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,5 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+public enum GameMode {
+ MODE_LOCAL, MODE_DEMO, MODE_NET, MODE_SAVE
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/Grave.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,17 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+public class Grave{
+
+ public final String name;
+ public final String path;
+
+ public Grave(String _name, String _path) {
+ name = _name;
+ path = _path;
+ }
+
+ public String toString(){
+ return name;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/Map.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,143 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+import java.io.File;
+import java.io.IOException;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Map implements Comparable<Map>, Parcelable{
+
+ private static final String MISSION_PREFIX = "Mission: ";
+
+ private String name;
+ private String path;
+ private String previewPath;
+ private MapType type;
+
+ public Map(File mapDir, MapType _type, Context c){
+ type = _type;
+
+ name = mapDir.getName();
+ path = mapDir.getAbsolutePath();
+ previewPath = path + "/preview.png";
+
+ /*switch(type){
+ case TYPE_DEFAULT:
+
+ break;
+ case TYPE_GENERATED:
+ //TODO
+ break;
+ case TYPE_MISSION:
+ name = MISSION_PREFIX + mapDir.getName();
+ path = mapDir.getAbsolutePath();
+ break;
+ }*/
+
+
+ }
+
+ public Map(Parcel in){
+ readFromParcel(in);
+ }
+
+ public String toString(){
+ switch(type){
+ default:
+ case TYPE_DEFAULT:
+ return name;
+ case TYPE_GENERATED:
+ return "bla";
+ case TYPE_MISSION:
+ return MISSION_PREFIX + name;
+ }
+ }
+
+ public void sendToEngine(EngineProtocolNetwork epn) throws IOException{
+ epn.sendToEngine(String.format("emap %s",name));
+ }
+
+ public MapType getType(){
+ return type;
+ }
+
+ public Drawable getDrawable(){
+ switch(type){
+ case TYPE_MISSION:
+ case TYPE_DEFAULT:
+ return Drawable.createFromPath(previewPath);
+ case TYPE_GENERATED:
+
+ default:
+ return null;
+ }
+ }
+
+ @Override
+ public int compareTo(Map another) {
+ switch(type){
+ case TYPE_GENERATED:
+ switch(another.getType()){
+ case TYPE_GENERATED:
+ return name.compareTo(another.name);
+ case TYPE_MISSION:
+ return -1;
+ case TYPE_DEFAULT:
+ return -1;
+ }
+ case TYPE_MISSION:
+ switch(another.getType()){
+ case TYPE_GENERATED:
+ return 1;
+ case TYPE_MISSION:
+ return name.compareTo(another.name);
+ case TYPE_DEFAULT:
+ return -1;
+ }
+ case TYPE_DEFAULT:
+ switch(another.getType()){
+ case TYPE_GENERATED:
+ return 1;
+ case TYPE_MISSION:
+ return 1;
+ case TYPE_DEFAULT:
+ return name.compareTo(another.name);
+ }
+ }
+ return 0;//default case this should never happen
+ }
+
+ public enum MapType{
+ TYPE_DEFAULT, TYPE_MISSION, TYPE_GENERATED
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(name);
+ dest.writeString(path);
+ dest.writeString(previewPath);
+ dest.writeString(type.name());
+ }
+
+ private void readFromParcel(Parcel src){
+ name = src.readString();
+ path = src.readString();
+ previewPath = src.readString();
+ type = MapType.valueOf(src.readString());
+ }
+ public static final Parcelable.Creator<Map> CREATOR = new Parcelable.Creator<Map>() {
+ public Map createFromParcel(Parcel source) {
+ return new Map(source);
+ }
+ public Map[] newArray(int size) {
+ return new Map[size];
+ }
+
+ };
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/PascalExports.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,22 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+public class PascalExports {
+
+ static{
+ System.loadLibrary("SDL");
+ System.loadLibrary("SDL_image");
+ System.loadLibrary("mikmod");
+ System.loadLibrary("SDL_net");
+ System.loadLibrary("SDL_mixer");
+ System.loadLibrary("SDL_ttf");
+ System.loadLibrary("lua5.1");
+ System.loadLibrary("hwengine");
+ }
+
+ public static native int HWversionInfoNetProto();
+ public static native String HWversionInfoVersion();
+ public static native int HWgetNumberOfWeapons();
+ public static native int HWgetMaxNumberOfTeams();
+ public static native int HWgetMaxNumberOfHogs();
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/Scheme.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,341 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+import android.content.Context;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Scheme implements Parcelable{
+
+ public static final String DIRECTORY_SCHEME = "schemes";
+
+ private String name;
+ //private ArrayList<Integer> basic;
+ private Integer gamemod;
+ private ArrayList<Integer> basic;;
+ private static ArrayList<LinkedHashMap<String, ?>> basicflags = new ArrayList<LinkedHashMap<String, ?>>();
+
+ public Scheme(String _name, ArrayList<Integer> _basic, int _gamemod){
+ name = _name;
+ gamemod = _gamemod;
+ basic = _basic;
+
+ }
+
+ public Scheme(Parcel in){
+ readFromParcel(in);
+ }
+
+ public void sendToEngine(EngineProtocolNetwork epn)throws IOException{
+ epn.sendToEngine(String.format("e$gmflags %d", gamemod));
+
+ for(int pos = 0; pos < basic.size(); pos++){
+ LinkedHashMap<String, ?> basicflag = basicflags.get(pos);
+
+ String command = (String)basicflag.get("command");
+ Integer value = basic.get(pos);
+ Boolean checkOverMax = (Boolean) basicflag.get("checkOverMax");
+ Boolean times1000 = (Boolean) basicflag.get("times1000");
+ Integer max = (Integer) basicflag.get("max");
+
+ if(checkOverMax && value >= max) value = max;
+ if(times1000) value *= 1000;
+
+ epn.sendToEngine(String.format("%s %d", command, value));
+ }
+ }
+ public String toString(){
+ return name;
+ }
+
+
+ public static final int STATE_START = 0;
+ public static final int STATE_ROOT = 1;
+ public static final int STATE_NAME = 2;
+ public static final int STATE_BASICFLAGS = 3;
+ public static final int STATE_GAMEMOD = 4;
+ public static final int STATE_BASICFLAG_INTEGER = 5;
+ public static final int STATE_GAMEMOD_TRUE = 6;
+ public static final int STATE_GAMEMOD_FALSE = 7;
+
+ public static ArrayList<Scheme> getSchemes(Context c) throws IllegalArgumentException{
+ String dir = c.getFilesDir().getAbsolutePath() + '/' + DIRECTORY_SCHEME + '/';
+ String[] files = new File(dir).list(fnf);
+ if(files == null) files = new String[]{};
+ Arrays.sort(files);
+ ArrayList<Scheme> schemes = new ArrayList<Scheme>();
+
+ try {
+ XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+ XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
+
+ for(String file : files){
+ BufferedReader br = new BufferedReader(new FileReader(dir + file), 1024);
+ xmlPuller.setInput(br);
+ String name = null;
+ ArrayList<Integer> basic = new ArrayList<Integer>();
+ Integer gamemod = 0;
+ int mask = 0x000000004;
+
+ int eventType = xmlPuller.getEventType();
+ int state = STATE_START;
+ while(eventType != XmlPullParser.END_DOCUMENT){
+ switch(state){
+ case STATE_START:
+ if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().equals("scheme")) state = STATE_ROOT;
+ else if(eventType != XmlPullParser.START_DOCUMENT) throwException(file, eventType);
+ break;
+ case STATE_ROOT:
+ if(eventType == XmlPullParser.START_TAG){
+ if(xmlPuller.getName().equals("basicflags")) state = STATE_BASICFLAGS;
+ else if(xmlPuller.getName().toLowerCase().equals("gamemod")) state = STATE_GAMEMOD;
+ else if(xmlPuller.getName().toLowerCase().equals("name")) state = STATE_NAME;
+ else throwException(file, eventType);
+ }else if(eventType == XmlPullParser.END_TAG) state = STATE_START;
+ else throwException(xmlPuller.getText(), eventType);
+ break;
+ case STATE_BASICFLAGS:
+ if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().toLowerCase().equals("integer")) state = STATE_BASICFLAG_INTEGER;
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ case STATE_GAMEMOD:
+ if(eventType == XmlPullParser.START_TAG){
+ if(xmlPuller.getName().toLowerCase().equals("true")) state = STATE_GAMEMOD_TRUE;
+ else if(xmlPuller.getName().toLowerCase().equals("false")) state = STATE_GAMEMOD_FALSE;
+ else throwException(file, eventType);
+ }else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ case STATE_NAME:
+ if(eventType == XmlPullParser.TEXT) name = xmlPuller.getText().trim();
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ case STATE_BASICFLAG_INTEGER:
+ if(eventType == XmlPullParser.TEXT) basic.add(Integer.parseInt(xmlPuller.getText().trim()));
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_BASICFLAGS;
+ else throwException(file, eventType);
+ break;
+ case STATE_GAMEMOD_FALSE:
+ if(eventType == XmlPullParser.TEXT) gamemod <<= 1;
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_GAMEMOD;
+ else throwException(file, eventType);
+ break;
+ case STATE_GAMEMOD_TRUE:
+ if(eventType == XmlPullParser.TEXT){
+ gamemod |= mask;
+ gamemod <<= 1;
+ }else if(eventType == XmlPullParser.END_TAG) state = STATE_GAMEMOD;
+ else throwException(file, eventType);
+ break;
+ }
+ eventType = getEventType(xmlPuller);
+ }//end while(eventtype != END_DOCUMENT
+ schemes.add(new Scheme(name, basic, gamemod));
+ }//end for(string file : files
+ return schemes;
+ } catch (XmlPullParserException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return new ArrayList<Scheme>();//TODO handle correctly
+ }
+
+ private static FilenameFilter fnf = new FilenameFilter(){
+ public boolean accept(File dir, String filename) {
+ return filename.toLowerCase().startsWith("scheme_");
+ }
+ };
+
+ /**
+ * This method will parse the basic flags from a prespecified xml file.
+ * I use a raw xml file rather than one parsed by aatp at compile time
+ * to keep it generic with other frontends, ie in the future we could
+ * use one provided by the Data folder.
+ */
+ public static void parseBasicFlags(Context c){
+ String filename = String.format("%s/%s/basicflags", c.getFilesDir().getAbsolutePath(), DIRECTORY_SCHEME);
+
+ XmlPullParser xmlPuller = null;
+ BufferedReader br = null;
+ try {
+ XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+ xmlPuller = xmlPullFactory.newPullParser();
+ br = new BufferedReader(new FileReader(filename), 1024);
+ xmlPuller.setInput(br);
+
+ int eventType = getEventType(xmlPuller);
+ boolean continueParsing = true;
+ do{
+ switch(eventType){
+
+ case XmlPullParser.START_TAG:
+ if(xmlPuller.getName().toLowerCase().equals("flag")){
+ basicflags.add(parseFlag(xmlPuller));
+ }else if(xmlPuller.getName().toLowerCase().equals("basicflags")){
+ eventType = getEventType(xmlPuller);
+ }else{
+ skipCurrentTag(xmlPuller);
+ eventType = getEventType(xmlPuller);
+ }
+ break;
+ case XmlPullParser.START_DOCUMENT://ignore all tags not being "flag"
+ case XmlPullParser.END_TAG:
+ case XmlPullParser.TEXT:
+ default:
+ continueParsing = true;
+ case XmlPullParser.END_DOCUMENT:
+ continueParsing = false;
+ }
+ }while(continueParsing);
+
+ }catch(IOException e){
+ e.printStackTrace();
+ }catch (XmlPullParserException e) {
+ e.printStackTrace();
+ }finally{
+ if(br != null)
+ try {
+ br.close();
+ } catch (IOException e) {}
+ }
+
+ }
+
+ /*
+ * * Parses a Tag structure from xml as example we use
+ *<flag>
+ * <checkOverMax>
+ * <boolean>false</boolean>
+ * </checkOverMax>
+ *</flag>
+ *
+ * It returns a LinkedHashMap with key/value pairs
+ */
+ private static LinkedHashMap<String, Object> parseFlag(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+ LinkedHashMap<String, Object> hash = new LinkedHashMap<String, Object>();
+
+ int eventType = xmlPuller.getEventType();//Get the event type which triggered this method
+ if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().toLowerCase().equals("flag")){//valid start of flag tag
+ String lcKey = null;
+ String lcType = null;
+ String value = null;
+
+ eventType = getEventType(xmlPuller);//<checkOverMax>
+ while(eventType == XmlPullParser.START_TAG){
+ lcKey = xmlPuller.getName();//checkOverMax
+ if(getEventType(xmlPuller) == XmlPullParser.START_TAG){//<boolean>
+ lcType = xmlPuller.getName().toLowerCase();
+ if(getEventType(xmlPuller) == XmlPullParser.TEXT){
+ value = xmlPuller.getText();
+ if(getEventType(xmlPuller) == XmlPullParser.END_TAG && //</boolean>
+ getEventType(xmlPuller) == XmlPullParser.END_TAG){//</checkOverMax>
+ if(lcType.equals("boolean")) hash.put(lcKey, new Boolean(value));
+ else if(lcType.equals("string"))hash.put(lcKey, value);
+ else if(lcType.equals("integer")){
+ try{
+ hash.put(lcKey, new Integer(value));
+ }catch (NumberFormatException e){
+ throw new XmlPullParserException("Wrong integer value in xml file");
+ }
+ }else{
+ throwException("basicflags", eventType);
+ }
+ }//</boolean> / </checkOverMax>
+ }//if TEXT
+ }//if boolean
+ eventType = getEventType(xmlPuller);//start new loop
+ }
+ eventType = getEventType(xmlPuller);//</flag>
+ }
+
+ return hash;
+ }
+
+ private static void skipCurrentTag(XmlPullParser xmlPuller) throws XmlPullParserException, IOException{
+ int eventType = xmlPuller.getEventType();
+ if(eventType != XmlPullParser.START_TAG)return;
+ String tag = xmlPuller.getName().toLowerCase();
+
+ while(true){
+ eventType = getEventType(xmlPuller);//getNext()
+ switch(eventType){
+ case XmlPullParser.START_DOCUMENT://we're inside of a start tag so START_ or END_DOCUMENT is just wrong
+ case XmlPullParser.END_DOCUMENT:
+ throw new XmlPullParserException("invalid xml file");
+ case XmlPullParser.START_TAG://if we get a new tag recursively handle it
+ skipCurrentTag(xmlPuller);
+ break;
+ case XmlPullParser.TEXT:
+ break;
+ case XmlPullParser.END_TAG:
+ if(!xmlPuller.getName().toLowerCase().equals(tag)){//if the end tag doesn't match the start tag
+ throw new XmlPullParserException("invalid xml file");
+ }else{
+ return;//skip completed
+ }
+
+ }
+ }
+ }
+
+ /**
+ * Skips whitespaces..
+ */
+ private static int getEventType(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+ int eventType = xmlPuller.next();
+ while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){
+ eventType = xmlPuller.next();
+ }
+ return eventType;
+ }
+ private static void throwException(String file, int eventType){
+ throw new IllegalArgumentException(String.format("Xml file: %s malformed with error: %d.", file, eventType));
+ }
+
+ @Override
+ public int describeContents() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(name);
+ dest.writeInt(gamemod);
+ dest.writeList(basic);
+
+ }
+
+ public void readFromParcel(Parcel src){
+ name = src.readString();
+ gamemod = src.readInt();
+ basic = src.readArrayList(ArrayList.class.getClassLoader());
+ }
+
+ public static final Parcelable.Creator<Scheme> CREATOR = new Parcelable.Creator<Scheme>() {
+ public Scheme createFromParcel(Parcel source) {
+ return new Scheme(source);
+ }
+ public Scheme[] newArray(int size) {
+ return new Scheme[size];
+ }
+
+ };
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/Team.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,327 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+import org.xmlpull.v1.XmlSerializer;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Xml;
+
+public class Team implements Parcelable{
+
+ public static final String DIRECTORY_TEAMS = "teams";
+ private static final Integer[] TEAM_COLORS = {
+ 0xd12b42, /* red */
+ 0x4980c1, /* blue */
+ 0x6ab530, /* green */
+ 0xbc64c4, /* purple */
+ 0xe76d14, /* orange */
+ 0x3fb6e6, /* cyan */
+ 0xe3e90c, /* yellow */
+ 0x61d4ac, /* mint */
+ 0xf1c3e1, /* pink */
+ /* add new colors here */
+ };
+
+// private static final Integer[] TEAM_COLORS = {
+// 0xff0000, /* red */
+// 0x00ff00, /* blue */
+// 0x0000ff, /* green */
+// };
+
+ private static final int STATE_START = 0;
+ private static final int STATE_ROOT = 1;
+ private static final int STATE_HOG_ROOT = 2;
+
+ public String name, grave, flag, voice, fort, hash;
+
+ public static int maxNumberOfHogs = 0;
+ public static int maxNumberOfTeams = 0;
+
+ static{
+ maxNumberOfHogs = PascalExports.HWgetMaxNumberOfHogs();
+ maxNumberOfTeams = PascalExports.HWgetMaxNumberOfTeams();
+ }
+ public String[] hats = new String[maxNumberOfHogs];
+ public String[] hogNames = new String[maxNumberOfHogs];
+ public int[] levels = new int[maxNumberOfHogs];
+
+ public int hogCount = 4;
+ public int color = TEAM_COLORS[0];
+
+ public Team(){
+ }
+
+ public Team(Parcel in){
+ readFromParcel(in);
+ }
+
+ public boolean equals(Object o){
+ if(super.equals(o)) return true;
+ else if(o instanceof Team){
+ Team t = (Team)o;
+ boolean ret = name.equals(t.name);
+ ret &= grave.equals(t.grave);
+ ret &= flag.equals(t.flag);
+ ret &= voice.equals(t.voice);
+ ret &= fort.equals(t.fort);
+ ret &= hash.equals(t.hash);
+ return ret;
+ }else{
+ return false;
+ }
+ }
+
+ public void setRandomColor(int[] illegalcolors){
+ Integer[] colorsToPickFrom = TEAM_COLORS;
+ if(illegalcolors != null){
+ ArrayList<Integer> colors = new ArrayList<Integer>();
+ for(int color : TEAM_COLORS){
+ boolean validColor = true;
+ for(int illegal : illegalcolors){
+ if(color == illegal) validColor = false;
+ }
+ if(validColor) colors.add(color);
+ }
+ if(colors.size() != 0) colorsToPickFrom = colors.toArray(new Integer[1]);
+ }
+ int index = (int)Math.round(Math.random()*(colorsToPickFrom.length-1));
+ color = colorsToPickFrom[index];
+ }
+
+
+ public void sendToEngine(EngineProtocolNetwork epn, int hogCount, int health) throws IOException{
+ epn.sendToEngine(String.format("eaddteam %s %d %s", hash, color, name));
+ epn.sendToEngine(String.format("egrave %s", grave));
+ epn.sendToEngine(String.format("efort %s", fort));
+ epn.sendToEngine(String.format("evoicepack %s", voice));
+ epn.sendToEngine(String.format("eflag %s", flag));
+
+ for(int i = 0; i < hogCount; i++){
+ epn.sendToEngine(String.format("eaddhh %d %d %s", levels[i], health, hogNames[i]));
+ epn.sendToEngine(String.format("ehat %s", hats[i]));
+ }
+ }
+
+ /*
+ * XML METHODS
+ */
+
+ /**
+ * Read the xml file path and convert it to a Team object
+ * @param path absolute path to the xml file
+ * @return
+ */
+ public static Team getTeamFromXml(String path){
+ try {
+ XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+ XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
+
+ BufferedReader br = new BufferedReader(new FileReader(path), 1024);
+ xmlPuller.setInput(br);
+ Team team = new Team();
+ int hogCounter = 0;
+
+ int eventType = xmlPuller.getEventType();
+ int state = STATE_START;
+ while(eventType != XmlPullParser.END_DOCUMENT){
+ switch(state){
+ case STATE_START:
+ if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().equals("team")) state = STATE_ROOT;
+ else if(eventType != XmlPullParser.START_DOCUMENT) throwException(path, eventType);
+ break;
+ case STATE_ROOT:
+ if(eventType == XmlPullParser.START_TAG){
+ if(xmlPuller.getName().toLowerCase().equals("name")){
+ team.name = getXmlText(xmlPuller, "name");
+ }else if(xmlPuller.getName().toLowerCase().equals("flag")){
+ team.flag= getXmlText(xmlPuller, "flag");
+ }else if(xmlPuller.getName().toLowerCase().equals("voice")){
+ team.voice = getXmlText(xmlPuller, "voice");
+ }else if(xmlPuller.getName().toLowerCase().equals("grave")){
+ team.grave = getXmlText(xmlPuller, "grave");
+ }else if(xmlPuller.getName().toLowerCase().equals("fort")){
+ team.fort = getXmlText(xmlPuller, "fort");
+ }else if(xmlPuller.getName().toLowerCase().equals("hash")){
+ team.hash = getXmlText(xmlPuller, "hash");
+ }else if(xmlPuller.getName().toLowerCase().equals("hog")){
+ state = STATE_HOG_ROOT;
+ }else throwException(xmlPuller.getName(), eventType);
+ }else if(eventType == XmlPullParser.END_TAG) state = STATE_START;
+ else throwException(xmlPuller.getText(), eventType);
+ break;
+ case STATE_HOG_ROOT:
+ if(eventType == XmlPullParser.START_TAG){
+ if(xmlPuller.getName().toLowerCase().equals("name")){
+ team.hogNames[hogCounter] = getXmlText(xmlPuller, "name");
+ }else if(xmlPuller.getName().toLowerCase().equals("hat")){
+ team.hats[hogCounter] = getXmlText(xmlPuller, "hat");
+ }else if(xmlPuller.getName().toLowerCase().equals("level")){
+ team.levels[hogCounter] = Integer.parseInt(getXmlText(xmlPuller, "level"));
+ }else throwException(xmlPuller.getText(), eventType);
+ }else if(eventType == XmlPullParser.END_TAG){
+ hogCounter++;
+ state = STATE_ROOT;
+ }else throwException(xmlPuller.getText(), eventType);
+ break;
+ }
+ eventType = getEventType(xmlPuller);
+ }//end while(eventtype != END_DOCUMENT
+ return team;
+ } catch (NumberFormatException e){
+ e.printStackTrace();
+ } catch (XmlPullParserException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ private static String getXmlText(XmlPullParser xmlPuller, String parentTag)throws XmlPullParserException, IOException{
+ if(getEventType(xmlPuller) == XmlPullParser.TEXT){
+ String txt = xmlPuller.getText();
+ if(getEventType(xmlPuller) == XmlPullParser.END_TAG && xmlPuller.getName().toLowerCase().equals(parentTag)){
+ return txt;
+ }
+ }
+ throw new XmlPullParserException("malformed xml file on string read from tag: " + parentTag);
+ }
+
+ /**
+ * Skips whitespaces..
+ */
+ private static int getEventType(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+ int eventType = xmlPuller.next();
+ while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){
+ eventType = xmlPuller.next();
+ }
+ return eventType;
+ }
+
+ private static void throwException(String file, int eventType){
+ throw new IllegalArgumentException(String.format("Xml file: %s malformed with error: %d.", file, eventType));
+ }
+
+ public void writeToXml(OutputStream os){
+ XmlSerializer serializer = Xml.newSerializer();
+ try{
+ serializer.setOutput(os, "UTF-8");
+ serializer.startDocument("UTF-8", true);
+ serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
+
+ serializer.startTag(null, "team");
+ serializer.startTag(null, "name");
+ serializer.text(name);
+ serializer.endTag(null, "name");
+ serializer.startTag(null, "flag");
+ serializer.text(flag);
+ serializer.endTag(null, "flag");
+ serializer.startTag(null, "fort");
+ serializer.text(fort);
+ serializer.endTag(null, "fort");
+ serializer.startTag(null, "grave");
+ serializer.text(grave);
+ serializer.endTag(null, "grave");
+ serializer.startTag(null, "voice");
+ serializer.text(voice);
+ serializer.endTag(null, "voice");
+ serializer.startTag(null, "hash");
+ serializer.text(hash);
+ serializer.endTag(null, "hash");
+
+ for(int i = 0; i < maxNumberOfHogs; i++){
+ serializer.startTag(null, "hog");
+ serializer.startTag(null, "name");
+ serializer.text(hogNames[i]);
+ serializer.endTag(null, "name");
+ serializer.startTag(null, "hat");
+ serializer.text(hats[i]);
+ serializer.endTag(null, "hat");
+ serializer.startTag(null, "level");
+ serializer.text(String.valueOf(levels[i]));
+ serializer.endTag(null, "level");
+
+ serializer.endTag(null, "hog");
+ }
+ serializer.endTag(null, "team");
+ serializer.endDocument();
+ serializer.flush();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }finally{
+ try {
+ os.close();
+ } catch (IOException e) {}
+ }
+ }
+ /*
+ * END XML METHODS
+ */
+
+
+
+ /*
+ * PARCABLE METHODS
+ */
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(name);
+ dest.writeString(grave);
+ dest.writeString(flag);
+ dest.writeString(voice);
+ dest.writeString(fort);
+ dest.writeString(hash);
+ dest.writeStringArray(hats);
+ dest.writeStringArray(hogNames);
+ dest.writeIntArray(levels);
+ dest.writeInt(color);
+ dest.writeInt(hogCount);
+ }
+
+
+ public void readFromParcel(Parcel src){
+ name = src.readString();
+ grave = src.readString();
+ flag = src.readString();
+ voice = src.readString();
+ fort = src.readString();
+ hash = src.readString();
+ src.readStringArray(hats);
+ src.readStringArray(hogNames);
+ src.readIntArray(levels);
+ color = src.readInt();
+ hogCount = src.readInt();
+ }
+
+ public static final Parcelable.Creator<Team> CREATOR = new Parcelable.Creator<Team>() {
+ public Team createFromParcel(Parcel source) {
+ return new Team(source);
+ }
+ public Team[] newArray(int size) {
+ return new Team[size];
+ }
+
+ };
+
+ /*
+ * END PARCABLE METHODS
+ */
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/Weapon.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,194 @@
+package org.hedgewars.mobile.EngineProtocol;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+import android.content.Context;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Weapon implements Parcelable{
+
+ public static final String DIRECTORY_WEAPON = "weapons";
+
+ private String name;
+ private String QT;
+ private String prob;
+ private String delay;
+ private String crate;
+ private static int maxWeapons;
+
+ static{
+ //maxWeapons = PascalExports.HWgetNumberOfWeapons();
+ }
+
+ public Weapon(String _name, String _QT, String _prob, String _delay, String _crate){
+ name = _name;
+
+ //Incase there's a newer ammoStore which is bigger we append with zeros
+ StringBuffer sb = new StringBuffer();
+ while(_QT.length() + sb.length() < maxWeapons){
+ sb.append('0');
+ }
+
+ QT = String.format("e%s %s%s", "ammloadt", _QT, sb);
+ prob = String.format("e%s %s%s", "ammprob", _prob, sb);
+ delay = String.format("e%s %s%s", "ammdelay", _delay, sb);
+ crate = String.format("e%s %s%s", "ammreinf", _crate, sb);
+ }
+
+ public Weapon(Parcel in){
+ readFromParcel(in);
+ }
+
+ public String toString(){
+ return name;
+ }
+
+ public void sendToEngine(EngineProtocolNetwork epn, int teamsCount) throws IOException{
+ epn.sendToEngine(QT);//command prefix is already in string
+ epn.sendToEngine(prob);
+ epn.sendToEngine(delay);
+ epn.sendToEngine(crate);
+
+ for(int i = 0; i < teamsCount; i++){
+ epn.sendToEngine("eammstore");
+ }
+ }
+
+ public static final int STATE_START = 0;
+ public static final int STATE_ROOT = 1;
+ public static final int STATE_NAME = 2;
+ public static final int STATE_QT = 3;
+ public static final int STATE_PROBABILITY = 4;
+ public static final int STATE_DELAY = 5;
+ public static final int STATE_CRATE = 6;
+
+ public static ArrayList<Weapon> getWeapons(Context c) throws IllegalArgumentException{
+ String dir = c.getFilesDir().getAbsolutePath() + '/' + DIRECTORY_WEAPON + '/';
+ String[] files = new File(dir).list();
+ if(files == null) files = new String[]{};
+ Arrays.sort(files);
+
+ ArrayList<Weapon> weapons = new ArrayList<Weapon>();
+
+ try {
+ XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+ XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
+
+ for(String file : files){
+ BufferedReader br = new BufferedReader(new FileReader(dir + file), 1024);
+ xmlPuller.setInput(br);
+ String name = null;
+ String qt = null;
+ String prob = null;
+ String delay = null;
+ String crate = null;
+
+ int eventType = xmlPuller.getEventType();
+ int state = STATE_START;
+ while(eventType != XmlPullParser.END_DOCUMENT){
+ switch(state){
+ case STATE_START:
+ if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().equals("weapon")) state = STATE_ROOT;
+ else if(eventType != XmlPullParser.START_DOCUMENT) throwException(file, eventType);
+ break;
+ case STATE_ROOT:
+ if(eventType == XmlPullParser.START_TAG){
+ if(xmlPuller.getName().toLowerCase().equals("qt")) state = STATE_QT;
+ else if(xmlPuller.getName().toLowerCase().equals("name")) state = STATE_NAME;
+ else if(xmlPuller.getName().toLowerCase().equals("probability")) state = STATE_PROBABILITY;
+ else if(xmlPuller.getName().toLowerCase().equals("delay")) state = STATE_DELAY;
+ else if(xmlPuller.getName().toLowerCase().equals("crate")) state = STATE_CRATE;
+ else throwException(file, eventType);
+ }else if(eventType == XmlPullParser.END_TAG) state = STATE_START;
+ else throwException(xmlPuller.getText(), eventType);
+ break;
+ case STATE_NAME:
+ if(eventType == XmlPullParser.TEXT) name = xmlPuller.getText().trim();
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ case STATE_QT:
+ if(eventType == XmlPullParser.TEXT) qt = xmlPuller.getText().trim();
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ case STATE_PROBABILITY:
+ if(eventType == XmlPullParser.TEXT) prob = xmlPuller.getText().trim();
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ case STATE_DELAY:
+ if(eventType == XmlPullParser.TEXT) delay = xmlPuller.getText().trim();
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ case STATE_CRATE:
+ if(eventType == XmlPullParser.TEXT) crate = xmlPuller.getText().trim();
+ else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+ else throwException(file, eventType);
+ break;
+ }
+ eventType = xmlPuller.next();
+ while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){//Skip whitespaces
+ eventType = xmlPuller.next();
+ }
+ }//end while(eventtype != END_DOCUMENT
+ weapons.add(new Weapon(name, qt, prob, delay, crate));
+ }//end for(string file : files
+ return weapons;
+
+ } catch (XmlPullParserException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return new ArrayList<Weapon>();//TODO handle correctly
+ }
+
+ private static void throwException(String file, int eventType){
+ throw new IllegalArgumentException(String.format("Xml file: %s malformed with eventType: %d.", file, eventType));
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(name);
+ dest.writeString(QT);
+ dest.writeString(prob);
+ dest.writeString(delay);
+ dest.writeString(crate);
+ }
+
+ private void readFromParcel(Parcel src){
+ name = src.readString();
+ QT = src.readString();
+ prob = src.readString();
+ delay = src.readString();
+ crate = src.readString();
+ }
+
+ public static final Parcelable.Creator<Weapon> CREATOR = new Parcelable.Creator<Weapon>() {
+ public Weapon createFromParcel(Parcel source) {
+ return new Weapon(source);
+ }
+ public Weapon[] newArray(int size) {
+ return new Weapon[size];
+ }
+
+ };
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/MainActivity.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,41 @@
+package org.hedgewars.mobile;
+
+import org.hedgewars.mobile.Downloader.DownloadActivity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+
+public class MainActivity extends Activity {
+
+ Button downloader, startGame;
+
+ public void onCreate(Bundle sis){
+ super.onCreate(sis);
+ setContentView(R.layout.main);
+
+ downloader = (Button)findViewById(R.id.downloader);
+ startGame = (Button)findViewById(R.id.startGame);
+
+ downloader.setOnClickListener(downloadClicker);
+ startGame.setOnClickListener(startGameClicker);
+ }
+
+
+
+ private OnClickListener downloadClicker = new OnClickListener(){
+ public void onClick(View v){
+ startActivityForResult(new Intent(getApplicationContext(), DownloadActivity.class), 0);
+ }
+ };
+
+ private OnClickListener startGameClicker = new OnClickListener(){
+ public void onClick(View v){
+ startActivity(new Intent(getApplicationContext(), StartGameActivity.class));
+ }
+ };
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/SDLActivity.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,556 @@
+package org.hedgewars.mobile;
+
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
+
+import org.hedgewars.mobile.EngineProtocol.EngineProtocolNetwork;
+import org.hedgewars.mobile.EngineProtocol.GameConfig;
+import org.hedgewars.mobile.TouchInterface.TouchInterface;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.PixelFormat;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.media.AudioFormat;
+import android.media.AudioManager;
+import android.media.AudioTrack;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.View;
+
+/**
+ * SDL Activity
+ */
+public class SDLActivity extends Activity {
+
+ // Main components
+ public static SDLActivity mSingleton;
+ public static SDLSurface mSurface;
+
+ // Audio
+ private static Thread mAudioThread;
+ private static AudioTrack mAudioTrack;
+
+ // Load the .so
+ static {
+ System.loadLibrary("SDL");
+ System.loadLibrary("SDL_image");
+ System.loadLibrary("mikmod");
+ System.loadLibrary("SDL_net");
+ System.loadLibrary("SDL_mixer");
+ System.loadLibrary("SDL_ttf");
+ System.loadLibrary("lua5.1");
+ System.loadLibrary("hwengine");
+ System.loadLibrary("main");
+ }
+
+ // Setup
+ protected void onCreate(Bundle savedInstanceState) {
+ // Log.v("SDL", "onCreate()");
+ super.onCreate(savedInstanceState);
+
+ // So we can call stuff from static callbacks
+ mSingleton = this;
+
+ // Set up the surface
+ GameConfig config = getIntent().getParcelableExtra("config");
+ mSurface = new SDLSurface(getApplication(), config);
+ setContentView(mSurface);
+ SurfaceHolder holder = mSurface.getHolder();
+ holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
+ }
+
+ // Events
+ protected void onPause() {
+ // Log.v("SDL", "onPause()");
+ super.onPause();
+
+ }
+
+ protected void onResume() {
+ // Log.v("SDL", "onResume()");
+ super.onResume();
+ }
+
+ public void onBackPressed(){
+ nativeQuit();
+ super.onBackPressed();
+ }
+
+ // Messages from the SDLMain thread
+ static int COMMAND_CHANGE_TITLE = 1;
+
+ // Handler for the messages
+ Handler commandHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ if (msg.arg1 == COMMAND_CHANGE_TITLE) {
+ setTitle((String) msg.obj);
+ }
+ }
+ };
+
+ // Send a message from the SDLMain thread
+ void sendCommand(int command, Object data) {
+ Message msg = commandHandler.obtainMessage();
+ msg.arg1 = command;
+ msg.obj = data;
+ commandHandler.sendMessage(msg);
+ }
+
+ // C functions we call
+ public static native void nativeInit(String[] argv);
+
+ public static native void nativeQuit();
+
+ public static native void onNativeResize(int x, int y, int format);
+
+ public static native void onNativeKeyDown(int keycode);
+
+ public static native void onNativeKeyUp(int keycode);
+
+ public static native void onNativeTouch(int action, int pointer, float x, float y,
+ float p);
+
+ public static native void onNativeAccel(float x, float y, float z);
+
+ public static native void nativeRunAudioThread();
+
+ // Java functions called from C
+
+ public static boolean createGLContext(int majorVersion, int minorVersion) {
+ return mSurface.initEGL(majorVersion, minorVersion);
+ }
+
+ public static void flipBuffers() {
+ mSurface.flipEGL();
+ }
+
+ public static void setActivityTitle(String title) {
+ // Called from SDLMain() thread and can't directly affect the view
+ mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
+ }
+
+ // Audio
+ private static Object buf;
+
+ public static Object audioInit(int sampleRate, boolean is16Bit,
+ boolean isStereo, int desiredFrames) {
+ int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO
+ : AudioFormat.CHANNEL_CONFIGURATION_MONO;
+ int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT
+ : AudioFormat.ENCODING_PCM_8BIT;
+ int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
+
+ Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono")
+ + " " + (is16Bit ? "16-bit" : "8-bit") + " "
+ + ((float) sampleRate / 1000f) + "kHz, " + desiredFrames
+ + " frames buffer");
+
+ // Let the user pick a larger buffer if they really want -- but ye
+ // gods they probably shouldn't, the minimums are horrifyingly high
+ // latency already
+ desiredFrames = Math.max(
+ desiredFrames,
+ (AudioTrack.getMinBufferSize(sampleRate, channelConfig,
+ audioFormat) + frameSize - 1)
+ / frameSize);
+
+ mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
+ channelConfig, audioFormat, desiredFrames * frameSize,
+ AudioTrack.MODE_STREAM);
+
+ audioStartThread();
+
+ Log.v("SDL",
+ "SDL audio: got "
+ + ((mAudioTrack.getChannelCount() >= 2) ? "stereo"
+ : "mono")
+ + " "
+ + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit"
+ : "8-bit") + " "
+ + ((float) mAudioTrack.getSampleRate() / 1000f)
+ + "kHz, " + desiredFrames + " frames buffer");
+
+ if (is16Bit) {
+ buf = new short[desiredFrames * (isStereo ? 2 : 1)];
+ } else {
+ buf = new byte[desiredFrames * (isStereo ? 2 : 1)];
+ }
+ return buf;
+ }
+
+ public static void audioStartThread() {
+ mAudioThread = new Thread(new Runnable() {
+ public void run() {
+ mAudioTrack.play();
+ nativeRunAudioThread();
+ }
+ });
+
+ // I'd take REALTIME if I could get it!
+ mAudioThread.setPriority(Thread.MAX_PRIORITY);
+ mAudioThread.start();
+ }
+
+ public static void audioWriteShortBuffer(short[] buffer) {
+ for (int i = 0; i < buffer.length;) {
+ int result = mAudioTrack.write(buffer, i, buffer.length - i);
+ if (result > 0) {
+ i += result;
+ } else if (result == 0) {
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+ // Nom nom
+ }
+ } else {
+ Log.w("SDL", "SDL audio: error return from write(short)");
+ return;
+ }
+ }
+ }
+
+ public static void audioWriteByteBuffer(byte[] buffer) {
+ for (int i = 0; i < buffer.length;) {
+ int result = mAudioTrack.write(buffer, i, buffer.length - i);
+ if (result > 0) {
+ i += result;
+ } else if (result == 0) {
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+ // Nom nom
+ }
+ } else {
+ Log.w("SDL", "SDL audio: error return from write(short)");
+ return;
+ }
+ }
+ }
+
+ public static void audioQuit() {
+ if (mAudioThread != null) {
+ try {
+ mAudioThread.join();
+ } catch (Exception e) {
+ Log.v("SDL", "Problem stopping audio thread: " + e);
+ }
+ mAudioThread = null;
+
+ // Log.v("SDL", "Finished waiting for audio thread");
+ }
+
+ if (mAudioTrack != null) {
+ mAudioTrack.stop();
+ mAudioTrack = null;
+ }
+ }
+}
+
+/**
+ * Simple nativeInit() runnable
+ */
+class SDLMain implements Runnable {
+ private int surfaceWidth, surfaceHeight;
+ private GameConfig config;
+
+ public SDLMain(int width, int height, GameConfig _config) {
+ config = _config;
+ surfaceWidth = width;
+ surfaceHeight = height;
+ }
+
+ public void run() {
+ // Runs SDL_main()
+
+ EngineProtocolNetwork ipc = new EngineProtocolNetwork(config);
+
+ String path = Utils.getDownloadPath(SDLActivity.mSingleton);
+ //path = path.substring(0, path.length()-1);//remove the trailing '/'
+
+ SDLActivity.nativeInit(new String[] { String.valueOf(ipc.port),
+ String.valueOf(surfaceWidth), String.valueOf(surfaceHeight),
+ "0", "null", "xeli", "1", "1", "1", "0", "", path });
+
+ // Log.v("SDL", "SDL thread terminated");
+ }
+}
+
+/**
+ * SDLSurface. This is what we draw on, so we need to know when it's created in
+ * order to do anything useful.
+ *
+ * Because of this, that's where we set up the SDL thread
+ */
+class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
+ View.OnKeyListener, SensorEventListener {
+
+ // This is what SDL runs in. It invokes SDL_main(), eventually
+ private Thread mSDLThread;
+
+ // EGL private objects
+ private EGLContext mEGLContext;
+ private EGLSurface mEGLSurface;
+ private EGLDisplay mEGLDisplay;
+
+ // Sensors
+ private static SensorManager mSensorManager;
+
+ private GameConfig config;
+
+ // Startup
+ public SDLSurface(Context context, GameConfig _config) {
+ super(context);
+ getHolder().addCallback(this);
+
+ setFocusable(true);
+ setFocusableInTouchMode(true);
+ requestFocus();
+ setOnKeyListener(this);
+ setOnTouchListener(TouchInterface.getTouchInterface());
+
+ mSensorManager = (SensorManager) context.getSystemService("sensor");
+
+ config = _config;
+ }
+
+ // Called when we have a valid drawing surface
+ public void surfaceCreated(SurfaceHolder holder) {
+ // Log.v("SDL", "surfaceCreated()");
+
+ enableSensor(Sensor.TYPE_ACCELEROMETER, true);
+ }
+
+ // Called when we lose the surface
+ public void surfaceDestroyed(SurfaceHolder holder) {
+ // Log.v("SDL", "surfaceDestroyed()");
+
+ // Send a quit message to the application
+ SDLActivity.nativeQuit();
+
+ // Now wait for the SDL thread to quit
+ if (mSDLThread != null) {
+ try {
+ mSDLThread.join();
+ } catch (Exception e) {
+ Log.v("SDL", "Problem stopping thread: " + e);
+ }
+ mSDLThread = null;
+
+ // Log.v("SDL", "Finished waiting for SDL thread");
+ }
+
+ enableSensor(Sensor.TYPE_ACCELEROMETER, false);
+ }
+
+ // Called when the surface is resized
+ public void surfaceChanged(SurfaceHolder holder, int format, int width,
+ int height) {
+ Log.d("SDL", "surfaceChanged()" + width + " + " + height);
+
+ int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
+ switch (format) {
+ case PixelFormat.A_8:
+ Log.v("SDL", "pixel format A_8");
+ break;
+ case PixelFormat.LA_88:
+ Log.v("SDL", "pixel format LA_88");
+ break;
+ case PixelFormat.L_8:
+ Log.v("SDL", "pixel format L_8");
+ break;
+ case PixelFormat.RGBA_4444:
+ Log.v("SDL", "pixel format RGBA_4444");
+ sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
+ break;
+ case PixelFormat.RGBA_5551:
+ Log.v("SDL", "pixel format RGBA_5551");
+ sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
+ break;
+ case PixelFormat.RGBA_8888:
+ Log.v("SDL", "pixel format RGBA_8888");
+ sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
+ break;
+ case PixelFormat.RGBX_8888:
+ Log.v("SDL", "pixel format RGBX_8888");
+ sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
+ break;
+ case PixelFormat.RGB_332:
+ Log.v("SDL", "pixel format RGB_332");
+ sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
+ break;
+ case PixelFormat.RGB_565:
+ Log.v("SDL", "pixel format RGB_565");
+ sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
+ break;
+ case PixelFormat.RGB_888:
+ Log.v("SDL", "pixel format RGB_888");
+ // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
+ sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
+ break;
+ default:
+ Log.v("SDL", "pixel format unknown " + format);
+ break;
+ }
+ SDLActivity.onNativeResize(width, height, sdlFormat);
+
+ // Now start up the C app thread
+ if (mSDLThread == null) {
+ mSDLThread = new Thread(new SDLMain(width, height, config),
+ "SDLThread");
+ mSDLThread.start();
+ }
+ }
+
+ // unused
+ public void onDraw(Canvas canvas) {
+ }
+
+ // EGL functions
+ public boolean initEGL(int majorVersion, int minorVersion) {
+ Log.v("SDL", "Starting up OpenGL ES " + majorVersion + "."
+ + minorVersion);
+
+ try {
+ EGL10 egl = (EGL10) EGLContext.getEGL();
+
+ EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
+
+ int[] version = new int[2];
+ egl.eglInitialize(dpy, version);
+
+ int EGL_OPENGL_ES_BIT = 1;
+ int EGL_OPENGL_ES2_BIT = 4;
+ int renderableType = 0;
+ if (majorVersion == 2) {
+ renderableType = EGL_OPENGL_ES2_BIT;
+ } else if (majorVersion == 1) {
+ renderableType = EGL_OPENGL_ES_BIT;
+ }
+ int[] configSpec = {
+ // EGL10.EGL_DEPTH_SIZE, 16,
+ EGL10.EGL_RENDERABLE_TYPE, renderableType, EGL10.EGL_NONE };
+ EGLConfig[] configs = new EGLConfig[1];
+ int[] num_config = new int[1];
+ if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config)
+ || num_config[0] == 0) {
+ Log.e("SDL", "No EGL config available");
+ return false;
+ }
+ EGLConfig config = configs[0];
+
+ EGLContext ctx = egl.eglCreateContext(dpy, config,
+ EGL10.EGL_NO_CONTEXT, null);
+ if (ctx == EGL10.EGL_NO_CONTEXT) {
+ Log.e("SDL", "Couldn't create context");
+ return false;
+ }
+
+ EGLSurface surface = egl.eglCreateWindowSurface(dpy, config, this,
+ null);
+ if (surface == EGL10.EGL_NO_SURFACE) {
+ Log.e("SDL", "Couldn't create surface");
+ return false;
+ }
+
+ if (!egl.eglMakeCurrent(dpy, surface, surface, ctx)) {
+ Log.e("SDL", "Couldn't make context current");
+ return false;
+ }
+
+ mEGLContext = ctx;
+ mEGLDisplay = dpy;
+ mEGLSurface = surface;
+
+ } catch (Exception e) {
+ Log.v("SDL", e + "");
+ for (StackTraceElement s : e.getStackTrace()) {
+ Log.v("SDL", s.toString());
+ }
+ }
+
+ return true;
+ }
+
+ // EGL buffer flip
+ public void flipEGL() {
+ try {
+ EGL10 egl = (EGL10) EGLContext.getEGL();
+
+ egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null);
+
+ // drawing here
+
+ egl.eglWaitGL();
+
+ egl.eglSwapBuffers(mEGLDisplay, mEGLSurface);
+
+ } catch (Exception e) {
+ Log.v("SDL", "flipEGL(): " + e);
+ for (StackTraceElement s : e.getStackTrace()) {
+ Log.v("SDL", s.toString());
+ }
+
+ }
+ }
+
+ // Key events
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if(keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP) return false;
+ if (event.getAction() == KeyEvent.ACTION_DOWN) {
+ Log.v("SDL", "key down: " + keyCode);
+ if(keyCode == KeyEvent.KEYCODE_BACK){//TODO ask user to quit or not
+ SDLActivity.nativeQuit();
+ SDLActivity.mSingleton.finish();
+ }else{
+ SDLActivity.onNativeKeyDown(keyCode);
+ }
+
+ return true;
+ } else if (event.getAction() == KeyEvent.ACTION_UP) {
+ Log.v("SDL", "key up: " + keyCode);
+ SDLActivity.onNativeKeyUp(keyCode);
+ return true;
+ }
+
+ return false;
+ }
+
+ // Sensor events
+ public void enableSensor(int sensortype, boolean enabled) {
+ // TODO: This uses getDefaultSensor - what if we have >1 accels?
+ if (enabled) {
+ mSensorManager.registerListener(this,
+ mSensorManager.getDefaultSensor(sensortype),
+ SensorManager.SENSOR_DELAY_GAME, null);
+ } else {
+ mSensorManager.unregisterListener(this,
+ mSensorManager.getDefaultSensor(sensortype));
+ }
+ }
+
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
+ // TODO
+ }
+
+ public void onSensorChanged(SensorEvent event) {
+ if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
+ SDLActivity.onNativeAccel(event.values[0], event.values[1],
+ event.values[2]);
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/StartGameActivity.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,184 @@
+package org.hedgewars.mobile;
+
+import java.util.ArrayList;
+
+import org.hedgewars.mobile.EngineProtocol.FrontendDataUtils;
+import org.hedgewars.mobile.EngineProtocol.GameConfig;
+import org.hedgewars.mobile.EngineProtocol.Map;
+import org.hedgewars.mobile.EngineProtocol.Scheme;
+import org.hedgewars.mobile.EngineProtocol.Team;
+import org.hedgewars.mobile.EngineProtocol.Weapon;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
+import android.widget.ArrayAdapter;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.Spinner;
+
+public class StartGameActivity extends Activity {
+
+ public static final int ACTIVITY_TEAM_SELECTOR = 0;
+
+ private GameConfig config = null;
+ private ImageButton start, back, team;
+ private Spinner maps, gameplay, gamescheme, weapons, themes;
+ private ImageView themeIcon, mapPreview;
+
+ public void onCreate(Bundle savedInstanceState){
+ super.onCreate(savedInstanceState);
+
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+
+ Utils.resRawToFilesDir(this,R.array.schemes, Scheme.DIRECTORY_SCHEME);
+ Utils.resRawToFilesDir(this, R.array.weapons, Weapon.DIRECTORY_WEAPON);
+ Scheme.parseBasicFlags(this);
+ config = new GameConfig();
+
+ setContentView(R.layout.starting_game);
+
+ back = (ImageButton) findViewById(R.id.btnBack);
+ team = (ImageButton) findViewById(R.id.btnTeams);
+ start = (ImageButton) findViewById(R.id.btnStart);
+
+ maps = (Spinner) findViewById(R.id.spinMaps);
+ gameplay = (Spinner) findViewById(R.id.spinGameplay);
+ gamescheme = (Spinner) findViewById(R.id.spinGamescheme);
+ weapons = (Spinner) findViewById(R.id.spinweapons);
+ themes = (Spinner) findViewById(R.id.spinTheme);
+
+ themeIcon = (ImageView) findViewById(R.id.imgTheme);
+ mapPreview = (ImageView) findViewById(R.id.mapPreview);
+
+ start.setOnClickListener(startClicker);
+ back.setOnClickListener(backClicker);
+ team.setOnClickListener(teamClicker);
+
+ ArrayAdapter<?> adapter = new ArrayAdapter<Map>(this, R.layout.listview_item, FrontendDataUtils.getMaps(this));
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ maps.setAdapter(adapter);
+ maps.setOnItemSelectedListener(mapsClicker);
+
+ adapter = new ArrayAdapter<String>(this, R.layout.listview_item, FrontendDataUtils.getGameplay(this));
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ gameplay.setAdapter(adapter);
+ gameplay.setOnItemSelectedListener(gameplayClicker);
+
+ adapter = new ArrayAdapter<Scheme>(this, R.layout.listview_item, FrontendDataUtils.getSchemes(this));
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ gamescheme.setAdapter(adapter);
+ gamescheme.setOnItemSelectedListener(schemeClicker);
+
+ adapter = new ArrayAdapter<Weapon>(this, R.layout.listview_item, FrontendDataUtils.getWeapons(this));
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ weapons.setAdapter(adapter);
+ weapons.setOnItemSelectedListener(weaponClicker);
+
+ adapter = new ArrayAdapter<String>(this, R.layout.listview_item, FrontendDataUtils.getThemes(this));
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ themes.setAdapter(adapter);
+ themes.setOnItemSelectedListener(themesClicker);
+
+ }
+
+ public void onActivityResult(int requestCode, int resultCode, Intent data){
+ switch(requestCode){
+ case ACTIVITY_TEAM_SELECTOR:
+ if(resultCode == Activity.RESULT_OK){
+ Parcelable[] parcelables = (Parcelable[])data.getParcelableArrayExtra("teams");
+ config.teams.clear();
+ for(Parcelable t : parcelables){
+ config.teams.add((Team)t);
+ }
+
+ }
+ break;
+ }
+ }
+
+
+ private OnItemSelectedListener themesClicker = new OnItemSelectedListener(){
+
+ public void onItemSelected(AdapterView<?> arg0, View view, int position, long rowId) {
+ String themeName = (String) arg0.getAdapter().getItem(position);
+ Drawable themeIconDrawable = Drawable.createFromPath(Utils.getDownloadPath(StartGameActivity.this) + "Themes/" + themeName + "/icon@2X.png");
+ themeIcon.setImageDrawable(themeIconDrawable);
+ config.theme = themeName;
+ }
+
+ public void onNothingSelected(AdapterView<?> arg0) {
+ }
+
+ };
+
+ private OnItemSelectedListener mapsClicker = new OnItemSelectedListener(){
+
+ public void onItemSelected(AdapterView<?> arg0, View view, int position,long rowId) {
+ Map map = (Map)arg0.getAdapter().getItem(position);
+ mapPreview.setImageDrawable(map.getDrawable());
+ config.map = map;
+ }
+
+ public void onNothingSelected(AdapterView<?> arg0) {
+ }
+
+ };
+
+ private OnItemSelectedListener weaponClicker = new OnItemSelectedListener(){
+ public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ config.weapon = (Weapon)arg0.getAdapter().getItem(arg2);
+ }
+ public void onNothingSelected(AdapterView<?> arg0) {
+
+ }
+ };
+ private OnItemSelectedListener schemeClicker = new OnItemSelectedListener(){
+ public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ config.scheme = (Scheme)arg0.getAdapter().getItem(arg2);
+ }
+ public void onNothingSelected(AdapterView<?> arg0) {
+
+ }
+ };
+ private OnItemSelectedListener gameplayClicker = new OnItemSelectedListener(){
+ public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ //config = ()arg0.getAdapter().getItem(arg2);
+ }
+ public void onNothingSelected(AdapterView<?> arg0) {
+
+ }
+ };
+
+ private OnClickListener startClicker = new OnClickListener(){
+ public void onClick(View v) {
+ Intent i = new Intent(StartGameActivity.this, SDLActivity.class);
+ i.putExtra("config", config);
+ startActivity(i);
+ }
+ };
+
+ private OnClickListener backClicker = new OnClickListener(){
+ public void onClick(View v) {
+ finish();
+ }
+ };
+
+ private OnClickListener teamClicker = new OnClickListener(){
+ public void onClick(View v) {
+ Intent i = new Intent(StartGameActivity.this, TeamSelectionActivity.class);
+ i.putParcelableArrayListExtra("teams", config.teams);
+ startActivityForResult(i, ACTIVITY_TEAM_SELECTOR);
+ }
+ };
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/TeamCreatorActivity.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,298 @@
+package org.hedgewars.mobile;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.hedgewars.mobile.EngineProtocol.FrontendDataUtils;
+import org.hedgewars.mobile.EngineProtocol.Team;
+
+import android.app.Activity;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.media.MediaPlayer;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnFocusChangeListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.ScrollView;
+import android.widget.SimpleAdapter;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+public class TeamCreatorActivity extends Activity {
+
+ private TextView name;
+ private Spinner difficulty, grave, flag, voice, fort;
+ private ImageView imgFort;
+ private ArrayList<ImageButton> hogDice = new ArrayList<ImageButton>();
+ private ArrayList<Spinner> hogHat = new ArrayList<Spinner>();
+ private ArrayList<EditText> hogName = new ArrayList<EditText>();
+ private ImageButton back, save, voiceButton;
+ private ScrollView scroller;
+ private MediaPlayer mp = null;
+ private ArrayList<RelativeLayout> hogs;
+ private boolean settingsChanged = false;
+ private boolean saved = false;
+
+ public void onCreate(Bundle savedInstanceState){
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.team_creation);
+
+ name = (TextView) findViewById(R.id.txtName);
+ difficulty = (Spinner) findViewById(R.id.spinType);
+ grave = (Spinner) findViewById(R.id.spinGrave);
+ flag = (Spinner) findViewById(R.id.spinFlag);
+ voice = (Spinner) findViewById(R.id.spinVoice);
+ fort = (Spinner) findViewById(R.id.spinFort);
+
+ imgFort = (ImageView) findViewById(R.id.imgFort);
+
+ back = (ImageButton) findViewById(R.id.btnBack);
+ save = (ImageButton) findViewById(R.id.btnSave);
+ voiceButton = (ImageButton) findViewById(R.id.btnPlay);
+
+ scroller = (ScrollView) findViewById(R.id.scroller);
+
+ save.setOnClickListener(saveClicker);
+ back.setOnClickListener(backClicker);
+
+ LinearLayout ll = (LinearLayout) findViewById(R.id.HogsContainer);
+ hogs = new ArrayList<RelativeLayout>(ll.getChildCount());
+ for(int i = 0; i < ll.getChildCount(); i++){
+ RelativeLayout team_creation_entry = (RelativeLayout) ll.getChildAt(i);
+
+ hogHat.add((Spinner)team_creation_entry.findViewById(R.id.spinTeam1));
+ hogDice.add((ImageButton)team_creation_entry.findViewById(R.id.btnTeam1));
+ hogName.add((EditText)team_creation_entry.findViewById(R.id.txtTeam1));
+ }
+ ArrayList<HashMap<String, ?>> gravesData = FrontendDataUtils.getGraves(this);
+ SimpleAdapter sa = new SimpleAdapter(this, gravesData, R.layout.spinner_textimg_entry, new String[]{"txt", "img"}, new int[]{R.id.spinner_txt, R.id.spinner_img});
+
+ sa.setViewBinder(viewBinder);
+ grave.setAdapter(sa);
+ grave.setOnFocusChangeListener(focusser);
+
+ ArrayList<HashMap<String, ?>> flagsData = FrontendDataUtils.getFlags(this);
+ sa = new SimpleAdapter(this, flagsData, R.layout.spinner_textimg_entry, new String[]{"txt", "img"}, new int[]{R.id.spinner_txt, R.id.spinner_img});
+ sa.setViewBinder(viewBinder);
+ flag.setAdapter(sa);
+ flag.setOnFocusChangeListener(focusser);
+
+ ArrayList<HashMap<String, ?>> typesData = FrontendDataUtils.getTypes(this);
+ sa = new SimpleAdapter(this, typesData, R.layout.spinner_textimg_entry, new String[]{"txt", "img"}, new int[]{R.id.spinner_txt, R.id.spinner_img});
+ difficulty.setAdapter(sa);
+ difficulty.setOnFocusChangeListener(focusser);
+
+ ArrayList<HashMap<String, ?>> hatsData = FrontendDataUtils.getHats(this);
+ sa = new SimpleAdapter(this, hatsData, R.layout.spinner_textimg_entry, new String[]{"txt", "img"}, new int[]{R.id.spinner_txt, R.id.spinner_img});
+ sa.setViewBinder(viewBinder);
+ for(Spinner spin : hogHat){
+ spin.setAdapter(sa);
+ }
+
+ ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.listview_item, FrontendDataUtils.getVoices(this));
+ voice.setAdapter(adapter);
+ voice.setOnFocusChangeListener(focusser);
+ voiceButton.setOnClickListener(voiceClicker);
+
+ adapter = new ArrayAdapter<String>(this, R.layout.listview_item, FrontendDataUtils.getForts(this));
+ fort.setAdapter(adapter);
+ fort.setOnItemSelectedListener(fortSelector);
+ fort.setOnFocusChangeListener(focusser);
+
+ Team t = this.getIntent().getParcelableExtra("team");
+ if(t != null){
+ name.setText(t.name);
+ int position = ((ArrayAdapter<String>)voice.getAdapter()).getPosition(t.voice);
+ voice.setSelection(position);
+
+ position = ((ArrayAdapter<String>)fort.getAdapter()).getPosition(t.fort);
+ fort.setSelection(position);
+
+ position = 0;
+ for(HashMap<String, ?> hashmap : typesData){
+ if(hashmap.get("txt").equals(t.levels[0])){
+ difficulty.setSelection(position);
+ break;
+ }
+ }
+
+ position = 0;
+ for(HashMap<String, ?> hashmap : gravesData){
+ if(hashmap.get("txt").equals(t.grave)){
+ grave.setSelection(position);
+ break;
+ }
+ }
+
+ position = 0;
+ for(HashMap<String, ?> hashmap : typesData){
+ if(hashmap.get("txt").equals(t.flag)){
+ flag.setSelection(position);
+ break;
+ }
+ }
+
+ for(int i = 0; i < Team.maxNumberOfHogs; i++){
+ position = 0;
+ for(HashMap<String, ?> hashmap : hatsData){
+ if(hashmap.get("txt").equals(t.hats[i])){
+ hogHat.get(i).setSelection(position);
+ }
+ }
+
+ hogName.get(i).setText(t.hogNames[i]);
+ }
+ }
+ }
+
+ public void onDestroy(){
+ super.onDestroy();
+ if(mp != null){
+ mp.release();
+ mp = null;
+ }
+ }
+
+ private OnFocusChangeListener focusser = new OnFocusChangeListener(){
+ public void onFocusChange(View v, boolean hasFocus) {
+ settingsChanged = true;
+ }
+
+ };
+
+ public void onBackPressed(){
+ onFinishing();
+ super.onBackPressed();
+
+ }
+
+ private OnClickListener backClicker = new OnClickListener(){
+ public void onClick(View v){
+ onFinishing();
+ finish();
+ }
+ };
+
+ private void onFinishing(){
+ if(settingsChanged){
+ setResult(RESULT_OK);
+ }else{
+ setResult(RESULT_CANCELED);
+ }
+ }
+
+ private OnClickListener saveClicker = new OnClickListener(){
+ public void onClick(View v) {
+ saved = true;
+ Team team = new Team();
+ team.name = name.getText().toString();
+ HashMap<String, Object> hashmap = (HashMap<String, Object>) flag.getSelectedItem();
+
+ team.flag = (String)hashmap.get("txt");
+ team.fort = fort.getSelectedItem().toString();
+ hashmap = (HashMap<String, Object>)grave.getSelectedItem();
+ team.grave = hashmap.get("txt").toString();
+ team.hash = "0";
+ team.voice = voice.getSelectedItem().toString();
+
+ hashmap = ((HashMap<String, Object>)difficulty.getSelectedItem());
+ String levelString = hashmap.get("txt").toString();
+ int levelInt;
+ if(levelString.equals(getString(R.string.human))){
+ levelInt = 0;
+ }else if(levelString.equals(getString(R.string.bot5))){
+ levelInt = 1;
+ }else if(levelString.equals(getString(R.string.bot4))){
+ levelInt = 2;
+ }else if(levelString.equals(getString(R.string.bot3))){
+ levelInt = 3;
+ }else if(levelString.equals(getString(R.string.bot2))){
+ levelInt = 4;
+ }else {
+ levelInt = 5;
+ }
+
+ for(int i = 0; i < hogName.size(); i++){
+ team.hogNames[i] = hogName.get(i).getText().toString();
+ hashmap = (HashMap<String, Object>)hogHat.get(i).getSelectedItem();
+ team.hats[i] = hashmap.get("txt").toString();
+ team.levels[i] = levelInt;
+ }
+ try {
+ File teamsDir = new File(getFilesDir().getAbsolutePath() + '/' + Team.DIRECTORY_TEAMS);
+ if(!teamsDir.exists()) teamsDir.mkdir();
+ FileOutputStream fos = new FileOutputStream(String.format("%s/%s.xml", teamsDir.getAbsolutePath(), team.name));
+ team.writeToXml(fos);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ };
+
+ private OnItemSelectedListener fortSelector = new OnItemSelectedListener(){
+ @SuppressWarnings("unchecked")
+ public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long arg3) {
+ settingsChanged = true;
+ String fortName = (String) arg0.getAdapter().getItem(position);
+ Drawable fortIconDrawable = Drawable.createFromPath(Utils.getDownloadPath(TeamCreatorActivity.this) + "Forts/" + fortName + "L.png");
+ imgFort.setImageDrawable(fortIconDrawable);
+ scroller.fullScroll(ScrollView.FOCUS_DOWN);//Scroll the scrollview to the bottom, work around for scollview invalidation (scrolls back to top)
+ }
+
+ public void onNothingSelected(AdapterView<?> arg0) {
+ }
+
+ };
+
+ private OnClickListener voiceClicker = new OnClickListener(){
+ public void onClick(View v) {
+ try {
+ File dir = new File(String.format("%sSounds/voices/%s", Utils.getDownloadPath(TeamCreatorActivity.this), voice.getSelectedItem()));
+ String file = "";
+ File[] dirs = dir.listFiles();
+ File f = dirs[(int)Math.round(Math.random()*dirs.length)];
+ if(f.getName().endsWith(".ogg"))file = f.getAbsolutePath();
+
+ if(mp == null) mp = new MediaPlayer();
+ else mp.reset();
+ mp.setDataSource(file);
+ mp.prepare();
+ mp.start();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalStateException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ private SimpleAdapter.ViewBinder viewBinder = new SimpleAdapter.ViewBinder() {
+
+ public boolean setViewValue(View view, Object data, String textRepresentation) {
+ if(view instanceof ImageView && data instanceof Bitmap){
+ ImageView v = (ImageView)view;
+ v.setImageBitmap((Bitmap)data);
+ return true;
+ }else{
+ return false;
+ }
+ }
+ };
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/TeamSelectionActivity.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,266 @@
+package org.hedgewars.mobile;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.hedgewars.mobile.EngineProtocol.FrontendDataUtils;
+import org.hedgewars.mobile.EngineProtocol.Team;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.view.ContextMenu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.SimpleAdapter;
+import android.widget.SimpleAdapter.ViewBinder;
+
+public class TeamSelectionActivity extends Activity{
+
+ private static final int ACTIVITY_TEAMCREATION = 0;
+
+ private ImageButton addTeam, back;
+ private ListView availableTeams, selectedTeams;
+ private ArrayList<HashMap<String, Object>> availableTeamsList, selectedTeamsList;
+ private int minTeams = 2;
+
+ public void onCreate(Bundle savedInstanceState){
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.team_selector);
+
+ addTeam = (ImageButton) findViewById(R.id.btnAdd);
+ back = (ImageButton) findViewById(R.id.btnBack);
+
+ addTeam.setOnClickListener(addTeamClicker);
+ back.setOnClickListener(backClicker);
+
+ availableTeams = (ListView) findViewById(R.id.availableTeams);
+ availableTeamsList = FrontendDataUtils.getTeams(this);
+ SimpleAdapter adapter = new SimpleAdapter(this, availableTeamsList, R.layout.team_selection_entry, new String[]{"txt", "img"}, new int[]{R.id.txtName, R.id.imgDifficulty});
+ availableTeams.setAdapter(adapter);
+ registerForContextMenu(availableTeams);
+ availableTeams.setOnItemClickListener(availableClicker);
+
+ selectedTeams = (ListView) findViewById(R.id.selectedTeams);
+ selectedTeamsList = new ArrayList<HashMap<String, Object>>();
+ ArrayList<HashMap<String, ?>> toBeRemoved = new ArrayList<HashMap<String, ?>>();
+ ArrayList<Team> teamsStartGame = getIntent().getParcelableArrayListExtra("teams");
+ for(HashMap<String, Object> hashmap : availableTeamsList){
+ for(Team t : teamsStartGame){
+ if(((Team)hashmap.get("team")).equals(t)){
+ toBeRemoved.add(hashmap);
+ selectedTeamsList.add(FrontendDataUtils.teamToHashMap(t));//create a new hashmap to ensure all variables are entered into the map
+ }
+ }
+ }
+ for(HashMap<String, ?> hashmap : toBeRemoved) availableTeamsList.remove(hashmap);
+
+ adapter = new SimpleAdapter(this, selectedTeamsList, R.layout.team_selection_entry, new String[]{"txt", "img", "color", "count"}, new int[]{R.id.txtName, R.id.imgDifficulty, R.id.teamColor, R.id.teamCount});
+ adapter.setViewBinder(viewBinder);
+ selectedTeams.setAdapter(adapter);
+ selectedTeams.setOnItemClickListener(selectedClicker);
+
+ }
+
+ private ViewBinder viewBinder = new ViewBinder(){
+ public boolean setViewValue(View view, Object data, String textRepresentation) {
+ switch(view.getId()){
+ case R.id.teamColor:
+ setTeamColor(view, (Integer)data);
+ return true;
+ case R.id.teamCount:
+ setTeamHogCount((ImageView)view, (Integer)data);
+ return true;
+ default:
+ return false;
+ }
+ }
+ };
+
+ public void onActivityResult(int requestCode, int resultCode, Intent data){
+ if(requestCode == ACTIVITY_TEAMCREATION){
+ if(resultCode == Activity.RESULT_OK){
+ updateListViews();
+ }
+ }else{
+ super.onActivityResult(requestCode, resultCode, data);
+ }
+ }
+
+ private void updateListViews(){
+ unregisterForContextMenu(availableTeams);
+ availableTeamsList = FrontendDataUtils.getTeams(this);
+ ArrayList<HashMap<String, Object>> toBeRemoved = new ArrayList<HashMap<String, Object>>();
+ for(HashMap<String, Object> hashmap : selectedTeamsList){
+ String name = (String)hashmap.get("txt");
+
+ for(HashMap<String, Object> hash : availableTeamsList){
+ if(name.equals((String)hash.get("txt"))){
+ toBeRemoved.add(hash);
+ }
+ }
+ }
+ for(HashMap<String, Object> hash: toBeRemoved) availableTeamsList.remove(hash);
+
+ SimpleAdapter adapter = new SimpleAdapter(this, availableTeamsList, R.layout.team_selection_entry, new String[]{"txt", "img"}, new int[]{R.id.txtName, R.id.imgDifficulty});
+ availableTeams.setAdapter(adapter);
+ registerForContextMenu(availableTeams);
+ availableTeams.setOnItemClickListener(availableClicker);
+
+
+ }
+
+ private void setTeamColor(int position, int color){
+ View iv = ((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount);
+ setTeamColor(iv, color);
+ }
+ private void setTeamColor(View iv, int color){
+ iv.setBackgroundColor(0xFF000000 + color);
+ }
+
+ private void setTeamHogCount(int position, int count){
+ ImageView iv = (ImageView)((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount);
+ setTeamHogCount(iv, count);
+ }
+
+ private void setTeamHogCount(ImageView iv, int count){
+
+ switch(count){
+ case 0:
+ iv.setImageResource(R.drawable.teamcount0);
+ break;
+ case 1:
+ iv.setImageResource(R.drawable.teamcount1);
+ break;
+ case 2:
+ iv.setImageResource(R.drawable.teamcount2);
+ break;
+ case 3:
+ iv.setImageResource(R.drawable.teamcount3);
+ break;
+ case 4:
+ iv.setImageResource(R.drawable.teamcount4);
+ break;
+ case 5:
+ iv.setImageResource(R.drawable.teamcount5);
+ break;
+ case 6:
+ iv.setImageResource(R.drawable.teamcount6);
+ break;
+ case 7:
+ iv.setImageResource(R.drawable.teamcount7);
+ break;
+ case 8:
+ iv.setImageResource(R.drawable.teamcount8);
+ break;
+ case 9:
+ iv.setImageResource(R.drawable.teamcount9);
+ break;
+ }
+ }
+
+ public void onBackPressed(){
+ returnTeams();
+ super.onBackPressed();
+ }
+
+ private OnClickListener addTeamClicker = new OnClickListener(){
+ public void onClick(View v) {
+ startActivityForResult(new Intent(TeamSelectionActivity.this, TeamCreatorActivity.class), ACTIVITY_TEAMCREATION);
+ }
+ };
+
+ private OnClickListener backClicker = new OnClickListener(){
+ public void onClick(View v){
+ returnTeams();
+ finish();
+ }
+ };
+
+ private OnItemClickListener availableClicker = new OnItemClickListener(){
+ public void onItemClick(AdapterView<?> arg0, View arg1, int position,long arg3) {
+ selectAvailableTeamsItem(position);
+ }
+ };
+ private OnItemClickListener selectedClicker = new OnItemClickListener(){
+ public void onItemClick(AdapterView<?> arg0, View arg1, int position,long arg3) {
+ availableTeamsList.add((HashMap<String, Object>) selectedTeamsList.get(position));
+ selectedTeamsList.remove(position);
+ ((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged();
+ ((SimpleAdapter)selectedTeams.getAdapter()).notifyDataSetChanged();
+ }
+
+ };
+
+ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuinfo){
+ menu.add(ContextMenu.NONE, 0, ContextMenu.NONE, R.string.select);
+ menu.add(ContextMenu.NONE, 2, ContextMenu.NONE, R.string.edit);
+ menu.add(ContextMenu.NONE, 1, ContextMenu.NONE, R.string.delete);
+
+ }
+ public boolean onContextItemSelected(MenuItem item){
+ AdapterView.AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
+ int position = menuInfo.position;
+ switch(item.getItemId()){
+ case 0://select
+ selectAvailableTeamsItem(position);
+ return true;
+ case 1://delete
+ File f = new File(String.format("%s/%s/%s.xml", TeamSelectionActivity.this.getFilesDir(), Team.DIRECTORY_TEAMS, availableTeamsList.get(position).get("txt")));
+ f.delete();
+ availableTeamsList.remove(position);
+ ((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged();
+ return true;
+ case 2://edit
+ Intent i = new Intent(TeamSelectionActivity.this, TeamCreatorActivity.class);
+ Team t = (Team)availableTeamsList.get(position).get("team");
+ i.putExtra("team", t);
+ startActivityForResult(i, ACTIVITY_TEAMCREATION);
+ return true;
+ }
+ return false;
+ }
+
+ private void selectAvailableTeamsItem(int position){
+ HashMap<String, Object> hash = (HashMap<String, Object>) availableTeamsList.get(position);
+ Team t = (Team)hash.get("team");
+ int[] illegalcolors = new int[selectedTeamsList.size()];
+ for(int i = 0; i < selectedTeamsList.size(); i++){
+ illegalcolors[i] = ((Team)selectedTeamsList.get(i).get("team")).color;
+ }
+ t.setRandomColor(illegalcolors);
+ hash.put("color", t.color);
+ hash.put("count", t.hogCount);
+
+ selectedTeamsList.add(hash);
+ availableTeamsList.remove(position);
+ ((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged();
+ ((SimpleAdapter)selectedTeams.getAdapter()).notifyDataSetChanged();
+ }
+
+ private void returnTeams(){
+ int teamsCount = selectedTeamsList.size();
+ if(teamsCount >= minTeams){
+ Intent i = new Intent();
+ Parcelable[] teams = new Parcelable[teamsCount];
+ for(int x = 0 ; x < teamsCount; x++){
+ teams[x] = (Team)selectedTeamsList.get(x).get("team");
+ }
+ i.putExtra("teams", teams);
+ setResult(Activity.RESULT_OK, i);
+ }else{
+ setResult(Activity.RESULT_CANCELED);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/TextImageAdapter.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,57 @@
+package org.hedgewars.mobile;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hedgewars.mobile.R;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+
+
+public class TextImageAdapter extends SimpleAdapter {
+
+ private Context context;
+ private ArrayList<Map<String, ?>> data;
+
+ public TextImageAdapter(Context _context, ArrayList<Map<String, ?>> _data, int resource, String[] from, int[] to) {
+ super(_context, _data, resource, from, to);
+ context = _context;
+ data = _data;
+ }
+
+ public static TextImageAdapter createAdapter(Context c, String[] txt, String[] img, String[] from, int[] to){
+ if(txt.length != img.length) throw new IllegalArgumentException("txt and img parameters not equal");
+
+ ArrayList<Map<String, ?>> data = new ArrayList<Map<String, ?>>(txt.length);
+
+ for(int i = 0; i < txt.length; i++){
+ HashMap<String, Object> map = new HashMap<String, Object>();
+ map.put("txt", txt[i]);
+ map.put("img", BitmapFactory.decodeFile(img[i]));
+ data.add(map);
+ }
+ return new TextImageAdapter(c, data, R.layout.spinner_textimg_entry, from, to);
+ }
+
+ public View getView(int position, View convertView, ViewGroup parent){
+ if(convertView == null){
+ LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ convertView = inflater.inflate(R.layout.spinner_textimg_entry, parent);
+ }
+ TextView tv = (TextView) convertView.findViewById(R.id.spinner_txt);
+ ImageView img = (ImageView) convertView.findViewById(R.id.spinner_img);
+
+ tv.setText((String)data.get(position).get("txt"));
+ img.setImageBitmap((Bitmap)data.get(position).get("img"));
+
+ return convertView;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/TouchInterface/TouchInterface.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,90 @@
+package org.hedgewars.mobile.TouchInterface;
+
+import org.hedgewars.mobile.SDLActivity;
+
+import android.os.Build;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnTouchListener;
+
+public class TouchInterface{
+
+ public static OnTouchListener getTouchInterface(){
+ OnTouchListener toucher;
+ if(Build.VERSION.SDK_INT < 5){//8 == Build.VERSION_CODES.FROYO
+ toucher = new TouchInterfaceST();
+ }else{
+ toucher = new TouchInterfaceMT();
+ }
+
+ return toucher;
+ }
+}
+/**
+ * Touch interface with multitouch
+ */
+class TouchInterfaceMT implements OnTouchListener {
+
+ private boolean firstEvent = true;
+
+ public boolean onTouch(View v, MotionEvent event) {
+ //dumpEvent(event);
+
+ if(firstEvent){
+ firstEvent = false;
+ SDLActivity.onNativeTouch(-1, -1, v.getWidth(), v.getHeight(), 1);
+ }
+
+ int action = event.getAction();
+ int actionCode = action & MotionEvent.ACTION_MASK;
+
+ for (int i = 0; i < event.getPointerCount(); i++) {
+ SDLActivity.onNativeTouch(actionCode, event.getPointerId(i), (int)event.getX(i), (int)event.getY(i), event.getPressure(i));
+// Log.d("Android", String.format("x=%f, y=%f, pntr=%d", event.getX(i), event.getY(i), event.getPointerId(i)));
+ }
+ return true;
+ }
+
+ /** Show an event in the LogCat view, for debugging */
+ private void dumpEvent(MotionEvent event) {
+ String names[] = { "DOWN" , "UP" , "MOVE" , "CANCEL" , "OUTSIDE" ,
+ "POINTER_DOWN" , "POINTER_UP" , "7?" , "8?" , "9?" };
+ StringBuilder sb = new StringBuilder();
+ int action = event.getAction();
+ int actionCode = action & MotionEvent.ACTION_MASK;
+ sb.append("event ACTION_" ).append(names[actionCode]);
+ if (actionCode == MotionEvent.ACTION_POINTER_DOWN
+ || actionCode == MotionEvent.ACTION_POINTER_UP) {
+ sb.append("(pid " ).append(
+ action >> MotionEvent.ACTION_POINTER_ID_SHIFT);
+ sb.append(")" );
+ }
+ sb.append("[" );
+ for (int i = 0; i < event.getPointerCount(); i++) {
+ sb.append("#" ).append(i);
+ sb.append("(pid " ).append(event.getPointerId(i));
+ sb.append(")=" ).append((int) event.getX(i));
+ sb.append("," ).append((int) event.getY(i));
+ if (i + 1 < event.getPointerCount())
+ sb.append(";" );
+ }
+ sb.append("]" );
+ Log.d("HW_APP_TOUCH", sb.toString());
+ }
+
+}
+
+/**
+ * Touch interface without multitouch
+ */
+class TouchInterfaceST implements OnTouchListener {
+
+ public boolean onTouch(View v, MotionEvent event) {
+ return false;
+ }
+
+
+
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/Utils.java Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,171 @@
+package org.hedgewars.mobile;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.widget.Toast;
+
+public class Utils {
+
+
+ /**
+ * get the path to which we should download all the data files
+ * @param c context
+ * @return absolute path
+ */
+ public static String getDownloadPath(Context c){
+ File f = c.getExternalCacheDir();
+ if(f != null){
+ return f.getAbsolutePath() + "/Data/";
+ }else{
+ Toast.makeText(c, R.string.sdcard_not_mounted, Toast.LENGTH_LONG);
+ return null;
+ }
+ }
+
+ /**
+ * Get files from dirName, dir name is relative to {@link getDownloadPath}
+ * @param dirName
+ * @param c context
+ * @return string of files
+ */
+ public static String[] getFileNamesFromRelativeDir(Context c, String dirName){
+ String prefix = getDownloadPath(c);
+ File f = new File(prefix + dirName);
+
+ if(f.exists() && f.isDirectory()) return f.list();
+ else throw new IllegalArgumentException("File not a directory or doesn't exist dirName = " + f.getAbsolutePath());
+ }
+
+ /**
+ * Return a File array with all the files from dirName
+ * @param c
+ * @param dirName
+ * @return
+ */
+ public static File[] getFilesFromRelativeDir(Context c, String dirName){
+ String prefix = getDownloadPath(c);
+ File f = new File(prefix + dirName);
+
+ if(f.exists() && f.isDirectory()) return f.listFiles();
+ else throw new IllegalArgumentException("File not a directory or doesn't exist dirName = " + f.getAbsolutePath());
+ }
+
+ /**
+ * Checks if this directory has a file with suffix suffix
+ * @param f - directory
+ * @return
+ */
+ public static boolean hasFileWithSuffix(File f, String suffix){
+ if(f.isDirectory()){
+ for(String s : f.list()){
+ if(s.endsWith(suffix)) return true;
+ }
+ return false;
+ }else{
+ return false;
+ }
+ }
+
+ /**
+ * Gives back all dirs which contain a file with suffix fileSuffix
+ * @param c
+ * @param path
+ * @param fileSuffix
+ * @return
+ */
+ public static String[] getDirsWithFileSuffix(Context c, String path, String fileSuffix){
+ File[] files = getFilesFromRelativeDir(c,path);
+ String[] validFiles = new String[files.length];
+ int validCounter = 0;
+
+ for(File f : files){
+ if(hasFileWithSuffix(f, fileSuffix)) validFiles[validCounter++] = f.getName();
+ }
+ String[] ret = new String[validCounter];
+ System.arraycopy(validFiles, 0, ret, 0, validCounter);
+ return ret;
+ }
+
+ /**
+ * Get all files from directory dir which have the given suffix
+ * @param c
+ * @param dir
+ * @param suffix
+ * @param removeSuffix
+ * @return
+ */
+ public static ArrayList<String> getFilesFromDirWithSuffix(Context c, String dir, String suffix, boolean removeSuffix){
+ String[] files = Utils.getFileNamesFromRelativeDir(c, dir);
+ ArrayList<String> ret = new ArrayList<String>();
+ for(String s : files){
+ if(s.endsWith(suffix)){
+ if(removeSuffix) ret.add(s.substring(0, s.length()-suffix.length()));
+ else ret.add(s);
+ }
+ }
+ return ret;
+ }
+
+ /**
+ * Moves resources pointed to by sourceResId (from @res/raw/) to the app's private data directory
+ * @param c
+ * @param sourceResId
+ * @param directory
+ */
+ public static void resRawToFilesDir(Context c, int sourceResId, String directory){
+ byte[] buffer = new byte[1024];
+ InputStream bis = null;
+ BufferedOutputStream bos = null;
+ File schemesDirFile = new File(c.getFilesDir().getAbsolutePath() + '/' + directory);
+ schemesDirFile.mkdirs();
+ String schemesDirPath = schemesDirFile.getAbsolutePath() + '/';
+
+ //Get an array with the resource files ID
+ TypedArray ta = c.getResources().obtainTypedArray(sourceResId);
+ int[] resIds = new int[ta.length()];
+ for(int i = 0; i < ta.length(); i++){
+ resIds[i] = ta.getResourceId(i, 0);
+ }
+
+ for(int id : resIds){
+ String fileName = c.getResources().getResourceEntryName(id);
+ File f = new File(schemesDirPath + fileName);
+ try {
+ if(!f.createNewFile()){
+ f.delete();
+ f.createNewFile();
+ }
+
+ bis = c.getResources().openRawResource(id);
+ bos = new BufferedOutputStream(new FileOutputStream(f), 1024);
+ int read = 0;
+ while((read = bis.read(buffer)) != -1){
+ bos.write(buffer, 0, read);
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }finally{
+ if(bis != null)
+ try {
+ bis.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if(bos != null)
+ try {
+ bos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/Templates/Makefile.android Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,20 @@
+SDL_ANDROID_DIR=./SDL-android-project
+
+PPCROSSARM=${FPC_DIR}/compiler/ppcrossarm
+PPCROSSARM_FLAGS= -Xd -O- -Tlinux -XParm-linux-androideabi- -vwnh -XS -a-
+PPCROSSARM_INCLUDES= \
+ -FD${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin \
+ -Fu${FPC_DIR}/rtl/units/arm-linux \
+ -Fl${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_LVL}/arch-arm/usr/lib \
+ -Fl$(SDL_ANDROID_DIR)/libs/armeabi \
+ -Fl${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \
+#LINKERFLAGS= -k"--static"
+FPC_DEFINES=-dandroid -darm
+
+
+all:
+ -${CMAKE_COMMAND} -E make_directory out
+ $(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -oout/libhwengine.so ../../hedgewars/hwLibrary.pas
+ ${CMAKE_COMMAND} -E copy out/libhwengine.so SDL-android-project/libs/armeabi/
+clean:
+ ${CMAKE_COMMAND} -E remove_directory out
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/Templates/complete_build.sh Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+
+cd SDL-android-project
+${ANDROID_NDK}/ndk-build
+if [ $? -ne 0 ]
+then
+ echo "Failed to execute ${ANDROID_NDK}/ndk-build"
+ exit 1
+fi
+
+cd ..
+make -f Makefile.android
+if [ $? -ne 0 ]
+then
+ echo "Failed to execute make"
+ exit 1
+fi
+
+cd SDL-android-project
+ant install
+if [ $? -ne 0 ]
+then
+ echo "Failed to execute ant install"
+ exit 1
+fi
+exit 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/Templates/default.properties Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-${ANDROID_SDK_API_LVL}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/Templates/local.properties Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must *NOT* be checked in Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk.dir=${ANDROID_SDK}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/Templates/pushToDevice.sh Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+${ANDROID_SDK}/platform-tools/adb push ./out/libhwengine.so /sdcard/libhwengine.so
+${ANDROID_SDK}/platform-tools/adb shell "su -c \"cat /sdcard/libhwengine.so > /data/data/org.hedgewars/lib/libhwengine.so \""
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/gles11.pp Fri Aug 19 17:22:12 2011 +0200
@@ -0,0 +1,1103 @@
+
+{$mode objfpc}
+unit gles11;
+interface
+
+{
+ Automatically converted by H2Pas 1.0.0 from gl.hh
+ The following command line parameters were used:
+ -P
+ -l
+ GLESv1_CM
+ -o
+ gles11.pp
+ -D
+ gl.hh
+}
+
+ procedure init;
+
+ const
+ External_library='GLESv1_CM'; {Setup as you need}
+
+ Type
+
+// khronos_int32_t = int32_t;
+// khronos_uint32_t = uint32_t;
+// khronos_int64_t = int64_t;
+// khronos_uint64_t = uint64_t;
+
+ khronos_int32_t = longint;
+ khronos_uint32_t = longword;
+ khronos_int64_t = Int64;
+ khronos_uint64_t = QWord;
+ khronos_int8_t = char;
+ khronos_uint8_t = byte;
+ khronos_int16_t = smallint;
+ khronos_uint16_t = word;
+ khronos_intptr_t = longint;
+ khronos_uintptr_t = dword;
+ khronos_ssize_t = longint;
+ khronos_usize_t = dword;
+ khronos_float_t = single;
+
+ GLvoid = pointer;
+ GLenum = dword;
+ GLboolean = byte;
+ GLbitfield = dword;
+ GLshort = smallint;
+ GLint = longint;
+ GLsizei = longint;
+ GLushort = word;
+ GLuint = dword;
+
+ GLbyte = khronos_int8_t;
+ GLubyte = khronos_uint8_t;
+ GLfloat = khronos_float_t;
+ GLclampf = khronos_float_t;
+ GLfixed = khronos_int32_t;
+ GLclampx = khronos_int32_t;
+ GLintptr = khronos_intptr_t;
+ GLsizeiptr = khronos_ssize_t;
+
+ PGLboolean = ^GLboolean;
+ PGLfixed = ^GLfixed;
+ PGLfloat = ^GLfloat;
+ PGLint = ^GLint;
+ PGLuint = ^GLuint;
+ PGLvoid = ^GLvoid;
+ PGLubyte = ^GLubyte;
+{$IFDEF FPC}
+{$PACKRECORDS C}
+{$ENDIF}
+
+ const
+// GL_API = KHRONOS_APICALL;
+{$define KHRONOS_APIENTRY}
+ GL_DIRECT_TEXTURE_2D_QUALCOMM = $7E80;
+
+ {*********************************************************** }
+ { OpenGL ES core versions }
+
+ const
+ GL_VERSION_ES_CM_1_0 = 1;
+ GL_VERSION_ES_CL_1_0 = 1;
+ GL_VERSION_ES_CM_1_1 = 1;
+ GL_VERSION_ES_CL_1_1 = 1;
+ { ClearBufferMask }
+ GL_DEPTH_BUFFER_BIT = $00000100;
+ GL_STENCIL_BUFFER_BIT = $00000400;
+ GL_COLOR_BUFFER_BIT = $00004000;
+ { Boolean }
+ GL_FALSE = 0;
+ GL_TRUE = 1;
+ { BeginMode }
+ GL_POINTS = $0000;
+ GL_LINES = $0001;
+ GL_LINE_LOOP = $0002;
+ GL_LINE_STRIP = $0003;
+ GL_TRIANGLES = $0004;
+ GL_TRIANGLE_STRIP = $0005;
+ GL_TRIANGLE_FAN = $0006;
+ { AlphaFunction }
+ GL_NEVER = $0200;
+ GL_LESS = $0201;
+ GL_EQUAL = $0202;
+ GL_LEQUAL = $0203;
+ GL_GREATER = $0204;
+ GL_NOTEQUAL = $0205;
+ GL_GEQUAL = $0206;
+ GL_ALWAYS = $0207;
+ { BlendingFactorDest }
+ GL_ZERO = 0;
+ GL_ONE = 1;
+ GL_SRC_COLOR = $0300;
+ GL_ONE_MINUS_SRC_COLOR = $0301;
+ GL_SRC_ALPHA = $0302;
+ GL_ONE_MINUS_SRC_ALPHA = $0303;
+ GL_DST_ALPHA = $0304;
+ GL_ONE_MINUS_DST_ALPHA = $0305;
+ { BlendingFactorSrc }
+ { GL_ZERO }
+ { GL_ONE }
+ GL_DST_COLOR = $0306;
+ GL_ONE_MINUS_DST_COLOR = $0307;
+ GL_SRC_ALPHA_SATURATE = $0308;
+ { GL_SRC_ALPHA }
+ { GL_ONE_MINUS_SRC_ALPHA }
+ { GL_DST_ALPHA }
+ { GL_ONE_MINUS_DST_ALPHA }
+ { ClipPlaneName }
+ GL_CLIP_PLANE0 = $3000;
+ GL_CLIP_PLANE1 = $3001;
+ GL_CLIP_PLANE2 = $3002;
+ GL_CLIP_PLANE3 = $3003;
+ GL_CLIP_PLANE4 = $3004;
+ GL_CLIP_PLANE5 = $3005;
+ { ColorMaterialFace }
+ { GL_FRONT_AND_BACK }
+ { ColorMaterialParameter }
+ { GL_AMBIENT_AND_DIFFUSE }
+ { ColorPointerType }
+ { GL_UNSIGNED_BYTE }
+ { GL_FLOAT }
+ { GL_FIXED }
+ { CullFaceMode }
+ GL_FRONT = $0404;
+ GL_BACK = $0405;
+ GL_FRONT_AND_BACK = $0408;
+ { DepthFunction }
+ { GL_NEVER }
+ { GL_LESS }
+ { GL_EQUAL }
+ { GL_LEQUAL }
+ { GL_GREATER }
+ { GL_NOTEQUAL }
+ { GL_GEQUAL }
+ { GL_ALWAYS }
+ { EnableCap }
+ GL_FOG = $0B60;
+ GL_LIGHTING = $0B50;
+ GL_TEXTURE_2D = $0DE1;
+ GL_CULL_FACE = $0B44;
+ GL_ALPHA_TEST = $0BC0;
+ GL_BLEND = $0BE2;
+ GL_COLOR_LOGIC_OP = $0BF2;
+ GL_DITHER = $0BD0;
+ GL_STENCIL_TEST = $0B90;
+ GL_DEPTH_TEST = $0B71;
+ { GL_LIGHT0 }
+ { GL_LIGHT1 }
+ { GL_LIGHT2 }
+ { GL_LIGHT3 }
+ { GL_LIGHT4 }
+ { GL_LIGHT5 }
+ { GL_LIGHT6 }
+ { GL_LIGHT7 }
+ GL_POINT_SMOOTH = $0B10;
+ GL_LINE_SMOOTH = $0B20;
+ GL_SCISSOR_TEST = $0C11;
+ GL_COLOR_MATERIAL = $0B57;
+ GL_NORMALIZE = $0BA1;
+ GL_RESCALE_NORMAL = $803A;
+ GL_POLYGON_OFFSET_FILL = $8037;
+ GL_VERTEX_ARRAY = $8074;
+ GL_NORMAL_ARRAY = $8075;
+ GL_COLOR_ARRAY = $8076;
+ GL_TEXTURE_COORD_ARRAY = $8078;
+ GL_MULTISAMPLE = $809D;
+ GL_SAMPLE_ALPHA_TO_COVERAGE = $809E;
+ GL_SAMPLE_ALPHA_TO_ONE = $809F;
+ GL_SAMPLE_COVERAGE = $80A0;
+ { ErrorCode }
+ GL_NO_ERROR = 0;
+ GL_INVALID_ENUM = $0500;
+ GL_INVALID_VALUE = $0501;
+ GL_INVALID_OPERATION = $0502;
+ GL_STACK_OVERFLOW = $0503;
+ GL_STACK_UNDERFLOW = $0504;
+ GL_OUT_OF_MEMORY = $0505;
+ { FogMode }
+ { GL_LINEAR }
+ GL_EXP = $0800;
+ GL_EXP2 = $0801;
+ { FogParameter }
+ GL_FOG_DENSITY = $0B62;
+ GL_FOG_START = $0B63;
+ GL_FOG_END = $0B64;
+ GL_FOG_MODE = $0B65;
+ GL_FOG_COLOR = $0B66;
+ { FrontFaceDirection }
+ GL_CW = $0900;
+ GL_CCW = $0901;
+ { GetPName }
+ GL_CURRENT_COLOR = $0B00;
+ GL_CURRENT_NORMAL = $0B02;
+ GL_CURRENT_TEXTURE_COORDS = $0B03;
+ GL_POINT_SIZE = $0B11;
+ GL_POINT_SIZE_MIN = $8126;
+ GL_POINT_SIZE_MAX = $8127;
+ GL_POINT_FADE_THRESHOLD_SIZE = $8128;
+ GL_POINT_DISTANCE_ATTENUATION = $8129;
+ GL_SMOOTH_POINT_SIZE_RANGE = $0B12;
+ GL_LINE_WIDTH = $0B21;
+ GL_SMOOTH_LINE_WIDTH_RANGE = $0B22;
+ GL_ALIASED_POINT_SIZE_RANGE = $846D;
+ GL_ALIASED_LINE_WIDTH_RANGE = $846E;
+ GL_CULL_FACE_MODE = $0B45;
+ GL_FRONT_FACE = $0B46;
+ GL_SHADE_MODEL = $0B54;
+ GL_DEPTH_RANGE = $0B70;
+ GL_DEPTH_WRITEMASK = $0B72;
+ GL_DEPTH_CLEAR_VALUE = $0B73;
+ GL_DEPTH_FUNC = $0B74;
+ GL_STENCIL_CLEAR_VALUE = $0B91;
+ GL_STENCIL_FUNC = $0B92;
+ GL_STENCIL_VALUE_MASK = $0B93;
+ GL_STENCIL_FAIL = $0B94;
+ GL_STENCIL_PASS_DEPTH_FAIL = $0B95;
+ GL_STENCIL_PASS_DEPTH_PASS = $0B96;
+ GL_STENCIL_REF = $0B97;
+ GL_STENCIL_WRITEMASK = $0B98;
+ GL_MATRIX_MODE = $0BA0;
+ GL_VIEWPORT = $0BA2;
+ GL_MODELVIEW_STACK_DEPTH = $0BA3;
+ GL_PROJECTION_STACK_DEPTH = $0BA4;
+ GL_TEXTURE_STACK_DEPTH = $0BA5;
+ GL_MODELVIEW_MATRIX = $0BA6;
+ GL_PROJECTION_MATRIX = $0BA7;
+ GL_TEXTURE_MATRIX = $0BA8;
+ GL_ALPHA_TEST_FUNC = $0BC1;
+ GL_ALPHA_TEST_REF = $0BC2;
+ GL_BLEND_DST = $0BE0;
+ GL_BLEND_SRC = $0BE1;
+ GL_LOGIC_OP_MODE = $0BF0;
+ GL_SCISSOR_BOX = $0C10;
+// GL_SCISSOR_TEST = $0C11;
+ GL_COLOR_CLEAR_VALUE = $0C22;
+ GL_COLOR_WRITEMASK = $0C23;
+ GL_UNPACK_ALIGNMENT = $0CF5;
+ GL_PACK_ALIGNMENT = $0D05;
+ GL_MAX_LIGHTS = $0D31;
+ GL_MAX_CLIP_PLANES = $0D32;
+ GL_MAX_TEXTURE_SIZE = $0D33;
+ GL_MAX_MODELVIEW_STACK_DEPTH = $0D36;
+ GL_MAX_PROJECTION_STACK_DEPTH = $0D38;
+ GL_MAX_TEXTURE_STACK_DEPTH = $0D39;
+ GL_MAX_VIEWPORT_DIMS = $0D3A;
+ GL_MAX_TEXTURE_UNITS = $84E2;
+ GL_SUBPIXEL_BITS = $0D50;
+ GL_RED_BITS = $0D52;
+ GL_GREEN_BITS = $0D53;
+ GL_BLUE_BITS = $0D54;
+ GL_ALPHA_BITS = $0D55;
+ GL_DEPTH_BITS = $0D56;
+ GL_STENCIL_BITS = $0D57;
+ GL_POLYGON_OFFSET_UNITS = $2A00;
+// GL_POLYGON_OFFSET_FILL = $8037;
+ GL_POLYGON_OFFSET_FACTOR = $8038;
+ GL_TEXTURE_BINDING_2D = $8069;
+ GL_VERTEX_ARRAY_SIZE = $807A;
+ GL_VERTEX_ARRAY_TYPE = $807B;
+ GL_VERTEX_ARRAY_STRIDE = $807C;
+ GL_NORMAL_ARRAY_TYPE = $807E;
+ GL_NORMAL_ARRAY_STRIDE = $807F;
+ GL_COLOR_ARRAY_SIZE = $8081;
+ GL_COLOR_ARRAY_TYPE = $8082;
+ GL_COLOR_ARRAY_STRIDE = $8083;
+ GL_TEXTURE_COORD_ARRAY_SIZE = $8088;
+ GL_TEXTURE_COORD_ARRAY_TYPE = $8089;
+ GL_TEXTURE_COORD_ARRAY_STRIDE = $808A;
+ GL_VERTEX_ARRAY_POINTER = $808E;
+ GL_NORMAL_ARRAY_POINTER = $808F;
+ GL_COLOR_ARRAY_POINTER = $8090;
+ GL_TEXTURE_COORD_ARRAY_POINTER = $8092;
+ GL_SAMPLE_BUFFERS = $80A8;
+ GL_SAMPLES = $80A9;
+ GL_SAMPLE_COVERAGE_VALUE = $80AA;
+ GL_SAMPLE_COVERAGE_INVERT = $80AB;
+ { GetTextureParameter }
+ { GL_TEXTURE_MAG_FILTER }
+ { GL_TEXTURE_MIN_FILTER }
+ { GL_TEXTURE_WRAP_S }
+ { GL_TEXTURE_WRAP_T }
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS = $86A2;
+ GL_COMPRESSED_TEXTURE_FORMATS = $86A3;
+ { HintMode }
+ GL_DONT_CARE = $1100;
+ GL_FASTEST = $1101;
+ GL_NICEST = $1102;
+ { HintTarget }
+ GL_PERSPECTIVE_CORRECTION_HINT = $0C50;
+ GL_POINT_SMOOTH_HINT = $0C51;
+ GL_LINE_SMOOTH_HINT = $0C52;
+ GL_FOG_HINT = $0C54;
+ GL_GENERATE_MIPMAP_HINT = $8192;
+ { LightModelParameter }
+ GL_LIGHT_MODEL_AMBIENT = $0B53;
+ GL_LIGHT_MODEL_TWO_SIDE = $0B52;
+ { LightParameter }
+ GL_AMBIENT = $1200;
+ GL_DIFFUSE = $1201;
+ GL_SPECULAR = $1202;
+ GL_POSITION = $1203;
+ GL_SPOT_DIRECTION = $1204;
+ GL_SPOT_EXPONENT = $1205;
+ GL_SPOT_CUTOFF = $1206;
+ GL_CONSTANT_ATTENUATION = $1207;
+ GL_LINEAR_ATTENUATION = $1208;
+ GL_QUADRATIC_ATTENUATION = $1209;
+ { DataType }
+ GL_BYTE = $1400;
+ GL_UNSIGNED_BYTE = $1401;
+ GL_SHORT = $1402;
+ GL_UNSIGNED_SHORT = $1403;
+ GL_FLOAT = $1406;
+ GL_FIXED = $140C;
+ { LogicOp }
+ GL_CLEAR = $1500;
+ GL_AND = $1501;
+ GL_AND_REVERSE = $1502;
+ GL_COPY = $1503;
+ GL_AND_INVERTED = $1504;
+ GL_NOOP = $1505;
+ GL_XOR = $1506;
+ GL_OR = $1507;
+ GL_NOR = $1508;
+ GL_EQUIV = $1509;
+ GL_INVERT = $150A;
+ GL_OR_REVERSE = $150B;
+ GL_COPY_INVERTED = $150C;
+ GL_OR_INVERTED = $150D;
+ GL_NAND = $150E;
+ GL_SET = $150F;
+ { MaterialFace }
+ { GL_FRONT_AND_BACK }
+ { MaterialParameter }
+ GL_EMISSION = $1600;
+ GL_SHININESS = $1601;
+ GL_AMBIENT_AND_DIFFUSE = $1602;
+ { GL_AMBIENT }
+ { GL_DIFFUSE }
+ { GL_SPECULAR }
+ { MatrixMode }
+ GL_MODELVIEW = $1700;
+ GL_PROJECTION = $1701;
+ GL_TEXTURE = $1702;
+ { NormalPointerType }
+ { GL_BYTE }
+ { GL_SHORT }
+ { GL_FLOAT }
+ { GL_FIXED }
+ { PixelFormat }
+ GL_ALPHA = $1906;
+ GL_RGB = $1907;
+ GL_RGBA = $1908;
+ GL_LUMINANCE = $1909;
+ GL_LUMINANCE_ALPHA = $190A;
+ { PixelStoreParameter }
+// GL_UNPACK_ALIGNMENT = $0CF5;
+// GL_PACK_ALIGNMENT = $0D05;
+ { PixelType }
+ { GL_UNSIGNED_BYTE }
+ GL_UNSIGNED_SHORT_4_4_4_4 = $8033;
+ GL_UNSIGNED_SHORT_5_5_5_1 = $8034;
+ GL_UNSIGNED_SHORT_5_6_5 = $8363;
+ { ShadingModel }
+ GL_FLAT = $1D00;
+ GL_SMOOTH = $1D01;
+ { StencilFunction }
+ { GL_NEVER }
+ { GL_LESS }
+ { GL_EQUAL }
+ { GL_LEQUAL }
+ { GL_GREATER }
+ { GL_NOTEQUAL }
+ { GL_GEQUAL }
+ { GL_ALWAYS }
+ { StencilOp }
+ { GL_ZERO }
+ GL_KEEP = $1E00;
+ GL_REPLACE = $1E01;
+ GL_INCR = $1E02;
+ GL_DECR = $1E03;
+ { GL_INVERT }
+ { StringName }
+ GL_VENDOR = $1F00;
+ GL_RENDERER = $1F01;
+ GL_VERSION = $1F02;
+ GL_EXTENSIONS = $1F03;
+ { TexCoordPointerType }
+ { GL_SHORT }
+ { GL_FLOAT }
+ { GL_FIXED }
+ { GL_BYTE }
+ { TextureEnvMode }
+ GL_MODULATE = $2100;
+ GL_DECAL = $2101;
+ { GL_BLEND }
+ GL_ADD = $0104;
+ { GL_REPLACE }
+ { TextureEnvParameter }
+ GL_TEXTURE_ENV_MODE = $2200;
+ GL_TEXTURE_ENV_COLOR = $2201;
+ { TextureEnvTarget }
+ GL_TEXTURE_ENV = $2300;
+ { TextureMagFilter }
+ GL_NEAREST = $2600;
+ GL_LINEAR = $2601;
+ { TextureMinFilter }
+ { GL_NEAREST }
+ { GL_LINEAR }
+ GL_NEAREST_MIPMAP_NEAREST = $2700;
+ GL_LINEAR_MIPMAP_NEAREST = $2701;
+ GL_NEAREST_MIPMAP_LINEAR = $2702;
+ GL_LINEAR_MIPMAP_LINEAR = $2703;
+ { TextureParameterName }
+ GL_TEXTURE_MAG_FILTER = $2800;
+ GL_TEXTURE_MIN_FILTER = $2801;
+ GL_TEXTURE_WRAP_S = $2802;
+ GL_TEXTURE_WRAP_T = $2803;
+ GL_GENERATE_MIPMAP = $8191;
+ { TextureTarget }
+ { GL_TEXTURE_2D }
+ { TextureUnit }
+ GL_TEXTURE0 = $84C0;
+ GL_TEXTURE1 = $84C1;
+ GL_TEXTURE2 = $84C2;
+ GL_TEXTURE3 = $84C3;
+ GL_TEXTURE4 = $84C4;
+ GL_TEXTURE5 = $84C5;
+ GL_TEXTURE6 = $84C6;
+ GL_TEXTURE7 = $84C7;
+ GL_TEXTURE8 = $84C8;
+ GL_TEXTURE9 = $84C9;
+ GL_TEXTURE10 = $84CA;
+ GL_TEXTURE11 = $84CB;
+ GL_TEXTURE12 = $84CC;
+ GL_TEXTURE13 = $84CD;
+ GL_TEXTURE14 = $84CE;
+ GL_TEXTURE15 = $84CF;
+ GL_TEXTURE16 = $84D0;
+ GL_TEXTURE17 = $84D1;
+ GL_TEXTURE18 = $84D2;
+ GL_TEXTURE19 = $84D3;
+ GL_TEXTURE20 = $84D4;
+ GL_TEXTURE21 = $84D5;
+ GL_TEXTURE22 = $84D6;
+ GL_TEXTURE23 = $84D7;
+ GL_TEXTURE24 = $84D8;
+ GL_TEXTURE25 = $84D9;
+ GL_TEXTURE26 = $84DA;
+ GL_TEXTURE27 = $84DB;
+ GL_TEXTURE28 = $84DC;
+ GL_TEXTURE29 = $84DD;
+ GL_TEXTURE30 = $84DE;
+ GL_TEXTURE31 = $84DF;
+ GL_ACTIVE_TEXTURE = $84E0;
+ GL_CLIENT_ACTIVE_TEXTURE = $84E1;
+ { TextureWrapMode }
+ GL_REPEAT = $2901;
+ GL_CLAMP_TO_EDGE = $812F;
+ { VertexPointerType }
+ { GL_SHORT }
+ { GL_FLOAT }
+ { GL_FIXED }
+ { GL_BYTE }
+ { LightName }
+ GL_LIGHT0 = $4000;
+ GL_LIGHT1 = $4001;
+ GL_LIGHT2 = $4002;
+ GL_LIGHT3 = $4003;
+ GL_LIGHT4 = $4004;
+ GL_LIGHT5 = $4005;
+ GL_LIGHT6 = $4006;
+ GL_LIGHT7 = $4007;
+ { Buffer Objects }
+ GL_ARRAY_BUFFER = $8892;
+ GL_ELEMENT_ARRAY_BUFFER = $8893;
+ GL_ARRAY_BUFFER_BINDING = $8894;
+ GL_ELEMENT_ARRAY_BUFFER_BINDING = $8895;
+ GL_VERTEX_ARRAY_BUFFER_BINDING = $8896;
+ GL_NORMAL_ARRAY_BUFFER_BINDING = $8897;
+ GL_COLOR_ARRAY_BUFFER_BINDING = $8898;
+ GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = $889A;
+ GL_STATIC_DRAW = $88E4;
+ GL_DYNAMIC_DRAW = $88E8;
+ GL_BUFFER_SIZE = $8764;
+ GL_BUFFER_USAGE = $8765;
+ { Texture combine + dot3 }
+ GL_SUBTRACT = $84E7;
+ GL_COMBINE = $8570;
+ GL_COMBINE_RGB = $8571;
+ GL_COMBINE_ALPHA = $8572;
+ GL_RGB_SCALE = $8573;
+ GL_ADD_SIGNED = $8574;
+ GL_INTERPOLATE = $8575;
+ GL_CONSTANT = $8576;
+ GL_PRIMARY_COLOR = $8577;
+ GL_PREVIOUS = $8578;
+ GL_OPERAND0_RGB = $8590;
+ GL_OPERAND1_RGB = $8591;
+ GL_OPERAND2_RGB = $8592;
+ GL_OPERAND0_ALPHA = $8598;
+ GL_OPERAND1_ALPHA = $8599;
+ GL_OPERAND2_ALPHA = $859A;
+ GL_ALPHA_SCALE = $0D1C;
+ GL_SRC0_RGB = $8580;
+ GL_SRC1_RGB = $8581;
+ GL_SRC2_RGB = $8582;
+ GL_SRC0_ALPHA = $8588;
+ GL_SRC1_ALPHA = $8589;
+ GL_SRC2_ALPHA = $858A;
+ GL_DOT3_RGB = $86AE;
+ GL_DOT3_RGBA = $86AF;
+ {------------------------------------------------------------------------*
+ * required OES extension tokens
+ *------------------------------------------------------------------------ }
+ { OES_read_format }
+ GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = $8B9A;
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = $8B9B;
+ { GL_OES_compressed_paletted_texture }
+ GL_PALETTE4_RGB8_OES = $8B90;
+ GL_PALETTE4_RGBA8_OES = $8B91;
+ GL_PALETTE4_R5_G6_B5_OES = $8B92;
+ GL_PALETTE4_RGBA4_OES = $8B93;
+ GL_PALETTE4_RGB5_A1_OES = $8B94;
+ GL_PALETTE8_RGB8_OES = $8B95;
+ GL_PALETTE8_RGBA8_OES = $8B96;
+ GL_PALETTE8_R5_G6_B5_OES = $8B97;
+ GL_PALETTE8_RGBA4_OES = $8B98;
+ GL_PALETTE8_RGB5_A1_OES = $8B99;
+ { OES_point_size_array }
+ GL_POINT_SIZE_ARRAY_OES = $8B9C;
+ GL_POINT_SIZE_ARRAY_TYPE_OES = $898A;
+ GL_POINT_SIZE_ARRAY_STRIDE_OES = $898B;
+ GL_POINT_SIZE_ARRAY_POINTER_OES = $898C;
+ GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = $8B9F;
+ { GL_OES_point_sprite }
+ GL_POINT_SPRITE_OES = $8861;
+ GL_COORD_REPLACE_OES = $8862;
+ {*********************************************************** }
+ { Available only in Common profile }
+
+ var
+ glAlphaFunc : procedure(func:GLenum; ref:GLclampf);cdecl;
+ glClearColor : procedure(red:GLclampf; green:GLclampf; blue:GLclampf; alpha:GLclampf);cdecl;
+ glClearDepthf : procedure(depth:GLclampf);cdecl;
+(* Const before type ignored *)
+ glClipPlanef : procedure(plane:GLenum; equation:pGLfloat);cdecl;
+ glColor4f : procedure(red:GLfloat; green:GLfloat; blue:GLfloat; alpha:GLfloat);cdecl;
+ glDepthRangef : procedure(zNear:GLclampf; zFar:GLclampf);cdecl;
+ glFogf : procedure(pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+ glFogfv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+ glFrustumf : procedure(left:GLfloat; right:GLfloat; bottom:GLfloat; top:GLfloat; zNear:GLfloat;
+ zFar:GLfloat);cdecl;
+ glGetClipPlanef : procedure(pname:GLenum; eqn:array of GLfloat);cdecl;
+ glGetFloatv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+ glGetLightfv : procedure(light:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+ glGetMaterialfv : procedure(face:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+ glGetTexEnvfv : procedure(env:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+ glGetTexParameterfv : procedure(target:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+ glLightModelf : procedure(pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+ glLightModelfv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+ glLightf : procedure(light:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+ glLightfv : procedure(light:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+ glLineWidth : procedure(width:GLfloat);cdecl;
+(* Const before type ignored *)
+ glLoadMatrixf : procedure(m:pGLfloat);cdecl;
+ glMaterialf : procedure(face:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+ glMaterialfv : procedure(face:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+(* Const before type ignored *)
+ glMultMatrixf : procedure(m:pGLfloat);cdecl;
+ glMultiTexCoord4f : procedure(target:GLenum; s:GLfloat; t:GLfloat; r:GLfloat; q:GLfloat);cdecl;
+ glNormal3f : procedure(nx:GLfloat; ny:GLfloat; nz:GLfloat);cdecl;
+ glOrthof : procedure(left:GLfloat; right:GLfloat; bottom:GLfloat; top:GLfloat; zNear:GLfloat;
+ zFar:GLfloat);cdecl;
+ glPointParameterf : procedure(pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+ glPointParameterfv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+ glPointSize : procedure(size:GLfloat);cdecl;
+ glPolygonOffset : procedure(factor:GLfloat; units:GLfloat);cdecl;
+ glRotatef : procedure(angle:GLfloat; x:GLfloat; y:GLfloat; z:GLfloat);cdecl;
+ glScalef : procedure(x:GLfloat; y:GLfloat; z:GLfloat);cdecl;
+ glTexEnvf : procedure(target:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+ glTexEnvfv : procedure(target:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+ glTexParameterf : procedure(target:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+ glTexParameterfv : procedure(target:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+ glTranslatef : procedure(x:GLfloat; y:GLfloat; z:GLfloat);cdecl;
+ { Available in both Common and Common-Lite profiles }
+ glActiveTexture : procedure(texture:GLenum);cdecl;
+ glAlphaFuncx : procedure(func:GLenum; ref:GLclampx);cdecl;
+ glBindBuffer : procedure(target:GLenum; buffer:GLuint);cdecl;
+ glBindTexture : procedure(target:GLenum; texture:GLuint);cdecl;
+ glBlendFunc : procedure(sfactor:GLenum; dfactor:GLenum);cdecl;
+(* Const before type ignored *)
+ glBufferData : procedure(target:GLenum; size:GLsizeiptr; data:pGLvoid; usage:GLenum);cdecl;
+(* Const before type ignored *)
+ glBufferSubData : procedure(target:GLenum; offset:GLintptr; size:GLsizeiptr; data:pGLvoid);cdecl;
+ glClear : procedure(mask:GLbitfield);cdecl;
+ glClearColorx : procedure(red:GLclampx; green:GLclampx; blue:GLclampx; alpha:GLclampx);cdecl;
+ glClearDepthx : procedure(depth:GLclampx);cdecl;
+ glClearStencil : procedure(s:GLint);cdecl;
+ glClientActiveTexture : procedure(texture:GLenum);cdecl;
+(* Const before type ignored *)
+ glClipPlanex : procedure(plane:GLenum; equation:pGLfixed);cdecl;
+ glColor4ub : procedure(red:GLubyte; green:GLubyte; blue:GLubyte; alpha:GLubyte);cdecl;
+ glColor4x : procedure(red:GLfixed; green:GLfixed; blue:GLfixed; alpha:GLfixed);cdecl;
+ glColorMask : procedure(red:GLboolean; green:GLboolean; blue:GLboolean; alpha:GLboolean);cdecl;
+(* Const before type ignored *)
+ glColorPointer : procedure(size:GLint; _type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+(* Const before type ignored *)
+ glCompressedTexImage2D : procedure(target:GLenum; level:GLint; internalformat:GLenum; width:GLsizei; height:GLsizei;
+ border:GLint; imageSize:GLsizei; data:pGLvoid);cdecl;
+(* Const before type ignored *)
+ glCompressedTexSubImage2D : procedure(target:GLenum; level:GLint; xoffset:GLint; yoffset:GLint; width:GLsizei;
+ height:GLsizei; format:GLenum; imageSize:GLsizei; data:pGLvoid);cdecl;
+ glCopyTexImage2D : procedure(target:GLenum; level:GLint; internalformat:GLenum; x:GLint; y:GLint;
+ width:GLsizei; height:GLsizei; border:GLint);cdecl;
+ glCopyTexSubImage2D : procedure(target:GLenum; level:GLint; xoffset:GLint; yoffset:GLint; x:GLint;
+ y:GLint; width:GLsizei; height:GLsizei);cdecl;
+ glCullFace : procedure(mode:GLenum);cdecl;
+(* Const before type ignored *)
+ glDeleteBuffers : procedure(n:GLsizei; buffers:pGLuint);cdecl;
+(* Const before type ignored *)
+ glDeleteTextures : procedure(n:GLsizei; textures:pGLuint);cdecl;
+ glDepthFunc : procedure(func:GLenum);cdecl;
+ glDepthMask : procedure(flag:GLboolean);cdecl;
+ glDepthRangex : procedure(zNear:GLclampx; zFar:GLclampx);cdecl;
+ glDisable : procedure(cap:GLenum);cdecl;
+ glDisableClientState : procedure(arry:GLenum);cdecl;
+ glDrawArrays : procedure(mode:GLenum; first:GLint; count:GLsizei);cdecl;
+(* Const before type ignored *)
+ glDrawElements : procedure(mode:GLenum; count:GLsizei; _type:GLenum; indices:pGLvoid);cdecl;
+ glEnable : procedure(cap:GLenum);cdecl;
+ glEnableClientState : procedure(arry:GLenum);cdecl;
+ glFinish : procedure;cdecl;
+ glFlush : procedure;cdecl;
+ glFogx : procedure(pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+ glFogxv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+ glFrontFace : procedure(mode:GLenum);cdecl;
+ glFrustumx : procedure(left:GLfixed; right:GLfixed; bottom:GLfixed; top:GLfixed; zNear:GLfixed;
+ zFar:GLfixed);cdecl;
+ glGetBooleanv : procedure(pname:GLenum; params:pGLboolean);cdecl;
+ glGetBufferParameteriv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+ glGetClipPlanex : procedure(pname:GLenum; eqn:array of GLfixed);cdecl;
+ glGenBuffers : procedure(n:GLsizei; buffers:pGLuint);cdecl;
+ glGenTextures : procedure(n:GLsizei; textures:pGLuint);cdecl;
+ glGetError : function:GLenum;cdecl;
+ glGetFixedv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+ glGetIntegerv : procedure(pname:GLenum; params:pGLint);cdecl;
+ glGetLightxv : procedure(light:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+ glGetMaterialxv : procedure(face:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+ glGetPointerv : procedure(pname:GLenum; params:Ppointer);cdecl;
+(* Const before type ignored *)
+ glGetString : function(name:GLenum):PGLubyte;cdecl;
+ glGetTexEnviv : procedure(env:GLenum; pname:GLenum; params:pGLint);cdecl;
+ glGetTexEnvxv : procedure(env:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+ glGetTexParameteriv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+ glGetTexParameterxv : procedure(target:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+ glHint : procedure(target:GLenum; mode:GLenum);cdecl;
+ glIsBuffer : function(buffer:GLuint):GLboolean;cdecl;
+ glIsEnabled : function(cap:GLenum):GLboolean;cdecl;
+ glIsTexture : function(texture:GLuint):GLboolean;cdecl;
+ glLightModelx : procedure(pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+ glLightModelxv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+ glLightx : procedure(light:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+ glLightxv : procedure(light:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+ glLineWidthx : procedure(width:GLfixed);cdecl;
+ glLoadIdentity : procedure;cdecl;
+(* Const before type ignored *)
+ glLoadMatrixx : procedure(m:pGLfixed);cdecl;
+ glLogicOp : procedure(opcode:GLenum);cdecl;
+ glMaterialx : procedure(face:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+ glMaterialxv : procedure(face:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+ glMatrixMode : procedure(mode:GLenum);cdecl;
+(* Const before type ignored *)
+ glMultMatrixx : procedure(m:pGLfixed);cdecl;
+ glMultiTexCoord4x : procedure(target:GLenum; s:GLfixed; t:GLfixed; r:GLfixed; q:GLfixed);cdecl;
+ glNormal3x : procedure(nx:GLfixed; ny:GLfixed; nz:GLfixed);cdecl;
+(* Const before type ignored *)
+ glNormalPointer : procedure(_type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+ glOrthox : procedure(left:GLfixed; right:GLfixed; bottom:GLfixed; top:GLfixed; zNear:GLfixed;
+ zFar:GLfixed);cdecl;
+ glPixelStorei : procedure(pname:GLenum; param:GLint);cdecl;
+ glPointParameterx : procedure(pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+ glPointParameterxv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+ glPointSizex : procedure(size:GLfixed);cdecl;
+ glPolygonOffsetx : procedure(factor:GLfixed; units:GLfixed);cdecl;
+ glPopMatrix : procedure;cdecl;
+ glPushMatrix : procedure;cdecl;
+ glReadPixels : procedure(x:GLint; y:GLint; width:GLsizei; height:GLsizei; format:GLenum;
+ _type:GLenum; pixels:pGLvoid);cdecl;
+ glRotatex : procedure(angle:GLfixed; x:GLfixed; y:GLfixed; z:GLfixed);cdecl;
+ glSampleCoverage : procedure(value:GLclampf; invert:GLboolean);cdecl;
+ glSampleCoveragex : procedure(value:GLclampx; invert:GLboolean);cdecl;
+ glScalex : procedure(x:GLfixed; y:GLfixed; z:GLfixed);cdecl;
+ glScissor : procedure(x:GLint; y:GLint; width:GLsizei; height:GLsizei);cdecl;
+ glShadeModel : procedure(mode:GLenum);cdecl;
+ glStencilFunc : procedure(func:GLenum; ref:GLint; mask:GLuint);cdecl;
+ glStencilMask : procedure(mask:GLuint);cdecl;
+ glStencilOp : procedure(fail:GLenum; zfail:GLenum; zpass:GLenum);cdecl;
+(* Const before type ignored *)
+ glTexCoordPointer : procedure(size:GLint; _type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+ glTexEnvi : procedure(target:GLenum; pname:GLenum; param:GLint);cdecl;
+ glTexEnvx : procedure(target:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+ glTexEnviv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+(* Const before type ignored *)
+ glTexEnvxv : procedure(target:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+(* Const before type ignored *)
+ glTexImage2D : procedure(target:GLenum; level:GLint; internalformat:GLint; width:GLsizei; height:GLsizei;
+ border:GLint; format:GLenum; _type:GLenum; pixels:pGLvoid);cdecl;
+ glTexParameteri : procedure(target:GLenum; pname:GLenum; param:GLint);cdecl;
+ glTexParameterx : procedure(target:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+ glTexParameteriv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+(* Const before type ignored *)
+ glTexParameterxv : procedure(target:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+(* Const before type ignored *)
+ glTexSubImage2D : procedure(target:GLenum; level:GLint; xoffset:GLint; yoffset:GLint; width:GLsizei;
+ height:GLsizei; format:GLenum; _type:GLenum; pixels:pGLvoid);cdecl;
+ glTranslatex : procedure(x:GLfixed; y:GLfixed; z:GLfixed);cdecl;
+(* Const before type ignored *)
+ glVertexPointer : procedure(size:GLint; _type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+ glViewport : procedure(x:GLint; y:GLint; width:GLsizei; height:GLsizei);cdecl;
+ {------------------------------------------------------------------------*
+ * Required OES extension functions
+ *------------------------------------------------------------------------ }
+ { GL_OES_read_format }
+
+ const
+ GL_OES_read_format = 1;
+ { GL_OES_compressed_paletted_texture }
+ GL_OES_compressed_paletted_texture = 1;
+ { GL_OES_point_size_array }
+ GL_OES_point_size_array = 1;
+(* Const before type ignored *)
+
+ var
+ glPointSizePointerOES : procedure(_type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+ { GL_OES_point_sprite }
+
+ const
+ GL_OES_point_sprite = 1;
+
+implementation
+
+ uses
+ SysUtils, dynlibs;
+
+ var
+ hlib : tlibhandle;
+
+
+ procedure Freegles11;
+ begin
+// FreeLibrary(hlib);
+ glAlphaFunc:=nil;
+ glClearColor:=nil;
+ glClearDepthf:=nil;
+ glClipPlanef:=nil;
+ glColor4f:=nil;
+ glDepthRangef:=nil;
+ glFogf:=nil;
+ glFogfv:=nil;
+ glFrustumf:=nil;
+ glGetClipPlanef:=nil;
+ glGetFloatv:=nil;
+ glGetLightfv:=nil;
+ glGetMaterialfv:=nil;
+ glGetTexEnvfv:=nil;
+ glGetTexParameterfv:=nil;
+ glLightModelf:=nil;
+ glLightModelfv:=nil;
+ glLightf:=nil;
+ glLightfv:=nil;
+ glLineWidth:=nil;
+ glLoadMatrixf:=nil;
+ glMaterialf:=nil;
+ glMaterialfv:=nil;
+ glMultMatrixf:=nil;
+ glMultiTexCoord4f:=nil;
+ glNormal3f:=nil;
+ glOrthof:=nil;
+ glPointParameterf:=nil;
+ glPointParameterfv:=nil;
+ glPointSize:=nil;
+ glPolygonOffset:=nil;
+ glRotatef:=nil;
+ glScalef:=nil;
+ glTexEnvf:=nil;
+ glTexEnvfv:=nil;
+ glTexParameterf:=nil;
+ glTexParameterfv:=nil;
+ glTranslatef:=nil;
+ glActiveTexture:=nil;
+ glAlphaFuncx:=nil;
+ glBindBuffer:=nil;
+ glBindTexture:=nil;
+ glBlendFunc:=nil;
+ glBufferData:=nil;
+ glBufferSubData:=nil;
+ glClear:=nil;
+ glClearColorx:=nil;
+ glClearDepthx:=nil;
+ glClearStencil:=nil;
+ glClientActiveTexture:=nil;
+ glClipPlanex:=nil;
+ glColor4ub:=nil;
+ glColor4x:=nil;
+ glColorMask:=nil;
+ glColorPointer:=nil;
+ glCompressedTexImage2D:=nil;
+ glCompressedTexSubImage2D:=nil;
+ glCopyTexImage2D:=nil;
+ glCopyTexSubImage2D:=nil;
+ glCullFace:=nil;
+ glDeleteBuffers:=nil;
+ glDeleteTextures:=nil;
+ glDepthFunc:=nil;
+ glDepthMask:=nil;
+ glDepthRangex:=nil;
+ glDisable:=nil;
+ glDisableClientState:=nil;
+ glDrawArrays:=nil;
+ glDrawElements:=nil;
+ glEnable:=nil;
+ glEnableClientState:=nil;
+ glFinish:=nil;
+ glFlush:=nil;
+ glFogx:=nil;
+ glFogxv:=nil;
+ glFrontFace:=nil;
+ glFrustumx:=nil;
+ glGetBooleanv:=nil;
+ glGetBufferParameteriv:=nil;
+ glGetClipPlanex:=nil;
+ glGenBuffers:=nil;
+ glGenTextures:=nil;
+ glGetError:=nil;
+ glGetFixedv:=nil;
+ glGetIntegerv:=nil;
+ glGetLightxv:=nil;
+ glGetMaterialxv:=nil;
+ glGetPointerv:=nil;
+ glGetString:=nil;
+ glGetTexEnviv:=nil;
+ glGetTexEnvxv:=nil;
+ glGetTexParameteriv:=nil;
+ glGetTexParameterxv:=nil;
+ glHint:=nil;
+ glIsBuffer:=nil;
+ glIsEnabled:=nil;
+ glIsTexture:=nil;
+ glLightModelx:=nil;
+ glLightModelxv:=nil;
+ glLightx:=nil;
+ glLightxv:=nil;
+ glLineWidthx:=nil;
+ glLoadIdentity:=nil;
+ glLoadMatrixx:=nil;
+ glLogicOp:=nil;
+ glMaterialx:=nil;
+ glMaterialxv:=nil;
+ glMatrixMode:=nil;
+ glMultMatrixx:=nil;
+ glMultiTexCoord4x:=nil;
+ glNormal3x:=nil;
+ glNormalPointer:=nil;
+ glOrthox:=nil;
+ glPixelStorei:=nil;
+ glPointParameterx:=nil;
+ glPointParameterxv:=nil;
+ glPointSizex:=nil;
+ glPolygonOffsetx:=nil;
+ glPopMatrix:=nil;
+ glPushMatrix:=nil;
+ glReadPixels:=nil;
+ glRotatex:=nil;
+ glSampleCoverage:=nil;
+ glSampleCoveragex:=nil;
+ glScalex:=nil;
+ glScissor:=nil;
+ glShadeModel:=nil;
+ glStencilFunc:=nil;
+ glStencilMask:=nil;
+ glStencilOp:=nil;
+ glTexCoordPointer:=nil;
+ glTexEnvi:=nil;
+ glTexEnvx:=nil;
+ glTexEnviv:=nil;
+ glTexEnvxv:=nil;
+ glTexImage2D:=nil;
+ glTexParameteri:=nil;
+ glTexParameterx:=nil;
+ glTexParameteriv:=nil;
+ glTexParameterxv:=nil;
+ glTexSubImage2D:=nil;
+ glTranslatex:=nil;
+ glVertexPointer:=nil;
+ glViewport:=nil;
+ glPointSizePointerOES:=nil;
+ end;
+
+
+ procedure Loadgles11(lib : pchar);
+ begin
+ Freegles11;
+ hlib:=LoadLibrary(lib);
+ if hlib=0 then
+ begin
+ raise Exception.Create(format('Could not load library: %s',[lib]));
+ end;
+ pointer(glAlphaFunc):=GetProcAddress(hlib,'glAlphaFunc');
+ pointer(glClearColor):=GetProcAddress(hlib,'glClearColor');
+ pointer(glClearDepthf):=GetProcAddress(hlib,'glClearDepthf');
+ pointer(glClipPlanef):=GetProcAddress(hlib,'glClipPlanef');
+ pointer(glColor4f):=GetProcAddress(hlib,'glColor4f');
+ pointer(glDepthRangef):=GetProcAddress(hlib,'glDepthRangef');
+ pointer(glFogf):=GetProcAddress(hlib,'glFogf');
+ pointer(glFogfv):=GetProcAddress(hlib,'glFogfv');
+ pointer(glFrustumf):=GetProcAddress(hlib,'glFrustumf');
+ pointer(glGetClipPlanef):=GetProcAddress(hlib,'glGetClipPlanef');
+ pointer(glGetFloatv):=GetProcAddress(hlib,'glGetFloatv');
+ pointer(glGetLightfv):=GetProcAddress(hlib,'glGetLightfv');
+ pointer(glGetMaterialfv):=GetProcAddress(hlib,'glGetMaterialfv');
+ pointer(glGetTexEnvfv):=GetProcAddress(hlib,'glGetTexEnvfv');
+ pointer(glGetTexParameterfv):=GetProcAddress(hlib,'glGetTexParameterfv');
+ pointer(glLightModelf):=GetProcAddress(hlib,'glLightModelf');
+ pointer(glLightModelfv):=GetProcAddress(hlib,'glLightModelfv');
+ pointer(glLightf):=GetProcAddress(hlib,'glLightf');
+ pointer(glLightfv):=GetProcAddress(hlib,'glLightfv');
+ pointer(glLineWidth):=GetProcAddress(hlib,'glLineWidth');
+ pointer(glLoadMatrixf):=GetProcAddress(hlib,'glLoadMatrixf');
+ pointer(glMaterialf):=GetProcAddress(hlib,'glMaterialf');
+ pointer(glMaterialfv):=GetProcAddress(hlib,'glMaterialfv');
+ pointer(glMultMatrixf):=GetProcAddress(hlib,'glMultMatrixf');
+ pointer(glMultiTexCoord4f):=GetProcAddress(hlib,'glMultiTexCoord4f');
+ pointer(glNormal3f):=GetProcAddress(hlib,'glNormal3f');
+ pointer(glOrthof):=GetProcAddress(hlib,'glOrthof');
+ pointer(glPointParameterf):=GetProcAddress(hlib,'glPointParameterf');
+ pointer(glPointParameterfv):=GetProcAddress(hlib,'glPointParameterfv');
+ pointer(glPointSize):=GetProcAddress(hlib,'glPointSize');
+ pointer(glPolygonOffset):=GetProcAddress(hlib,'glPolygonOffset');
+ pointer(glRotatef):=GetProcAddress(hlib,'glRotatef');
+ pointer(glScalef):=GetProcAddress(hlib,'glScalef');
+ pointer(glTexEnvf):=GetProcAddress(hlib,'glTexEnvf');
+ pointer(glTexEnvfv):=GetProcAddress(hlib,'glTexEnvfv');
+ pointer(glTexParameterf):=GetProcAddress(hlib,'glTexParameterf');
+ pointer(glTexParameterfv):=GetProcAddress(hlib,'glTexParameterfv');
+ pointer(glTranslatef):=GetProcAddress(hlib,'glTranslatef');
+ pointer(glActiveTexture):=GetProcAddress(hlib,'glActiveTexture');
+ pointer(glAlphaFuncx):=GetProcAddress(hlib,'glAlphaFuncx');
+ pointer(glBindBuffer):=GetProcAddress(hlib,'glBindBuffer');
+ pointer(glBindTexture):=GetProcAddress(hlib,'glBindTexture');
+ pointer(glBlendFunc):=GetProcAddress(hlib,'glBlendFunc');
+ pointer(glBufferData):=GetProcAddress(hlib,'glBufferData');
+ pointer(glBufferSubData):=GetProcAddress(hlib,'glBufferSubData');
+ pointer(glClear):=GetProcAddress(hlib,'glClear');
+ pointer(glClearColorx):=GetProcAddress(hlib,'glClearColorx');
+ pointer(glClearDepthx):=GetProcAddress(hlib,'glClearDepthx');
+ pointer(glClearStencil):=GetProcAddress(hlib,'glClearStencil');
+ pointer(glClientActiveTexture):=GetProcAddress(hlib,'glClientActiveTexture');
+ pointer(glClipPlanex):=GetProcAddress(hlib,'glClipPlanex');
+ pointer(glColor4ub):=GetProcAddress(hlib,'glColor4ub');
+ pointer(glColor4x):=GetProcAddress(hlib,'glColor4x');
+ pointer(glColorMask):=GetProcAddress(hlib,'glColorMask');
+ pointer(glColorPointer):=GetProcAddress(hlib,'glColorPointer');
+ pointer(glCompressedTexImage2D):=GetProcAddress(hlib,'glCompressedTexImage2D');
+ pointer(glCompressedTexSubImage2D):=GetProcAddress(hlib,'glCompressedTexSubImage2D');
+ pointer(glCopyTexImage2D):=GetProcAddress(hlib,'glCopyTexImage2D');
+ pointer(glCopyTexSubImage2D):=GetProcAddress(hlib,'glCopyTexSubImage2D');
+ pointer(glCullFace):=GetProcAddress(hlib,'glCullFace');
+ pointer(glDeleteBuffers):=GetProcAddress(hlib,'glDeleteBuffers');
+ pointer(glDeleteTextures):=GetProcAddress(hlib,'glDeleteTextures');
+ pointer(glDepthFunc):=GetProcAddress(hlib,'glDepthFunc');
+ pointer(glDepthMask):=GetProcAddress(hlib,'glDepthMask');
+ pointer(glDepthRangex):=GetProcAddress(hlib,'glDepthRangex');
+ pointer(glDisable):=GetProcAddress(hlib,'glDisable');
+ pointer(glDisableClientState):=GetProcAddress(hlib,'glDisableClientState');
+ pointer(glDrawArrays):=GetProcAddress(hlib,'glDrawArrays');
+ pointer(glDrawElements):=GetProcAddress(hlib,'glDrawElements');
+ pointer(glEnable):=GetProcAddress(hlib,'glEnable');
+ pointer(glEnableClientState):=GetProcAddress(hlib,'glEnableClientState');
+ pointer(glFinish):=GetProcAddress(hlib,'glFinish');
+ pointer(glFlush):=GetProcAddress(hlib,'glFlush');
+ pointer(glFogx):=GetProcAddress(hlib,'glFogx');
+ pointer(glFogxv):=GetProcAddress(hlib,'glFogxv');
+ pointer(glFrontFace):=GetProcAddress(hlib,'glFrontFace');
+ pointer(glFrustumx):=GetProcAddress(hlib,'glFrustumx');
+ pointer(glGetBooleanv):=GetProcAddress(hlib,'glGetBooleanv');
+ pointer(glGetBufferParameteriv):=GetProcAddress(hlib,'glGetBufferParameteriv');
+ pointer(glGetClipPlanex):=GetProcAddress(hlib,'glGetClipPlanex');
+ pointer(glGenBuffers):=GetProcAddress(hlib,'glGenBuffers');
+ pointer(glGenTextures):=GetProcAddress(hlib,'glGenTextures');
+ pointer(glGetError):=GetProcAddress(hlib,'glGetError');
+ pointer(glGetFixedv):=GetProcAddress(hlib,'glGetFixedv');
+ pointer(glGetIntegerv):=GetProcAddress(hlib,'glGetIntegerv');
+ pointer(glGetLightxv):=GetProcAddress(hlib,'glGetLightxv');
+ pointer(glGetMaterialxv):=GetProcAddress(hlib,'glGetMaterialxv');
+ pointer(glGetPointerv):=GetProcAddress(hlib,'glGetPointerv');
+ pointer(glGetString):=GetProcAddress(hlib,'glGetString');
+ pointer(glGetTexEnviv):=GetProcAddress(hlib,'glGetTexEnviv');
+ pointer(glGetTexEnvxv):=GetProcAddress(hlib,'glGetTexEnvxv');
+ pointer(glGetTexParameteriv):=GetProcAddress(hlib,'glGetTexParameteriv');
+ pointer(glGetTexParameterxv):=GetProcAddress(hlib,'glGetTexParameterxv');
+ pointer(glHint):=GetProcAddress(hlib,'glHint');
+ pointer(glIsBuffer):=GetProcAddress(hlib,'glIsBuffer');
+ pointer(glIsEnabled):=GetProcAddress(hlib,'glIsEnabled');
+ pointer(glIsTexture):=GetProcAddress(hlib,'glIsTexture');
+ pointer(glLightModelx):=GetProcAddress(hlib,'glLightModelx');
+ pointer(glLightModelxv):=GetProcAddress(hlib,'glLightModelxv');
+ pointer(glLightx):=GetProcAddress(hlib,'glLightx');
+ pointer(glLightxv):=GetProcAddress(hlib,'glLightxv');
+ pointer(glLineWidthx):=GetProcAddress(hlib,'glLineWidthx');
+ pointer(glLoadIdentity):=GetProcAddress(hlib,'glLoadIdentity');
+ pointer(glLoadMatrixx):=GetProcAddress(hlib,'glLoadMatrixx');
+ pointer(glLogicOp):=GetProcAddress(hlib,'glLogicOp');
+ pointer(glMaterialx):=GetProcAddress(hlib,'glMaterialx');
+ pointer(glMaterialxv):=GetProcAddress(hlib,'glMaterialxv');
+ pointer(glMatrixMode):=GetProcAddress(hlib,'glMatrixMode');
+ pointer(glMultMatrixx):=GetProcAddress(hlib,'glMultMatrixx');
+ pointer(glMultiTexCoord4x):=GetProcAddress(hlib,'glMultiTexCoord4x');
+ pointer(glNormal3x):=GetProcAddress(hlib,'glNormal3x');
+ pointer(glNormalPointer):=GetProcAddress(hlib,'glNormalPointer');
+ pointer(glOrthox):=GetProcAddress(hlib,'glOrthox');
+ pointer(glPixelStorei):=GetProcAddress(hlib,'glPixelStorei');
+ pointer(glPointParameterx):=GetProcAddress(hlib,'glPointParameterx');
+ pointer(glPointParameterxv):=GetProcAddress(hlib,'glPointParameterxv');
+ pointer(glPointSizex):=GetProcAddress(hlib,'glPointSizex');
+ pointer(glPolygonOffsetx):=GetProcAddress(hlib,'glPolygonOffsetx');
+ pointer(glPopMatrix):=GetProcAddress(hlib,'glPopMatrix');
+ pointer(glPushMatrix):=GetProcAddress(hlib,'glPushMatrix');
+ pointer(glReadPixels):=GetProcAddress(hlib,'glReadPixels');
+ pointer(glRotatex):=GetProcAddress(hlib,'glRotatex');
+ pointer(glSampleCoverage):=GetProcAddress(hlib,'glSampleCoverage');
+ pointer(glSampleCoveragex):=GetProcAddress(hlib,'glSampleCoveragex');
+ pointer(glScalex):=GetProcAddress(hlib,'glScalex');
+ pointer(glScissor):=GetProcAddress(hlib,'glScissor');
+ pointer(glShadeModel):=GetProcAddress(hlib,'glShadeModel');
+ pointer(glStencilFunc):=GetProcAddress(hlib,'glStencilFunc');
+ pointer(glStencilMask):=GetProcAddress(hlib,'glStencilMask');
+ pointer(glStencilOp):=GetProcAddress(hlib,'glStencilOp');
+ pointer(glTexCoordPointer):=GetProcAddress(hlib,'glTexCoordPointer');
+ pointer(glTexEnvi):=GetProcAddress(hlib,'glTexEnvi');
+ pointer(glTexEnvx):=GetProcAddress(hlib,'glTexEnvx');
+ pointer(glTexEnviv):=GetProcAddress(hlib,'glTexEnviv');
+ pointer(glTexEnvxv):=GetProcAddress(hlib,'glTexEnvxv');
+ pointer(glTexImage2D):=GetProcAddress(hlib,'glTexImage2D');
+ pointer(glTexParameteri):=GetProcAddress(hlib,'glTexParameteri');
+ pointer(glTexParameterx):=GetProcAddress(hlib,'glTexParameterx');
+ pointer(glTexParameteriv):=GetProcAddress(hlib,'glTexParameteriv');
+ pointer(glTexParameterxv):=GetProcAddress(hlib,'glTexParameterxv');
+ pointer(glTexSubImage2D):=GetProcAddress(hlib,'glTexSubImage2D');
+ pointer(glTranslatex):=GetProcAddress(hlib,'glTranslatex');
+ pointer(glVertexPointer):=GetProcAddress(hlib,'glVertexPointer');
+ pointer(glViewport):=GetProcAddress(hlib,'glViewport');
+ pointer(glPointSizePointerOES):=GetProcAddress(hlib,'glPointSizePointerOES');
+ end;
+
+procedure init;
+begin
+ Loadgles11('libGLESv1_CM.so');
+end;
+
+
+initialization
+ Loadgles11('gles11');
+finalization
+ Freegles11;
+
+end.
Binary file project_files/HedgewarsMobile/Audio/Music/Art.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Brick.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Castle.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/City.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Compost.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Desert.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/EarthRise.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Freeway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Halloween.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Nature.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Olympics.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Rock.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/Sheep.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/bath.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/hell.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/oriental.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/pirate.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/snow.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Music/underwater.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/1C.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/2D.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/3E.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/4F.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/5G.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/6A.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/7B.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/8C.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/9D.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/BirdyLay.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/CollectCrate.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/Droplet1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/Droplet2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/Droplet3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/Hellish.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/Whistle.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/Yoohoo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/baseballbat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/bee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/beewater.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/cake2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/denied.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/drillgun.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/egg.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/explosion.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/graveimpact.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/grenadeimpact.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/gun.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_growl.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_ooff.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_ow.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_ugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/hogchant3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/homerun.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/lowgravity.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/melonimpact.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/minetick.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/molotov.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/mortar.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/pickhammer.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/placed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/plane.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/rcplane.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/ride_of_the_valkyries.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/ropeattach.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/roperelease.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/ropeshot.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/shotgunfire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/shotgunreload.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/shutterclick.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/skip.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/sniperreload.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/splash.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/steam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/steps.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/suddendeath.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/switchhog.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/throwpowerup.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/throwrelease.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/ufo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch5.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch6.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/PoisonCough.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/PoisonMoan.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Firepunch2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Firepunch3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Firepunch4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Firepunch5.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Firepunch6.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/JustYouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/PoisonCough.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/PoisonMoan.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default_uk/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch5.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch6.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch5.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch6.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch5.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch6.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/FlawlessPossibility.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/VictoryPossibility.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Amazing.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Boring.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Brilliant.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Bugger.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Bungee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Byebye.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Comeonthen.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Coward.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Cutitout.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Drat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Enemydown.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Excellent.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Fire.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch5.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch6.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firstblood.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Flawless.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Gonnagetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Grenade.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hello.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hmm.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hurry.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Illgetyou.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Incoming.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Justyouwait.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Kamikaze.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Laugh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Leavemealone.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Melon.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Missed.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Nooo.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Nutter.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ohdear.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Oops.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ouch.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow1.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow2.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow3.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow4.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Perfect.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Reinforcements.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Revenge.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Runaway.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Sameteam.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Solong.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Stupid.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Takecover.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Thisoneismine.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Traitor.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Uh-oh.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Victory.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Watchit.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Watchthis.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Whatthe.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Whoopsee.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Yessir.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Youllregretthat.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/warp.ogg has changed
Binary file project_files/HedgewarsMobile/Audio/Sounds/whipcrack.ogg has changed