From 3b89d3af0813883a1007df9eb4c07e3b39ab57b7 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 8 Mar 2012 19:16:30 +0000 Subject: [PATCH] OS X: fix and enable startup windows; enable PPC build in osxbuild.sh. git-svn-id: https://svn.eduke32.com/eduke32@2430 1a8010ca-5511-0410-912e-c29ae57300e0 --- .../eduke32/Apple/StartupWinController.game.m | 42 +++++++++---------- polymer/eduke32/Makefile | 2 +- polymer/eduke32/build/src/sdlayer.c | 3 ++ polymer/eduke32/osxbuild.sh | 28 ++++++------- 4 files changed, 39 insertions(+), 36 deletions(-) diff --git a/polymer/eduke32/Apple/StartupWinController.game.m b/polymer/eduke32/Apple/StartupWinController.game.m index 8cce09a09..a4cbd7eac 100644 --- a/polymer/eduke32/Apple/StartupWinController.game.m +++ b/polymer/eduke32/Apple/StartupWinController.game.m @@ -4,6 +4,7 @@ #define GetTime xGetTime #include "duke3d.h" +#include "game.h" #undef GetTime #include "build.h" #include "compat.h" @@ -399,7 +400,6 @@ int startwin_idle(void *v) return 0; } -extern char *duke3dgrp; int startwin_run(void) { @@ -407,16 +407,16 @@ int startwin_run(void) if (startwin == nil) return 0; - settings.fullscreen = ScreenMode; - settings.xdim3d = ScreenWidth; - settings.ydim3d = ScreenHeight; - settings.bpp3d = ScreenBPP; - settings.samplerate = MixRate; - settings.bitspersample = NumBits; - settings.channels = NumChannels; - settings.forcesetup = ForceSetup; - settings.game = gametype; - strncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH); + settings.fullscreen = ud.config.ScreenMode; + settings.xdim3d = ud.config.ScreenWidth; + settings.ydim3d = ud.config.ScreenHeight; + settings.bpp3d = ud.config.ScreenBPP; + settings.samplerate = ud.config.MixRate; + settings.bitspersample = ud.config.NumBits; + settings.channels = ud.config.NumChannels; + settings.forcesetup = ud.config.ForceSetup; +// settings.game = gametype; + strncpy(settings.selectedgrp, defaultduke3dgrp, BMAX_PATH); [startwin setupRunMode]; @@ -429,16 +429,16 @@ int startwin_run(void) [startwin setupMessagesMode]; if (retval) { - ScreenMode = settings.fullscreen; - ScreenWidth = settings.xdim3d; - ScreenHeight = settings.ydim3d; - ScreenBPP = settings.bpp3d; - MixRate = settings.samplerate; - NumBits = settings.bitspersample; - NumChannels = settings.channels; - ForceSetup = settings.forcesetup; - duke3dgrp = settings.selectedgrp; - gametype = settings.game; + ud.config.ScreenMode = settings.fullscreen; + ud.config.ScreenWidth = settings.xdim3d; + ud.config.ScreenHeight = settings.ydim3d; + ud.config.ScreenBPP = settings.bpp3d; + ud.config.MixRate = settings.samplerate; + ud.config.NumBits = settings.bitspersample; + ud.config.NumChannels = settings.channels; + ud.config.ForceSetup = settings.forcesetup; + strncpy(defaultduke3dgrp, settings.selectedgrp, BMAX_PATH); +// gametype = settings.game; } return retval; diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index b75701366..29d608d9f 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -213,7 +213,7 @@ ifeq ($(PLATFORM),DARWIN) -Wl,-framework,QuickTime -lm endif ifneq (0,$(OSX_STARTUPWINDOW)) - EDITOROBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o +# EDITOROBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o GAMEOBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o endif NASMFLAGS += -f macho diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 81eeb9ece..5f7d78b3a 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -34,11 +34,14 @@ #if (!defined __APPLE__ && !defined HAVE_GTK2) || (defined __APPLE__) // && defined __BIG_ENDIAN__) #undef UNREFERENCED_PARAMETER #define UNREFERENCED_PARAMETER(x) x=x + +# ifndef OSX_STARTUPWINDOW int32_t startwin_open(void) { return 0; } int32_t startwin_close(void) { return 0; } int32_t startwin_puts(const char *s) { UNREFERENCED_PARAMETER(s); return 0; } int32_t startwin_idle(void *s) { UNREFERENCED_PARAMETER(s); return 0; } int32_t startwin_settitle(const char *s) { UNREFERENCED_PARAMETER(s); return 0; } +# endif #endif /// These can be useful for debugging sometimes... diff --git a/polymer/eduke32/osxbuild.sh b/polymer/eduke32/osxbuild.sh index d548ae03b..4ef7ea4d3 100755 --- a/polymer/eduke32/osxbuild.sh +++ b/polymer/eduke32/osxbuild.sh @@ -47,7 +47,7 @@ if [ $onlyzip -eq 0 ]; then # fi make veryclean - WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=1 make -j 3 + OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=1 make -j 3 if [ $? ]; then echo 64-bit release build succeeded. cp "Mapster32.app/Contents/MacOS/mapster32" mapster32.x64 @@ -67,7 +67,7 @@ if [ $onlyzip -eq 0 ]; then # fi make veryclean - WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=1 USE_LIBVPX=0 make -j 3 + OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=1 USE_LIBVPX=0 make -j 3 if [ $? ]; then echo 32-bit release build succeeded. cp "Mapster32.app/Contents/MacOS/mapster32" mapster32.x86 @@ -86,15 +86,15 @@ if [ $onlyzip -eq 0 ]; then # echo PowerPC debug build failed. # fi - # make veryclean - # ARCH='-arch ppc' WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=0 make -j 3 - # if [ $? ]; then - # echo PowerPC release build succeeded. - # cp "Mapster32.app/Contents/MacOS/mapster32" mapster32.ppc - # cp "EDuke32.app/Contents/MacOS/eduke32" eduke32.ppc - # else - # echo PowerPC release build failed. - # fi + make veryclean + ARCH='-arch ppc' OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=0 make -j 3 + if [ $? ]; then + echo PowerPC release build succeeded. + cp "Mapster32.app/Contents/MacOS/mapster32" mapster32.ppc + cp "EDuke32.app/Contents/MacOS/eduke32" eduke32.ppc + else + echo PowerPC release build failed. + fi fi # clean up, clean up, everybody everywhere, clean up, clean up, everybody do your share @@ -113,16 +113,16 @@ fi # fi # Almost done... -if [ -f mapster32.x64 ] && [ -f eduke32.x86 ]; then # && [ -f eduke32.ppc ]; then +if [ -f mapster32.x64 ] && [ -f eduke32.x86 ] && [ -f eduke32.ppc ]; then echo Creating fat binaries. - lipo -create mapster32.x64 mapster32.x86 -output mapster32 + lipo -create mapster32.x64 mapster32.x86 mapster32.ppc -output mapster32 cp -f mapster32 "Mapster32.app/Contents/MacOS/mapster32" # lipo -create mapster32.debug.x64 mapster32.debug.x86 -output mapster32.debug # cp -f mapster32 "Mapster32.debug.app/Contents/MacOS/mapster32" - lipo -create eduke32.x64 eduke32.x86 -output eduke32 + lipo -create eduke32.x64 eduke32.x86 mapster32.ppc -output eduke32 cp -f eduke32 "EDuke32.app/Contents/MacOS/eduke32" # lipo -create eduke32.debug.x64 eduke32.debug.x86 -output eduke32.debug