Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/yangws/cocos2d-x into yan…
Browse files Browse the repository at this point in the history
…gws-master
  • Loading branch information
walzer committed Mar 17, 2011
2 parents 68cf738 + 0384515 commit 781d2a3
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 4 deletions.
8 changes: 8 additions & 0 deletions HelloWorld/AppDelegate.cpp
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion cocos2dx/platform/ios/CCEGLView_ios.mm
Expand Up @@ -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)
Expand Down
10 changes: 8 additions & 2 deletions template/msvc/CCAppWiz.win32/Scripts/1033/default.js
Expand Up @@ -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');
Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -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.
Expand All @@ -40,6 +61,8 @@ bool AppDelegate::initInstance()
CCFileUtils::setResource("[!output PROJECT_NAME].zip");
#endif

#endif // CC_PLATFORM_WOPHONE

bRet = true;
} while (0);
return bRet;
Expand Down
10 changes: 9 additions & 1 deletion tests/AppDelegate.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit 781d2a3

Please sign in to comment.