From: Brad A. <br...@us...> - 2012-07-12 04:58:40
|
gemrb: Infinity Engine emulator The branch master has been updated via 14ef1d4a9b2f0c737243539610cda6c34d8f9269 (commit) via cfc3c64319511c6958e397341e3fb481803147aa (commit) via 86aa72b6d4d748e1ea5200cc905e1c972233af6d (commit) Summary of changes: apple/CocoaWrapper/ios/GEM_AppDelegate.mm | 14 +++++++++++++- apple/CocoaWrapper/ios/GEM_ConfController.m | 7 ++++++- apple/GemRB.xcodeproj/project.pbxproj | 17 +++++++++++++++-- gemrb/plugins/SDLVideo/SDL20Video.cpp | 4 ++-- gemrb/plugins/SDLVideo/SpriteRenderer.inl | 20 ++++++++++---------- 5 files changed, 46 insertions(+), 16 deletions(-) from 398dbf854dd0cbd2ccc0a1995974ccd78def3b95 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=14ef1d4a9b2f0c737243539610cda6c34d8f9269 commit 14ef1d4a9b2f0c737243539610cda6c34d8f9269 Author: Brad Allred <bra...@me...> Date: Wed Jul 11 22:58:15 2012 -0600 CocoaWrapper: add (useless) dealloc method for the app delegate for convention sake. diff --git a/apple/CocoaWrapper/ios/GEM_AppDelegate.mm b/apple/CocoaWrapper/ios/GEM_AppDelegate.mm index 3830b00..b664d20 100644 --- a/apple/CocoaWrapper/ios/GEM_AppDelegate.mm +++ b/apple/CocoaWrapper/ios/GEM_AppDelegate.mm @@ -67,7 +67,7 @@ using namespace GemRB; [nibObjects retain]; configWin.rootViewController = confControl.rootVC; configWin.screen = [UIScreen mainScreen]; - [configWin makeKeyAndVisible]; + [configWin makeKeyAndVisible]; // Note that this causes the window to be retained! } - (void)setupComplete:(NSString*)configPath @@ -138,4 +138,16 @@ using namespace GemRB; } } +- (void)dealloc +{ + // This is really just formallity. + // these objects would have been deallocated in runGemRB under normal circumstances + + [configWin release]; + [nibObjects release]; + [confControl release]; + + [super dealloc]; +} + @end http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=cfc3c64319511c6958e397341e3fb481803147aa commit cfc3c64319511c6958e397341e3fb481803147aa Author: Brad Allred <bra...@me...> Date: Wed Jul 11 22:52:47 2012 -0600 xcode: more build script fixes don't optimize debug builds fix another issue with spaces in paths preventing the SDLVideo driver from building automatically add a script to VLC plugin to re-link to VLC.app if it is present so that users don't need to hunt down libVLC.dylib to build it diff --git a/apple/GemRB.xcodeproj/project.pbxproj b/apple/GemRB.xcodeproj/project.pbxproj index c573bf3..bc4daf7 100644 --- a/apple/GemRB.xcodeproj/project.pbxproj +++ b/apple/GemRB.xcodeproj/project.pbxproj @@ -4150,7 +4150,20 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "#build the SDLVideo driver. we cannot have it as a target dependency because we use \"bundle loader\"\nxcodebuild -project GemRB.xcodeproj -target SDLVideo -configuration $CONFIGURATION SYMROOT=$SYMROOT\ncp $BUILT_PRODUCTS_DIR/SDLVideo.so \"$BUILT_PRODUCTS_DIR/$PLUGINS_FOLDER_PATH\"/SDLVideo.so\n\n#copy GUIScripts to bundle\ncp -r ../gemrb/GUIScripts/ \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/GUIScripts\n#copy Override to bundle\ncp -r ../gemrb/override/ \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/override\n#clear the cmake files and make files\nfind \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/ -name CMakeLists.txt | xargs -I{} rm {}\nfind \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/ -name Makefile.am | xargs -I{} rm {}\n\n#increment the version number for the build\nREV=`git log --pretty=format:'' | wc -l | sed 's/\\ //g'`\nVERSION=`git describe --tags --dirty=-patched`\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $REV\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\n/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $VERSION\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\""; + shellScript = "#build the SDLVideo driver. we cannot have it as a target dependency because we use \"bundle loader\"\nxcodebuild -project GemRB.xcodeproj -target SDLVideo -configuration $CONFIGURATION SYMROOT=\"$SYMROOT\"\ncp $BUILT_PRODUCTS_DIR/SDLVideo.so \"$BUILT_PRODUCTS_DIR/$PLUGINS_FOLDER_PATH\"/SDLVideo.so\n\n#copy GUIScripts to bundle\ncp -r ../gemrb/GUIScripts/ \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/GUIScripts\n#copy Override to bundle\ncp -r ../gemrb/override/ \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/override\n#clear the cmake files and make files\nfind \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/ -name CMakeLists.txt | xargs -I{} rm {}\nfind \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH\"/Resources/ -name Makefile.am | xargs -I{} rm {}\n\n#increment the version number for the build\nREV=`git log --pretty=format:'' | wc -l | sed 's/\\ //g'`\nVERSION=`git describe --tags --dirty=-patched`\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $REV\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\n/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $VERSION\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\""; + }; + A2BD125D15A8E32B000FAB95 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# if the user has VLC installed re-link to its libraries.\n# this way the user doesnt have to install libVLC to use this plugin\n\nVLC=`mdfind \"kMDItemFSName==VLC.app&&kMDItemKind==Application\"`\nlibVLC=\"$VLC/Contents/MacOS/lib/libvlc.5.dylib\"\n\nif [ -e `$VLC`] # note: use VLC path because we wont have permission to the lib path\nthen\n echo \"found libVLC:$libVLC\"\n install_name_tool -change @loader_path/lib/libvlc.5.dylib \"${libVLC}\" \"$BUILT_PRODUCTS_DIR\"/\"$EXECUTABLE_NAME\"\nfi\n"; }; A2D4C61613A978520086BCC4 /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -6643,7 +6656,7 @@ "$(FRAMEWORK_SEARCH_PATHS)", /Library/Frameworks/, ); - GCC_OPTIMIZATION_LEVEL = 2; + GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; "GCC_VERSION[arch=x86_64]" = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=86aa72b6d4d748e1ea5200cc905e1c972233af6d commit 86aa72b6d4d748e1ea5200cc905e1c972233af6d Author: Brad Allred <bra...@me...> Date: Wed Jul 11 22:51:52 2012 -0600 fix running on iOS this fixes both the faulty sprite masks as well as addresses a change in libSDL that was breaking things due to disabling the event pump after SDL_main returns. diff --git a/apple/CocoaWrapper/ios/GEM_ConfController.m b/apple/CocoaWrapper/ios/GEM_ConfController.m index daf2287..8cdb188 100644 --- a/apple/CocoaWrapper/ios/GEM_ConfController.m +++ b/apple/CocoaWrapper/ios/GEM_ConfController.m @@ -20,7 +20,7 @@ #import "GEM_ConfController.h" -#import <SDL/SDL_hints.h> +#import <SDL/SDL.h> #include <archive.h> #include <archive_entry.h> @@ -533,6 +533,11 @@ enum ConfigTableSection { 3. ensure we have dropped back to the main runloop so autoreleased objects are disposed of bonus: the call stack is significantly reduced this way */ + + // SDL disables the event pump after SDL_main returns because normally SDL_main houses the application event loop + // GemRB is diffrent and our wrapper interface makes that impossible. + SDL_iPhoneSetEventPump(SDL_TRUE); + [[self delegate] performSelectorOnMainThread:@selector(setupComplete:) withObject:[self selectedConfigPath] waitUntilDone:NO]; } diff --git a/gemrb/plugins/SDLVideo/SDL20Video.cpp b/gemrb/plugins/SDLVideo/SDL20Video.cpp index 41b6ea3..9e6a310 100644 --- a/gemrb/plugins/SDLVideo/SDL20Video.cpp +++ b/gemrb/plugins/SDLVideo/SDL20Video.cpp @@ -155,7 +155,7 @@ void SDL20VideoDriver::showFrame(unsigned char* buf, unsigned int bufw, int pitch; SDL_Color color = {0, 0, 0, 0}; - if(!SDL_LockTexture(videoPlayer, NULL, &pixels, &pitch)) { + if(SDL_LockTexture(videoPlayer, NULL, &pixels, &pitch) != GEM_OK) { Log(ERROR, "SDL 2 driver", "Unable to lock video player: %s", SDL_GetError()); return; } @@ -218,7 +218,7 @@ void SDL20VideoDriver::showYUVFrame(unsigned char** buf, unsigned int *strides, Uint8 *pixels; int pitch; - if(!SDL_LockTexture(videoPlayer, NULL, (void**)&pixels, &pitch)) { + if(SDL_LockTexture(videoPlayer, NULL, (void**)&pixels, &pitch) != GEM_OK) { Log(ERROR, "SDL 2 driver", "Unable to lock video player: %s", SDL_GetError()); return; } diff --git a/gemrb/plugins/SDLVideo/SpriteRenderer.inl b/gemrb/plugins/SDLVideo/SpriteRenderer.inl index 17388bd..c2c027a 100644 --- a/gemrb/plugins/SDLVideo/SpriteRenderer.inl +++ b/gemrb/plugins/SDLVideo/SpriteRenderer.inl @@ -26,7 +26,9 @@ // For pixel formats: // We hardcode a single pixel format per bit depth. -#ifdef TARGET_OS_MAC +#if TARGET_OS_IPHONE +// NOTE: TARGET_OS_IPHONE must go before TARGET_OS_MAC +// I don't know if its just the simulator, but TARGET_OS_MAC is set on iOS const unsigned int RLOSS16 = 3; const unsigned int GLOSS16 = 2; @@ -35,13 +37,11 @@ const unsigned int RSHIFT16 = 11; const unsigned int GSHIFT16 = 5; const unsigned int BSHIFT16 = 0; -const unsigned int RSHIFT32 = 8; -const unsigned int GSHIFT32 = 16; -const unsigned int BSHIFT32 = 24; - -#elif TARGET_OS_IPHONE +const unsigned int RSHIFT32 = 0; +const unsigned int GSHIFT32 = 8; +const unsigned int BSHIFT32 = 16; -// TODO: check these values. I am no longer able. +#elif TARGET_OS_MAC const unsigned int RLOSS16 = 3; const unsigned int GLOSS16 = 2; @@ -50,9 +50,9 @@ const unsigned int RSHIFT16 = 11; const unsigned int GSHIFT16 = 5; const unsigned int BSHIFT16 = 0; -const unsigned int RSHIFT32 = 0; -const unsigned int GSHIFT32 = 8; -const unsigned int BSHIFT32 = 16; +const unsigned int RSHIFT32 = 8; +const unsigned int GSHIFT32 = 16; +const unsigned int BSHIFT32 = 24; #else ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |