From 29be687f0beff23b88de626aafe09999ab2b8ca1 Mon Sep 17 00:00:00 2001 From: minggo Date: Sun, 8 Apr 2012 14:28:07 +0800 Subject: [PATCH] merge commit 0e8a8c04a21b7e96a7386237d0e4e4eef2269c89 --- cocos2dx/platform/win32/CCEGLView_win32.h | 2 +- cocos2dx/platform/win32/CCFileUtils_win32.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cocos2dx/platform/win32/CCEGLView_win32.h b/cocos2dx/platform/win32/CCEGLView_win32.h index a6e71cba7f..9a021be804 100644 --- a/cocos2dx/platform/win32/CCEGLView_win32.h +++ b/cocos2dx/platform/win32/CCEGLView_win32.h @@ -54,7 +54,7 @@ public: bool canSetContentScaleFactor(); void setContentScaleFactor(float contentScaleFactor); - float getMainScreenScale() { return 1.0f; } + float getMainScreenScale() { return -1.0f; } virtual bool Create(LPCTSTR pTitle, int w, int h); virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); diff --git a/cocos2dx/platform/win32/CCFileUtils_win32.cpp b/cocos2dx/platform/win32/CCFileUtils_win32.cpp index dc11d0e0ff..79d9720821 100644 --- a/cocos2dx/platform/win32/CCFileUtils_win32.cpp +++ b/cocos2dx/platform/win32/CCFileUtils_win32.cpp @@ -25,6 +25,8 @@ THE SOFTWARE. #include "windows.h" #include "CCDirector.h" +#define CC_RETINA_DISPLAY_FILENAME_SUFFIX "-hd" + using namespace std; NS_CC_BEGIN; @@ -76,7 +78,7 @@ const char* CCFileUtils::fullPathFromRelativePath(const char *pszRelativePath) pRet->m_sString = s_pszResourcePath; pRet->m_sString += pszRelativePath; } -#if (CC_IS_RETINA_DISPLAY_SUPPORTED) + if (CC_CONTENT_SCALE_FACTOR() != 1.0f) { std::string hiRes = pRet->m_sString.c_str(); @@ -98,7 +100,7 @@ const char* CCFileUtils::fullPathFromRelativePath(const char *pszRelativePath) pRet->m_sString.swap(hiRes); } } -#endif + return pRet->m_sString.c_str(); }