From 06a94abc2b2900656d7473369aba563050b22b82 Mon Sep 17 00:00:00 2001 From: yangws Date: Thu, 17 Mar 2011 10:03:32 +0800 Subject: [PATCH 1/3] fixed #401 replace ConfigurationName with Cofiguration --- template/msvc/CCAppWiz.win32/Scripts/1033/default.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/template/msvc/CCAppWiz.win32/Scripts/1033/default.js b/template/msvc/CCAppWiz.win32/Scripts/1033/default.js index 3027ee9fd7fa..4be2f7d51305 100644 --- a/template/msvc/CCAppWiz.win32/Scripts/1033/default.js +++ b/template/msvc/CCAppWiz.win32/Scripts/1033/default.js @@ -173,8 +173,14 @@ function AddConfigurations(proj, strProjectName) { // else // config.CharacterSet = charSetMBCS; - config.OutputDirectory = '$(SolutionDir)$(ConfigurationName).win32' - config.IntermediateDirectory = '$(ConfigurationName).win32'; + var WizardVersion = wizard.FindSymbol('WIZARD_VERSION'); + if(WizardVersion >= 10.0) { + config.OutputDirectory = '$(SolutionDir)$(Configuration).win32' + config.IntermediateDirectory = '$(Configuration).win32'; + } else { + config.OutputDirectory = '$(SolutionDir)$(ConfigurationName).win32' + config.IntermediateDirectory = '$(ConfigurationName).win32'; + } // Compiler settings var CLTool = config.Tools('VCCLCompilerTool'); From 9fe836b5fb13cb683ddaa8de207c289908f669f4 Mon Sep 17 00:00:00 2001 From: yangws Date: Thu, 17 Mar 2011 11:10:50 +0800 Subject: [PATCH 2/3] fixed #404 enableRitinaDisplay return false on iphone3 --- cocos2dx/platform/ios/CCEGLView_ios.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocos2dx/platform/ios/CCEGLView_ios.mm b/cocos2dx/platform/ios/CCEGLView_ios.mm index 3ddb9ce2538e..587b5e5149bf 100644 --- a/cocos2dx/platform/ios/CCEGLView_ios.mm +++ b/cocos2dx/platform/ios/CCEGLView_ios.mm @@ -54,7 +54,8 @@ of this software and associated documentation files (the "Software"), to deal bool CCEGLView::canSetContentScaleFactor() { - return [[EAGLView sharedEGLView] respondsToSelector:@selector(setContentScaleFactor:)]; + return [[EAGLView sharedEGLView] respondsToSelector:@selector(setContentScaleFactor:)] + && [[UIScreen mainScreen] scale] != 1.0; } void CCEGLView::setContentScaleFactor(float contentScaleFactor) From 0384515690b19102a6507a91931e5b69c945b3a8 Mon Sep 17 00:00:00 2001 From: yangws Date: Thu, 17 Mar 2011 11:27:51 +0800 Subject: [PATCH 3/3] fixed #395 Add initInstance code for all platform in msvc templates. --- HelloWorld/AppDelegate.cpp | 8 +++++ .../Templates/1033/Classes/AppDelegate.cpp | 30 +++++++++++++++++++ .../Templates/1033/Classes/AppDelegate.cpp | 23 ++++++++++++++ tests/AppDelegate.cpp | 10 ++++++- 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/HelloWorld/AppDelegate.cpp b/HelloWorld/AppDelegate.cpp index b9b212fc501c..01dacc220365 100644 --- a/HelloWorld/AppDelegate.cpp +++ b/HelloWorld/AppDelegate.cpp @@ -30,9 +30,17 @@ bool AppDelegate::initInstance() #endif // CC_PLATFORM_WIN32 #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + // OpenGLView initialized in testsAppDelegate.mm on ios platform, nothing need to do here. + #endif // CC_PLATFORM_IOS +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + + // Android doesn't need to do anything. + +#endif // CC_PLATFORM_ANDROID + #if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) // Initialize OpenGLView instance, that release by CCDirector when application terminate. diff --git a/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp b/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp index 1754a9fd709a..fee74fdc940b 100644 --- a/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp +++ b/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp @@ -27,11 +27,41 @@ bool AppDelegate::initInstance() bool bRet = false; do { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) // Initialize OpenGLView instance, that release by CCDirector when application terminate. // The HelloWorld is designed as HVGA. CCEGLView * pMainWnd = new CCEGLView(); CC_BREAK_IF(! pMainWnd || ! pMainWnd->Create(TEXT("[!output PROJECT_NAME]"), 320, 480)); +#endif // CC_PLATFORM_WIN32 + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + + // OpenGLView initialized in testsAppDelegate.mm on ios platform, nothing need to do here. + +#endif // CC_PLATFORM_IOS + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + + // Android doesn't need to do anything. + +#endif // CC_PLATFORM_ANDROID + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) + // Initialize OpenGLView instance, that release by CCDirector when application terminate. + // The HelloWorld is designed as HVGA. + // Use GetScreenWidth() and GetScreenHeight() get screen width and height. + CCEGLView * pMainWnd = new CCEGLView(this); + CC_BREAK_IF(! pMainWnd + || ! pMainWnd->Create(320, 480)); + +#if !defined(_TRANZDA_VM_) + // set the resource zip file + // on wophone emulator, we copy resources files to Work7/TG3/APP/ folder instead of zip file + CCFileUtils::setResource("[!output PROJECT_NAME].zip"); +#endif + +#endif // CC_PLATFORM_WOPHONE bRet = true; } while (0); diff --git a/template/msvc/CCAppWiz.wophone/Templates/1033/Classes/AppDelegate.cpp b/template/msvc/CCAppWiz.wophone/Templates/1033/Classes/AppDelegate.cpp index 32e39f7cc153..fee74fdc940b 100644 --- a/template/msvc/CCAppWiz.wophone/Templates/1033/Classes/AppDelegate.cpp +++ b/template/msvc/CCAppWiz.wophone/Templates/1033/Classes/AppDelegate.cpp @@ -27,6 +27,27 @@ bool AppDelegate::initInstance() bool bRet = false; do { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) + // Initialize OpenGLView instance, that release by CCDirector when application terminate. + // The HelloWorld is designed as HVGA. + CCEGLView * pMainWnd = new CCEGLView(); + CC_BREAK_IF(! pMainWnd + || ! pMainWnd->Create(TEXT("[!output PROJECT_NAME]"), 320, 480)); +#endif // CC_PLATFORM_WIN32 + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + + // OpenGLView initialized in testsAppDelegate.mm on ios platform, nothing need to do here. + +#endif // CC_PLATFORM_IOS + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + + // Android doesn't need to do anything. + +#endif // CC_PLATFORM_ANDROID + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) // Initialize OpenGLView instance, that release by CCDirector when application terminate. // The HelloWorld is designed as HVGA. // Use GetScreenWidth() and GetScreenHeight() get screen width and height. @@ -40,6 +61,8 @@ bool AppDelegate::initInstance() CCFileUtils::setResource("[!output PROJECT_NAME].zip"); #endif +#endif // CC_PLATFORM_WOPHONE + bRet = true; } while (0); return bRet; diff --git a/tests/AppDelegate.cpp b/tests/AppDelegate.cpp index d7b36feaf8bb..ccda6ca59eaf 100644 --- a/tests/AppDelegate.cpp +++ b/tests/AppDelegate.cpp @@ -30,9 +30,17 @@ bool AppDelegate::initInstance() #endif // CC_PLATFORM_WIN32 #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + // OpenGLView initialized in testsAppDelegate.mm on ios platform, nothing need to do here. + #endif // CC_PLATFORM_IOS - + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + + // Android doesn't need to do anything. + +#endif // CC_PLATFORM_ANDROID + #if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) // Initialize OpenGLView instance, that release by CCDirector when application terminate.