From 018e24aab0edf06d18e0365bbb4aed03b6b80f59 Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Sun, 10 Oct 2010 18:08:11 +0800 Subject: [PATCH 1/2] Use dynamic PhysicsFS library again to fix linking errors --- CHANGELOG.txt | 4 +++ INSTALL.txt | 6 ++-- d1x-rebirth.xcodeproj/project.pbxproj | 43 +++++++++++++++++++-------- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 487737f25..59ec92bfd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20101010 +-------- +d1x-rebirth.xcodeproj/project.pbxproj, INSTALL.txt: Use dynamic PhysicsFS library again to fix linking errors + 20100926 -------- arch/sdl/jukebox.c, include/strutil.h, main/menu.c, misc/strutil.c: Add support for M3U playlists, tweak 'Jukebox playing' message so it shows the end of the path when truncating diff --git a/INSTALL.txt b/INSTALL.txt index f96461b95..42ce07a83 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -37,12 +37,12 @@ Compiling: the frameworks from source as 'Debug' builds, then use these instead. PhysicsFS must be compiled from source. Put its enclosing folder 'physfs', renaming if necessary, next to D1X's (typically d1x-rebirth). In CMake ensure the build path points to 'build' inside 'physfs'. Specify 'i386;ppc' as the architecture - for a universal binary. In Xcode, build the 'Debug' static library target. If anyone knows how to get the - 'Release' build to properly link with DXX, please tell. + for a universal binary. In Xcode, build 'Debug' and 'Release' from the dynamic library target. SCons also works on MacOS X, but it's recommended to use XCode instead. For Mac OS 9, an MPW Makefile is available. MPW includes the compiler. As for the shared libraries, - compile PhysicsFS version 1.0 and the latest SDL and SDL_mixer (as of writing) from source. + compile PhysicsFS version 1.0 and the latest SDL and SDL_mixer (as of writing) from source. For SDL_mixer + 1.2.11 you will need to disable MikMod support, from SDL_mixer.make, otherwise use SDL_mixer 1.2.8. For any sources to compile, they will need to be made into text files using a typecode changing program, if they were downloaded outside of Mac OS 9 (including Mac OS X). This will also need to be done after any Terminal command (diff, svn update etc) edits the source files. diff --git a/d1x-rebirth.xcodeproj/project.pbxproj b/d1x-rebirth.xcodeproj/project.pbxproj index 33c71dcc8..2ae85d8ae 100755 --- a/d1x-rebirth.xcodeproj/project.pbxproj +++ b/d1x-rebirth.xcodeproj/project.pbxproj @@ -284,11 +284,13 @@ EB380D7D0E168B1900EBD9AD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EB380D7B0E168B1900EBD9AD /* InfoPlist.strings */; }; EB380D7E0E168B1900EBD9AD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EB380D7B0E168B1900EBD9AD /* InfoPlist.strings */; }; EB775A7A105611720036C348 /* extractD1Data.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB775A79105611720036C348 /* extractD1Data.cpp */; }; - EB796886123F1C8F00B2028B /* libphysfs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EB796885123F1C8F00B2028B /* libphysfs.a */; }; - EB796887123F1C8F00B2028B /* libphysfs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EB796885123F1C8F00B2028B /* libphysfs.a */; }; EB861343111E9E810097D871 /* net_ipx.c in Sources */ = {isa = PBXBuildFile; fileRef = EBF658990F936A8400CB5C73 /* net_ipx.c */; }; EB8BE84F1071FBE00069486E /* player.c in Sources */ = {isa = PBXBuildFile; fileRef = EB8BE84E1071FBE00069486E /* player.c */; }; EB8BE8501071FBE00069486E /* player.c in Sources */ = {isa = PBXBuildFile; fileRef = EB8BE84E1071FBE00069486E /* player.c */; }; + EB91A41012617070009E0095 /* libphysfs.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EB91A40F12617070009E0095 /* libphysfs.dylib */; }; + EB91A41112617070009E0095 /* libphysfs.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EB91A40F12617070009E0095 /* libphysfs.dylib */; }; + EB91A41312617084009E0095 /* libphysfs.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EB91A41212617084009E0095 /* libphysfs.dylib */; }; + EB91A41412617084009E0095 /* libphysfs.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EB91A41212617084009E0095 /* libphysfs.dylib */; }; EB92BE600CDD693C0045A32C /* digi_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = EB92BE5C0CDD693C0045A32C /* digi_audio.c */; }; EB92BE610CDD693C0045A32C /* digi_mixer_music.c in Sources */ = {isa = PBXBuildFile; fileRef = EB92BE5D0CDD693C0045A32C /* digi_mixer_music.c */; }; EB92BE620CDD693C0045A32C /* digi_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = EB92BE5E0CDD693C0045A32C /* digi_mixer.c */; }; @@ -361,7 +363,7 @@ 670E3796066C50C30085B671 /* CHANGELOG.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CHANGELOG.txt; sourceTree = ""; }; 6710AAFE066B2D6100DB0F68 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; 6710AB68066B2E0400DB0F68 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 675ED123066B196700E42AA7 /* d1x-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "d1x-Info.plist"; sourceTree = ""; }; + 675ED123066B196700E42AA7 /* d1x-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "d1x-Info.plist"; sourceTree = ""; }; 676032DC066B399A008A67A3 /* multi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = multi.c; sourceTree = ""; }; 676032DD066B399A008A67A3 /* multibot.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = multibot.c; sourceTree = ""; }; 676032F9066B39CE008A67A3 /* kmatrix.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = kmatrix.c; sourceTree = ""; }; @@ -491,7 +493,7 @@ 67B44915066880C400DF26D8 /* grdef.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = grdef.h; sourceTree = ""; }; 67F6FED0066B13B400443922 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDLMain.h; path = arch/cocoa/SDLMain.h; sourceTree = ""; }; 67F6FED1066B13B400443922 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SDLMain.m; path = arch/cocoa/SDLMain.m; sourceTree = ""; }; - 67F6FEEA066B13D900443922 /* d1xgl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "d1xgl-Info.plist"; sourceTree = ""; }; + 67F6FEEA066B13D900443922 /* d1xgl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "d1xgl-Info.plist"; sourceTree = ""; }; EB01AFA90A65323200EA4C7C /* newdemo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = newdemo.h; sourceTree = ""; }; EB0420B90A341041002CC961 /* multi.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = multi.h; sourceTree = ""; }; EB0420BB0A341042002CC961 /* morph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = morph.h; sourceTree = ""; }; @@ -578,9 +580,10 @@ EB3CA4F90E97740E00FB1E93 /* tracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tracker.h; sourceTree = ""; }; EB775A6F105611320036C348 /* d1Extract */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = d1Extract; sourceTree = BUILT_PRODUCTS_DIR; }; EB775A79105611720036C348 /* extractD1Data.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extractD1Data.cpp; sourceTree = ""; }; - EB796885123F1C8F00B2028B /* libphysfs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libphysfs.a; path = ../physfs/build/Debug/libphysfs.a; sourceTree = SOURCE_ROOT; }; EB8BE84E1071FBE00069486E /* player.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = player.c; sourceTree = ""; }; EB9181090DABA47B0010CB39 /* console.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + EB91A40F12617070009E0095 /* libphysfs.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libphysfs.dylib; path = ../physfs/build/Debug/libphysfs.dylib; sourceTree = SOURCE_ROOT; }; + EB91A41212617084009E0095 /* libphysfs.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libphysfs.dylib; path = ../physfs/build/Release/libphysfs.dylib; sourceTree = SOURCE_ROOT; }; EB92BE5C0CDD693C0045A32C /* digi_audio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = digi_audio.c; sourceTree = ""; }; EB92BE5D0CDD693C0045A32C /* digi_mixer_music.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = digi_mixer_music.c; sourceTree = ""; }; EB92BE5E0CDD693C0045A32C /* digi_mixer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = digi_mixer.c; sourceTree = ""; }; @@ -732,7 +735,8 @@ 6710AB00066B2D6100DB0F68 /* SDL.framework in Frameworks */, EB92BEC60CDD6B4B0045A32C /* SDL_mixer.framework in Frameworks */, EBC858F5122E165800FA437D /* ApplicationServices.framework in Frameworks */, - EB796887123F1C8F00B2028B /* libphysfs.a in Frameworks */, + EB91A41112617070009E0095 /* libphysfs.dylib in Frameworks */, + EB91A41412617084009E0095 /* libphysfs.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -745,7 +749,8 @@ 6710AB69066B2E0400DB0F68 /* OpenGL.framework in Frameworks */, 17A707EB10C1B5FA002D1680 /* SDL_mixer.framework in Frameworks */, EBC858F4122E165800FA437D /* ApplicationServices.framework in Frameworks */, - EB796886123F1C8F00B2028B /* libphysfs.a in Frameworks */, + EB91A41012617070009E0095 /* libphysfs.dylib in Frameworks */, + EB91A41312617084009E0095 /* libphysfs.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -771,7 +776,8 @@ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( - EB796885123F1C8F00B2028B /* libphysfs.a */, + EB91A41212617084009E0095 /* libphysfs.dylib */, + EB91A40F12617070009E0095 /* libphysfs.dylib */, EBC858F3122E165800FA437D /* ApplicationServices.framework */, EB92BEC40CDD6B4B0045A32C /* SDL_mixer.framework */, 6710AB68066B2E0400DB0F68 /* OpenGL.framework */, @@ -1988,7 +1994,7 @@ /Library/Frameworks/SDL.framework/Headers, ); INFOPLIST_FILE = "d1x-Info.plist"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../physfs/build/Debug\""; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../physfs/build/Release\""; PRODUCT_NAME = d1x; SKIP_INSTALL = NO; WARNING_CFLAGS = "-Wall"; @@ -2014,8 +2020,13 @@ ); INFOPLIST_FILE = "d1x-Info.plist"; INSTALL_PATH = "$(USER_APPS_DIR)"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../physfs/build/Debug\""; + LIBRARY_SEARCH_PATHS = ( + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + ); LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../Library/Frameworks\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../physfs/build/Debug\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../physfs/build/Release\""; PRODUCT_NAME = d1x; WARNING_CFLAGS = "-Wall"; }; @@ -2085,7 +2096,7 @@ /Library/Frameworks/SDL.framework/Headers, ); INFOPLIST_FILE = "d1xgl-Info.plist"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../physfs/build/Debug\""; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../physfs/build/Release\""; PRODUCT_NAME = d1xgl; SKIP_INSTALL = NO; WARNING_CFLAGS = "-Wall"; @@ -2118,10 +2129,14 @@ "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", ); LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../Library/Frameworks\""; LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../physfs/build/Debug\""; LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../physfs/build/Release\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(SRCROOT)/../physfs/build/Release\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SRCROOT)/../physfs/build/Debug\""; PRODUCT_NAME = d1xgl; WARNING_CFLAGS = "-Wall"; }; @@ -2132,6 +2147,7 @@ buildSettings = { GCC_PREFIX_HEADER = arch/carbon/conf.h; GCC_TREAT_WARNINGS_AS_ERRORS = YES; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Development; }; @@ -2148,8 +2164,8 @@ MACOSX_DEPLOYMENT_TARGET = 10.1; MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.1; - SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk; - SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk; + OTHER_CFLAGS = "-lSystemStubs"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Deployment; }; @@ -2160,6 +2176,7 @@ "$(HOME)/Library/Frameworks", /Library/Frameworks, ); + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Default; }; From 499c8e3799424e0ec41e7da4c93750924dee2f29 Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Sun, 10 Oct 2010 18:42:53 +0800 Subject: [PATCH 2/2] Fix errors for Mac OS 9, Mac OS X 'd1x' target builds again --- CHANGELOG.txt | 1 + D1X.make | 39 +++++++++++++--------- arch/sdl/jukebox.c | 47 ++++++++++----------------- d1x-rebirth.xcodeproj/project.pbxproj | 2 -- include/pstypes.h | 3 ++ main/hud.c | 8 +++++ main/menu.c | 38 +++++++++++++++------- main/newdemo.c | 5 +-- main/titles.c | 5 +-- misc/args.c | 21 +++++++----- misc/physfsx.c | 6 ++-- 11 files changed, 102 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 59ec92bfd..6e53ef4ae 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D1X-Rebirth Changelog 20101010 -------- d1x-rebirth.xcodeproj/project.pbxproj, INSTALL.txt: Use dynamic PhysicsFS library again to fix linking errors +D1X.make, arch/sdl/jukebox.c, d1x-rebirth.xcodeproj/project.pbxproj, include/pstypes.h, main/hud.c, main/menu.c, main/newdemo.c, main/titles.c, misc/args.c, misc/physfsx.c: Fix errors for Mac OS 9, Mac OS X 'd1x' target builds again 20100926 -------- diff --git a/D1X.make b/D1X.make index 75cb33684..1e7e05710 100644 --- a/D1X.make +++ b/D1X.make @@ -9,12 +9,12 @@ MAKEFILE = D1X.make ObjDir = ":obj:" Includes = ¶ - -i :arch:carbon: ¶ - -i :arch:include: ¶ -i :include: ¶ + -i :arch:include: ¶ -i "{CIncludes}SDL:" ¶ + -i :arch:carbon: ¶ -i "{CIncludes}" ¶ - -i :main: ¶ + -i :main: Sym-PPC = -sym on @@ -69,6 +69,7 @@ SrcFiles = :arch:sdl:mouse.c ¶ :arch:sdl:rbaudio.c ¶ :arch:sdl:timer.c ¶ + :arch:sdl:window.c ¶ :iff:iff.c ¶ :main:ai.c ¶ :main:aipath.c ¶ @@ -90,8 +91,10 @@ SrcFiles = :main:fuelcen.c ¶ :main:fvi.c ¶ :main:game.c ¶ + :main:gamecntl.c ¶ :main:gamefont.c ¶ :main:gamemine.c ¶ + :main:gamerend.c ¶ :main:gamesave.c ¶ :main:gameseg.c ¶ :main:gameseq.c ¶ @@ -110,7 +113,6 @@ SrcFiles = :main:morph.c ¶ :main:multi.c ¶ :main:multibot.c ¶ - :main:multipow.c ¶ :main:net_ipx.c ¶ :main:net_udp.c ¶ :main:newdemo.c ¶ @@ -119,6 +121,7 @@ SrcFiles = :main:paging.c ¶ :main:physics.c ¶ :main:piggy.c ¶ + :main:player.c ¶ :main:playsave.c ¶ :main:polyobj.c ¶ :main:powerup.c ¶ @@ -143,11 +146,11 @@ SrcFiles = :maths:vecmat.c ¶ :mem:mem.c ¶ :misc:args.c ¶ - :misc:compare.c ¶ :misc:dl_list.c ¶ :misc:error.c ¶ - :misc:hmp2mid.c ¶ + :misc:hmp.c ¶ :misc:ignorecase.c ¶ + :misc:physfsx.c ¶ :misc:strio.c ¶ :misc:strutil.c ¶ :texmap:ntmap.c ¶ @@ -206,6 +209,7 @@ GeneralObjects = {ObjDir}mouse.c.x ¶ {ObjDir}rbaudio.c.x ¶ {ObjDir}timer.c.x ¶ + {ObjDir}window.c.x ¶ {ObjDir}iff.c.x ¶ {ObjDir}ai.c.x ¶ {ObjDir}aipath.c.x ¶ @@ -227,8 +231,10 @@ GeneralObjects = {ObjDir}fuelcen.c.x ¶ {ObjDir}fvi.c.x ¶ {ObjDir}game.c.x ¶ + {ObjDir}gamecntl.c.x ¶ {ObjDir}gamefont.c.x ¶ {ObjDir}gamemine.c.x ¶ + {ObjDir}gamerend.c.x ¶ {ObjDir}gamesave.c.x ¶ {ObjDir}gameseg.c.x ¶ {ObjDir}gameseq.c.x ¶ @@ -245,9 +251,8 @@ GeneralObjects = {ObjDir}mglobal.c.x ¶ {ObjDir}mission.c.x ¶ {ObjDir}morph.c.x ¶ - {ObjDir}multi.c.x ¶ - {ObjDir}multibot.c.x ¶ - {ObjDir}multipow.c.x ¶ +# {ObjDir}multi.c.x ¶ +# {ObjDir}multibot.c.x ¶ {ObjDir}net_ipx.c.x ¶ {ObjDir}net_udp.c.x ¶ {ObjDir}newdemo.c.x ¶ @@ -256,6 +261,7 @@ GeneralObjects = {ObjDir}paging.c.x ¶ {ObjDir}physics.c.x ¶ {ObjDir}piggy.c.x ¶ + {ObjDir}player.c.x ¶ {ObjDir}playsave.c.x ¶ {ObjDir}polyobj.c.x ¶ {ObjDir}powerup.c.x ¶ @@ -280,11 +286,11 @@ GeneralObjects = {ObjDir}vecmat.c.x ¶ {ObjDir}mem.c.x ¶ {ObjDir}args.c.x ¶ - {ObjDir}compare.c.x ¶ {ObjDir}dl_list.c.x ¶ {ObjDir}error.c.x ¶ - {ObjDir}hmp2mid.c.x ¶ + {ObjDir}hmp.c.x ¶ {ObjDir}ignorecase.c.x ¶ + {ObjDir}physfsx.c.x ¶ {ObjDir}strio.c.x ¶ {ObjDir}strutil.c.x ¶ {ObjDir}ntmap.c.x ¶ @@ -384,7 +390,7 @@ directories {ObjDir}digi_mixer.c.x Ä :arch:sdl:digi_mixer.c {ObjDir}digi_mixer_music.c.x Ä :arch:sdl:digi_mixer_music.c {ObjDir}event.c.x Ä :arch:sdl:event.c -{ObjDir}gr.c.x Ä :arch:sdl:gr.c +{ObjDir}SDL:gr.c.x Ä :arch:sdl:gr.c {ObjDir}init.c.x Ä :arch:sdl:init.c {ObjDir}joy.c.x Ä :arch:sdl:joy.c {ObjDir}jukebox.c.x Ä :arch:sdl:jukebox.c @@ -392,6 +398,7 @@ directories {ObjDir}mouse.c.x Ä :arch:sdl:mouse.c {ObjDir}rbaudio.c.x Ä :arch:sdl:rbaudio.c {ObjDir}timer.c.x Ä :arch:sdl:timer.c +{ObjDir}window.c.x Ä :arch:sdl:window.c {ObjDir}iff.c.x Ä :iff:iff.c {ObjDir}ai.c.x Ä :main:ai.c {ObjDir}aipath.c.x Ä :main:aipath.c @@ -413,8 +420,10 @@ directories {ObjDir}fuelcen.c.x Ä :main:fuelcen.c {ObjDir}fvi.c.x Ä :main:fvi.c {ObjDir}game.c.x Ä :main:game.c +{ObjDir}gamecntl.c.x Ä :main:gamecntl.c {ObjDir}gamefont.c.x Ä :main:gamefont.c {ObjDir}gamemine.c.x Ä :main:gamemine.c +{ObjDir}gamerend.c.x Ä :main:gamerend.c {ObjDir}gamesave.c.x Ä :main:gamesave.c {ObjDir}gameseg.c.x Ä :main:gameseg.c {ObjDir}gameseq.c.x Ä :main:gameseq.c @@ -433,7 +442,6 @@ directories {ObjDir}morph.c.x Ä :main:morph.c {ObjDir}multi.c.x Ä :main:multi.c {ObjDir}multibot.c.x Ä :main:multibot.c -{ObjDir}multipow.c.x Ä :main:multipow.c {ObjDir}net_ipx.c.x Ä :main:net_ipx.c {ObjDir}net_udp.c.x Ä :main:net_udp.c {ObjDir}newdemo.c.x Ä :main:newdemo.c @@ -442,6 +450,7 @@ directories {ObjDir}paging.c.x Ä :main:paging.c {ObjDir}physics.c.x Ä :main:physics.c {ObjDir}piggy.c.x Ä :main:piggy.c +{ObjDir}player.c.x Ä :main:player.c {ObjDir}playsave.c.x Ä :main:playsave.c {ObjDir}polyobj.c.x Ä :main:polyobj.c {ObjDir}powerup.c.x Ä :main:powerup.c @@ -466,11 +475,11 @@ directories {ObjDir}vecmat.c.x Ä :maths:vecmat.c {ObjDir}mem.c.x Ä :mem:mem.c {ObjDir}args.c.x Ä :misc:args.c -{ObjDir}compare.c.x Ä :misc:compare.c {ObjDir}dl_list.c.x Ä :misc:dl_list.c {ObjDir}error.c.x Ä :misc:error.c -{ObjDir}hmp2mid.c.x Ä :misc:hmp2mid.c +{ObjDir}hmp.c.x Ä :misc:hmp.c {ObjDir}ignorecase.c.x Ä :misc:ignorecase.c +{ObjDir}physfsx.c.x Ä :misc:physfsx.c {ObjDir}strio.c.x Ä :misc:strio.c {ObjDir}strutil.c.x Ä :misc:strutil.c {ObjDir}ntmap.c.x Ä :texmap:ntmap.c diff --git a/arch/sdl/jukebox.c b/arch/sdl/jukebox.c index a7f46cd54..70cb1356f 100644 --- a/arch/sdl/jukebox.c +++ b/arch/sdl/jukebox.c @@ -41,30 +41,24 @@ char hud_msg_buf[MUSIC_HUDMSG_MAXLEN+4]; void jukebox_unload() { - if (JukeboxSongs.list) - d_free(JukeboxSongs.list); - if (JukeboxSongs.list_buf) + { d_free(JukeboxSongs.list_buf); - + + if (JukeboxSongs.list) + d_free(JukeboxSongs.list); + } + else if (JukeboxSongs.list) + { + PHYSFS_freeList(JukeboxSongs.list); + JukeboxSongs.list = NULL; + } + JukeboxSongs.num_songs = JukeboxSongs.max_songs = JukeboxSongs.max_buf = 0; } char *jukebox_exts[] = { ".mp3", ".ogg", ".wav", ".aif", ".mid", NULL }; -void jukebox_add_song(void *data, const char *origdir, const char *fname) -{ - char *ext; - char **i = NULL; - - ext = strrchr(fname, '.'); - if (ext) - for (i = jukebox_exts; *i != NULL && stricmp(ext, *i); i++) {} // see if the file is of a type we want - - if ((!strcmp((PHYSFS_getRealDir(fname)==NULL?"":PHYSFS_getRealDir(fname)), GameCfg.CMLevelMusicPath)) && (ext && *i)) - string_array_add(&JukeboxSongs.list, &JukeboxSongs.list_buf, &JukeboxSongs.num_songs, &JukeboxSongs.max_songs, &JukeboxSongs.max_buf, fname); -} - void read_m3u(void) { FILE *fp; @@ -176,22 +170,17 @@ void jukebox_load() } else { + int i; + // Read directory using PhysicsFS - if (!string_array_new(&JukeboxSongs.list, &JukeboxSongs.list_buf, &JukeboxSongs.num_songs, &JukeboxSongs.max_songs, &JukeboxSongs.max_buf)) + // as mountpoints are no option (yet), make sure only files originating from GameCfg.CMLevelMusicPath are aded to the list. + JukeboxSongs.list = PHYSFSX_findabsoluteFiles("", GameCfg.CMLevelMusicPath, jukebox_exts); + if (!JukeboxSongs.list) return; - // as mountpoints are no option (yet), make sure only files originating from GameCfg.CMLevelMusicPath are aded to the list. - PHYSFS_enumerateFilesCallback("", jukebox_add_song, NULL); - string_array_tidy(&JukeboxSongs.list, &JukeboxSongs.list_buf, &JukeboxSongs.num_songs, &JukeboxSongs.max_songs, &JukeboxSongs.max_buf, 0, -#ifdef __LINUX__ - strcmp -#elif defined(_WIN32) || defined(macintosh) - stricmp -#else - strcasecmp -#endif - ); + for (i = 0; JukeboxSongs.list[i]; i++) {} + JukeboxSongs.num_songs = i; } if (JukeboxSongs.num_songs) diff --git a/d1x-rebirth.xcodeproj/project.pbxproj b/d1x-rebirth.xcodeproj/project.pbxproj index 2ae85d8ae..f599dcc8a 100755 --- a/d1x-rebirth.xcodeproj/project.pbxproj +++ b/d1x-rebirth.xcodeproj/project.pbxproj @@ -284,7 +284,6 @@ EB380D7D0E168B1900EBD9AD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EB380D7B0E168B1900EBD9AD /* InfoPlist.strings */; }; EB380D7E0E168B1900EBD9AD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EB380D7B0E168B1900EBD9AD /* InfoPlist.strings */; }; EB775A7A105611720036C348 /* extractD1Data.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB775A79105611720036C348 /* extractD1Data.cpp */; }; - EB861343111E9E810097D871 /* net_ipx.c in Sources */ = {isa = PBXBuildFile; fileRef = EBF658990F936A8400CB5C73 /* net_ipx.c */; }; EB8BE84F1071FBE00069486E /* player.c in Sources */ = {isa = PBXBuildFile; fileRef = EB8BE84E1071FBE00069486E /* player.c */; }; EB8BE8501071FBE00069486E /* player.c in Sources */ = {isa = PBXBuildFile; fileRef = EB8BE84E1071FBE00069486E /* player.c */; }; EB91A41012617070009E0095 /* libphysfs.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EB91A40F12617070009E0095 /* libphysfs.dylib */; }; @@ -1733,7 +1732,6 @@ EBE8D8910FDA76D1009D181F /* gamerend.c in Sources */, EB8BE8501071FBE00069486E /* player.c in Sources */, 17DFA6B110C1A29500674D11 /* net_udp.c in Sources */, - EB861343111E9E810097D871 /* net_ipx.c in Sources */, 179E6E9E11F37B3400175C54 /* hmp.c in Sources */, EB1405BB12100883002B1CC6 /* physfsx.c in Sources */, ); diff --git a/include/pstypes.h b/include/pstypes.h index 9a66a2e62..2b5d78ff0 100644 --- a/include/pstypes.h +++ b/include/pstypes.h @@ -7,7 +7,10 @@ #ifndef _TYPES_H #define _TYPES_H +#ifndef macintosh #include +#endif + #include // define a dboolean diff --git a/main/hud.c b/main/hud.c index 893e5886e..973570a67 100644 --- a/main/hud.c +++ b/main/hud.c @@ -113,9 +113,17 @@ void HUD_render_message_frame() int HUD_init_message_va(char * format, va_list args) { int i, j; +#ifndef macintosh char message[HUD_MESSAGE_LENGTH+1] = ""; +#else + char message[1024] = ""; +#endif +#ifndef macintosh vsnprintf(message, sizeof(char)*HUD_MESSAGE_LENGTH, format, args); +#else + vsprintf(message, format, args); +#endif // already in list - do not add again for (i = 0; i < HUD_nmessages; i++) diff --git a/main/menu.c b/main/menu.c index 91c17474f..1da27af40 100644 --- a/main/menu.c +++ b/main/menu.c @@ -890,7 +890,7 @@ int options_menuset(newmenu *menu, d_event *event, void *userdata) break; } - userdata++; //kill warning + userdata = userdata; //kill warning return 0; } @@ -911,8 +911,8 @@ void change_res() num_presets = gr_list_modes( modes ); { - newmenu_item m[num_presets+8]; - char restext[num_presets][12], crestext[12], casptext[12]; + newmenu_item m[50+8]; + char restext[50][12], crestext[12], casptext[12]; for (i = 0; i <= num_presets-1; i++) { @@ -1120,8 +1120,7 @@ void do_graphics_menu() } while( i>-1 ); } -#define CUR_DIRLIST "DirectoryListDXX" - +#if PHYSFS_VER_MAJOR >= 2 typedef struct browser { char *title; // The title - needed for making another listbox when changing directory @@ -1392,6 +1391,23 @@ int select_file_recursive(char *title, const char *orig_path, char **ext_list, i return newmenu_listbox1(title, b->num_files, b->list, 1, 0, (int (*)(listbox *, d_event *, void *))select_file_handler, b) >= 0; } +#define PATH_HEADER_TYPE NM_TYPE_MENU +#define BROWSE_TXT_SHRT " (...)" +#define BROWSE_TXT " (browse...)" + +#else + +int select_file_recursive(char *title, const char *orig_path, char **ext_list, int select_dir, int (*when_selected)(void *userdata, const char *filename), void *userdata) +{ + return 0; +} + +#define PATH_HEADER_TYPE NM_TYPE_TEXT +#define BROWSE_TXT_SHRT +#define BROWSE_TXT + +#endif + int opt_sm_digivol = -1, opt_sm_musicvol = -1, opt_sm_revstereo = -1, opt_sm_mtype0 = -1, opt_sm_mtype1 = -1, opt_sm_mtype2 = -1, opt_sm_mtype3 = -1, opt_sm_redbook_playorder = -1, opt_sm_mtype3_lmpath = -1, opt_sm_mtype3_lmplayorder1 = -1, opt_sm_mtype3_lmplayorder2 = -1, opt_sm_cm_mtype3_file1_b = -1, opt_sm_cm_mtype3_file1 = -1, opt_sm_cm_mtype3_file2_b = -1, opt_sm_cm_mtype3_file2 = -1, opt_sm_cm_mtype3_file3_b = -1, opt_sm_cm_mtype3_file3 = -1, opt_sm_cm_mtype3_file4_b = -1, opt_sm_cm_mtype3_file4 = -1, opt_sm_cm_mtype3_file5_b = -1, opt_sm_cm_mtype3_file5 = -1; void set_extmusic_volume(int volume); @@ -1605,7 +1621,7 @@ void do_sound_menu() m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "jukebox options:"; opt_sm_mtype3_lmpath = nitems; - m[nitems].type = NM_TYPE_MENU; m[nitems++].text = "path to music used for levels (...)"; + m[nitems].type = PATH_HEADER_TYPE; m[nitems++].text = "path to music used for levels" BROWSE_TXT_SHRT; m[nitems].type = NM_TYPE_INPUT; m[nitems].text = GameCfg.CMLevelMusicPath; m[nitems++].text_len = NM_MAX_TEXT_LEN-1; @@ -1624,31 +1640,31 @@ void do_sound_menu() m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "non-level music:"; opt_sm_cm_mtype3_file1_b = nitems; - m[nitems].type = NM_TYPE_MENU; m[nitems++].text = "main menu (browse...)"; + m[nitems].type = PATH_HEADER_TYPE; m[nitems++].text = "main menu" BROWSE_TXT; opt_sm_cm_mtype3_file1 = nitems; m[nitems].type = NM_TYPE_INPUT; m[nitems].text = GameCfg.CMMiscMusic[SONG_TITLE]; m[nitems++].text_len = NM_MAX_TEXT_LEN-1; opt_sm_cm_mtype3_file2_b = nitems; - m[nitems].type = NM_TYPE_MENU; m[nitems++].text = "briefing (browse...)"; + m[nitems].type = PATH_HEADER_TYPE; m[nitems++].text = "briefing" BROWSE_TXT; opt_sm_cm_mtype3_file2 = nitems; m[nitems].type = NM_TYPE_INPUT; m[nitems].text = GameCfg.CMMiscMusic[SONG_BRIEFING]; m[nitems++].text_len = NM_MAX_TEXT_LEN-1; opt_sm_cm_mtype3_file3_b = nitems; - m[nitems].type = NM_TYPE_MENU; m[nitems++].text = "credits (browse...)"; + m[nitems].type = PATH_HEADER_TYPE; m[nitems++].text = "credits" BROWSE_TXT; opt_sm_cm_mtype3_file3 = nitems; m[nitems].type = NM_TYPE_INPUT; m[nitems].text = GameCfg.CMMiscMusic[SONG_CREDITS]; m[nitems++].text_len = NM_MAX_TEXT_LEN-1; opt_sm_cm_mtype3_file4_b = nitems; - m[nitems].type = NM_TYPE_MENU; m[nitems++].text = "escape sequence (browse...)"; + m[nitems].type = PATH_HEADER_TYPE; m[nitems++].text = "escape sequence" BROWSE_TXT; opt_sm_cm_mtype3_file4 = nitems; m[nitems].type = NM_TYPE_INPUT; m[nitems].text = GameCfg.CMMiscMusic[SONG_ENDLEVEL]; m[nitems++].text_len = NM_MAX_TEXT_LEN-1; opt_sm_cm_mtype3_file5_b = nitems; - m[nitems].type = NM_TYPE_MENU; m[nitems++].text = "game ending (browse...)"; + m[nitems].type = PATH_HEADER_TYPE; m[nitems++].text = "game ending" BROWSE_TXT; opt_sm_cm_mtype3_file5 = nitems; m[nitems].type = NM_TYPE_INPUT; m[nitems].text = GameCfg.CMMiscMusic[SONG_ENDGAME]; m[nitems++].text_len = NM_MAX_TEXT_LEN-1; diff --git a/main/newdemo.c b/main/newdemo.c index a1dc6d8bd..731bd0587 100644 --- a/main/newdemo.c +++ b/main/newdemo.c @@ -445,9 +445,10 @@ static int shareware = 0; // reading shareware demo? void nd_read_object(object *obj) { - memset(obj, 0, sizeof(object)); short shortsig = 0; + memset(obj, 0, sizeof(object)); + /* * Do render type first, since with render_type == RT_NONE, we * blow by all other object information @@ -3310,9 +3311,9 @@ void newdemo_start_playback(char * filename) { // Randomly pick a filename int NumFiles = 0, RandFileNum; - rnd_demo = 1; char *types[] = { DEMO_EXT, NULL }; + rnd_demo = 1; NumFiles = newdemo_count_demos(); if ( NumFiles == 0 ) { diff --git a/main/titles.c b/main/titles.c index 95694c68b..9944dc120 100644 --- a/main/titles.c +++ b/main/titles.c @@ -454,9 +454,10 @@ int check_text_pos(briefing *br) void put_char_delay(briefing *br, int ch) { - char str[] = { ch, '\0' }; + char str[2]; int w, h, aw; + str[0] = ch; str[1] = '\0'; if (br->delay_count && (timer_get_fixed_seconds() < br->start_time + br->delay_count)) { br->message--; // Go back to same character @@ -891,7 +892,7 @@ int load_briefing_screen(briefing *br, char *fname) MALLOC(fname2, char, FILENAME_LEN); snprintf(fname2, sizeof(char)*FILENAME_LEN, fname); MALLOC(forigin, char, PATH_MAX); - snprintf(forigin, sizeof(char)*PATH_MAX, PHYSFS_getRealDir(fname)); + snprintf(forigin, sizeof(char)*PATH_MAX, "%s", PHYSFS_getRealDir(fname)); strlwr(forigin); // check if we have a hires version of this image (not included in PC-version by default) diff --git a/misc/args.c b/misc/args.c index 77771d2f0..c72f882f0 100644 --- a/misc/args.c +++ b/misc/args.c @@ -20,13 +20,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include #include -#include "u_mem.h" -#include "physfsx.h" -#include "strio.h" -#include "strutil.h" -#include "args.h" -#include "game.h" -#include "gauges.h" +#include + #ifdef OGL #if defined(__APPLE__) && defined(__MACH__) #include @@ -38,6 +33,14 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #endif +#include "u_mem.h" +#include "physfsx.h" +#include "strio.h" +#include "strutil.h" +#include "args.h" +#include "game.h" +#include "gauges.h" + #define MAX_ARGS 1000 #define INI_FILENAME "d1x.ini" @@ -158,9 +161,9 @@ void ReadCmdArgs(void) GameArg.CtlMouselook = FindArg("-mouselook"); GameArg.CtlGrabMouse = FindArg("-grabmouse"); if (FindArg("-nostickykeys")) // no GameArg, just an environment variable. Must happen before SDL_Init! - putenv("SDL_DISABLE_LOCK_KEYS=1"); + SDL_putenv("SDL_DISABLE_LOCK_KEYS=1"); else - putenv("SDL_DISABLE_LOCK_KEYS=0"); + SDL_putenv("SDL_DISABLE_LOCK_KEYS=0"); // Sound Options diff --git a/misc/physfsx.c b/misc/physfsx.c index e8b7a92d7..8ed0fb02d 100644 --- a/misc/physfsx.c +++ b/misc/physfsx.c @@ -23,12 +23,9 @@ // The user directory is searched first. void PHYSFSX_init(int argc, char *argv[]) { -#if defined (_WIN32) char fullPath[PATH_MAX + 5]; -#endif #if defined(__unix__) char *path = NULL; - char fullPath[PATH_MAX + 5]; #endif #ifdef macintosh // Mac OS 9 char base_dir[PATH_MAX]; @@ -361,6 +358,7 @@ void PHYSFSX_addArchiveContent() PHYSFS_freeList(list); list = NULL; +#if PHYSFS_VER_MAJOR >= 2 // find files in DEMO_DIR ... list = PHYSFSX_findFiles(DEMO_DIR, archive_exts); // if found, add them... @@ -374,6 +372,8 @@ void PHYSFSX_addArchiveContent() d_free(file[0]); d_free(file[1]); } +#endif + PHYSFS_freeList(list); list = NULL; }