issue #2430: Moved constant to header file to avoid errors in 'switch case', the error is 'case value is not a constant expression'.

Also added more deprecated constants.
This commit is contained in:
James Chen 2013-07-27 00:55:41 +08:00
parent db61ebef0f
commit feadd2b2dd
11 changed files with 217 additions and 362 deletions

View File

@ -47,21 +47,6 @@ const Color3B ccGRAY = Color3B::GRAY;
const BlendFunc kCCBlendFuncDisable = BlendFunc::DISABLE;
const int kCCVertexAttrib_Position = GLProgram::VERTEX_ATTRIB_POSITION;
const int kCCVertexAttrib_Color = GLProgram::VERTEX_ATTRIB_COLOR;
const int kCCVertexAttrib_TexCoords = GLProgram::VERTEX_ATTRIB_TEX_COORDS;
const int kCCVertexAttrib_MAX = GLProgram::VERTEX_ATTRIB_MAX;
const int kCCUniformPMatrix = GLProgram::UNIFORM_P_MATRIX;
const int kCCUniformMVMatrix = GLProgram::UNIFORM_MV_MATRIX;
const int kCCUniformMVPMatrix = GLProgram::UNIFORM_MVP_MATRIX;
const int kCCUniformTime = GLProgram::UNIFORM_TIME;
const int kCCUniformSinTime = GLProgram::UNIFORM_SIN_TIME;
const int kCCUniformCosTime = GLProgram::UNIFORM_COS_TIME;
const int kCCUniformRandom01 = GLProgram::UNIFORM_RANDOM01;
const int kCCUniformSampler = GLProgram::UNIFORM_SAMPLER;
const int kCCUniform_MAX = GLProgram::UNIFORM_MAX;
const char* kCCShader_PositionTextureColor = GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR;
const char* kCCShader_PositionTextureColorAlphaTest = GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST;
const char* kCCShader_PositionColor = GLProgram::SHADER_NAME_POSITION_COLOR;
@ -87,115 +72,6 @@ const char* kCCAttributeNameColor = GLProgram::ATTRIBUTE_NAME_COLOR;
const char* kCCAttributeNamePosition = GLProgram::ATTRIBUTE_NAME_POSITION;
const char* kCCAttributeNameTexCoord = GLProgram::ATTRIBUTE_NAME_TEX_COORD;
const int kCCVertexAttribFlag_None = GL::VERTEX_ATTRIB_FLAT_NONE;
const int kCCVertexAttribFlag_Position = GL::VERTEX_ATTRIB_FLAG_POSITION;
const int kCCVertexAttribFlag_Color = GL::VERTEX_ATTRIB_FLAG_COLOR;
const int kCCVertexAttribFlag_TexCoords = GL::VERTEX_ATTRIB_FLAG_TEX_COORDS;
const int kCCVertexAttribFlag_PosColorTex = GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX;
const ProgressTimer::Type kCCProgressTimerTypeRadial = ProgressTimer::Type::RADIAL;
const ProgressTimer::Type kCCProgressTimerTypeBar = ProgressTimer::Type::BAR;
const Director::Projection kCCDirectorProjection2D = Director::Projection::_2D;
const Director::Projection kCCDirectorProjection3D = Director::Projection::_3D;
const Director::Projection kCCDirectorProjectionCustom = Director::Projection::CUSTOM;
const Director::Projection kCCDirectorProjectionDefault = Director::Projection::DEFAULT;
const int kCCParticleDurationInfinity = ParticleSystem::DURATION_INFINITY;
const int kCCParticleStartSizeEqualToEndSize = ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE;
const int kCCParticleStartRadiusEqualToEndRadius = ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS;
const ParticleSystem::Mode kCCParticleModeGravity = ParticleSystem::Mode::GRAVITY;
const ParticleSystem::Mode kCCParticleModeRadius = ParticleSystem::Mode::RADIUS;
const int kCCParticleDefaultCapacity = kParticleDefaultCapacity;
const ParticleSystem::PositionType kCCPositionTypeFree = ParticleSystem::PositionType::FREE;
const ParticleSystem::PositionType kCCPositionTypeRelative = ParticleSystem::PositionType::RELATIVE;
const ParticleSystem::PositionType kCCPositionTypeGrouped = ParticleSystem::PositionType::GROUPED;
const Label::VAlignment kCCVerticalTextAlignmentTop = Label::VAlignment::TOP;
const Label::VAlignment kCCVerticalTextAlignmentCenter = Label::VAlignment::CENTER;
const Label::VAlignment kCCVerticalTextAlignmentBottom = Label::VAlignment::BOTTOM;
const Label::HAlignment kCCTextAlignmentLeft = Label::HAlignment::LEFT;
const Label::HAlignment kCCTextAlignmentCenter = Label::HAlignment::CENTER;
const Label::HAlignment kCCTextAlignmentRight = Label::HAlignment::RIGHT;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA8888 = Texture2D::PixelFormat::RGBA8888;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB888 = Texture2D::PixelFormat::RGB888;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB565 = Texture2D::PixelFormat::RGB565;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_A8 = Texture2D::PixelFormat::A8;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_I8 = Texture2D::PixelFormat::I8;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_AI88 = Texture2D::PixelFormat::AI88;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA4444 = Texture2D::PixelFormat::RGBA4444;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB5A1 = Texture2D::PixelFormat::RGB5A1;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC4 = Texture2D::PixelFormat::PRVTC4;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC2 = Texture2D::PixelFormat::PRVTC2;
const Texture2D::PixelFormat kCCTexture2DPixelFormat_Default = Texture2D::PixelFormat::DEFAULT;
const int kCCMenuHandlerPriority = Menu::HANDLER_PRIORITY;
const Menu::State kCCMenuStateWaiting = Menu::State::WAITING;
const Menu::State kCCMenuStateTrackingTouch = Menu::State::TRACKING_TOUCH;
const Touch::DispatchMode kCCTouchesOneByOne = Touch::DispatchMode::ONE_BY_ONE;
const Touch::DispatchMode kCCTouchesAllAtOnce = Touch::DispatchMode::ALL_AT_ONCE;
const Image::Format kCCImageFormatPNG = Image::Format::PNG;
const Image::Format kCCImageFormatJPEG = Image::Format::JPG;
const TransitionScene::Orientation kCCTransitionOrientationLeftOver = TransitionScene::Orientation::LEFT_OVER;
const TransitionScene::Orientation kCCTransitionOrientationRightOver = TransitionScene::Orientation::RIGHT_OVER;
const TransitionScene::Orientation kCCTransitionOrientationUpOver = TransitionScene::Orientation::UP_OVER;
const TransitionScene::Orientation kCCTransitionOrientationDownOver = TransitionScene::Orientation::DOWN_OVER;
const int kCCPrioritySystem = Scheduler::PRIORITY_SYSTEM;
const int kCCPriorityNonSystemMin = Scheduler::PRIORITY_NON_SYSTEM_MIN;
const int kCCActionTagInvalid = kActionTagInvalid;
const int kCCNodeTagInvalid = kNodeTagInvalid;
const int kCCNodeOnEnter = kNodeOnEnter;
const int kCCNodeOnExit = kNodeOnExit;
const int kCCNodeOnEnterTransitionDidFinish = kNodeOnEnterTransitionDidFinish;
const int kCCNodeOnExitTransitionDidStart = kNodeOnExitTransitionDidStart;
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()
{
DrawPrimitives::init();

View File

@ -810,20 +810,20 @@ CC_DEPRECATED_ATTRIBUTE typedef ProgressTimer::Type CCProgressTimerType;
CC_DEPRECATED_ATTRIBUTE typedef void* CCZone;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttrib_Position;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttrib_Color;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttrib_TexCoords;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttrib_MAX;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_Position = GLProgram::VERTEX_ATTRIB_POSITION;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_Color = GLProgram::VERTEX_ATTRIB_COLOR;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_TexCoords = GLProgram::VERTEX_ATTRIB_TEX_COORDS;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_MAX = GLProgram::VERTEX_ATTRIB_MAX;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformPMatrix;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformMVMatrix;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformMVPMatrix;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformTime;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformSinTime;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformCosTime;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformRandom01;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniformSampler;
CC_DEPRECATED_ATTRIBUTE extern const int kCCUniform_MAX;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformPMatrix = GLProgram::UNIFORM_P_MATRIX;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformMVMatrix = GLProgram::UNIFORM_MV_MATRIX;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformMVPMatrix = GLProgram::UNIFORM_MVP_MATRIX;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformTime = GLProgram::UNIFORM_TIME;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformSinTime = GLProgram::UNIFORM_SIN_TIME;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformCosTime = GLProgram::UNIFORM_COS_TIME;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformRandom01 = GLProgram::UNIFORM_RANDOM01;
CC_DEPRECATED_ATTRIBUTE const int kCCUniformSampler = GLProgram::UNIFORM_SAMPLER;
CC_DEPRECATED_ATTRIBUTE const int kCCUniform_MAX = GLProgram::UNIFORM_MAX;
CC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTextureColor;
CC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTextureColorAlphaTest;
@ -850,129 +850,138 @@ CC_DEPRECATED_ATTRIBUTE extern const char* kCCAttributeNameColor;
CC_DEPRECATED_ATTRIBUTE extern const char* kCCAttributeNamePosition;
CC_DEPRECATED_ATTRIBUTE extern const char* kCCAttributeNameTexCoord;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_None;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_Position;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_Color;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_TexCoords;
CC_DEPRECATED_ATTRIBUTE extern const int kCCVertexAttribFlag_PosColorTex;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_None = GL::VERTEX_ATTRIB_FLAT_NONE;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_Position = GL::VERTEX_ATTRIB_FLAG_POSITION;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_Color = GL::VERTEX_ATTRIB_FLAG_COLOR;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_TexCoords = GL::VERTEX_ATTRIB_FLAG_TEX_COORDS;
CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_PosColorTex = GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX;
CC_DEPRECATED_ATTRIBUTE extern const ProgressTimer::Type kCCProgressTimerTypeRadial;
CC_DEPRECATED_ATTRIBUTE extern const ProgressTimer::Type kCCProgressTimerTypeBar;
CC_DEPRECATED_ATTRIBUTE const ProgressTimer::Type kCCProgressTimerTypeRadial = ProgressTimer::Type::RADIAL;
CC_DEPRECATED_ATTRIBUTE const ProgressTimer::Type kCCProgressTimerTypeBar = ProgressTimer::Type::BAR;
CC_DEPRECATED_ATTRIBUTE typedef ProgressTimer::Type ProgressTimerType;
CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjection2D;
CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjection3D;
CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjectionCustom;
CC_DEPRECATED_ATTRIBUTE extern const Director::Projection kCCDirectorProjectionDefault;
CC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjection2D = Director::Projection::_2D;
CC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjection3D = Director::Projection::_3D;
CC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjectionCustom = Director::Projection::CUSTOM;
CC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjectionDefault = Director::Projection::DEFAULT;
CC_DEPRECATED_ATTRIBUTE typedef Director::Projection ccDirectorProjection;
CC_DEPRECATED_ATTRIBUTE extern const Label::VAlignment kCCVerticalTextAlignmentTop;
CC_DEPRECATED_ATTRIBUTE extern const Label::VAlignment kCCVerticalTextAlignmentCenter;
CC_DEPRECATED_ATTRIBUTE extern const Label::VAlignment kCCVerticalTextAlignmentBottom;
CC_DEPRECATED_ATTRIBUTE const Label::VAlignment kCCVerticalTextAlignmentTop = Label::VAlignment::TOP;
CC_DEPRECATED_ATTRIBUTE const Label::VAlignment kCCVerticalTextAlignmentCenter = Label::VAlignment::CENTER;
CC_DEPRECATED_ATTRIBUTE const Label::VAlignment kCCVerticalTextAlignmentBottom = Label::VAlignment::BOTTOM;
CC_DEPRECATED_ATTRIBUTE extern const Label::HAlignment kCCTextAlignmentLeft;
CC_DEPRECATED_ATTRIBUTE extern const Label::HAlignment kCCTextAlignmentCenter;
CC_DEPRECATED_ATTRIBUTE extern const Label::HAlignment kCCTextAlignmentRight;
CC_DEPRECATED_ATTRIBUTE const Label::HAlignment kCCTextAlignmentLeft = Label::HAlignment::LEFT;
CC_DEPRECATED_ATTRIBUTE const Label::HAlignment kCCTextAlignmentCenter = Label::HAlignment::CENTER;
CC_DEPRECATED_ATTRIBUTE const Label::HAlignment kCCTextAlignmentRight = Label::HAlignment::RIGHT;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA8888 = Texture2D::PixelFormat::RGBA8888;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB888 = Texture2D::PixelFormat::RGB888;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB565 = Texture2D::PixelFormat::RGB565;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_A8 = Texture2D::PixelFormat::A8;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_I8 = Texture2D::PixelFormat::I8;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_AI88 = Texture2D::PixelFormat::AI88;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA4444 = Texture2D::PixelFormat::RGBA4444;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB5A1 = Texture2D::PixelFormat::RGB5A1;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC4 = Texture2D::PixelFormat::PRVTC4;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC2 = Texture2D::PixelFormat::PRVTC2;
CC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_Default = Texture2D::PixelFormat::DEFAULT;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA8888;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB888;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB565;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_A8;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_I8;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_AI88;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA4444;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB5A1;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC4;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC2;
CC_DEPRECATED_ATTRIBUTE extern const Texture2D::PixelFormat kCCTexture2DPixelFormat_Default;
CC_DEPRECATED_ATTRIBUTE typedef Texture2D::PixelFormat CCTexture2DPixelFormat;
CC_DEPRECATED_ATTRIBUTE const int kCCParticleDurationInfinity = ParticleSystem::DURATION_INFINITY;
CC_DEPRECATED_ATTRIBUTE const int kCCParticleStartSizeEqualToEndSize = ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE;
CC_DEPRECATED_ATTRIBUTE const int kCCParticleStartRadiusEqualToEndRadius = ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS;
CC_DEPRECATED_ATTRIBUTE const int kParticleDurationInfinity = ParticleSystem::DURATION_INFINITY;
CC_DEPRECATED_ATTRIBUTE const int kParticleStartSizeEqualToEndSize = ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE;
CC_DEPRECATED_ATTRIBUTE const int kParticleStartRadiusEqualToEndRadius = ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS;
CC_DEPRECATED_ATTRIBUTE const ParticleSystem::Mode kCCParticleModeGravity = ParticleSystem::Mode::GRAVITY;
CC_DEPRECATED_ATTRIBUTE const ParticleSystem::Mode kCCParticleModeRadius = ParticleSystem::Mode::RADIUS;
CC_DEPRECATED_ATTRIBUTE const int kCCParticleDefaultCapacity = kParticleDefaultCapacity;
CC_DEPRECATED_ATTRIBUTE const ParticleSystem::PositionType kCCPositionTypeFree = ParticleSystem::PositionType::FREE;
CC_DEPRECATED_ATTRIBUTE const ParticleSystem::PositionType kCCPositionTypeRelative = ParticleSystem::PositionType::RELATIVE;
CC_DEPRECATED_ATTRIBUTE const ParticleSystem::PositionType kCCPositionTypeGrouped = ParticleSystem::PositionType::GROUPED;
CC_DEPRECATED_ATTRIBUTE typedef ParticleSystem::PositionType tPositionType;
#define kCCLabelAutomaticWidth kLabelAutomaticWidth
CC_DEPRECATED_ATTRIBUTE extern const int kCCParticleDurationInfinity;
CC_DEPRECATED_ATTRIBUTE extern const int kCCParticleStartSizeEqualToEndSize;
CC_DEPRECATED_ATTRIBUTE extern const int kCCParticleStartRadiusEqualToEndRadius;
CC_DEPRECATED_ATTRIBUTE extern const ParticleSystem::Mode kCCParticleModeGravity;
CC_DEPRECATED_ATTRIBUTE extern const ParticleSystem::Mode kCCParticleModeRadius;
CC_DEPRECATED_ATTRIBUTE const int kCCMenuHandlerPriority = Menu::HANDLER_PRIORITY;
CC_DEPRECATED_ATTRIBUTE const Menu::State kCCMenuStateWaiting = Menu::State::WAITING;
CC_DEPRECATED_ATTRIBUTE const Menu::State kCCMenuStateTrackingTouch = Menu::State::TRACKING_TOUCH;
CC_DEPRECATED_ATTRIBUTE extern const int kCCParticleDefaultCapacity;
CC_DEPRECATED_ATTRIBUTE extern const ParticleSystem::PositionType kCCPositionTypeFree;
CC_DEPRECATED_ATTRIBUTE extern const ParticleSystem::PositionType kCCPositionTypeRelative;
CC_DEPRECATED_ATTRIBUTE extern const ParticleSystem::PositionType kCCPositionTypeGrouped;
CC_DEPRECATED_ATTRIBUTE typedef ParticleSystem::PositionType tPositionType;
CC_DEPRECATED_ATTRIBUTE extern const int kCCMenuHandlerPriority;
CC_DEPRECATED_ATTRIBUTE extern const Menu::State kCCMenuStateWaiting;
CC_DEPRECATED_ATTRIBUTE extern const Menu::State kCCMenuStateTrackingTouch;
CC_DEPRECATED_ATTRIBUTE typedef Menu::State tMenuState;
CC_DEPRECATED_ATTRIBUTE extern const Touch::DispatchMode kCCTouchesOneByOne;
CC_DEPRECATED_ATTRIBUTE extern const Touch::DispatchMode kCCTouchesAllAtOnce;
CC_DEPRECATED_ATTRIBUTE const Touch::DispatchMode kCCTouchesOneByOne = Touch::DispatchMode::ONE_BY_ONE;
CC_DEPRECATED_ATTRIBUTE const Touch::DispatchMode kCCTouchesAllAtOnce = Touch::DispatchMode::ALL_AT_ONCE;
CC_DEPRECATED_ATTRIBUTE typedef Touch::DispatchMode ccTouchesMode;
CC_DEPRECATED_ATTRIBUTE extern const Image::Format kCCImageFormatPNG;
CC_DEPRECATED_ATTRIBUTE extern const Image::Format kCCImageFormatJPEG;
CC_DEPRECATED_ATTRIBUTE const Image::Format kCCImageFormatPNG = Image::Format::PNG;
CC_DEPRECATED_ATTRIBUTE const Image::Format kCCImageFormatJPEG = Image::Format::JPG;
CC_DEPRECATED_ATTRIBUTE typedef Image::Format tImageFormat;
CC_DEPRECATED_ATTRIBUTE extern const TransitionScene::Orientation kCCTransitionOrientationLeftOver;
CC_DEPRECATED_ATTRIBUTE extern const TransitionScene::Orientation kCCTransitionOrientationRightOver;
CC_DEPRECATED_ATTRIBUTE extern const TransitionScene::Orientation kCCTransitionOrientationUpOver;
CC_DEPRECATED_ATTRIBUTE extern const TransitionScene::Orientation kCCTransitionOrientationDownOver;
CC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationLeftOver = TransitionScene::Orientation::LEFT_OVER;
CC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationRightOver = TransitionScene::Orientation::RIGHT_OVER;
CC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationUpOver = TransitionScene::Orientation::UP_OVER;
CC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationDownOver = TransitionScene::Orientation::DOWN_OVER;
CC_DEPRECATED_ATTRIBUTE typedef TransitionScene::Orientation tOrientation;
CC_DEPRECATED_ATTRIBUTE extern const int kCCPrioritySystem;
CC_DEPRECATED_ATTRIBUTE extern const int kCCPriorityNonSystemMin;
CC_DEPRECATED_ATTRIBUTE const int kCCPrioritySystem = Scheduler::PRIORITY_SYSTEM;
CC_DEPRECATED_ATTRIBUTE const int kCCPriorityNonSystemMin = Scheduler::PRIORITY_NON_SYSTEM_MIN;
CC_DEPRECATED_ATTRIBUTE extern const int kCCActionTagInvalid;
CC_DEPRECATED_ATTRIBUTE const int kCCActionTagInvalid = kActionTagInvalid;
CC_DEPRECATED_ATTRIBUTE const int kCCNodeTagInvalid = kNodeTagInvalid;
CC_DEPRECATED_ATTRIBUTE const int kCCNodeOnEnter = kNodeOnEnter;
CC_DEPRECATED_ATTRIBUTE const int kCCNodeOnExit = kNodeOnExit;
CC_DEPRECATED_ATTRIBUTE const int kCCNodeOnEnterTransitionDidFinish = kNodeOnEnterTransitionDidFinish;
CC_DEPRECATED_ATTRIBUTE const int kCCNodeOnExitTransitionDidStart = kNodeOnExitTransitionDidStart;
CC_DEPRECATED_ATTRIBUTE const int kCCNodeOnCleanup = kNodeOnCleanup;
CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeTagInvalid;
CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeOnEnter;
CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeOnExit;
CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeOnEnterTransitionDidFinish;
CC_DEPRECATED_ATTRIBUTE extern const int kCCNodeOnExitTransitionDidStart;
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 const LanguageType kLanguageEnglish = LanguageType::ENGLISH;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageChinese = LanguageType::CHINESE;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageFrench = LanguageType::FRENCH;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageItalian = LanguageType::ITALIAN;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageGerman = LanguageType::GERMAN;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageSpanish = LanguageType::SPANISH;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageRussian = LanguageType::RUSSIAN;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageKorean = LanguageType::KOREAN;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageJapanese = LanguageType::JAPANESE;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageHungarian = LanguageType::HUNGARIAN;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguagePortuguese = LanguageType::PORTUGUESE;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageArabic = LanguageType::ARABIC;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageNorwegian = LanguageType::NORWEGIAN;
CC_DEPRECATED_ATTRIBUTE const LanguageType kLanguagePolish = LanguageType::POLISH;
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 const Application::Platform kTargetWindows = Application::Platform::OS_WINDOWS;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetLinux = Application::Platform::OS_LINUX;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetMacOS = Application::Platform::OS_MAC;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetAndroid = Application::Platform::OS_ANDROID;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetIphone = Application::Platform::OS_IPHONE;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetIpad = Application::Platform::OS_IPAD;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetBlackBerry = Application::Platform::OS_BLACKBERRY;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetNaCl = Application::Platform::OS_NACL;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetEmscripten = Application::Platform::OS_EMSCRIPTEN;
CC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetTizen = Application::Platform::OS_TIZEN;
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;
CC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionExactFit = ResolutionPolicy::EXACT_FIT;
CC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionNoBorder = ResolutionPolicy::NO_BORDER;
CC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionShowAll = ResolutionPolicy::SHOW_ALL;
CC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionFixedHeight = ResolutionPolicy::FIXED_HEIGHT;
CC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionFixedWidth = ResolutionPolicy::FIXED_WIDTH;
CC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionUnKnown = ResolutionPolicy::UNKNOWN;
#define kCCTMXTileHorizontalFlag kTMXTileHorizontalFlag
#define kCCTMXTileVerticalFlag kTMXTileVerticalFlag

View File

@ -139,6 +139,12 @@ public:
*/
friend int assetsManagerProgressFunc(void *, double, double, double, double);
// Backward compatibility
CC_DEPRECATED_ATTRIBUTE static const ErrorCode kCCCreateFile = ErrorCode::CREATE_FILE;
CC_DEPRECATED_ATTRIBUTE static const ErrorCode kCCNetwork = ErrorCode::NETWORK;
CC_DEPRECATED_ATTRIBUTE static const ErrorCode kCCNoNewVersion = ErrorCode::NO_NEW_VERSION;
CC_DEPRECATED_ATTRIBUTE static const ErrorCode kCCUncompress = ErrorCode::UNCOMPRESS;
protected:
bool downLoad();
void checkStoragePath();

View File

@ -24,51 +24,8 @@
#include "cocos-ext.h"
NS_CC_EXT_BEGIN
NS_CC_EXT_BEGIN
const Control::EventType CCControlEventTouchDown = Control::EventType::TOUCH_DOWN;
const Control::EventType CCControlEventTouchDragInside = Control::EventType::DRAG_INSIDE;
const Control::EventType CCControlEventTouchDragOutside = Control::EventType::DRAG_OUTSIDE;
const Control::EventType CCControlEventTouchDragEnter = Control::EventType::DRAG_ENTER;
const Control::EventType CCControlEventTouchDragExit = Control::EventType::DRAG_EXIT;
const Control::EventType CCControlEventTouchUpInside = Control::EventType::TOUCH_UP_INSIDE;
const Control::EventType CCControlEventTouchUpOutside = Control::EventType::TOUCH_UP_OUTSIDE;
const Control::EventType CCControlEventTouchCancel = Control::EventType::TOUCH_CANCEL;
const Control::EventType CCControlEventValueChanged = Control::EventType::VALUE_CHANGED;
const Control::State CCControlStateNormal = Control::State::NORMAL;
const Control::State CCControlStateHighlighted = Control::State::HIGH_LIGHTED;
const Control::State CCControlStateDisabled = Control::State::DISABLED;
const Control::State CCControlStateSelected = Control::State::SELECTED;
const EditBox::KeyboardReturnType kKeyboardReturnTypeDefault = EditBox::KeyboardReturnType::DEFAULT;
const EditBox::KeyboardReturnType kKeyboardReturnTypeDone = EditBox::KeyboardReturnType::DONE;
const EditBox::KeyboardReturnType kKeyboardReturnTypeSend = EditBox::KeyboardReturnType::SEND;
const EditBox::KeyboardReturnType kKeyboardReturnTypeSearch = EditBox::KeyboardReturnType::SEARCH;
const EditBox::KeyboardReturnType kKeyboardReturnTypeGo = EditBox::KeyboardReturnType::GO;
const EditBox::InputMode kEditBoxInputModeAny = EditBox::InputMode::ANY;
const EditBox::InputMode kEditBoxInputModeEmailAddr = EditBox::InputMode::EMAIL_ADDRESS;
const EditBox::InputMode kEditBoxInputModeNumeric = EditBox::InputMode::NUMERIC;
const EditBox::InputMode kEditBoxInputModePhoneNumber = EditBox::InputMode::PHONE_NUMBER;
const EditBox::InputMode kEditBoxInputModeUrl = EditBox::InputMode::URL;
const EditBox::InputMode kEditBoxInputModeDecimal = EditBox::InputMode::DECIMAL;
const EditBox::InputMode kEditBoxInputModeSingleLine = EditBox::InputMode::SINGLE_LINE;
const EditBox::InputFlag kEditBoxInputFlagPassword = EditBox::InputFlag::PASSWORD;
const EditBox::InputFlag kEditBoxInputFlagSensitive = EditBox::InputFlag::SENSITIVE;
const EditBox::InputFlag kEditBoxInputFlagInitialCapsWord = EditBox::InputFlag::INITIAL_CAPS_WORD;
const EditBox::InputFlag kEditBoxInputFlagInitialCapsSentence = EditBox::InputFlag::INITIAL_CAPS_SENTENCE;
const EditBox::InputFlag kEditBoxInputFlagInitialCapsAllCharacters = EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS;
const ScrollView::Direction kCCScrollViewDirectionNone = ScrollView::Direction::NONE;
const ScrollView::Direction kCCScrollViewDirectionHorizontal = ScrollView::Direction::HORIZONTAL;
const ScrollView::Direction kCCScrollViewDirectionVertical = ScrollView::Direction::VERTICAL;
const ScrollView::Direction kCCScrollViewDirectionBoth = ScrollView::Direction::BOTH;
const TableView::VerticalFillOrder kCCTableViewFillTopDown = TableView::VerticalFillOrder::TOP_DOWN;
const TableView::VerticalFillOrder kCCTableViewFillBottomUp = TableView::VerticalFillOrder::BOTTOM_UP;
NS_CC_EXT_END

View File

@ -118,83 +118,72 @@ CC_DEPRECATED_ATTRIBUTE typedef AtlasAttachmentLoader CCAtlasAttachmentLoader;
CC_DEPRECATED_ATTRIBUTE typedef VertexIndex CCVertexIndex;
CC_DEPRECATED_ATTRIBUTE typedef RegionAttachment CCRegionAttachment;
CC_DEPRECATED_ATTRIBUTE typedef ControlStepperPart CCControlStepperPart;
CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMap CCNodeLoaderMap;
CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMapEntry CCNodeLoaderMapEntry;
CC_DEPRECATED_ATTRIBUTE typedef EventRegistry CCEventRegistry;
CC_DEPRECATED_ATTRIBUTE typedef AttachmentType CCAttachmentType;
CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionNone = ScrollView::Direction::NONE;
CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionHorizontal = ScrollView::Direction::HORIZONTAL;
CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionVertical = ScrollView::Direction::VERTICAL;
CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionBoth = ScrollView::Direction::BOTH;
CC_DEPRECATED_ATTRIBUTE typedef ScrollView::Direction CCScrollViewDirection;
CC_DEPRECATED_ATTRIBUTE extern const ScrollView::Direction kCCScrollViewDirectionNone;
CC_DEPRECATED_ATTRIBUTE extern const ScrollView::Direction kCCScrollViewDirectionHorizontal;
CC_DEPRECATED_ATTRIBUTE extern const ScrollView::Direction kCCScrollViewDirectionVertical;
CC_DEPRECATED_ATTRIBUTE extern const ScrollView::Direction kCCScrollViewDirectionBoth;
CC_DEPRECATED_ATTRIBUTE const TableView::VerticalFillOrder kCCTableViewFillTopDown = TableView::VerticalFillOrder::TOP_DOWN;
CC_DEPRECATED_ATTRIBUTE const TableView::VerticalFillOrder kCCTableViewFillBottomUp = TableView::VerticalFillOrder::BOTTOM_UP;
CC_DEPRECATED_ATTRIBUTE typedef TableView::VerticalFillOrder CCTableViewVerticalFillOrder;
CC_DEPRECATED_ATTRIBUTE extern const TableView::VerticalFillOrder kCCTableViewFillTopDown;
CC_DEPRECATED_ATTRIBUTE extern const TableView::VerticalFillOrder kCCTableViewFillBottomUp;
CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeDefault = EditBox::KeyboardReturnType::DEFAULT;
CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeDone = EditBox::KeyboardReturnType::DONE;
CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeSend = EditBox::KeyboardReturnType::SEND;
CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeSearch = EditBox::KeyboardReturnType::SEARCH;
CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeGo = EditBox::KeyboardReturnType::GO;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::KeyboardReturnType kKeyboardReturnTypeDefault;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::KeyboardReturnType kKeyboardReturnTypeDone;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::KeyboardReturnType kKeyboardReturnTypeSend;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::KeyboardReturnType kKeyboardReturnTypeSearch;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::KeyboardReturnType kKeyboardReturnTypeGo;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeAny = EditBox::InputMode::ANY;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeEmailAddr = EditBox::InputMode::EMAIL_ADDRESS;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeNumeric = EditBox::InputMode::NUMERIC;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModePhoneNumber = EditBox::InputMode::PHONE_NUMBER;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeUrl = EditBox::InputMode::URL;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeDecimal = EditBox::InputMode::DECIMAL;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeSingleLine = EditBox::InputMode::SINGLE_LINE;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputMode kEditBoxInputModeAny;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputMode kEditBoxInputModeEmailAddr;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputMode kEditBoxInputModeNumeric;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputMode kEditBoxInputModePhoneNumber;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputMode kEditBoxInputModeUrl;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputMode kEditBoxInputModeDecimal;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputMode kEditBoxInputModeSingleLine;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputFlag kEditBoxInputFlagPassword;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputFlag kEditBoxInputFlagSensitive;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputFlag kEditBoxInputFlagInitialCapsWord;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputFlag kEditBoxInputFlagInitialCapsSentence;
CC_DEPRECATED_ATTRIBUTE extern const EditBox::InputFlag kEditBoxInputFlagInitialCapsAllCharacters;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagPassword = EditBox::InputFlag::PASSWORD;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagSensitive = EditBox::InputFlag::SENSITIVE;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsWord = EditBox::InputFlag::INITIAL_CAPS_WORD;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsSentence = EditBox::InputFlag::INITIAL_CAPS_SENTENCE;
CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsAllCharacters = EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS;
CC_DEPRECATED_ATTRIBUTE typedef EditBox::KeyboardReturnType KeyboardReturnType;
CC_DEPRECATED_ATTRIBUTE typedef EditBox::InputMode EditBoxInputMode;
CC_DEPRECATED_ATTRIBUTE typedef EditBox::InputFlag EditBoxInputFlag;
#define kCCControlStepperPartMinus kControlStepperPartMinus
#define kCCControlStepperPartPlus kControlStepperPartPlus
#define kCCControlStepperPartNone kControlStepperPartNone
CC_DEPRECATED_ATTRIBUTE typedef ControlStepper::Part ControlStepperPart;
CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartMinus = ControlStepper::Part::MINUS;
CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartPlus = ControlStepper::Part::PLUS;
CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartNone = ControlStepper::Part::NONE;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDown = Control::EventType::TOUCH_DOWN;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragInside = Control::EventType::DRAG_INSIDE;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragOutside = Control::EventType::DRAG_OUTSIDE;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragEnter = Control::EventType::DRAG_ENTER;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragExit = Control::EventType::DRAG_EXIT;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchUpInside = Control::EventType::TOUCH_UP_INSIDE;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchUpOutside = Control::EventType::TOUCH_UP_OUTSIDE;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchCancel = Control::EventType::TOUCH_CANCEL;
CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventValueChanged = Control::EventType::VALUE_CHANGED;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchDown;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchDragInside;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchDragOutside;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchDragEnter;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchDragExit;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchUpInside;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchUpOutside;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventTouchCancel;
CC_DEPRECATED_ATTRIBUTE extern const Control::EventType CCControlEventValueChanged;
CC_DEPRECATED_ATTRIBUTE typedef Control::EventType CCControlEvent;
CC_DEPRECATED_ATTRIBUTE extern const Control::State CCControlStateNormal;
CC_DEPRECATED_ATTRIBUTE extern const Control::State CCControlStateHighlighted;
CC_DEPRECATED_ATTRIBUTE extern const Control::State CCControlStateDisabled;
CC_DEPRECATED_ATTRIBUTE extern const Control::State CCControlStateSelected;
CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateNormal = Control::State::NORMAL;
CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateHighlighted = Control::State::HIGH_LIGHTED;
CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateDisabled = Control::State::DISABLED;
CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateSelected = Control::State::SELECTED;
CC_DEPRECATED_ATTRIBUTE typedef Control::State CCControlState;
CC_DEPRECATED_ATTRIBUTE typedef Control::Handler SEL_CCControlHandler;
#define kCCCreateFile kCreateFile
#define kCCNetwork kNetwork
#define kCCNoNewVersion kNoNewVersion
#define kCCUncompress kUncompress
#define kCCHttpGet kHttpGet
#define kCCHttpPut kHttpPut
#define kCCHttpPost kHttpPost
#define kCCHttpDelete kHttpDelete
#define kCCHttpUnkown kHttpUnkown
NS_CC_EXT_END
#endif // COCOS2D_CCDEPRECATED_EXT_H__

View File

@ -51,7 +51,7 @@ ControlStepper::ControlStepper()
, _maximumValue(0.0)
, _stepValue(0.0)
, _touchInsideFlag(false)
, _touchedPart(kControlStepperPartNone)
, _touchedPart(Part::NONE)
, _autorepeatCount(0)
{
@ -237,10 +237,10 @@ void ControlStepper::update(float dt)
if ((_autorepeatCount < kAutorepeatIncreaseTimeIncrement) && (_autorepeatCount % 3) != 0)
return;
if (_touchedPart == kControlStepperPartMinus)
if (_touchedPart == Part::MINUS)
{
this->setValueWithSendingEvent(_value - _stepValue, _continuous);
} else if (_touchedPart == kControlStepperPartPlus)
} else if (_touchedPart == Part::PLUS)
{
this->setValueWithSendingEvent(_value + _stepValue, _continuous);
}
@ -253,20 +253,20 @@ void ControlStepper::updateLayoutUsingTouchLocation(Point location)
if (location.x < _minusSprite->getContentSize().width
&& _value > _minimumValue)
{
_touchedPart = kControlStepperPartMinus;
_touchedPart = Part::MINUS;
_minusSprite->setColor(Color3B::GRAY);
_plusSprite->setColor(Color3B::WHITE);
} else if (location.x >= _minusSprite->getContentSize().width
&& _value < _maximumValue)
{
_touchedPart = kControlStepperPartPlus;
_touchedPart = Part::PLUS;
_minusSprite->setColor(Color3B::WHITE);
_plusSprite->setColor(Color3B::GRAY);
} else
{
_touchedPart = kControlStepperPartNone;
_touchedPart = Part::NONE;
_minusSprite->setColor(Color3B::WHITE);
_plusSprite->setColor(Color3B::WHITE);
@ -310,11 +310,12 @@ void ControlStepper::ccTouchMoved(Touch *pTouch, Event *pEvent)
this->startAutorepeat();
}
}
} else
}
else
{
_touchInsideFlag = false;
_touchedPart = kControlStepperPartNone;
_touchedPart = Part::NONE;
_minusSprite->setColor(Color3B::WHITE);
_plusSprite->setColor(Color3B::WHITE);

View File

@ -39,16 +39,16 @@ NS_CC_EXT_BEGIN
* @{
*/
typedef enum
{
kControlStepperPartMinus,
kControlStepperPartPlus,
kControlStepperPartNone,
} ControlStepperPart;
class ControlStepper : public Control
{
public:
enum class Part
{
MINUS,
PLUS,
NONE
};
static ControlStepper* create(Sprite *minusSprite, Sprite *plusSprite);
ControlStepper();
@ -100,7 +100,7 @@ protected:
/** The step, or increment, value for the stepper. */
double _stepValue;
bool _touchInsideFlag;
ControlStepperPart _touchedPart;
Part _touchedPart;
int _autorepeatCount;
// Weak links to children

View File

@ -143,7 +143,7 @@ static void networkThread(void)
// Process the request -> get response packet
switch (request->getRequestType())
{
case HttpRequest::kHttpGet: // HTTP GET
case HttpRequest::Type::GET: // HTTP GET
retValue = processGetTask(request,
writeData,
response->getResponseData(),
@ -152,7 +152,7 @@ static void networkThread(void)
response->getResponseHeader());
break;
case HttpRequest::kHttpPost: // HTTP POST
case HttpRequest::Type::POST: // HTTP POST
retValue = processPostTask(request,
writeData,
response->getResponseData(),
@ -161,7 +161,7 @@ static void networkThread(void)
response->getResponseHeader());
break;
case HttpRequest::kHttpPut:
case HttpRequest::Type::PUT:
retValue = processPutTask(request,
writeData,
response->getResponseData(),
@ -170,7 +170,7 @@ static void networkThread(void)
response->getResponseHeader());
break;
case HttpRequest::kHttpDelete:
case HttpRequest::Type::DELETE:
retValue = processDeleteTask(request,
writeData,
response->getResponseData(),

View File

@ -45,16 +45,16 @@ class HttpRequest : public Object
{
public:
/** Use this enum type as param in setReqeustType(param) */
typedef enum
enum class Type
{
kHttpGet,
kHttpPost,
kHttpPut,
kHttpDelete,
kHttpUnkown,
} HttpRequestType;
GET,
POST,
PUT,
DELETE,
UNKNOWN,
};
/** Constructor
/** Constructor
Because HttpRequest object will be used between UI thead and network thread,
requestObj->autorelease() is forbidden to avoid crashes in AutoreleasePool
new/retain/release still works, which means you need to release it manually
@ -62,7 +62,7 @@ public:
*/
HttpRequest()
{
_requestType = kHttpUnkown;
_requestType = Type::UNKNOWN;
_url.clear();
_requestData.clear();
_tag.clear();
@ -93,12 +93,12 @@ public:
/** Required field for HttpRequest object before being sent.
kHttpGet & kHttpPost is currently supported
*/
inline void setRequestType(HttpRequestType type)
inline void setRequestType(Type type)
{
_requestType = type;
};
/** Get back the kHttpGet/Post/... enum value */
inline HttpRequestType getRequestType()
inline Type getRequestType()
{
return _requestType;
};
@ -215,10 +215,16 @@ public:
return _headers;
}
// Backward compatibility
CC_DEPRECATED_ATTRIBUTE static const Type kHttpGet = Type::GET;
CC_DEPRECATED_ATTRIBUTE static const Type kHttpPut = Type::PUT;
CC_DEPRECATED_ATTRIBUTE static const Type kHttpPost = Type::POST;
CC_DEPRECATED_ATTRIBUTE static const Type kHttpDelete = Type::DELETE;
CC_DEPRECATED_ATTRIBUTE static const Type kHttpUnkown = Type::UNKNOWN;
protected:
// properties
HttpRequestType _requestType; /// kHttpRequestGet, kHttpRequestPost or other enums
Type _requestType; /// kHttpRequestGet, kHttpRequestPost or other enums
std::string _url; /// target url that this request is sent to
std::vector<char> _requestData; /// used for POST
std::string _tag; /// user defined tag, to identify different requests in response callback

View File

@ -120,7 +120,7 @@ void SIOClientImpl::handshake()
HttpRequest* request = new HttpRequest();
request->setUrl(pre.str().c_str());
request->setRequestType(HttpRequest::kHttpGet);
request->setRequestType(HttpRequest::Type::GET);
request->setResponseCallback(this, httpresponse_selector(SIOClientImpl::handshakeResponse));
request->setTag("handshake");

View File

@ -125,6 +125,17 @@ public:
* @brief Gets current state of connection.
*/
State getReadyState();
// Backward compatibility
CC_DEPRECATED_ATTRIBUTE static const ErrorCode kErrorTimeout = ErrorCode::TIME_OUT;
CC_DEPRECATED_ATTRIBUTE static const ErrorCode kErrorConnectionFailure = ErrorCode::CONNECTION_FAILURE;
CC_DEPRECATED_ATTRIBUTE static const ErrorCode kErrorUnknown = ErrorCode::UNKNOWN;
CC_DEPRECATED_ATTRIBUTE static const State kStateConnecting = State::CONNECTING;
CC_DEPRECATED_ATTRIBUTE static const State kStateOpen = State::OPEN;
CC_DEPRECATED_ATTRIBUTE static const State kStateClosing = State::CLOSING;
CC_DEPRECATED_ATTRIBUTE static const State kStateClosed = State::CLOSED;
private:
virtual void onSubThreadStarted();
virtual int onSubThreadLoop();