add a new way to fetch version info from pascal to c
authorkoda
Wed, 10 Feb 2010 22:00:49 +0000
changeset 2799 558b29bf00c5
parent 2798 d48bbe4518e6
child 2800 f286d91157b8
add a new way to fetch version info from pascal to c complete the stubs for the new lua section fixed a glitch in the ifrontend
cocoaTouch/GameSetup.m
cocoaTouch/MainMenuViewController.m
cocoaTouch/MainMenuViewController.xib
cocoaTouch/SettingsViewController.m
cocoaTouch/cleanData.sh
cocoaTouch/otherSrc/PascalImports.h
hedgewars/LuaPas.pas
hedgewars/PascalExports.pas
hedgewars/hwengine.pas
hedgewars/uScript.pas
--- a/cocoaTouch/GameSetup.m	Wed Feb 10 21:23:03 2010 +0000
+++ b/cocoaTouch/GameSetup.m	Wed Feb 10 22:00:49 2010 +0000
@@ -199,8 +199,11 @@
 						break;
 					case 'e':
 						sscanf(buffer, "%*s %d", &eProto);
-						if (HW_protoVer() == eProto) {
-							NSLog(@"Setting protocol version %s", buffer);
+						short int netProto;
+						char *versionStr;
+						HW_versionInfo(&netProto, &versionStr);
+						if (netProto == eProto) {
+							NSLog(@"Setting protocol version %d (%s)", eProto, versionStr);
 						} else {
 							NSLog(@"ERROR - wrong protocol number: [%s] - expecting %d", buffer, eProto);
 							clientQuit = YES;
--- a/cocoaTouch/MainMenuViewController.m	Wed Feb 10 21:23:03 2010 +0000
+++ b/cocoaTouch/MainMenuViewController.m	Wed Feb 10 22:00:49 2010 +0000
@@ -8,6 +8,7 @@
 
 #import "MainMenuViewController.h"
 #import "SDL_uikitappdelegate.h"
+#import "PascalImports.h"
 
 @implementation MainMenuViewController
 
@@ -35,13 +36,16 @@
 	// Release any cached data, images, etc that aren't in use.
 	if (nil == self.settingsViewController.view.superview) {
 		self.settingsViewController = nil;
+		[settingsViewController release];
 	}
 }
 
 
 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
 -(void) viewDidLoad {
-	self.versionLabel.text = @"0.9.13-dev";
+	char *ver;
+	HW_versionInfo(NULL, &ver);
+	self.versionLabel.text = [[NSString stringWithUTF8String:ver] autorelease];
 	[super viewDidLoad];
 }
 
@@ -92,14 +96,14 @@
 			SettingsViewController *controller = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController"
 												      bundle:nil];
 			self.settingsViewController = controller;
-			self.settingsViewController.parentView = self.mainView;
 			[controller release];
 		}
 		self.settingsViewController.view.frame = CGRectMake(0, -320, 480, 320);
+		self.settingsViewController.parentView = self.mainView;
 
 		[UIView beginAnimations:@"View Switch" context:NULL];
-		[UIView setAnimationDuration:3];
-		[UIView setAnimationDuration:UIViewAnimationCurveEaseOut];
+		[UIView setAnimationDuration:1];
+		//[UIView setAnimationDuration:UIViewAnimationCurveEaseOut];
 		self.settingsViewController.view.frame = CGRectMake(0, 0, 480, 320);
 		self.mainView.frame = CGRectMake(0, 320, 480, 320);
 		
--- a/cocoaTouch/MainMenuViewController.xib	Wed Feb 10 21:23:03 2010 +0000
+++ b/cocoaTouch/MainMenuViewController.xib	Wed Feb 10 22:00:49 2010 +0000
@@ -162,7 +162,7 @@
 							<object class="IBUILabel" id="533529472">
 								<reference key="NSNextResponder" ref="167221315"/>
 								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{20, 133}, {145, 21}}</string>
+								<string key="NSFrame">{{67, 114}, {145, 21}}</string>
 								<reference key="NSSuperview" ref="167221315"/>
 								<bool key="IBUIOpaque">NO</bool>
 								<bool key="IBUIClipsSubviews">YES</bool>
@@ -180,7 +180,7 @@
 								<nil key="IBUIHighlightedColor"/>
 								<int key="IBUIBaselineAdjustment">1</int>
 								<float key="IBUIMinimumFontSize">10</float>
-								<int key="IBUITextAlignment">2</int>
+								<int key="IBUITextAlignment">1</int>
 							</object>
 							<object class="IBUIButton" id="753723574">
 								<reference key="NSNextResponder" ref="167221315"/>
@@ -273,6 +273,14 @@
 					</object>
 					<int key="connectionID">33</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">versionLabel</string>
