Patch by koda to better support Mac OS X
authorunc0rr
Sat, 21 Feb 2009 11:49:56 +0000
changeset 1819 17dac76954d1
parent 1818 4391c7037281
child 1820 ae428043da32
Patch by koda to better support Mac OS X
hedgewars/SDLh.pas
hedgewars/uChat.pas
--- a/hedgewars/SDLh.pas	Fri Feb 20 19:54:02 2009 +0000
+++ b/hedgewars/SDLh.pas	Sat Feb 21 11:49:56 2009 +0000
@@ -37,13 +37,33 @@
 
 {$PACKRECORDS C}
 
+{$IFDEF DARWIN}
+{$linklib libpng}
+{$linklib libz}
+{$linklib libjpeg}
+{$linklib libtiff}
+{$linklib libfreetype}
+{$linklib libsmpeg}
+{$linklib libvorbis}
+{$linklib libvorbisfile}
+{$linklib libogg}
+
+{$linkframework Carbon}
+{$linkframework OpenGL}
+{$linkframework AudioUnit}
+{$linkframework Quicktime}
+{$linkframework IOKit}
+{$linkframework ForceFeedback}
+{$linkframework CoreAudio}
+{$ENDIF}
+
 (*  SDL *)
 const {$IFDEF WIN32}
       SDLLibName = 'SDL.dll';
       {$ENDIF}
       {$IFDEF UNIX}
 	{$IFDEF DARWIN}
-	  SDLLibName = 'libSDL.dylib';
+	  SDLLibName = 'libSDL.a';
 	  {$linklib libSDL}
 	  {$linklib SDLmain}
 	  {$linkframework Cocoa}
@@ -278,7 +298,7 @@
       {$ENDIF}
       {$IFDEF UNIX}
 	{$IFDEF DARWIN}
-	  SDL_TTFLibName = 'libSDL_ttf.dylib';
+	  SDL_TTFLibName = 'libSDL_ttf.a';
 	  {$linklib libSDL_ttf}
 	{$ELSE}
           SDL_TTFLibName = 'libSDL_ttf.so';
@@ -313,7 +333,7 @@
       {$ENDIF}
       {$IFDEF UNIX}
 	{$IFDEF DARWIN}
-	  SDL_MixerLibName = 'libSDL_mixer.dylib';
+	  SDL_MixerLibName = 'libSDL_mixer.a';
 	  {$linklib libSDL_mixer}
 	{$ELSE}
           SDL_MixerLibName = 'libSDL_mixer.so';
@@ -379,7 +399,7 @@
       {$ENDIF}
       {$IFDEF UNIX}
 	{$IFDEF DARWIN}
-	  SDL_ImageLibName = 'libSDL_image.dylib';
+	  SDL_ImageLibName = 'libSDL_image.a';
 	  {$linklib libSDL_image}
 	{$ELSE}
            SDL_ImageLibName = 'libSDL_image.so';
@@ -395,7 +415,7 @@
       {$ENDIF}
       {$IFDEF UNIX}
 	{$IFDEF DARWIN}
-	  SDL_NetLibName = 'libSDL_net.dylib';
+	  SDL_NetLibName = 'libSDL_net.a';
 	  {$linklib libSDL_net}
 	{$ELSE}
           SDL_NetLibName = 'libSDL_net.so';
--- a/hedgewars/uChat.pas	Fri Feb 20 19:54:02 2009 +0000
+++ b/hedgewars/uChat.pas	Sat Feb 21 11:49:56 2009 +0000
@@ -152,14 +152,18 @@
 var i, btw: integer;
     utf8: shortstring;
 begin
+
 if Key <> 0 then
 	case Key of
-		8: if Length(InputStr.s) > 0 then
+		{Backspace}
+		8, 127: if Length(InputStr.s) > 0 then
 				begin
 				InputStr.s[0]:= InputStrL[byte(InputStr.s[0])];
 				SetLine(InputStr, InputStr.s, true)
 				end;
+		{Esc}
 		27: SetLine(InputStr, '', true);
+		{Return}
 		13, 271: begin
 			if Length(InputStr.s) > 0 then
 				begin
@@ -168,7 +172,16 @@
 				end;
 			FreezeEnterKey;
 			GameState:= gsGame
-			end
+			end;
+		{missing Mac keys}
+		{*
+			63272 is canc
+			63232 is UP
+			63234 is LEFT
+			63235 is RIGHT
+			63233 is DOWN
+		*}
+		63272, 63232, 36233, 36234, 36235: Key:=28;
 	else
 	if (Key < $80) then btw:= 1
 	else if (Key < $800) then btw:= 2