From 168e0882ed46ff8e9a2cd7d3b79bfede55b75160 Mon Sep 17 00:00:00 2001 From: acicchetti Date: Mon, 13 Aug 2018 15:27:27 -0400 Subject: [PATCH 1/2] Started modifications for mac compilation --- src/mac.mak | 20 ++++++++++---------- src/platform/mac/platform_mac.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/mac.mak b/src/mac.mak index a419522..9d72b20 100755 --- a/src/mac.mak +++ b/src/mac.mak @@ -27,7 +27,7 @@ DMG = wrogue-$(GAME_VERSION).dmg DMG_TMP = $(DMG:.dmg=.tmp.dmg) -include sources.inc +include wrogue_sources.inc SRC_PLATFORM = \ platform/sdl/platform_sdl.c \ @@ -46,14 +46,14 @@ CFLAGS ?= -std=c99 -Wall -Os -fomit-frame-pointer -ffast-math MFLAGS ?= -Wall -Os -fomit-frame-pointer -ffast-math CFLAGS += -std=c99 -F"$(SDL_FRAMEWORK_PATH)" \ --I"$(SDL_FRAMEWORK_PATH)/SDL.framework/Headers" -I. -I./lib \ --isysroot/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Os +-I"$(SDL_FRAMEWORK_PATH)/SDL2.framework/Headers" -I. -I./lib \ +-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -Os -MFLAGS += -I"$(SDL_FRAMEWORK_PATH)/SDL.framework/Headers" \ --isysroot/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Os +MFLAGS += -I"$(SDL_FRAMEWORK_PATH)/SDL2.framework/Headers" \ +-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -Os -LDFLAGS += -F"$(SDL_FRAMEWORK_PATH)" -framework SDL -framework Cocoa \ --lm -arch i386 -arch ppc -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk +LDFLAGS += -F"$(SDL_FRAMEWORK_PATH)" -framework SDL2 -framework Cocoa \ +-lm -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk RM = rm -rf @@ -88,9 +88,9 @@ app: $(EXE) sed '$(INFO_PLIST_PATTERN)' "$(APP_TEMPLATE)/Contents/Info.plist" > "app/$(GAME_NAME).app/Contents/Info.plist" cp $(EXE) "app/$(GAME_NAME).app/Contents/MacOS/$(EXEC_NAME)" ln -s "Contents/MacOS/$(EXEC_NAME)" "app/$(GAME_NAME).app/$(EXEC_NAME)" - cp -R "$(SDL_FRAMEWORK_PATH)/SDL.framework" "app/$(GAME_NAME).app/Contents/Frameworks" - rm -r "app/$(GAME_NAME).app/Contents/Frameworks/SDL.framework/Versions/A/Headers" - rm "app/$(GAME_NAME).app/Contents/Frameworks/SDL.framework/Headers" + cp -R "$(SDL_FRAMEWORK_PATH)/SDL2.framework" "app/$(GAME_NAME).app/Contents/Frameworks" + rm -r "app/$(GAME_NAME).app/Contents/Frameworks/SDL2.framework/Versions/A/Headers" + rm "app/$(GAME_NAME).app/Contents/Frameworks/SDL2.framework/Headers" cp -R "$(DATA_DIR)/"* "app/$(GAME_NAME).app/Contents/Resources" cp "./platform/mac/$(ICON_NAME)" "app/$(GAME_NAME).app/Contents/Resources/" diff --git a/src/platform/mac/platform_mac.c b/src/platform/mac/platform_mac.c index ddf8513..6d2fd16 100755 --- a/src/platform/mac/platform_mac.c +++ b/src/platform/mac/platform_mac.c @@ -26,7 +26,7 @@ #include -#include +#include #include "wrogue.h" From 13e2ab6613bda2a99a9e657b1886398a82cca51d Mon Sep 17 00:00:00 2001 From: acicchetti Date: Mon, 13 Aug 2018 15:49:26 -0400 Subject: [PATCH 2/2] Started making SDL2 migration via https://wiki.libsdl.org/MigrationGuide --- src/platform/mac/platform_mac.c | 2 +- src/platform/sdl/platform_sdl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/mac/platform_mac.c b/src/platform/mac/platform_mac.c index 6d2fd16..ddf8513 100755 --- a/src/platform/mac/platform_mac.c +++ b/src/platform/mac/platform_mac.c @@ -26,7 +26,7 @@ #include -#include +#include #include "wrogue.h" diff --git a/src/platform/sdl/platform_sdl.c b/src/platform/sdl/platform_sdl.c index c758ae9..5e74740 100755 --- a/src/platform/sdl/platform_sdl.c +++ b/src/platform/sdl/platform_sdl.c @@ -619,7 +619,7 @@ static void background_init(void) background_image = SDL_LoadBMP(data_path()); if (background_image == NULL) load_bmp_error(); - Background = SDL_DisplayFormat(background_image); + Background = SDL_ConvertSurfaceFormat(background_image); SDL_FreeSurface(background_image); }