+						<reference key="source" ref="372490531"/>
+						<reference key="destination" ref="533529472"/>
+					</object>
+					<int key="connectionID">34</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -404,7 +412,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">33</int>
+			<int key="maxID">34</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
--- a/cocoaTouch/SettingsViewController.m	Wed Feb 10 21:23:03 2010 +0000
+++ b/cocoaTouch/SettingsViewController.m	Wed Feb 10 22:00:49 2010 +0000
@@ -151,14 +151,14 @@
 	[actionSheet release];
 	 */
 	[UIView beginAnimations:@"Get Back" context:NULL];
-	[UIView setAnimationDuration:3];
-	[UIView setAnimationDuration:UIViewAnimationCurveEaseOut];
+	[UIView setAnimationDuration:1];
+	//[UIView setAnimationDuration:UIViewAnimationCurveEaseOut];
 	
 	self.view.frame = CGRectMake(0, -320, 480, 320);
 	self.parentView.frame = CGRectMake(0, 0, 480, 320);
 	[UIView commitAnimations];
 
-	[self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:2];
+	[self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
 	self.parentView = nil;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cocoaTouch/cleanData.sh	Wed Feb 10 22:00:49 2010 +0000
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+svn export --force share/hedgewars/Data ../iphone-hwengine/Data
+rm -rf ../iphone-hwengine/Data/Sounds/*
+rm -rf ../iphone-hwengine/Data/Music/*
+rm -rf ../iphone-hwengine/Data/Locale/hedgewars_*
--- a/cocoaTouch/otherSrc/PascalImports.h	Wed Feb 10 21:23:03 2010 +0000
+++ b/cocoaTouch/otherSrc/PascalImports.h	Wed Feb 10 22:00:49 2010 +0000
@@ -21,7 +21,7 @@
 	void Game(const char *args[]);
 
 
-	int HW_protoVer(void);
+	void HW_versionInfo(short int*, char**);
 
 	void HW_click(void);
 	void HW_zoomIn(void);
--- a/hedgewars/LuaPas.pas	Wed Feb 10 21:23:03 2010 +0000
+++ b/hedgewars/LuaPas.pas	Wed Feb 10 22:00:49 2010 +0000
@@ -21,10 +21,12 @@
 
 const
 {$IFDEF UNIX}
-  LuaDLL = 'lua5.1.so';
-//  LuaDLL = 'lua5.1.a';
+  LuaLibName = 'lua5.1.so';
+{$IFDEF DARWIN}
+    LuaLibName = 'lua5.1.a';
+{$ENDIF}
 {$ELSE}
-  LuaDLL = 'lua5.1.dll';
+  LuaLibName = 'lua5.1.dll';
 {$ENDIF}
 
 
@@ -186,175 +188,175 @@
 ** state manipulation
 *)
 function  lua_newstate(f : lua_Alloc; ud : Pointer) : Plua_State;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_close(L: Plua_State);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_newthread(L : Plua_State) : Plua_State;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function  lua_atpanic(L : Plua_State; panicf : lua_CFunction) : lua_CFunction;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*
 ** basic stack manipulation
 *)
 function  lua_gettop(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_settop(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushvalue(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_remove(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_insert(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_replace(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_checkstack(L : Plua_State; sz : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 procedure lua_xmove(src, dest : Plua_State; n : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*
 ** access functions (stack -> C)
 *)
 function lua_isnumber(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_isstring(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_iscfunction(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_isuserdata(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_type(L : Plua_State; idx : LongInt) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_typename(L : Plua_State; tp : LongInt) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function lua_equal(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_rawequal(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_lessthan(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function lua_tonumber(L : Plua_State; idx : LongInt) : lua_Number;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_tointeger(L : Plua_State; idx : LongInt) : lua_Integer;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_toboolean(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_tolstring(L : Plua_State; idx : LongInt;
                        len : Psize_t) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_objlen(L : Plua_State; idx : LongInt) : size_t;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_tocfunction(L : Plua_State; idx : LongInt) : lua_CFunction;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_touserdata(L : Plua_State; idx : LongInt) : Pointer;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_tothread(L : Plua_State; idx : LongInt) : Plua_State;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_topointer(L : Plua_State; idx : LongInt) : Pointer;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*
 ** push functions (C -> stack)
 *)
 procedure lua_pushnil(L : Plua_State);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushnumber(L : Plua_State; n : lua_Number);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushinteger(L : Plua_State; n : lua_Integer);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushlstring(L : Plua_State; const s : PChar; ls : size_t);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushstring(L : Plua_State; const s : PChar);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_pushvfstring(L : Plua_State;
                            const fmt : PChar; argp : Pointer) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_pushfstring(L : Plua_State; const fmt : PChar) : PChar; varargs;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushcclosure(L : Plua_State; fn : lua_CFunction; n : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushboolean(L : Plua_State; b : LongBool);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_pushlightuserdata(L : Plua_State; p : Pointer);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_pushthread(L : Plua_state) : Cardinal;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*
 ** get functions (Lua -> stack)
 *)
 procedure lua_gettable(L : Plua_State ; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_getfield(L : Plua_State; idx : LongInt; k : PChar);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_rawget(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_rawgeti(L : Plua_State; idx, n : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_createtable(L : Plua_State; narr, nrec : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_newuserdata(L : Plua_State; sz : size_t) : Pointer;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_getmetatable(L : Plua_State; objindex : LongInt) : LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_getfenv(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*
 ** set functions (stack -> Lua)
 *)
 procedure lua_settable(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_setfield(L : Plua_State; idx : LongInt; const k : PChar);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_rawset(L : Plua_State; idx : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_rawseti(L : Plua_State; idx , n: LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_setmetatable(L : Plua_State; objindex : LongInt): LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_setfenv(L : Plua_State; idx : LongInt): LongBool;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 (*
 ** `load' and `call' functions (load and run Lua code)
 *)
 procedure lua_call(L : Plua_State; nargs, nresults : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_pcall(L : Plua_State;
                     nargs, nresults, errfunc : LongInt) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_cpcall(L : Plua_State;
                      func : lua_CFunction; ud : Pointer) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  lua_load(L : Plua_State; reader : lua_Reader;
                    dt : Pointer; const chunkname : PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function lua_dump(L : Plua_State; writer : lua_Writer; data: Pointer) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*
 ** coroutine functions
 *)
 function lua_yield(L : Plua_State; nresults : LongInt) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_resume(L : Plua_State; narg : LongInt) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_status(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 (*
 ** garbage-collection functions and options
@@ -370,24 +372,24 @@
   LUA_GCSETSTEPMUL = 7;
 
 function lua_gc(L : Plua_State; what, data : LongInt) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 (*
 ** miscellaneous functions
 *)
 function lua_error(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function lua_next(L : Plua_State; idx : LongInt) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 procedure lua_concat(L : Plua_State; n : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function  lua_getallocf(L : Plua_State; ud : PPointer) : lua_Alloc;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure lua_setallocf(L : Plua_State; f : lua_Alloc; ud : Pointer);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 (*
 ** ===============================================================
@@ -483,33 +485,33 @@
 
 function lua_getstack(L : Plua_State; level : LongInt;
                       ar : Plua_Debug) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_getinfo(L : Plua_State; const what : PChar;
                      ar: Plua_Debug): LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_getlocal(L : Plua_State;
                       ar : Plua_Debug; n : LongInt) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_setlocal(L : Plua_State;
                       ar : Plua_Debug; n : LongInt) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_getupvalue(L : Plua_State; funcindex, n : LongInt) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_setupvalue(L : Plua_State; funcindex, n : LongInt) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function lua_sethook(L : Plua_State; func : lua_Hook;
                      mask, count: LongInt): LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 {$IFDEF LUA_GETHOOK}
 function lua_gethook(L : Plua_State) : lua_Hook;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 {$ENDIF}
 
 function lua_gethookmask(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function lua_gethookcount(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*****************************************************************************)
@@ -536,31 +538,31 @@
   LUA_LOADLIBNAME = 'package';
 
 function luaopen_base(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaopen_table(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaopen_io(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaopen_os(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaopen_string(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaopen_math(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaopen_debug(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaopen_package(L : Plua_State) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 procedure luaL_openlibs(L : Plua_State);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 procedure lua_assert(x : Boolean);    // a macro
 
@@ -592,85 +594,85 @@
 
 procedure luaL_openlib(L : Plua_State; const libname : PChar;
                        const lr : PluaL_Reg; nup : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_register(L : Plua_State; const libname : PChar;
                        const lr : PluaL_Reg);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_getmetafield(L : Plua_State; obj : LongInt;
                            const e : PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_callmeta(L : Plua_State; obj : LongInt;
                        const e : PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_typerror(L : Plua_State; narg : LongInt;
                        const tname : PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_argerror(L : Plua_State; numarg : LongInt;
                        const extramsg : PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_checklstring(L : Plua_State; numArg : LongInt;
                            ls : Psize_t) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_optlstring(L : Plua_State; numArg : LongInt;
                          const def: PChar; ls: Psize_t) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_checknumber(L : Plua_State; numArg : LongInt) : lua_Number;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_optnumber(L : Plua_State; nArg : LongInt;
                         def : lua_Number) : lua_Number;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_checkinteger(L : Plua_State; numArg : LongInt) : lua_Integer;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_optinteger(L : Plua_State; nArg : LongInt;
                         def : lua_Integer) : lua_Integer;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 procedure luaL_checkstack(L : Plua_State; sz : LongInt; const msg : PChar);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_checktype(L : Plua_State; narg, t : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_checkany(L : Plua_State; narg : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_newmetatable(L : Plua_State; const tname : PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_checkudata(L : Plua_State; ud : LongInt;
                          const tname : PChar) : Pointer;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 procedure luaL_where(L : Plua_State; lvl : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  luaL_error(L : Plua_State; const fmt : PChar) : LongInt; varargs;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_checkoption(L : Plua_State; narg : LongInt; const def : PChar;
                           const lst : array of PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function  luaL_ref(L : Plua_State; t : LongInt) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_unref(L : Plua_State; t, ref : LongInt);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_loadfile(L : Plua_State; const filename : PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function luaL_loadbuffer(L : Plua_State; const buff : PChar;
                          sz : size_t; const name: PChar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_loadstring(L : Plua_State; const s : Pchar) : LongInt;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_newstate : Plua_State;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_gsub(L : Plua_State; const s, p, r : PChar) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 function luaL_findtable(L : Plua_State; idx : LongInt;
                         const fname : PChar; szhint : LongInt) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 
 (*
@@ -723,17 +725,17 @@
 procedure luaL_addsize(B : PluaL_Buffer; n : LongInt);
 
 procedure luaL_buffinit(L : Plua_State; B : PluaL_Buffer);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 function  luaL_prepbuffer(B : PluaL_Buffer) : PChar;
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_addlstring(B : PluaL_Buffer; const s : PChar; ls : size_t);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_addstring(B : PluaL_Buffer; const s : PChar);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_addvalue(B : PluaL_Buffer);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 procedure luaL_pushresult(B : PluaL_Buffer);
-  cdecl; external LuaDLL;
+  cdecl; external LuaLibName;
 
 (* ====================================================== *)
 
--- a/hedgewars/PascalExports.pas	Wed Feb 10 21:23:03 2010 +0000
+++ b/hedgewars/PascalExports.pas	Wed Feb 10 22:00:49 2010 +0000
@@ -23,7 +23,7 @@
 procedure IPH_showControls; cdecl; external;
 
 // retrieve protocol information
-function  HW_protoVer: LongInt; cdecl; export;
+procedure HW_versionInfo(netProto: PShortInt; versionStr: PString); cdecl; export;
 
 // called by the touch functions (SDL_uikitview.m)
 // they emulate user interaction from mouse or keyboard
@@ -46,12 +46,12 @@
 implementation
 
 {$IFDEF IPHONEOS}
-function HW_protoVer: LongInt; cdecl; export;
+procedure HW_versionInfo(netProto: PShortInt; versionStr: PString); cdecl; export;
 begin
-	HW_protoVer:= cNetProtoVersion;
+	if netProto <> nil then netProto^:= cNetProtoVersion;
+	if versionStr <> nil then versionStr^:= string(cVersionString);
 end;
 
-
 procedure HW_click; cdecl; export;
 begin
 	leftClick:= true;
--- a/hedgewars/hwengine.pas	Wed Feb 10 21:23:03 2010 +0000
+++ b/hedgewars/hwengine.pas	Wed Feb 10 22:00:49 2010 +0000
@@ -56,12 +56,8 @@
 	uTriggers in 'uTriggers.pas',
 	uLandTexture in 'uLandTexture.pas',
 	uScript in 'uScript.pas',
-	{$IFDEF IPHONEOS}
-	PascalExports in 'PascalExports.pas',
-	{$ELSE}
-	sysutils
-	{$ENDIF}
-	;
+	{$IFDEF IPHONEOS}PascalExports in 'PascalExports.pas',{$ENDIF}
+	sysutils;
 
 // also: GSHandlers.inc
 //       CCHandlers.inc
--- a/hedgewars/uScript.pas	Wed Feb 10 21:23:03 2010 +0000
+++ b/hedgewars/uScript.pas	Wed Feb 10 22:00:49 2010 +0000
@@ -549,7 +549,22 @@
 
 function ScriptCall(fname : string; par1, par2, par3, par4 : LongInt) : LongInt;
 begin
-ScriptCall:= nil
+ScriptCall:= 0
+end;
+
+function ScriptCall(fname : string; par1: LongInt) : LongInt;
+begin
+ScriptCall:= 0
+end;
+
+function ScriptCall(fname : string; par1, par2: LongInt) : LongInt;
+begin
+ScriptCall:= 0
+end;
+
+function ScriptCall(fname : string; par1, par2, par3: LongInt) : LongInt;
+begin
+ScriptCall:= 0
 end;
 
 procedure init_uScript;