Merge pull request #3276 from dumganhar/constants-refactor

Enumeration refactoring
This commit is contained in:
James Chen 2013-07-26 05:36:16 -07:00
commit a73a4b9837
42 changed files with 330 additions and 255 deletions

View File

@ -93,8 +93,8 @@ const int kCCVertexAttribFlag_Color = GL::VERTEX_ATTRIB_FLAG_COLOR;
const int kCCVertexAttribFlag_TexCoords = GL::VERTEX_ATTRIB_FLAG_TEX_COORDS; const int kCCVertexAttribFlag_TexCoords = GL::VERTEX_ATTRIB_FLAG_TEX_COORDS;
const int kCCVertexAttribFlag_PosColorTex = GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX; const int kCCVertexAttribFlag_PosColorTex = GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX;
const int kCCProgressTimerTypeRadial = ProgressTimer::RADIAL; const ProgressTimer::Type kCCProgressTimerTypeRadial = ProgressTimer::Type::RADIAL;
const int kCCProgressTimerTypeBar = ProgressTimer::BAR; const ProgressTimer::Type kCCProgressTimerTypeBar = ProgressTimer::Type::BAR;
const Director::Projection kCCDirectorProjection2D = Director::Projection::_2D; const Director::Projection kCCDirectorProjection2D = Director::Projection::_2D;
const Director::Projection kCCDirectorProjection3D = Director::Projection::_3D; const Director::Projection kCCDirectorProjection3D = Director::Projection::_3D;
@ -161,6 +161,40 @@ const int kCCNodeOnEnterTransitionDidFinish = kNodeOnEnterTransitionDidFinish;
const int kCCNodeOnExitTransitionDidStart = kNodeOnExitTransitionDidStart; const int kCCNodeOnExitTransitionDidStart = kNodeOnExitTransitionDidStart;
const int kCCNodeOnCleanup = kNodeOnCleanup; const int kCCNodeOnCleanup = kNodeOnCleanup;
const LanguageType kLanguageEnglish = LanguageType::ENGLISH;
const LanguageType kLanguageChinese = LanguageType::CHINESE;
const LanguageType kLanguageFrench = LanguageType::FRENCH;
const LanguageType kLanguageItalian = LanguageType::ITALIAN;
const LanguageType kLanguageGerman = LanguageType::GERMAN;
const LanguageType kLanguageSpanish = LanguageType::SPANISH;
const LanguageType kLanguageRussian = LanguageType::RUSSIAN;
const LanguageType kLanguageKorean = LanguageType::KOREAN;
const LanguageType kLanguageJapanese = LanguageType::JAPANESE;
const LanguageType kLanguageHungarian = LanguageType::HUNGARIAN;
const LanguageType kLanguagePortuguese = LanguageType::PORTUGUESE;
const LanguageType kLanguageArabic = LanguageType::ARABIC;
const LanguageType kLanguageNorwegian = LanguageType::NORWEGIAN;
const LanguageType kLanguagePolish = LanguageType::POLISH;
const Application::Platform kTargetWindows = Application::Platform::OS_WINDOWS;
const Application::Platform kTargetLinux = Application::Platform::OS_LINUX;
const Application::Platform kTargetMacOS = Application::Platform::OS_MAC;
const Application::Platform kTargetAndroid = Application::Platform::OS_ANDROID;
const Application::Platform kTargetIphone = Application::Platform::OS_IPHONE;
const Application::Platform kTargetIpad = Application::Platform::OS_IPAD;
const Application::Platform kTargetBlackBerry = Application::Platform::OS_BLACKBERRY;
const Application::Platform kTargetNaCl = Application::Platform::OS_NACL;
const Application::Platform kTargetEmscripten = Application::Platform::OS_EMSCRIPTEN;
const Application::Platform kTargetTizen = Application::Platform::OS_TIZEN;
const ResolutionPolicy kResolutionExactFit = ResolutionPolicy::EXACT_FIT;
const ResolutionPolicy kResolutionNoBorder = ResolutionPolicy::NO_BORDER;
const ResolutionPolicy kResolutionShowAll = ResolutionPolicy::SHOW_ALL;
const ResolutionPolicy kResolutionFixedHeight = ResolutionPolicy::FIXED_HEIGHT;
const ResolutionPolicy kResolutionFixedWidth = ResolutionPolicy::FIXED_WIDTH;
const ResolutionPolicy kResolutionUnKnown = ResolutionPolicy::UNKNOWN;
void ccDrawInit() void ccDrawInit()
{ {

View File

@ -856,9 +856,9 @@ CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_Color;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_TexCoords; CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_TexCoords;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_PosColorTex; CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_PosColorTex;
CC_DEPRECATED_ATTRIBUTE extern const int kCCProgressTimerTypeRadial; CC_DEPRECATED_ATTRIBUTE extern const ProgressTimer::Type kCCProgressTimerTypeRadial;
CC_DEPRECATED_ATTRIBUTE extern const int kCCProgressTimerTypeBar; CC_DEPRECATED_ATTRIBUTE extern const ProgressTimer::Type kCCProgressTimerTypeBar;
CC_DEPRECATED_ATTRIBUTE typedef enum ProgressTimer::Type ProgressTimerType; CC_DEPRECATED_ATTRIBUTE typedef ProgressTimer::Type ProgressTimerType;
CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjection2D; CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjection2D;
CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjection3D; CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjection3D;
@ -937,6 +937,43 @@ CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeOnExitTransitionDidStart;
CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeOnCleanup; CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeOnCleanup;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageEnglish;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageChinese;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageFrench;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageItalian;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageGerman;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageSpanish;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageRussian;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageKorean;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageJapanese;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageHungarian;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguagePortuguese;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageArabic;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguageNorwegian;
CC_DEPRECATED_ATTRIBUTE extern const LanguageType kLanguagePolish;
CC_DEPRECATED_ATTRIBUTE typedef LanguageType ccLanguageType;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetWindows;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetLinux;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetMacOS;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetAndroid;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetIphone;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetIpad;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetBlackBerry;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetNaCl;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetEmscripten;
CC_DEPRECATED_ATTRIBUTE extern const Application::Platform kTargetTizen;
CC_DEPRECATED_ATTRIBUTE typedef Application::Platform TargetPlatform;
CC_DEPRECATED_ATTRIBUTE extern const ResolutionPolicy kResolutionExactFit;
CC_DEPRECATED_ATTRIBUTE extern const ResolutionPolicy kResolutionNoBorder;
CC_DEPRECATED_ATTRIBUTE extern const ResolutionPolicy kResolutionShowAll;
CC_DEPRECATED_ATTRIBUTE extern const ResolutionPolicy kResolutionFixedHeight;
CC_DEPRECATED_ATTRIBUTE extern const ResolutionPolicy kResolutionFixedWidth;
CC_DEPRECATED_ATTRIBUTE extern const ResolutionPolicy kResolutionUnKnown;
#define kCCTMXTileHorizontalFlag kTMXTileHorizontalFlag #define kCCTMXTileHorizontalFlag kTMXTileHorizontalFlag
#define kCCTMXTileVerticalFlag kTMXTileVerticalFlag #define kCCTMXTileVerticalFlag kTMXTileVerticalFlag
#define kCCTMXTileDiagonalFlag kTMXTileDiagonalFlag #define kCCTMXTileDiagonalFlag kTMXTileDiagonalFlag

View File

@ -140,7 +140,7 @@ ProgressTimer* TransitionProgressRadialCCW::progressTimerNodeWithRenderTexture(R
// but it is flipped upside down so we flip the sprite // but it is flipped upside down so we flip the sprite
pNode->getSprite()->setFlipY(true); pNode->getSprite()->setFlipY(true);
pNode->setType(ProgressTimer::RADIAL); pNode->setType(ProgressTimer::Type::RADIAL);
// Return the radial type that we want to use // Return the radial type that we want to use
pNode->setReverseDirection(false); pNode->setReverseDirection(false);
@ -184,7 +184,7 @@ ProgressTimer* TransitionProgressRadialCW::progressTimerNodeWithRenderTexture(Re
// but it is flipped upside down so we flip the sprite // but it is flipped upside down so we flip the sprite
pNode->getSprite()->setFlipY(true); pNode->getSprite()->setFlipY(true);
pNode->setType( ProgressTimer::RADIAL ); pNode->setType( ProgressTimer::Type::RADIAL );
// Return the radial type that we want to use // Return the radial type that we want to use
pNode->setReverseDirection(true); pNode->setReverseDirection(true);
@ -216,7 +216,7 @@ ProgressTimer* TransitionProgressHorizontal::progressTimerNodeWithRenderTexture(
// but it is flipped upside down so we flip the sprite // but it is flipped upside down so we flip the sprite
pNode->getSprite()->setFlipY(true); pNode->getSprite()->setFlipY(true);
pNode->setType( ProgressTimer::BAR); pNode->setType( ProgressTimer::Type::BAR);
pNode->setMidpoint(Point(1, 0)); pNode->setMidpoint(Point(1, 0));
pNode->setBarChangeRate(Point(1,0)); pNode->setBarChangeRate(Point(1,0));
@ -249,7 +249,7 @@ ProgressTimer* TransitionProgressVertical::progressTimerNodeWithRenderTexture(Re
// but it is flipped upside down so we flip the sprite // but it is flipped upside down so we flip the sprite
pNode->getSprite()->setFlipY(true); pNode->getSprite()->setFlipY(true);
pNode->setType(ProgressTimer::BAR); pNode->setType(ProgressTimer::Type::BAR);
pNode->setMidpoint(Point(0, 0)); pNode->setMidpoint(Point(0, 0));
pNode->setBarChangeRate(Point(0,1)); pNode->setBarChangeRate(Point(0,1));
@ -295,7 +295,7 @@ ProgressTimer* TransitionProgressInOut::progressTimerNodeWithRenderTexture(Rende
// but it is flipped upside down so we flip the sprite // but it is flipped upside down so we flip the sprite
pNode->getSprite()->setFlipY(true); pNode->getSprite()->setFlipY(true);
pNode->setType( ProgressTimer::BAR); pNode->setType( ProgressTimer::Type::BAR);
pNode->setMidpoint(Point(0.5f, 0.5f)); pNode->setMidpoint(Point(0.5f, 0.5f));
pNode->setBarChangeRate(Point(1, 1)); pNode->setBarChangeRate(Point(1, 1));
@ -329,7 +329,7 @@ ProgressTimer* TransitionProgressOutIn::progressTimerNodeWithRenderTexture(Rende
// but it is flipped upside down so we flip the sprite // but it is flipped upside down so we flip the sprite
pNode->getSprite()->setFlipY(true); pNode->getSprite()->setFlipY(true);
pNode->setType( ProgressTimer::BAR ); pNode->setType( ProgressTimer::Type::BAR );
pNode->setMidpoint(Point(0.5f, 0.5f)); pNode->setMidpoint(Point(0.5f, 0.5f));
pNode->setBarChangeRate(Point(1, 1)); pNode->setBarChangeRate(Point(1, 1));

View File

@ -45,7 +45,7 @@ const char kProgressTextureCoords = 0x4b;
ProgressTimer::ProgressTimer() ProgressTimer::ProgressTimer()
:_type(RADIAL) :_type(Type::RADIAL)
,_percentage(0.0f) ,_percentage(0.0f)
,_sprite(NULL) ,_sprite(NULL)
,_vertexDataCount(0) ,_vertexDataCount(0)
@ -78,7 +78,7 @@ bool ProgressTimer::initWithSprite(Sprite* sp)
_vertexDataCount = 0; _vertexDataCount = 0;
setAnchorPoint(Point(0.5f,0.5f)); setAnchorPoint(Point(0.5f,0.5f));
_type = RADIAL; _type = Type::RADIAL;
_reverseDirection = false; _reverseDirection = false;
setMidpoint(Point(0.5f, 0.5f)); setMidpoint(Point(0.5f, 0.5f));
setBarChangeRate(Point(1,1)); setBarChangeRate(Point(1,1));
@ -225,10 +225,10 @@ void ProgressTimer::updateProgress(void)
{ {
switch (_type) switch (_type)
{ {
case RADIAL: case Type::RADIAL:
updateRadial(); updateRadial();
break; break;
case BAR: case Type::BAR:
updateBar(); updateBar();
break; break;
default: default:
@ -527,11 +527,11 @@ void ProgressTimer::draw(void)
glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(_vertexData[0]), &_vertexData[0].colors); glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(_vertexData[0]), &_vertexData[0].colors);
#endif // EMSCRIPTEN #endif // EMSCRIPTEN
if(_type == RADIAL) if(_type == Type::RADIAL)
{ {
glDrawArrays(GL_TRIANGLE_FAN, 0, _vertexDataCount); glDrawArrays(GL_TRIANGLE_FAN, 0, _vertexDataCount);
} }
else if (_type == BAR) else if (_type == Type::BAR)
{ {
if (!_reverseDirection) if (!_reverseDirection)
{ {

View File

@ -52,7 +52,7 @@ public:
/** Types of progress /** Types of progress
@since v0.99.1 @since v0.99.1
*/ */
enum Type enum class Type
{ {
/// Radial Counter-Clockwise /// Radial Counter-Clockwise
RADIAL, RADIAL,

View File

@ -3,20 +3,6 @@
NS_CC_BEGIN NS_CC_BEGIN
enum TargetPlatform
{
kTargetWindows,
kTargetLinux,
kTargetMacOS,
kTargetAndroid,
kTargetIphone,
kTargetIpad,
kTargetBlackBerry,
kTargetNaCl,
kTargetEmscripten,
kTargetTizen
};
/** /**
* @addtogroup platform * @addtogroup platform
* @{ * @{
@ -26,6 +12,23 @@ class CC_DLL ApplicationProtocol
{ {
public: public:
// Since WINDOWS and ANDROID are defined as macros, we could not just use these keywords in enumeration(Platform).
// Therefore, 'OS_' prefix is added to avoid conflicts with the definitions of system macros.
enum class Platform
{
OS_WINDOWS,
OS_LINUX,
OS_MAC,
OS_ANDROID,
OS_IPHONE,
OS_IPAD,
OS_BLACKBERRY,
OS_NACL,
OS_EMSCRIPTEN,
OS_TIZEN
};
virtual ~ApplicationProtocol() {} virtual ~ApplicationProtocol() {}
/** /**
@ -57,12 +60,12 @@ public:
@brief Get current language config @brief Get current language config
@return Current language config @return Current language config
*/ */
virtual ccLanguageType getCurrentLanguage() = 0; virtual LanguageType getCurrentLanguage() = 0;
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform() = 0; virtual Platform getTargetPlatform() = 0;
}; };
// end of platform group // end of platform group

View File

@ -55,25 +55,25 @@ void CC_DLL MessageBox(const char * pszMsg, const char * pszTitle);
/** /**
@brief Enum the language type supported now @brief Enum the language type supported now
*/ */
typedef enum LanguageType enum class LanguageType
{ {
kLanguageEnglish = 0, ENGLISH = 0,
kLanguageChinese, CHINESE,
kLanguageFrench, FRENCH,
kLanguageItalian, ITALIAN,
kLanguageGerman, GERMAN,
kLanguageSpanish, SPANISH,
kLanguageRussian, RUSSIAN,
kLanguageKorean, KOREAN,
kLanguageJapanese, JAPANESE,
kLanguageHungarian, HUNGARIAN,
kLanguagePortuguese, PORTUGUESE,
kLanguageArabic, ARABIC,
kLanguageNorwegian, NORWEGIAN,
kLanguagePolish POLISH
} ccLanguageType; };
// end of platform group // END of platform group
/// @} /// @}
NS_CC_END NS_CC_END

View File

@ -46,7 +46,7 @@ EGLViewProtocol::EGLViewProtocol()
: _delegate(NULL) : _delegate(NULL)
, _scaleX(1.0f) , _scaleX(1.0f)
, _scaleY(1.0f) , _scaleY(1.0f)
, _resolutionPolicy(kResolutionUnKnown) , _resolutionPolicy(ResolutionPolicy::UNKNOWN)
{ {
} }
@ -57,7 +57,7 @@ EGLViewProtocol::~EGLViewProtocol()
void EGLViewProtocol::setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy) void EGLViewProtocol::setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy)
{ {
CCASSERT(resolutionPolicy != kResolutionUnKnown, "should set resolutionPolicy"); CCASSERT(resolutionPolicy != ResolutionPolicy::UNKNOWN, "should set resolutionPolicy");
if (width == 0.0f || height == 0.0f) if (width == 0.0f || height == 0.0f)
{ {
@ -69,22 +69,22 @@ void EGLViewProtocol::setDesignResolutionSize(float width, float height, Resolut
_scaleX = (float)_screenSize.width / _designResolutionSize.width; _scaleX = (float)_screenSize.width / _designResolutionSize.width;
_scaleY = (float)_screenSize.height / _designResolutionSize.height; _scaleY = (float)_screenSize.height / _designResolutionSize.height;
if (resolutionPolicy == kResolutionNoBorder) if (resolutionPolicy == ResolutionPolicy::NO_BORDER)
{ {
_scaleX = _scaleY = MAX(_scaleX, _scaleY); _scaleX = _scaleY = MAX(_scaleX, _scaleY);
} }
if (resolutionPolicy == kResolutionShowAll) if (resolutionPolicy == ResolutionPolicy::SHOW_ALL)
{ {
_scaleX = _scaleY = MIN(_scaleX, _scaleY); _scaleX = _scaleY = MIN(_scaleX, _scaleY);
} }
if ( resolutionPolicy == kResolutionFixedHeight) { if ( resolutionPolicy == ResolutionPolicy::FIXED_HEIGHT) {
_scaleX = _scaleY; _scaleX = _scaleY;
_designResolutionSize.width = ceilf(_screenSize.width/_scaleX); _designResolutionSize.width = ceilf(_screenSize.width/_scaleX);
} }
if ( resolutionPolicy == kResolutionFixedWidth) { if ( resolutionPolicy == ResolutionPolicy::FIXED_WIDTH) {
_scaleY = _scaleX; _scaleY = _scaleX;
_designResolutionSize.height = ceilf(_screenSize.height/_scaleY); _designResolutionSize.height = ceilf(_screenSize.height/_scaleY);
} }
@ -120,7 +120,7 @@ void EGLViewProtocol::setFrameSize(float width, float height)
Size EGLViewProtocol::getVisibleSize() const Size EGLViewProtocol::getVisibleSize() const
{ {
if (_resolutionPolicy == kResolutionNoBorder) if (_resolutionPolicy == ResolutionPolicy::NO_BORDER)
{ {
return Size(_screenSize.width/_scaleX, _screenSize.height/_scaleY); return Size(_screenSize.width/_scaleX, _screenSize.height/_scaleY);
} }
@ -132,7 +132,7 @@ Size EGLViewProtocol::getVisibleSize() const
Point EGLViewProtocol::getVisibleOrigin() const Point EGLViewProtocol::getVisibleOrigin() const
{ {
if (_resolutionPolicy == kResolutionNoBorder) if (_resolutionPolicy == ResolutionPolicy::NO_BORDER)
{ {
return Point((_designResolutionSize.width - _screenSize.width/_scaleX)/2, return Point((_designResolutionSize.width - _screenSize.width/_scaleX)/2,
(_designResolutionSize.height - _screenSize.height/_scaleY)/2); (_designResolutionSize.height - _screenSize.height/_scaleY)/2);

View File

@ -3,29 +3,29 @@
#include "ccTypes.h" #include "ccTypes.h"
enum ResolutionPolicy enum class ResolutionPolicy
{ {
// The entire application is visible in the specified area without trying to preserve the original aspect ratio. // The entire application is visible in the specified area without trying to preserve the original aspect ratio.
// Distortion can occur, and the application may appear stretched or compressed. // Distortion can occur, and the application may appear stretched or compressed.
kResolutionExactFit, EXACT_FIT,
// The entire application fills the specified area, without distortion but possibly with some cropping, // The entire application fills the specified area, without distortion but possibly with some cropping,
// while maintaining the original aspect ratio of the application. // while maintaining the original aspect ratio of the application.
kResolutionNoBorder, NO_BORDER,
// The entire application is visible in the specified area without distortion while maintaining the original // The entire application is visible in the specified area without distortion while maintaining the original
// aspect ratio of the application. Borders can appear on two sides of the application. // aspect ratio of the application. Borders can appear on two sides of the application.
kResolutionShowAll, SHOW_ALL,
// The application takes the height of the design resolution size and modifies the width of the internal // The application takes the height of the design resolution size and modifies the width of the internal
// canvas so that it fits the aspect ratio of the device // canvas so that it fits the aspect ratio of the device
// no distortion will occur however you must make sure your application works on different // no distortion will occur however you must make sure your application works on different
// aspect ratios // aspect ratios
kResolutionFixedHeight, FIXED_HEIGHT,
// The application takes the width of the design resolution size and modifies the height of the internal // The application takes the width of the design resolution size and modifies the height of the internal
// canvas so that it fits the aspect ratio of the device // canvas so that it fits the aspect ratio of the device
// no distortion will occur however you must make sure your application works on different // no distortion will occur however you must make sure your application works on different
// aspect ratios // aspect ratios
kResolutionFixedWidth, FIXED_WIDTH,
kResolutionUnKnown, UNKNOWN,
}; };
NS_CC_BEGIN NS_CC_BEGIN
@ -84,9 +84,9 @@ public:
* @param width Design resolution width. * @param width Design resolution width.
* @param height Design resolution height. * @param height Design resolution height.
* @param resolutionPolicy The resolution policy desired, you may choose: * @param resolutionPolicy The resolution policy desired, you may choose:
* [1] kResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched. * [1] EXACT_FIT Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.
* [2] kResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut. * [2] NO_BORDER Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.
* [3] kResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown. * [3] SHOW_ALL Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
*/ */
virtual void setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy); virtual void setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy);

View File

@ -67,74 +67,74 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
std::string languageName = getCurrentLanguageJNI(); std::string languageName = getCurrentLanguageJNI();
const char* pLanguageName = languageName.c_str(); const char* pLanguageName = languageName.c_str();
ccLanguageType ret = kLanguageEnglish; LanguageType ret = LanguageType::ENGLISH;
if (0 == strcmp("zh", pLanguageName)) if (0 == strcmp("zh", pLanguageName))
{ {
ret = kLanguageChinese; ret = LanguageType::CHINESE;
} }
else if (0 == strcmp("en", pLanguageName)) else if (0 == strcmp("en", pLanguageName))
{ {
ret = kLanguageEnglish; ret = LanguageType::ENGLISH;
} }
else if (0 == strcmp("fr", pLanguageName)) else if (0 == strcmp("fr", pLanguageName))
{ {
ret = kLanguageFrench; ret = LanguageType::FRENCH;
} }
else if (0 == strcmp("it", pLanguageName)) else if (0 == strcmp("it", pLanguageName))
{ {
ret = kLanguageItalian; ret = LanguageType::ITALIAN;
} }
else if (0 == strcmp("de", pLanguageName)) else if (0 == strcmp("de", pLanguageName))
{ {
ret = kLanguageGerman; ret = LanguageType::GERMAN;
} }
else if (0 == strcmp("es", pLanguageName)) else if (0 == strcmp("es", pLanguageName))
{ {
ret = kLanguageSpanish; ret = LanguageType::SPANISH;
} }
else if (0 == strcmp("ru", pLanguageName)) else if (0 == strcmp("ru", pLanguageName))
{ {
ret = kLanguageRussian; ret = LanguageType::RUSSIAN;
} }
else if (0 == strcmp("ko", pLanguageName)) else if (0 == strcmp("ko", pLanguageName))
{ {
ret = kLanguageKorean; ret = LanguageType::KOREAN;
} }
else if (0 == strcmp("ja", pLanguageName)) else if (0 == strcmp("ja", pLanguageName))
{ {
ret = kLanguageJapanese; ret = LanguageType::JAPANESE;
} }
else if (0 == strcmp("hu", pLanguageName)) else if (0 == strcmp("hu", pLanguageName))
{ {
ret = kLanguageHungarian; ret = LanguageType::HUNGARIAN;
} }
else if (0 == strcmp("pt", pLanguageName)) else if (0 == strcmp("pt", pLanguageName))
{ {
ret = kLanguagePortuguese; ret = LanguageType::PORTUGUESE;
} }
else if (0 == strcmp("ar", pLanguageName)) else if (0 == strcmp("ar", pLanguageName))
{ {
ret = kLanguageArabic; ret = LanguageType::ARABIC;
} }
else if (0 == strcmp("nb", pLanguageName)) else if (0 == strcmp("nb", pLanguageName))
{ {
ret = kLanguageNorwegian; ret = LanguageType::NORWEGIAN;
} }
else if (0 == strcmp("pl", pLanguageName)) else if (0 == strcmp("pl", pLanguageName))
{ {
ret = kLanguagePolish; ret = LanguageType::POLISH;
} }
return ret; return ret;
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
return kTargetAndroid; return Platform::OS_ANDROID;
} }
NS_CC_END NS_CC_END

View File

@ -38,12 +38,12 @@ public:
@brief Get current language config @brief Get current language config
@return Current language config @return Current language config
*/ */
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
protected: protected:
static Application * sm_pSharedApplication; static Application * sm_pSharedApplication;

View File

@ -85,9 +85,9 @@ const std::string& Application::getResourceRootPath(void)
return _resourceRootPath; return _resourceRootPath;
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
return kTargetEmscripten; return Platform::OS_EMSCRIPTEN;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -105,9 +105,9 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
return kLanguageEnglish; return LanguageType::ENGLISH;
} }
NS_CC_END; NS_CC_END;

View File

@ -38,12 +38,12 @@ public:
@brief Get current language config @brief Get current language config
@return Current language config @return Current language config
*/ */
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
/** /**

View File

@ -62,12 +62,12 @@ public:
@brief Get current language config @brief Get current language config
@return Current language config @return Current language config
*/ */
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
protected: protected:
static Application * sm_pSharedApplication; static Application * sm_pSharedApplication;

View File

@ -75,7 +75,7 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
// get the current language and country config // get the current language and country config
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@ -86,63 +86,63 @@ ccLanguageType Application::getCurrentLanguage()
NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage]; NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];
NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode]; NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];
ccLanguageType ret = kLanguageEnglish; LanguageType ret = LanguageType::ENGLISH;
if ([languageCode isEqualToString:@"zh"]) if ([languageCode isEqualToString:@"zh"])
{ {
ret = kLanguageChinese; ret = LanguageType::CHINESE;
} }
else if ([languageCode isEqualToString:@"en"]) else if ([languageCode isEqualToString:@"en"])
{ {
ret = kLanguageEnglish; ret = LanguageType::ENGLISH;
} }
else if ([languageCode isEqualToString:@"fr"]){ else if ([languageCode isEqualToString:@"fr"]){
ret = kLanguageFrench; ret = LanguageType::FRENCH;
} }
else if ([languageCode isEqualToString:@"it"]){ else if ([languageCode isEqualToString:@"it"]){
ret = kLanguageItalian; ret = LanguageType::ITALIAN;
} }
else if ([languageCode isEqualToString:@"de"]){ else if ([languageCode isEqualToString:@"de"]){
ret = kLanguageGerman; ret = LanguageType::GERMAN;
} }
else if ([languageCode isEqualToString:@"es"]){ else if ([languageCode isEqualToString:@"es"]){
ret = kLanguageSpanish; ret = LanguageType::SPANISH;
} }
else if ([languageCode isEqualToString:@"ru"]){ else if ([languageCode isEqualToString:@"ru"]){
ret = kLanguageRussian; ret = LanguageType::RUSSIAN;
} }
else if ([languageCode isEqualToString:@"ko"]){ else if ([languageCode isEqualToString:@"ko"]){
ret = kLanguageKorean; ret = LanguageType::KOREAN;
} }
else if ([languageCode isEqualToString:@"ja"]){ else if ([languageCode isEqualToString:@"ja"]){
ret = kLanguageJapanese; ret = LanguageType::JAPANESE;
} }
else if ([languageCode isEqualToString:@"hu"]){ else if ([languageCode isEqualToString:@"hu"]){
ret = kLanguageHungarian; ret = LanguageType::HUNGARIAN;
} }
else if ([languageCode isEqualToString:@"pt"]){ else if ([languageCode isEqualToString:@"pt"]){
ret = kLanguagePortuguese; ret = LanguageType::PORTUGUESE;
} }
else if ([languageCode isEqualToString:@"ar"]){ else if ([languageCode isEqualToString:@"ar"]){
ret = kLanguageArabic; ret = LanguageType::ARABIC;
} }
else if ([languageCode isEqualToString:@"nb"]){ else if ([languageCode isEqualToString:@"nb"]){
ret = kLanguageNorwegian; ret = LanguageType::NORWEGIAN;
} }
else if ([languageCode isEqualToString:@"pl"]){ else if ([languageCode isEqualToString:@"pl"]){
ret = kLanguagePolish; ret = LanguageType::POLISH;
} }
return ret; return ret;
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) // idiom for iOS <= 3.2, otherwise: [UIDevice userInterfaceIdiom] is faster. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) // idiom for iOS <= 3.2, otherwise: [UIDevice userInterfaceIdiom] is faster.
{ {
return kTargetIpad; return Platform::OS_IPAD;
} }
else else
{ {
return kTargetIphone; return Platform::OS_IPHONE;
} }
} }

View File

@ -48,7 +48,7 @@ bool EGLView::isOpenGLReady()
bool EGLView::setContentScaleFactor(float contentScaleFactor) bool EGLView::setContentScaleFactor(float contentScaleFactor)
{ {
assert(_resolutionPolicy == kResolutionUnKnown); // cannot enable retina mode assert(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode
_scaleX = _scaleY = contentScaleFactor; _scaleX = _scaleY = contentScaleFactor;
[[CCEAGLView sharedEGLView] setNeedsLayout]; [[CCEAGLView sharedEGLView] setNeedsLayout];

View File

@ -84,9 +84,9 @@ const std::string& Application::getResourceRootPath(void)
return _resourceRootPath; return _resourceRootPath;
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
return kTargetLinux; return Platform::OS_LINUX;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -104,75 +104,75 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
char *pLanguageName = getenv("LANG"); char *pLanguageName = getenv("LANG");
ccLanguageType ret = kLanguageEnglish; LanguageType ret = LanguageType::ENGLISH;
if (!pLanguageName) if (!pLanguageName)
{ {
return kLanguageEnglish; return LanguageType::ENGLISH;
} }
strtok(pLanguageName, "_"); strtok(pLanguageName, "_");
if (!pLanguageName) if (!pLanguageName)
{ {
return kLanguageEnglish; return LanguageType::ENGLISH;
} }
if (0 == strcmp("zh", pLanguageName)) if (0 == strcmp("zh", pLanguageName))
{ {
ret = kLanguageChinese; ret = LanguageType::CHINESE;
} }
else if (0 == strcmp("en", pLanguageName)) else if (0 == strcmp("en", pLanguageName))
{ {
ret = kLanguageEnglish; ret = LanguageType::ENGLISH;
} }
else if (0 == strcmp("fr", pLanguageName)) else if (0 == strcmp("fr", pLanguageName))
{ {
ret = kLanguageFrench; ret = LanguageType::FRENCH;
} }
else if (0 == strcmp("it", pLanguageName)) else if (0 == strcmp("it", pLanguageName))
{ {
ret = kLanguageItalian; ret = LanguageType::ITALIAN;
} }
else if (0 == strcmp("de", pLanguageName)) else if (0 == strcmp("de", pLanguageName))
{ {
ret = kLanguageGerman; ret = LanguageType::GERMAN;
} }
else if (0 == strcmp("es", pLanguageName)) else if (0 == strcmp("es", pLanguageName))
{ {
ret = kLanguageSpanish; ret = LanguageType::SPANISH;
} }
else if (0 == strcmp("ru", pLanguageName)) else if (0 == strcmp("ru", pLanguageName))
{ {
ret = kLanguageRussian; ret = LanguageType::RUSSIAN;
} }
else if (0 == strcmp("ko", pLanguageName)) else if (0 == strcmp("ko", pLanguageName))
{ {
ret = kLanguageKorean; ret = LanguageType::KOREAN;
} }
else if (0 == strcmp("ja", pLanguageName)) else if (0 == strcmp("ja", pLanguageName))
{ {
ret = kLanguageJapanese; ret = LanguageType::JAPANESE;
} }
else if (0 == strcmp("hu", pLanguageName)) else if (0 == strcmp("hu", pLanguageName))
{ {
ret = kLanguageHungarian; ret = LanguageType::HUNGARIAN;
} }
else if (0 == strcmp("pt", pLanguageName)) else if (0 == strcmp("pt", pLanguageName))
{ {
ret = kLanguagePortuguese; ret = LanguageType::PORTUGUESE;
} }
else if (0 == strcmp("ar", pLanguageName)) else if (0 == strcmp("ar", pLanguageName))
{ {
ret = kLanguageArabic; ret = LanguageType::ARABIC;
} }
else if (0 == strcmp("nb", pLanguageName)) else if (0 == strcmp("nb", pLanguageName))
{ {
ret = kLanguageNorwegian; ret = LanguageType::NORWEGIAN;
} }
else if (0 == strcmp("pl", pLanguageName)) else if (0 == strcmp("pl", pLanguageName))
{ {
ret = kLanguagePolish; ret = LanguageType::POLISH;
} }
return ret; return ret;

View File

@ -42,7 +42,7 @@ public:
CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();
/* override functions */ /* override functions */
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
* Sets the Resource root path. * Sets the Resource root path.
@ -59,7 +59,7 @@ public:
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
protected: protected:
long _animationInterval; //micro second long _animationInterval; //micro second
std::string _resourceRootPath; std::string _resourceRootPath;

View File

@ -65,12 +65,12 @@ public:
@brief Get current language config @brief Get current language config
@return Current language config @return Current language config
*/ */
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
/** /**
* Sets the Resource root path. * Sets the Resource root path.

View File

@ -60,9 +60,9 @@ void Application::setAnimationInterval(double interval)
[[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ]; [[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ];
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
return kTargetMacOS; return Platform::OS_MAC;
} }
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
@ -81,7 +81,7 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
// get the current language and country config // get the current language and country config
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@ -92,52 +92,52 @@ ccLanguageType Application::getCurrentLanguage()
NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage]; NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];
NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode]; NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];
ccLanguageType ret = kLanguageEnglish; LanguageType ret = LanguageType::ENGLISH;
if ([languageCode isEqualToString:@"zh"]) if ([languageCode isEqualToString:@"zh"])
{ {
ret = kLanguageChinese; ret = LanguageType::CHINESE;
} }
else if ([languageCode isEqualToString:@"en"]) else if ([languageCode isEqualToString:@"en"])
{ {
ret = kLanguageEnglish; ret = LanguageType::ENGLISH;;
} }
else if ([languageCode isEqualToString:@"fr"]){ else if ([languageCode isEqualToString:@"fr"]){
ret = kLanguageFrench; ret = LanguageType::FRENCH;
} }
else if ([languageCode isEqualToString:@"it"]){ else if ([languageCode isEqualToString:@"it"]){
ret = kLanguageItalian; ret = LanguageType::ITALIAN;
} }
else if ([languageCode isEqualToString:@"de"]){ else if ([languageCode isEqualToString:@"de"]){
ret = kLanguageGerman; ret = LanguageType::GERMAN;
} }
else if ([languageCode isEqualToString:@"es"]){ else if ([languageCode isEqualToString:@"es"]){
ret = kLanguageSpanish; ret = LanguageType::SPANISH;
} }
else if ([languageCode isEqualToString:@"ru"]){ else if ([languageCode isEqualToString:@"ru"]){
ret = kLanguageRussian; ret = LanguageType::RUSSIAN;
} }
else if ([languageCode isEqualToString:@"ko"]){ else if ([languageCode isEqualToString:@"ko"]){
ret = kLanguageKorean; ret = LanguageType::KOREAN;
} }
else if ([languageCode isEqualToString:@"ja"]){ else if ([languageCode isEqualToString:@"ja"]){
ret = kLanguageJapanese; ret = LanguageType::JAPANESE;
} }
else if ([languageCode isEqualToString:@"hu"]){ else if ([languageCode isEqualToString:@"hu"]){
ret = kLanguageHungarian; ret = LanguageType::HUNGARIAN;
} }
else if ([languageCode isEqualToString:@"pt"]) else if ([languageCode isEqualToString:@"pt"])
{ {
ret = kLanguagePortuguese; ret = LanguageType::PORTUGUESE;
} }
else if ([languageCode isEqualToString:@"ar"]) else if ([languageCode isEqualToString:@"ar"])
{ {
ret = kLanguageArabic; ret = LanguageType::ARABIC;
} }
else if ([languageCode isEqualToString:@"nb"]){ else if ([languageCode isEqualToString:@"nb"]){
ret = kLanguageNorwegian; ret = LanguageType::NORWEGIAN;
} }
else if ([languageCode isEqualToString:@"pl"]){ else if ([languageCode isEqualToString:@"pl"]){
ret = kLanguagePolish; ret = LanguageType::POLISH;
} }
return ret; return ret;
} }

View File

@ -90,9 +90,9 @@ void Application::setAnimationInterval(double interval)
_animationInterval = interval * 1000.0f; _animationInterval = interval * 1000.0f;
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
return kTargetNaCl; return Platform::OS_NACL;
} }
Application* Application::getInstance() Application* Application::getInstance()
@ -107,9 +107,9 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
ccLanguageType ret = kLanguageEnglish; LanguageType ret = LanguageType::ENGLISH;
return ret; return ret;
} }

View File

@ -58,12 +58,12 @@ public:
CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();
/* override functions */ /* override functions */
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
static bool isRunning() { return s_running; } static bool isRunning() { return s_running; }
protected: protected:

View File

@ -84,12 +84,12 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
result r = E_SUCCESS; result r = E_SUCCESS;
int index = 0; int index = 0;
Tizen::Base::String localelanguageCode, languageCode; Tizen::Base::String localelanguageCode, languageCode;
ccLanguageType ret = kLanguageEnglish; LanguageType ret = LanguageType::ENGLISH;
r = SettingInfo::GetValue(L"http://tizen.org/setting/locale.language", localelanguageCode); r = SettingInfo::GetValue(L"http://tizen.org/setting/locale.language", localelanguageCode);
TryLog(!IsFailed(r), "[%s] Cannot get the current language setting", GetErrorMessage(r)); TryLog(!IsFailed(r), "[%s] Cannot get the current language setting", GetErrorMessage(r));
@ -98,66 +98,66 @@ ccLanguageType Application::getCurrentLanguage()
if (0 == languageCode.CompareTo(L"zho")) if (0 == languageCode.CompareTo(L"zho"))
{ {
ret = kLanguageChinese; ret = LanguageType::CHINESE;
} }
else if (0 == languageCode.CompareTo(L"eng")) else if (0 == languageCode.CompareTo(L"eng"))
{ {
ret = kLanguageEnglish; ret = LanguageType::ENGLISH;
} }
else if (0 == languageCode.CompareTo(L"fre")) else if (0 == languageCode.CompareTo(L"fre"))
{ {
ret = kLanguageFrench; ret = LanguageType::FRENCH;
} }
else if (0 == languageCode.CompareTo(L"ita")) else if (0 == languageCode.CompareTo(L"ita"))
{ {
ret = kLanguageItalian; ret = LanguageType::ITALIAN;
} }
else if (0 == languageCode.CompareTo(L"deu")) else if (0 == languageCode.CompareTo(L"deu"))
{ {
ret = kLanguageGerman; ret = LanguageType::GERMAN;
} }
else if (0 == languageCode.CompareTo(L"spa")) else if (0 == languageCode.CompareTo(L"spa"))
{ {
ret = kLanguageSpanish; ret = LanguageType::SPANISH;
} }
else if (0 == languageCode.CompareTo(L"rus")) else if (0 == languageCode.CompareTo(L"rus"))
{ {
ret = kLanguageRussian; ret = LanguageType::RUSSIAN;
} }
else if (0 == languageCode.CompareTo(L"kor")) else if (0 == languageCode.CompareTo(L"kor"))
{ {
ret = kLanguageKorean; ret = LanguageType::KOREAN;
} }
else if (0 == languageCode.CompareTo(L"jpn")) else if (0 == languageCode.CompareTo(L"jpn"))
{ {
ret = kLanguageJapanese; ret = LanguageType::JAPANESE;
} }
else if (0 == languageCode.CompareTo(L"hun")) else if (0 == languageCode.CompareTo(L"hun"))
{ {
ret = kLanguageHungarian; ret = LanguageType::HUNGARIAN;
} }
else if (0 == languageCode.CompareTo(L"por")) else if (0 == languageCode.CompareTo(L"por"))
{ {
ret = kLanguagePortuguese; ret = LanguageType::PORTUGUESE;
} }
else if (0 == languageCode.CompareTo(L"ara")) else if (0 == languageCode.CompareTo(L"ara"))
{ {
ret = kLanguageArabic; ret = LanguageType::ARABIC;
} }
else if (0 == languageCode.CompareTo(L"nor")) else if (0 == languageCode.CompareTo(L"nor"))
{ {
ret = kLanguageNorwegian; ret = LanguageType::NORWEGIAN;
} }
else if (0 == languageCode.CompareTo(L"pol")) else if (0 == languageCode.CompareTo(L"pol"))
{ {
ret = kLanguagePolish; ret = LanguageType::POLISH;
} }
return ret; return ret;
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
return kTargetTizen; return Platform::OS_TIZEN;
} }
NS_CC_END NS_CC_END

View File

@ -66,12 +66,12 @@ public:
@brief Get current language config @brief Get current language config
@return Current language config @return Current language config
*/ */
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
protected: protected:
static Application * sm_pSharedApplication; static Application * sm_pSharedApplication;

View File

@ -112,9 +112,9 @@ Application* Application::sharedApplication()
return Application::getInstance(); return Application::getInstance();
} }
ccLanguageType Application::getCurrentLanguage() LanguageType Application::getCurrentLanguage()
{ {
ccLanguageType ret = kLanguageEnglish; LanguageType ret = LanguageType::ENGLISH;
LCID localeID = GetUserDefaultLCID(); LCID localeID = GetUserDefaultLCID();
unsigned short primaryLanguageID = localeID & 0xFF; unsigned short primaryLanguageID = localeID & 0xFF;
@ -122,55 +122,55 @@ ccLanguageType Application::getCurrentLanguage()
switch (primaryLanguageID) switch (primaryLanguageID)
{ {
case LANG_CHINESE: case LANG_CHINESE:
ret = kLanguageChinese; ret = LanguageType::CHINESE;
break; break;
case LANG_ENGLISH: case LANG_ENGLISH:
ret = kLanguageEnglish; ret = LanguageType::ENGLISH;
break; break;
case LANG_FRENCH: case LANG_FRENCH:
ret = kLanguageFrench; ret = LanguageType::FRENCH;
break; break;
case LANG_ITALIAN: case LANG_ITALIAN:
ret = kLanguageItalian; ret = LanguageType::ITALIAN;
break; break;
case LANG_GERMAN: case LANG_GERMAN:
ret = kLanguageGerman; ret = LanguageType::GERMAN;
break; break;
case LANG_SPANISH: case LANG_SPANISH:
ret = kLanguageSpanish; ret = LanguageType::SPANISH;
break; break;
case LANG_RUSSIAN: case LANG_RUSSIAN:
ret = kLanguageRussian; ret = LanguageType::RUSSIAN;
break; break;
case LANG_KOREAN: case LANG_KOREAN:
ret = kLanguageKorean; ret = LanguageType::KOREAN;
break; break;
case LANG_JAPANESE: case LANG_JAPANESE:
ret = kLanguageJapanese; ret = LanguageType::JAPANESE;
break; break;
case LANG_HUNGARIAN: case LANG_HUNGARIAN:
ret = kLanguageHungarian; ret = LanguageType::HUNGARIAN;
break; break;
case LANG_PORTUGUESE: case LANG_PORTUGUESE:
ret = kLanguagePortuguese; ret = LanguageType::PORTUGUESE;
break; break;
case LANG_ARABIC: case LANG_ARABIC:
ret = kLanguageArabic; ret = LanguageType::ARABIC;
break; break;
case LANG_NORWEGIAN: case LANG_NORWEGIAN:
ret = kLanguageNorwegian; ret = LanguageType::NORWEGIAN;
break; break;
case LANG_POLISH: case LANG_POLISH:
ret = kLanguagePolish; ret = LanguageType::POLISH;
break; break;
} }
return ret; return ret;
} }
TargetPlatform Application::getTargetPlatform() Application::Platform Application::getTargetPlatform()
{ {
return kTargetWindows; return Platform::OS_WINDOWS;
} }
void Application::setResourceRootPath(const std::string& rootResDir) void Application::setResourceRootPath(const std::string& rootResDir)

View File

@ -32,12 +32,12 @@ public:
/* override functions */ /* override functions */
virtual void setAnimationInterval(double interval); virtual void setAnimationInterval(double interval);
virtual ccLanguageType getCurrentLanguage(); virtual LanguageType getCurrentLanguage();
/** /**
@brief Get target platform @brief Get target platform
*/ */
virtual TargetPlatform getTargetPlatform(); virtual Platform getTargetPlatform();
/** /**
* Sets the Resource root path. * Sets the Resource root path.

View File

@ -18,7 +18,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
pDirector->setOpenGLView(pEGLView); pDirector->setOpenGLView(pEGLView);
pEGLView->setDesignResolutionSize(960.0f, 640.0f, kResolutionNoBorder); pEGLView->setDesignResolutionSize(960.0f, 640.0f, ResolutionPolicy::NO_BORDER);
// turn on display FPS // turn on display FPS
pDirector->setDisplayStats(true); pDirector->setDisplayStats(true);

View File

@ -225,7 +225,7 @@ void TestAnalytics::eventMenuCallback(Object* pSender)
void TestAnalytics::loadPlugins() void TestAnalytics::loadPlugins()
{ {
ccLanguageType langType = Application::getInstance()->getCurrentLanguage(); LanguageType langType = Application::getInstance()->getCurrentLanguage();
std::string umengKey = ""; std::string umengKey = "";
std::string flurryKey = ""; std::string flurryKey = "";
@ -240,7 +240,7 @@ void TestAnalytics::loadPlugins()
flurryKey = FLURRY_KEY_ANDROID; flurryKey = FLURRY_KEY_ANDROID;
#endif #endif
if (kLanguageChinese == langType) if (LanguageType::CHINESE == langType)
{ {
pluginName = "AnalyticsUmeng"; pluginName = "AnalyticsUmeng";
strAppKey = umengKey; strAppKey = umengKey;

View File

@ -27,7 +27,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
Size size = director->getWinSize(); Size size = director->getWinSize();
// Set the design resolution // Set the design resolution
glView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder); glView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
Size frameSize = glView->getFrameSize(); Size frameSize = glView->getFrameSize();

View File

@ -36,7 +36,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
FileUtils::getInstance()->setSearchPaths(searchPaths); FileUtils::getInstance()->setSearchPaths(searchPaths);
EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);
// turn on display FPS // turn on display FPS
director->setDisplayStats(true); director->setDisplayStats(true);

View File

@ -136,13 +136,13 @@ void SpriteProgressToRadial::onEnter()
ProgressTo *to2 = ProgressTo::create(2, 100); ProgressTo *to2 = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1)); ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType( ProgressTimer::RADIAL ); left->setType( ProgressTimer::Type::RADIAL );
addChild(left); addChild(left);
left->setPosition(Point(100, s.height/2)); left->setPosition(Point(100, s.height/2));
left->runAction( RepeatForever::create(to1)); left->runAction( RepeatForever::create(to1));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathBlock)); ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathBlock));
right->setType(ProgressTimer::RADIAL); right->setType(ProgressTimer::Type::RADIAL);
// Makes the ridial CCW // Makes the ridial CCW
right->setReverseProgress(true); right->setReverseProgress(true);
addChild(right); addChild(right);
@ -171,7 +171,7 @@ void SpriteProgressToHorizontal::onEnter()
ProgressTo *to2 = ProgressTo::create(2, 100); ProgressTo *to2 = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1)); ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType(ProgressTimer::BAR); left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the left since the midpoint is 0 for the x // Setup for a bar starting from the left since the midpoint is 0 for the x
left->setMidpoint(Point(0,0)); left->setMidpoint(Point(0,0));
// Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
@ -181,7 +181,7 @@ void SpriteProgressToHorizontal::onEnter()
left->runAction( RepeatForever::create(to1)); left->runAction( RepeatForever::create(to1));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2)); ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
right->setType(ProgressTimer::BAR); right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the left since the midpoint is 1 for the x // Setup for a bar starting from the left since the midpoint is 1 for the x
right->setMidpoint(Point(1, 0)); right->setMidpoint(Point(1, 0));
// Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
@ -211,7 +211,7 @@ void SpriteProgressToVertical::onEnter()
ProgressTo *to2 = ProgressTo::create(2, 100); ProgressTo *to2 = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1)); ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType(ProgressTimer::BAR); left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0,0)); left->setMidpoint(Point(0,0));
@ -222,7 +222,7 @@ void SpriteProgressToVertical::onEnter()
left->runAction( RepeatForever::create(to1)); left->runAction( RepeatForever::create(to1));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2)); ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
right->setType(ProgressTimer::BAR); right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0, 1)); right->setMidpoint(Point(0, 1));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@ -254,7 +254,7 @@ void SpriteProgressToRadialMidpointChanged::onEnter()
* Our image on the left should be a radial progress indicator, clockwise * Our image on the left should be a radial progress indicator, clockwise
*/ */
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathBlock)); ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathBlock));
left->setType(ProgressTimer::RADIAL); left->setType(ProgressTimer::Type::RADIAL);
addChild(left); addChild(left);
left->setMidpoint(Point(0.25f, 0.75f)); left->setMidpoint(Point(0.25f, 0.75f));
left->setPosition(Point(100, s.height/2)); left->setPosition(Point(100, s.height/2));
@ -264,7 +264,7 @@ void SpriteProgressToRadialMidpointChanged::onEnter()
* Our image on the left should be a radial progress indicator, counter clockwise * Our image on the left should be a radial progress indicator, counter clockwise
*/ */
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathBlock)); ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathBlock));
right->setType(ProgressTimer::RADIAL); right->setType(ProgressTimer::Type::RADIAL);
right->setMidpoint(Point(0.75f, 0.25f)); right->setMidpoint(Point(0.75f, 0.25f));
/** /**
@ -295,7 +295,7 @@ void SpriteProgressBarVarious::onEnter()
ProgressTo *to = ProgressTo::create(2, 100); ProgressTo *to = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1)); ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType(ProgressTimer::BAR); left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0.5f, 0.5f)); left->setMidpoint(Point(0.5f, 0.5f));
@ -306,7 +306,7 @@ void SpriteProgressBarVarious::onEnter()
left->runAction(RepeatForever::create(to->clone())); left->runAction(RepeatForever::create(to->clone()));
ProgressTimer *middle = ProgressTimer::create(Sprite::create(s_pathSister2)); ProgressTimer *middle = ProgressTimer::create(Sprite::create(s_pathSister2));
middle->setType(ProgressTimer::BAR); middle->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
middle->setMidpoint(Point(0.5f, 0.5f)); middle->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@ -316,7 +316,7 @@ void SpriteProgressBarVarious::onEnter()
middle->runAction(RepeatForever::create(to->clone())); middle->runAction(RepeatForever::create(to->clone()));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2)); ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
right->setType(ProgressTimer::BAR); right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0.5f, 0.5f)); right->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@ -352,7 +352,7 @@ void SpriteProgressBarTintAndFade::onEnter()
NULL); NULL);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1)); ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
left->setType(ProgressTimer::BAR); left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0.5f, 0.5f)); left->setMidpoint(Point(0.5f, 0.5f));
@ -366,7 +366,7 @@ void SpriteProgressBarTintAndFade::onEnter()
left->addChild(LabelTTF::create("Tint", "Marker Felt", 20.0f)); left->addChild(LabelTTF::create("Tint", "Marker Felt", 20.0f));
ProgressTimer *middle = ProgressTimer::create(Sprite::create(s_pathSister2)); ProgressTimer *middle = ProgressTimer::create(Sprite::create(s_pathSister2));
middle->setType(ProgressTimer::BAR); middle->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
middle->setMidpoint(Point(0.5f, 0.5f)); middle->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@ -379,7 +379,7 @@ void SpriteProgressBarTintAndFade::onEnter()
middle->addChild(LabelTTF::create("Fade", "Marker Felt", 20.0f)); middle->addChild(LabelTTF::create("Fade", "Marker Felt", 20.0f));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2)); ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
right->setType(ProgressTimer::BAR); right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0.5f, 0.5f)); right->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@ -414,7 +414,7 @@ void SpriteProgressWithSpriteFrame::onEnter()
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist"); SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist");
ProgressTimer *left = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_01.png")); ProgressTimer *left = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_01.png"));
left->setType(ProgressTimer::BAR); left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0.5f, 0.5f)); left->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@ -424,7 +424,7 @@ void SpriteProgressWithSpriteFrame::onEnter()
left->runAction(RepeatForever::create(to->clone())); left->runAction(RepeatForever::create(to->clone()));
ProgressTimer *middle = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_02.png")); ProgressTimer *middle = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_02.png"));
middle->setType(ProgressTimer::BAR); middle->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
middle->setMidpoint(Point(0.5f, 0.5f)); middle->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@ -434,7 +434,7 @@ void SpriteProgressWithSpriteFrame::onEnter()
middle->runAction(RepeatForever::create(to->clone())); middle->runAction(RepeatForever::create(to->clone()));
ProgressTimer *right = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_03.png")); ProgressTimer *right = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_03.png"));
right->setType(ProgressTimer::RADIAL); right->setType(ProgressTimer::Type::RADIAL);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y // Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0.5f, 0.5f)); right->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change

View File

@ -48,7 +48,7 @@ bool AppDelegate::applicationDidFinishLaunching()
director->setContentScaleFactor(resourceSize.height/designSize.height); director->setContentScaleFactor(resourceSize.height/designSize.height);
} }
EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);
auto scene = Scene::create(); auto scene = Scene::create();
auto layer = new TestController(); auto layer = new TestController();

View File

@ -9,49 +9,49 @@ CurrentLanguageTest::CurrentLanguageTest()
LabelTTF *labelLanguage = LabelTTF::create("", "Arial", 20); LabelTTF *labelLanguage = LabelTTF::create("", "Arial", 20);
labelLanguage->setPosition(VisibleRect::center()); labelLanguage->setPosition(VisibleRect::center());
ccLanguageType currentLanguageType = Application::getInstance()->getCurrentLanguage(); LanguageType currentLanguageType = Application::getInstance()->getCurrentLanguage();
switch (currentLanguageType) switch (currentLanguageType)
{ {
case kLanguageEnglish: case LanguageType::ENGLISH:
labelLanguage->setString("current language is English"); labelLanguage->setString("current language is English");
break; break;
case kLanguageChinese: case LanguageType::CHINESE:
labelLanguage->setString("current language is Chinese"); labelLanguage->setString("current language is Chinese");
break; break;
case kLanguageFrench: case LanguageType::FRENCH:
labelLanguage->setString("current language is French"); labelLanguage->setString("current language is French");
break; break;
case kLanguageGerman: case LanguageType::GERMAN:
labelLanguage->setString("current language is German"); labelLanguage->setString("current language is German");
break; break;
case kLanguageItalian: case LanguageType::ITALIAN:
labelLanguage->setString("current language is Italian"); labelLanguage->setString("current language is Italian");
break; break;
case kLanguageRussian: case LanguageType::RUSSIAN:
labelLanguage->setString("current language is Russian"); labelLanguage->setString("current language is Russian");
break; break;
case kLanguageSpanish: case LanguageType::SPANISH:
labelLanguage->setString("current language is Spanish"); labelLanguage->setString("current language is Spanish");
break; break;
case kLanguageKorean: case LanguageType::KOREAN:
labelLanguage->setString("current language is Korean"); labelLanguage->setString("current language is Korean");
break; break;
case kLanguageJapanese: case LanguageType::JAPANESE:
labelLanguage->setString("current language is Japanese"); labelLanguage->setString("current language is Japanese");
break; break;
case kLanguageHungarian: case LanguageType::HUNGARIAN:
labelLanguage->setString("current language is Hungarian"); labelLanguage->setString("current language is Hungarian");
break; break;
case kLanguagePortuguese: case LanguageType::PORTUGUESE:
labelLanguage->setString("current language is Portuguese"); labelLanguage->setString("current language is Portuguese");
break; break;
case kLanguageArabic: case LanguageType::ARABIC:
labelLanguage->setString("current language is Arabic"); labelLanguage->setString("current language is Arabic");
break; break;
case kLanguageNorwegian: case LanguageType::NORWEGIAN:
labelLanguage->setString("current language is Norwegian"); labelLanguage->setString("current language is Norwegian");
break; break;
case kLanguagePolish: case LanguageType::POLISH:
labelLanguage->setString("current language is Polish"); labelLanguage->setString("current language is Polish");
break; break;
} }

View File

@ -109,7 +109,7 @@ bool AppDelegate::applicationDidFinishLaunching()
pDirector->setContentScaleFactor(resourceSize.width/designSize.width); pDirector->setContentScaleFactor(resourceSize.width/designSize.width);
EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);
// turn on display FPS // turn on display FPS
pDirector->setDisplayStats(true); pDirector->setDisplayStats(true);

View File

@ -91,7 +91,7 @@ bool AppDelegate::applicationDidFinishLaunching()
} }
pDirector->setContentScaleFactor(resourceSize.width/designSize.width); pDirector->setContentScaleFactor(resourceSize.width/designSize.width);
EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionShowAll); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL);
// turn on display FPS // turn on display FPS
pDirector->setDisplayStats(true); pDirector->setDisplayStats(true);

View File

@ -32,7 +32,7 @@ bool AppDelegate::applicationDidFinishLaunching()
pDirector->setProjection(Director::Projection::_2D); pDirector->setProjection(Director::Projection::_2D);
// Set the design resolution // Set the design resolution
EGLView::getInstance()->setDesignResolutionSize(320, 480, kResolutionShowAll); EGLView::getInstance()->setDesignResolutionSize(320, 480, ResolutionPolicy::SHOW_ALL);
// turn on display FPS // turn on display FPS
pDirector->setDisplayStats(true); pDirector->setDisplayStats(true);

View File

@ -33,7 +33,7 @@ bool AppDelegate::applicationDidFinishLaunching()
pDirector->setOpenGLView(EGLView::getInstance()); pDirector->setOpenGLView(EGLView::getInstance());
// JS-Test in Html5 uses 800x450 as design resolution // JS-Test in Html5 uses 800x450 as design resolution
EGLView::getInstance()->setDesignResolutionSize(800, 450, kResolutionFixedHeight); EGLView::getInstance()->setDesignResolutionSize(800, 450, ResolutionPolicy::FIXED_HEIGHT);
// turn on display FPS // turn on display FPS
pDirector->setDisplayStats(true); pDirector->setDisplayStats(true);

View File

@ -36,7 +36,7 @@ bool AppDelegate::applicationDidFinishLaunching()
// set FPS. the default value is 1.0/60 if you don't call this // set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60); pDirector->setAnimationInterval(1.0 / 60);
EGLView::getInstance()->setDesignResolutionSize(480, 320, kResolutionFixedHeight); EGLView::getInstance()->setDesignResolutionSize(480, 320, ResolutionPolicy::FIXED_HEIGHT);
ScriptingCore* sc = ScriptingCore::getInstance(); ScriptingCore* sc = ScriptingCore::getInstance();
sc->addRegisterCallback(register_all_cocos2dx); sc->addRegisterCallback(register_all_cocos2dx);

View File

@ -26,7 +26,7 @@ bool AppDelegate::applicationDidFinishLaunching()
Director *pDirector = Director::getInstance(); Director *pDirector = Director::getInstance();
pDirector->setOpenGLView(EGLView::getInstance()); pDirector->setOpenGLView(EGLView::getInstance());
EGLView::getInstance()->setDesignResolutionSize(480, 320, kResolutionNoBorder); EGLView::getInstance()->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER);
// turn on display FPS // turn on display FPS
pDirector->setDisplayStats(true); pDirector->setDisplayStats(true);

View File

@ -44,7 +44,7 @@ bool AppDelegate::applicationDidFinishLaunching()
pDirector->setContentScaleFactor(resourceSize.height/designSize.height); pDirector->setContentScaleFactor(resourceSize.height/designSize.height);
} }
EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionFixedHeight); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::FIXED_HEIGHT);
// register lua engine // register lua engine
LuaEngine* pEngine = LuaEngine::getInstance(); LuaEngine* pEngine = LuaEngine::getInstance();

View File

@ -1 +1 @@
d2e1fc14f4c663f31bc92cb89e099efdbfc986a2 fa9c4583d202c4fd4af5f97259eb3cac2bfbdec1

View File

@ -341,7 +341,8 @@ TOLUA_API int tolua_Cocos2d_open (lua_State* tolua_S);]], [[]])
remove_prefix() remove_prefix()
result = string.gsub(result, "(tolua_tonumber%(tolua_S,%d,)(kCC)", "%1(int)%2") result = string.gsub(result, '(tolua_tonumber%(tolua_S,%d,)(kCC)', '%1(int)%2')
result = string.gsub(result, '(tolua_constant%(tolua_S,"k%w*",)(k)', '%1(int)%2')
result = string.gsub(result, "(self%->setEmitterMode%()", "%1(ParticleSystem::Mode)") result = string.gsub(result, "(self%->setEmitterMode%()", "%1(ParticleSystem::Mode)")