powerpc and gameserver compilation disabled temporarily
work in progress for converting longword to sdl_color
--- a/CMakeLists.txt Wed Dec 16 14:58:45 2009 +0000
+++ b/CMakeLists.txt Fri Dec 18 02:33:45 2009 +0000
@@ -42,10 +42,11 @@
#create universal binaries only when it's time to bundle the application
IF(BUNDLE)
+ set(WITH_SERVER false)
if(current_macosx_version MATCHES "10.6")
- set(CMAKE_OSX_ARCHITECTURES "x86_64;i386;ppc7400")
+ set(CMAKE_OSX_ARCHITECTURES "x86_64;i386") #;ppc7400
else()
- set(CMAKE_OSX_ARCHITECTURES "i386;ppc7400")
+ set(CMAKE_OSX_ARCHITECTURES "i386") #;ppc7400
endif()
ENDIF()
@@ -88,14 +89,14 @@
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
-set(pascal_compiler_flags_cmn "-B" "-FE../bin" "-Fl../bin/" "-Cs2000000" "-vwi")
+set(pascal_compiler_flags_cmn "-B" "-FE../bin" "-Fl../bin/" "-Cs2000000" "-vwi" "/Users/vittorio/hedge.build/trunk/SDLMain.o")
if(LOWRES)
set(pascal_compiler_flags_cmn "-dLOWRES" ${pascal_compiler_flags_cmn})
add_definitions(-DLOWRES)
endif(LOWRES)
if(Optz)
- set(pascal_compiler_flags_cmn "-O2" "-Xs" "-Si" "-Or" ${pascal_compiler_flags_cmn})
+ set(pascal_compiler_flags_cmn "-O2" "-Xs" "-Si" ${pascal_compiler_flags_cmn})
set(haskell_compiler_flags_cmn "-w" "-O2")
else(Optz)
set(pascal_compiler_flags_cmn "-O-" "-gl" "-dDEBUGFILE" "-pg" "-vv" ${pascal_compiler_flags_cmn})
@@ -116,6 +117,10 @@
if(WITH_SERVER)
set(HAVE_NETSERVER true)
add_subdirectory(gameServer)
+ if(APPLE)
+ #workaround for http://hackage.haskell.org/trac/ghc/ticket/3400
+ set(haskell_compiler_flags_cmn ${haskell_compiler_flags_cmn} "-optc-m32" "-opta-m32" "-optl-m32")
+ endif()
else(WITH_SERVER)
set(HAVE_NETSERVER false)
endif(WITH_SERVER)
--- a/hedgewars/CMakeLists.txt Wed Dec 16 14:58:45 2009 +0000
+++ b/hedgewars/CMakeLists.txt Fri Dec 18 02:33:45 2009 +0000
@@ -136,7 +136,7 @@
COMMAND "${pascal_compiler}"
ARGS ${pascal_compiler_flags} -ohwengine.${build_arch} -P${build_arch}
MAIN_DEPENDENCY ${hwengine_project}
- DEPENDS ${engine_sources}
+ DEPENDS ${engine_sources} SDLmain
)
add_custom_target(hwengine.${build_arch} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}")
endforeach()
--- a/hedgewars/SDLh.pas Wed Dec 16 14:58:45 2009 +0000
+++ b/hedgewars/SDLh.pas Fri Dec 18 02:33:45 2009 +0000
@@ -262,19 +262,10 @@
PSDL_RWops = ^TSDL_RWops;
-{$IFDEF FPC}
TSeek = function( context: PSDL_RWops; offset: LongInt; whence: LongInt ): LongInt; cdecl;
TRead = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; maxnum : LongInt ): LongInt; cdecl;
TWrite = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; num: LongInt ): LongInt; cdecl;
TClose = function( context: PSDL_RWops ): LongInt; cdecl;
-{$ELSE}
- TSeek = function( context: PSDL_RWops; offset: LongInt; whence: LongInt ): LongInt;
- TRead = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; maxnum : LongInt ): LongInt;
- TWrite = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; num: LongInt ): LongInt;
- TClose = function( context: PSDL_RWops ): LongInt;
-
- PByte = ^Byte;
-{$ENDIF}
TStdio = record
autoclose: LongInt;
@@ -669,9 +660,9 @@
function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; var w, h: LongInt): LongInt; cdecl; external SDL_TTFLibName;
(* TSDL_Color -> Longword conversion is workaround over freepascal bug.
See http://www.freepascal.org/mantis/view.php?id=7613 for details *)
-function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
+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: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
-function TTF_RenderUTF8_Shaded(font: PTTF_Font; const text: PChar; fg, bg: Longword): 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;
--- a/hedgewars/uChat.pas Wed Dec 16 14:58:45 2009 +0000
+++ b/hedgewars/uChat.pas Fri Dec 18 02:33:45 2009 +0000
@@ -48,26 +48,17 @@
InputStr: TChatLine;
InputStrL: array[0..260] of char; // for full str + 4-byte utf-8 char
-const colors: array[#1..#4] of Longword = (
-{$IFDEF ENDIAN_LITTLE}
-// ABGR
- $FFFFFFFF, // chat message [White]
- $FFFF00FF, // action message [Purple]
- $FF90FF90, // join/leave message [Lime]
- $FFA0FFFF // team message [Light Yellow]
-{$ELSE}
-// RGBA
- $FFFFFFFF, // chat message [White]
- $FF00FFFF, // action message [Purple]
- $90FF90FF, // join/leave message [Lime]
- $FFFFA0FF // team message [Light Yellow]
-{$ENDIF}
+const colors: array[#1..#4] of TSDL_Color = (
+ (r:$FF; g:$FF; b:$FF; unused:$FF), // chat message [White]
+ (r:$FF; g:$00; b:$FF; unused:$FF), // action message [Purple]
+ (r:$90; g:$FF; b:$90; unused:$FF), // join/leave message [Lime]
+ (r:$FF; g:$FF; b:$A0; unused:$FF) // team message [Light Yellow]
);
procedure SetLine(var cl: TChatLine; str: shortstring; isInput: boolean);
var strSurface, resSurface: PSDL_Surface;
w, h: LongInt;
- color: Longword;
+ color: TSDL_Color;
begin
if cl.Tex <> nil then
FreeTexture(cl.Tex);
@@ -76,19 +67,19 @@
cl.s:= str;
if isInput then
- begin
- color:=
-{$IFDEF ENDIAN_LITTLE}
- $FFFFFF00; // [Yellow abgr]
-{$ELSE}
- $00FFFFFF; // [Yellow rgba]
-{$ENDIF}
+begin
+ // [Light Blue]
+ color.r:= $00;
+ color.g:= $FF;
+ color.b:= $FF;
+ color.unused:= $FF;
str:= UserNick + '> ' + str + '_'
- end
- else begin
+end
+else
+begin
color:= colors[str[1]];
delete(str, 1, 1)
- end;
+end;
TTF_SizeUTF8(Fontz[fnt16].Handle, Str2PChar(str), w, h);
--- a/hedgewars/uMisc.pas Wed Dec 16 14:58:45 2009 +0000
+++ b/hedgewars/uMisc.pas Fri Dec 18 02:33:45 2009 +0000
@@ -82,9 +82,10 @@
TimeTrialStartTime: Longword = 0;
TimeTrialStopTime : Longword = 0;
- cSkyColor : Longword = 0;
+ cBlackColor : TSDL_Color = (r:$00; g:$00; b:$00; unused:$00);
cWhiteColor : Longword = $FFFFFFFF;
cYellowColor : Longword = $FFFFFF00;
+// cYellowColor : TSDL_Color = (r:$FF; g:$FF; b:$00; unused:$FF);
cNearBlackColor : Longword = $FF000010;
cExplosionBorderColor : LongWord = $FF808080;