From d0dbf343191431f5ee9da9337f811fdaf063499d Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 16 Jan 2014 21:35:58 -0800 Subject: [PATCH 1/3] removes "include "cocos2d.h" from cocos2d files --- cocos/2d/CCAtlasNode.cpp | 2 +- cocos/2d/CCClippingNode.cpp | 7 +- cocos/2d/CCConfiguration.cpp | 2 +- cocos/2d/CCDirector.cpp | 5 +- cocos/2d/CCDrawNode.cpp | 4 +- cocos/2d/CCFont.h | 1 - cocos/2d/CCFontAtlas.cpp | 4 +- cocos/2d/CCFontAtlas.h | 3 + cocos/2d/CCFontAtlasCache.cpp | 2 + cocos/2d/CCFontAtlasCache.h | 2 +- cocos/2d/CCFontAtlasFactory.h | 2 +- cocos/2d/CCFontDefinition.cpp | 3 +- cocos/2d/CCFontFNT.cpp | 4 + cocos/2d/CCFontFNT.h | 3 +- cocos/2d/CCFontFreeType.cpp | 1 + cocos/2d/CCLabel.cpp | 6 + cocos/2d/CCLabel.h | 36 ++--- cocos/2d/CCLabelTextFormatProtocol.h | 15 +- cocos/2d/CCLabelTextFormatter.cpp | 2 +- cocos/2d/CCLayer.cpp | 4 +- cocos/2d/CCMotionStreak.cpp | 4 +- cocos/2d/CCNodeGrid.cpp | 6 +- cocos/2d/CCParticleBatchNode.cpp | 2 +- cocos/2d/CCParticleSystemQuad.cpp | 4 +- cocos/2d/CCProgressTimer.cpp | 4 +- cocos/2d/CCRenderTexture.cpp | 6 +- cocos/2d/CCSprite.cpp | 4 +- cocos/2d/CCSpriteBatchNode.cpp | 2 +- cocos/2d/CCTextImage.cpp | 4 +- cocos/2d/CCTextImage.h | 144 +++++++++--------- cocos/2d/CCTextureAtlas.cpp | 8 +- ...ccShader_PositionTextureColor_noMVP_vert.h | 2 +- cocos/2d/cocos2d.cpp | 2 +- cocos/2d/renderer/CCCustomCommand.cpp | 2 +- cocos/2d/renderer/CCFrustum.cpp | 2 +- cocos/2d/renderer/CCGroupCommand.cpp | 4 +- cocos/2d/renderer/CCRenderer.cpp | 29 ++-- .../cocosbuilder/CCBAnimationManager.h | 6 +- .../editor-support/cocosbuilder/CCBKeyframe.h | 4 +- .../cocosbuilder/CCBMemberVariableAssigner.h | 1 - .../editor-support/cocosbuilder/CCBReader.cpp | 12 +- cocos/editor-support/cocosbuilder/CCBReader.h | 5 +- .../cocosbuilder/CCBSelectorResolver.h | 1 - .../editor-support/cocosbuilder/CCBSequence.h | 3 +- .../cocosbuilder/CCBSequenceProperty.h | 3 +- .../cocosbuilder/CCLabelBMFontLoader.h | 3 + .../cocosbuilder/CCLabelTTFLoader.h | 3 + .../cocosbuilder/CCMenuItemLoader.h | 3 + .../cocosbuilder/CCMenuLoader.h | 2 + .../CCNode+CCBRelativePositioning.h | 1 - .../cocosbuilder/CCNodeLoader.cpp | 3 + .../cocosbuilder/CCNodeLoader.h | 1 - .../cocosbuilder/CCNodeLoaderLibrary.h | 1 - .../cocosbuilder/CCNodeLoaderListener.h | 1 - .../cocosbuilder/CCParticleSystemQuadLoader.h | 3 + .../cocostudio/CCActionEaseEx.h | 1 - .../editor-support/cocostudio/CCActionFrame.h | 3 +- .../cocostudio/CCActionFrameEasing.h | 2 +- .../cocostudio/CCActionManagerEx.h | 1 - .../editor-support/cocostudio/CCActionNode.h | 1 - .../cocostudio/CCActionObject.cpp | 4 + .../cocostudio/CCActionObject.h | 1 - .../editor-support/cocostudio/CCArmature.cpp | 9 +- .../cocostudio/CCArmatureDataManager.cpp | 1 + .../cocostudio/CCArmatureDefine.h | 2 - .../editor-support/cocostudio/CCBatchNode.cpp | 7 +- cocos/editor-support/cocostudio/CCBatchNode.h | 1 + cocos/editor-support/cocostudio/CCComBase.h | 1 - .../cocostudio/CCDataReaderHelper.cpp | 11 +- cocos/editor-support/cocostudio/CCDatas.h | 6 + .../cocostudio/CCDisplayFactory.cpp | 2 + .../cocostudio/CCDisplayManager.cpp | 2 + .../cocostudio/CCInputDelegate.cpp | 5 + .../cocostudio/CCInputDelegate.h | 7 +- .../cocostudio/CCSSceneReader.h | 1 - cocos/editor-support/cocostudio/CCSkin.cpp | 6 + cocos/editor-support/cocostudio/CCSkin.h | 4 +- .../cocostudio/CCSpriteFrameCacheHelper.cpp | 4 +- .../cocostudio/CCSpriteFrameCacheHelper.h | 1 + cocos/editor-support/cocostudio/CCUtilMath.h | 1 + .../cocostudio/DictionaryHelper.cpp | 1 + .../cocostudio/DictionaryHelper.h | 1 - cocos/editor-support/spine/CCSkeleton.h | 6 +- .../spine/CCSkeletonAnimation.h | 1 - cocos/gui/UILayout.cpp | 6 +- cocos/network/HttpClient.cpp | 5 + cocos/network/HttpClient.h | 2 - cocos/network/HttpRequest.h | 3 +- cocos/network/HttpResponse.h | 1 - cocos/physics/CCPhysicsBody.h | 44 +++--- .../lua/bindings/lua_xml_http_request.h | 2 + extensions/GUI/CCControlExtension/CCControl.h | 3 +- .../GUI/CCControlExtension/CCControlButton.h | 1 + .../CCControlPotentiometer.cpp | 1 - .../CCControlPotentiometer.h | 1 + .../GUI/CCControlExtension/CCControlStepper.h | 1 + .../CCControlExtension/CCControlSwitch.cpp | 7 +- .../GUI/CCControlExtension/CCScale9Sprite.cpp | 3 + .../GUI/CCControlExtension/CCScale9Sprite.h | 5 +- extensions/GUI/CCEditBox/CCEditBox.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImpl.h | 1 - extensions/GUI/CCScrollView/CCScrollView.cpp | 7 + extensions/GUI/CCScrollView/CCScrollView.h | 4 +- extensions/GUI/CCScrollView/CCTableView.cpp | 1 - .../GUI/CCScrollView/CCTableViewCell.cpp | 2 +- extensions/GUI/CCScrollView/CCTableViewCell.h | 4 +- extensions/physics-nodes/CCPhysicsDebugNode.h | 3 +- extensions/physics-nodes/CCPhysicsSprite.h | 2 +- 108 files changed, 368 insertions(+), 229 deletions(-) diff --git a/cocos/2d/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp index 4fa8442b92..f86c143d78 100644 --- a/cocos/2d/CCAtlasNode.cpp +++ b/cocos/2d/CCAtlasNode.cpp @@ -34,7 +34,7 @@ THE SOFTWARE. #include "ccGLStateCache.h" #include "CCDirector.h" #include "TransformUtils.h" -#include "CCRenderer.h" +#include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" // external diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index cdaf6a3df5..f5bc3bf95d 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -31,9 +31,10 @@ #include "CCShaderCache.h" #include "CCDirector.h" #include "CCDrawingPrimitives.h" -#include "CCRenderer.h" -#include "CCGroupCommand.h" -#include "CCCustomCommand.h" + +#include "renderer/CCRenderer.h" +#include "renderer/CCGroupCommand.h" +#include "renderer/CCCustomCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/CCConfiguration.cpp b/cocos/2d/CCConfiguration.cpp index ddbc3cfae9..dbdf12ea14 100644 --- a/cocos/2d/CCConfiguration.cpp +++ b/cocos/2d/CCConfiguration.cpp @@ -31,13 +31,13 @@ THE SOFTWARE. #include "CCDictionary.h" #include "CCInteger.h" #include "CCBool.h" -#include "cocos2d.h" #include "platform/CCFileUtils.h" using namespace std; NS_CC_BEGIN +extern const char* cocos2dVersion(); Configuration* Configuration::s_sharedConfiguration = nullptr; diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 3e06a99c75..d66385e295 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -60,9 +60,10 @@ THE SOFTWARE. #include "CCEventDispatcher.h" #include "CCEventCustom.h" #include "CCFontFreeType.h" -#include "CCRenderer.h" -#include "CCConsole.h" +#include "renderer/CCRenderer.h" #include "renderer/CCFrustum.h" +#include "CCConsole.h" + /** Position of the FPS diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index b920a311c2..3432ad024f 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -26,9 +26,9 @@ #include "CCGL.h" #include "CCEventType.h" #include "CCConfiguration.h" -#include "CCCustomCommand.h" +#include "renderer/CCCustomCommand.h" +#include "renderer/CCRenderer.h" #include "CCDirector.h" -#include "CCRenderer.h" #include "CCEventListenerCustom.h" #include "CCEventDispatcher.h" diff --git a/cocos/2d/CCFont.h b/cocos/2d/CCFont.h index 440da0808b..466336d2a2 100644 --- a/cocos/2d/CCFont.h +++ b/cocos/2d/CCFont.h @@ -28,7 +28,6 @@ #include -#include "cocos2d.h" #include "CCLabel.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index 9282956d03..166ec788a9 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -22,10 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "cocos2d.h" + #include "CCFontAtlas.h" #include "CCFont.h" #include "CCFontFreeType.h" +#include "ccUTF8.h" +#include "CCDirector.h" #define PAGE_WIDTH 1024 #define PAGE_HEIGHT 1024 diff --git a/cocos/2d/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h index 0a2d6f215b..b4122e1294 100644 --- a/cocos/2d/CCFontAtlas.h +++ b/cocos/2d/CCFontAtlas.h @@ -26,11 +26,14 @@ #define _CCFontAtlas_h_ #include +#include "CCPlatformMacros.h" +#include "CCObject.h" NS_CC_BEGIN //fwd class Font; +class Texture2D; struct FontLetterDefinition { diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index ccea76b254..0ae1335f98 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -23,6 +23,8 @@ THE SOFTWARE. ****************************************************************************/ +#include + #include "CCFontAtlasCache.h" #include "CCFontAtlasFactory.h" diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index bdc7dd24d1..acacf883bb 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -29,8 +29,8 @@ #include #include -#include "cocos2d.h" #include "CCFontAtlas.h" +#include "CCLabel.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFontAtlasFactory.h b/cocos/2d/CCFontAtlasFactory.h index 2a10cc8d63..1674fe0266 100644 --- a/cocos/2d/CCFontAtlasFactory.h +++ b/cocos/2d/CCFontAtlasFactory.h @@ -26,8 +26,8 @@ #ifndef _CCFontAtlasFactory_h_ #define _CCFontAtlasFactory_h_ -#include "cocos2d.h" #include "CCFontAtlas.h" +#include "CCLabel.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFontDefinition.cpp b/cocos/2d/CCFontDefinition.cpp index c0d8af5051..7fd10d86a1 100644 --- a/cocos/2d/CCFontDefinition.cpp +++ b/cocos/2d/CCFontDefinition.cpp @@ -23,8 +23,9 @@ THE SOFTWARE. ****************************************************************************/ -#include "cocos2d.h" + #include "CCFontDefinition.h" +#include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index 93fd5c2410..53eade4046 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -25,6 +25,10 @@ #include "CCFontFNT.h" #include "CCFontAtlas.h" +#include "CCLabelBMFont.h" +#include "CCDirector.h" +#include "CCTextureCache.h" +#include "ccUTF8.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFontFNT.h b/cocos/2d/CCFontFNT.h index eec0bd761c..85588a662a 100644 --- a/cocos/2d/CCFontFNT.h +++ b/cocos/2d/CCFontFNT.h @@ -26,11 +26,12 @@ #ifndef _CCFontFNT_h_ #define _CCFontFNT_h_ -#include "cocos2d.h" #include "CCFont.h" NS_CC_BEGIN +class CCBMFontConfiguration; + class FontFNT : public Font { diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 60b5a11954..915a333a48 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -31,6 +31,7 @@ THE SOFTWARE. #include "CCTextImage.h" #include "CCFont.h" #include "CCFontDefinition.h" +#include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index a267a41938..f97faa808b 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -27,6 +27,12 @@ #include "CCFontDefinition.h" #include "CCFontAtlasCache.h" #include "CCLabelTextFormatter.h" +#include "CCSprite.h" +#include "CCShaderCache.h" +#include "ccUTF8.h" +#include "CCSpriteFrame.h" +#include "CCDirector.h" +#include "renderer/CCRenderer.h" #define DISTANCEFIELD_ATLAS_FONTSIZE 50 diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index 26dcc89f9a..a046dca694 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -172,29 +172,29 @@ private: virtual void updateColor() override; //! used for optimization - Sprite *_reusedLetter; - std::vector _lettersInfo; + Sprite *_reusedLetter; + std::vector _lettersInfo; - float _commonLineHeight; - bool _lineBreakWithoutSpaces; - float _width; - TextHAlignment _alignment; - unsigned short int * _currentUTF16String; - unsigned short int * _originalUTF16String; - Size * _advances; - FontAtlas * _fontAtlas; - bool _isOpacityModifyRGB; + float _commonLineHeight; + bool _lineBreakWithoutSpaces; + float _width; + TextHAlignment _alignment; + unsigned short int * _currentUTF16String; + unsigned short int * _originalUTF16String; + Size * _advances; + FontAtlas * _fontAtlas; + bool _isOpacityModifyRGB; - bool _useDistanceField; - bool _useA8Shader; - int _fontSize; + bool _useDistanceField; + bool _useA8Shader; + int _fontSize; - LabelEffect _currLabelEffect; - Color3B _effectColor; + LabelEffect _currLabelEffect; + Color3B _effectColor; - GLuint _uniformEffectColor; + GLuint _uniformEffectColor; - CustomCommand _customCommand; + CustomCommand _customCommand; }; diff --git a/cocos/2d/CCLabelTextFormatProtocol.h b/cocos/2d/CCLabelTextFormatProtocol.h index bf72775a51..e91d7b875a 100644 --- a/cocos/2d/CCLabelTextFormatProtocol.h +++ b/cocos/2d/CCLabelTextFormatProtocol.h @@ -25,11 +25,16 @@ #ifndef _CCLabelTextFormatProtocol_h_ #define _CCLabelTextFormatProtocol_h_ -#include "CCFontAtlas.h" + #include +#include "CCFontAtlas.h" +#include "CCGeometry.h" +#include "ccTypes.h" + NS_CC_BEGIN +class Sprite; struct LetterInfo { @@ -46,13 +51,13 @@ public: virtual ~LabelTextFormatProtocol() {} - virtual bool recordLetterInfo(const cocos2d::Point& point,unsigned short int theChar, int spriteIndex) = 0; + virtual bool recordLetterInfo(const Point& point,unsigned short int theChar, int spriteIndex) = 0; virtual bool recordPlaceholderInfo(int spriteIndex) = 0; virtual std::vector *getLettersInfo() = 0; virtual float getLetterPosXLeft(int index) const = 0; virtual float getLetterPosXRight(int index) const = 0; // sprite related stuff - virtual cocos2d::Sprite *getLetter(int ID) = 0; + virtual Sprite *getLetter(int ID) = 0; // font related stuff virtual int getCommonLineHeight() const = 0; @@ -60,7 +65,7 @@ public: virtual int getXOffsetForChar(unsigned short c) const = 0; virtual int getYOffsetForChar(unsigned short c) const = 0; virtual int getAdvanceForChar(unsigned short c, int hintPositionInString) const = 0; - virtual cocos2d::Rect getRectForChar(unsigned short c) const = 0; + virtual Rect getRectForChar(unsigned short c) const = 0; // string related stuff virtual int getStringNumLines() const = 0; @@ -68,7 +73,7 @@ public: virtual unsigned short getCharAtStringPosition(int position) const = 0; virtual unsigned short * getUTF8String() const = 0; virtual void assignNewUTF8String(unsigned short *newString) = 0; - virtual TextHAlignment getTextAlignment() const = 0; + virtual TextHAlignment getTextAlignment() const = 0; // label related stuff virtual float getMaxLineWidth() const = 0; diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 550d017beb..e131cabeec 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -25,9 +25,9 @@ #include -#include "cocos2d.h" #include "ccUTF8.h" #include "CCLabelTextFormatter.h" +#include "CCDirector.h" using namespace std; diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 1bae6e040c..1b24c97f25 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -44,8 +44,8 @@ THE SOFTWARE. #include "CCEventListenerAcceleration.h" #include "platform/CCDevice.h" #include "CCScene.h" -#include "CCCustomCommand.h" -#include "CCRenderer.h" +#include "renderer/CCCustomCommand.h" +#include "renderer/CCRenderer.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp index 4e248b7ea1..fdb0b70fb8 100644 --- a/cocos/2d/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -31,8 +31,8 @@ THE SOFTWARE. #include "ccMacros.h" #include "CCDirector.h" #include "CCVertex.h" -#include "CCCustomCommand.h" -#include "CCRenderer.h" +#include "renderer/CCCustomCommand.h" +#include "renderer/CCRenderer.h" NS_CC_BEGIN diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index 90d5647a57..9c24500da0 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -25,9 +25,9 @@ #include "CCNodeGrid.h" #include "CCGrid.h" -#include "CCGroupCommand.h" -#include "CCRenderer.h" -#include "CCCustomCommand.h" +#include "renderer/CCGroupCommand.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCCustomCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index 773b780997..b291910422 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -44,7 +44,7 @@ #include "kazmath/GL/matrix.h" #include "CCProfiling.h" #include "renderer/CCQuadCommand.h" -#include "CCRenderer.h" +#include "renderer/CCRenderer.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 579db6c024..8495483116 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -38,9 +38,9 @@ THE SOFTWARE. #include "TransformUtils.h" #include "CCEventType.h" #include "CCConfiguration.h" -#include "CCRenderer.h" +#include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" -#include "CCCustomCommand.h" +#include "renderer/CCCustomCommand.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index 7d135a9016..37c754a0ee 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -33,8 +33,8 @@ THE SOFTWARE. #include "CCDirector.h" #include "TransformUtils.h" #include "CCDrawingPrimitives.h" -#include "CCRenderer.h" -#include "CCCustomCommand.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCCustomCommand.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index efaad582ef..fcf00452ed 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -38,9 +38,9 @@ THE SOFTWARE. #include "CCEventType.h" #include "CCGrid.h" -#include "CCRenderer.h" -#include "CCGroupCommand.h" -#include "CCCustomCommand.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCGroupCommand.h" +#include "renderer/CCCustomCommand.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 8bf5a3d1b1..c66c811b1b 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -45,9 +45,9 @@ THE SOFTWARE. #include "CCAffineTransform.h" #include "TransformUtils.h" #include "CCProfiling.h" -#include "CCRenderer.h" +#include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" -#include "CCFrustum.h" +#include "renderer/CCFrustum.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 502474d00e..fde85639aa 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -43,7 +43,7 @@ THE SOFTWARE. #include "CCProfiling.h" #include "CCLayer.h" #include "CCScene.h" -#include "CCRenderer.h" +#include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCTextImage.cpp b/cocos/2d/CCTextImage.cpp index d47ab768d0..cd972a172e 100644 --- a/cocos/2d/CCTextImage.cpp +++ b/cocos/2d/CCTextImage.cpp @@ -28,10 +28,10 @@ #include #include -#include "cocos2d.h" #include "CCTextImage.h" #include "CCFontFreeType.h" #include "CCFont.h" +#include "ccUTF8.h" NS_CC_BEGIN @@ -295,7 +295,7 @@ bool TextImage::createPageDefinitions(unsigned short int *inText, int imageWidth return true; } -int TextImage::getNumGlyphsFittingInSize(std::map &glyphDefs, unsigned short int *strUTF8, Font *font, Size *constrainSize, int &outNewSize) +int TextImage::getNumGlyphsFittingInSize(std::unordered_map &glyphDefs, unsigned short int *strUTF8, Font *font, Size *constrainSize, int &outNewSize) { if (!strUTF8) return 0; diff --git a/cocos/2d/CCTextImage.h b/cocos/2d/CCTextImage.h index 1c0da97201..b7baddb561 100644 --- a/cocos/2d/CCTextImage.h +++ b/cocos/2d/CCTextImage.h @@ -23,15 +23,19 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _TextImage_h_ -#define _TextImage_h_ +#ifndef _CCTextImage_h_ +#define _CCTextImage_h_ -//#include "CCFont.h" #include +#include + +#include "CCPlatformMacros.h" +#include "CCGeometry.h" NS_CC_BEGIN class Font; +class Texture2D; /** @brief GlyphDef defines one single glyph (character) in a text image * @@ -43,27 +47,33 @@ class CC_DLL GlyphDef { public: - GlyphDef() : _validGlyph(false) { /*do nothing*/ } - GlyphDef(unsigned short int letterUTF8, const Rect &rect) { _gliphRect = rect; _uTF16Letter = letterUTF8; } + GlyphDef() : _validGlyph(false) {} + GlyphDef(unsigned short int letterUTF8, const Rect &rect) { + _gliphRect = rect; + _uTF16Letter = letterUTF8; + } - void setUTF16Letter(unsigned short int letterUTF8) { _uTF16Letter = letterUTF8; } - void setRect(const Rect & theRect) { _gliphRect = theRect; } - unsigned short int getUTF8Letter() { return _uTF16Letter; } - const Rect & getRect() const { return _gliphRect; } - void setPadding(float padding) { _padding = padding; } - float getPadding() { return _padding; } - void setCommonHeight(float commonHeight) { _commonHeight = commonHeight; } - float getCommonHeight() { return _commonHeight; } - void setValid(bool isValid) { _validGlyph = isValid; } - bool isValid() { return _validGlyph; } + void setUTF16Letter(unsigned short int letterUTF8) { _uTF16Letter = letterUTF8; } + void setRect(const Rect & theRect) { _gliphRect = theRect; } + + unsigned short int getUTF8Letter() const { return _uTF16Letter; } + const Rect& getRect() const { return _gliphRect; } + + void setPadding(float padding) { _padding = padding; } + float getPadding() const { return _padding; } + + void setCommonHeight(float commonHeight) { _commonHeight = commonHeight; } + float getCommonHeight() const { return _commonHeight; } + + void setValid(bool isValid) { _validGlyph = isValid; } + bool isValid() const { return _validGlyph; } -private: - - Rect _gliphRect; - unsigned short int _uTF16Letter; - float _padding; - float _commonHeight; - bool _validGlyph; +protected: + Rect _gliphRect; + unsigned short int _uTF16Letter; + float _padding; + float _commonHeight; + bool _validGlyph; }; @@ -78,23 +88,21 @@ public: TextLineDef(float x, float y, float width, float height); - float getX() const { return _x; } - float getY() const { return _y; } - float getWidth() const { return _width; } - float getHeight() const { return _height; } + float getX() const { return _x; } + float getY() const { return _y; } + float getWidth() const { return _width; } + float getHeight() const { return _height; } - void addGlyph(GlyphDef theGlyph) { _glyphs.push_back(theGlyph); } - int getNumGlyph() const { return static_cast(_glyphs.size()); } - const GlyphDef & getGlyphAt(int index) const { return _glyphs[index]; } - -private: - - float _x; - float _y; - float _width; - float _height; - std::vector _glyphs; + void addGlyph(GlyphDef theGlyph) { _glyphs.push_back(theGlyph); } + int getNumGlyph() const { return static_cast(_glyphs.size()); } + const GlyphDef & getGlyphAt(int index) const { return _glyphs[index]; } +protected: + float _x; + float _y; + float _width; + float _height; + std::vector _glyphs; }; /** @brief TextPageDef defines one text image page (a TextImage can have/use more than one page) @@ -115,28 +123,26 @@ public: */ ~TextPageDef(); - void addLine(TextLineDef *theLine) { _lines.push_back(theLine); } - int getNumLines() const { return static_cast(_lines.size()); } - TextLineDef * getLineAt(int index) const { return _lines[index]; } - int getWidth() const { return _width; } - int getHeight() const { return _height; } - int getPageNumber() const { return _pageNum; } - void setPageData(unsigned char *data) { _pageData = data; } - const unsigned char * getPageData() const { return _pageData; } - Texture2D *getPageTexture(); + void addLine(TextLineDef *theLine) { _lines.push_back(theLine); } + int getNumLines() const { return static_cast(_lines.size()); } + TextLineDef * getLineAt(int index) const { return _lines[index]; } + int getWidth() const { return _width; } + int getHeight() const { return _height; } + int getPageNumber() const { return _pageNum; } + void setPageData(unsigned char *data) { _pageData = data; } + const unsigned char * getPageData() const { return _pageData; } + Texture2D *getPageTexture(); void preparePageTexture(bool releaseRAWData = true); -private: - +protected: bool generatePageTexture(bool releasePageData = false); - int _pageNum; - int _width; - int _height; - unsigned char * _pageData; - Texture2D * _pageTexture; - std::vector _lines; - + int _pageNum; + int _width; + int _height; + unsigned char * _pageData; + Texture2D* _pageTexture; + std::vector _lines; }; /** @brief CCTextFontPages collection of pages (TextPageDef) @@ -156,13 +162,12 @@ public: */ ~TextFontPagesDef(); - void addPage(TextPageDef *newPage) { _pages.push_back(newPage); } - int getNumPages() const { return static_cast(_pages.size()); } - TextPageDef* getPageAt(int index) const { return _pages[index]; } + void addPage(TextPageDef *newPage) { _pages.push_back(newPage); } + int getNumPages() const { return static_cast(_pages.size()); } + TextPageDef* getPageAt(int index) const { return _pages[index]; } -private: - - std::vector _pages; +protected: + std::vector _pages; }; @@ -184,28 +189,27 @@ public: bool initWithString(const char *text, int width, int height, Font* font, bool releaseRAWData = true); - TextFontPagesDef * getPages() const { return _fontPages; } - Font * getFont() const { return _font; } - -private: + TextFontPagesDef* getPages() const { return _fontPages; } + Font* getFont() const { return _font; } +protected: bool createImageDataFromPages(TextFontPagesDef *thePages, bool releaseRAWData = true); bool addGlyphsToLine(TextLineDef *line, const char *lineText, bool textIsUTF16 = false); bool generateTextGlyphs(const char * text); - int getNumGlyphsFittingInSize(std::map &glyphDefs, unsigned short int *strUTF8, Font *font, Size *constrainSize, int &outNewSize); + int getNumGlyphsFittingInSize(std::unordered_map &glyphDefs, unsigned short int *strUTF8, Font *font, Size *constrainSize, int &outNewSize); bool createPageDefinitions(unsigned short int *inText, int imageWidth, int imageHeight, int lineHeight); unsigned char * preparePageGlyphData(TextPageDef *thePage); // glyph rendering unsigned char * renderGlyphData(TextPageDef *thePage); - std::map _textGlyphs; - TextFontPagesDef * _fontPages; - Font * _font; + std::unordered_map _textGlyphs; + TextFontPagesDef* _fontPages; + Font* _font; }; NS_CC_END -#endif +#endif // _CCTextImage_h_ diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index 8a9818d8fc..2d2787a25d 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -624,11 +624,11 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) { glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); // option 1: subdata - //glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] ); - +// glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] ); + // option 2: data - // glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW); - +// glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW); + // option 3: orphaning + glMapBuffer glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (numberOfQuads-start), nullptr, GL_DYNAMIC_DRAW); void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); diff --git a/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h b/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h index bae95bcfea..f2d39c3c10 100644 --- a/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h +++ b/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h @@ -38,7 +38,7 @@ varying vec2 v_texCoord; \n\ \n\ void main() \n\ { \n\ - gl_Position = CC_PMatrix * a_position; \n\ + gl_Position = CC_PMatrix * a_position; \n\ v_fragmentColor = a_color; \n\ v_texCoord = a_texCoord; \n\ } \n\ diff --git a/cocos/2d/cocos2d.cpp b/cocos/2d/cocos2d.cpp index 99adc6518c..34b10b7f09 100644 --- a/cocos/2d/cocos2d.cpp +++ b/cocos/2d/cocos2d.cpp @@ -25,7 +25,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "cocos2d.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/CCCustomCommand.cpp b/cocos/2d/renderer/CCCustomCommand.cpp index b0c39f2049..5bbf2032ea 100644 --- a/cocos/2d/renderer/CCCustomCommand.cpp +++ b/cocos/2d/renderer/CCCustomCommand.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCCustomCommand.h" +#include "renderer/CCCustomCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/CCFrustum.cpp b/cocos/2d/renderer/CCFrustum.cpp index e02236e3b0..4f88e2356f 100644 --- a/cocos/2d/renderer/CCFrustum.cpp +++ b/cocos/2d/renderer/CCFrustum.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCFrustum.h" +#include "renderer/CCFrustum.h" #include "CCConsole.h" #include diff --git a/cocos/2d/renderer/CCGroupCommand.cpp b/cocos/2d/renderer/CCGroupCommand.cpp index 4f7707cd76..9c0e57eb92 100644 --- a/cocos/2d/renderer/CCGroupCommand.cpp +++ b/cocos/2d/renderer/CCGroupCommand.cpp @@ -23,8 +23,8 @@ ****************************************************************************/ -#include "CCGroupCommand.h" -#include "CCRenderer.h" +#include "renderer/CCGroupCommand.h" +#include "renderer/CCRenderer.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 3ffa5b583a..30495a8aa3 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -22,13 +22,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCRenderer.h" -#include "CCShaderCache.h" -#include "ccGLStateCache.h" -#include "CCCustomCommand.h" +#include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" #include "renderer/CCBatchCommand.h" -#include "CCGroupCommand.h" +#include "renderer/CCCustomCommand.h" +#include "renderer/CCGroupCommand.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" #include "CCConfiguration.h" #include "CCDirector.h" #include "CCEventDispatcher.h" @@ -330,20 +330,24 @@ void Renderer::render() void Renderer::convertToWorldCoordiantes(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const kmMat4& modelView) { +// kmMat4 matrixP, mvp; +// kmGLGetMatrix(KM_GL_PROJECTION, &matrixP); +// kmMat4Multiply(&mvp, &matrixP, &modelView); + for(ssize_t i=0; ibl.vertices; - kmVec3Transform(vec1, vec1, &modelView); + kmVec3TransformCoord(vec1, vec1, &modelView); kmVec3 *vec2 = (kmVec3*)&q->br.vertices; - kmVec3Transform(vec2, vec2, &modelView); + kmVec3TransformCoord(vec2, vec2, &modelView); kmVec3 *vec3 = (kmVec3*)&q->tr.vertices; - kmVec3Transform(vec3, vec3, &modelView); + kmVec3TransformCoord(vec3, vec3, &modelView); kmVec3 *vec4 = (kmVec3*)&q->tl.vertices; - kmVec3Transform(vec4, vec4, &modelView); + kmVec3TransformCoord(vec4, vec4, &modelView); } } @@ -366,6 +370,13 @@ void Renderer::drawBatchedQuads() //Set VBO data glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); + // option 1: subdata +// glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] ); + + // option 2: data +// glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW); + + // option 3: orphaning + glMapBuffer glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (_numQuads), nullptr, GL_DYNAMIC_DRAW); void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); memcpy(buf, _quads, sizeof(_quads[0])* (_numQuads)); diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h index 14328af61d..f1f351a631 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h @@ -1,7 +1,11 @@ #ifndef __CCB_CCBANIMATION_MANAGER_H__ #define __CCB_CCBANIMATION_MANAGER_H__ -#include "cocos2d.h" +#include "CCMap.h" +#include "CCActionInterval.h" +#include "CCActionInstant.h" +#include "CCActionEase.h" + #include "extensions/ExtensionMacros.h" #include "CCBSequence.h" #include "CCBSequenceProperty.h" diff --git a/cocos/editor-support/cocosbuilder/CCBKeyframe.h b/cocos/editor-support/cocosbuilder/CCBKeyframe.h index 49779319cc..e3c009e2df 100644 --- a/cocos/editor-support/cocosbuilder/CCBKeyframe.h +++ b/cocos/editor-support/cocosbuilder/CCBKeyframe.h @@ -1,7 +1,9 @@ #ifndef __CCB_KEYFRAME_H__ #define __CCB_KEYFRAME_H__ -#include "cocos2d.h" +#include "CCObject.h" +#include "CCValue.h" + namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h b/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h index 7c429ed505..4cafab98d6 100644 --- a/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h +++ b/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h @@ -1,7 +1,6 @@ #ifndef _CCB_CCBMEMBERVARIABLEASSIGNER_H_ #define _CCB_CCBMEMBERVARIABLEASSIGNER_H_ -#include "cocos2d.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index f190b72def..056f2553d0 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -1,7 +1,13 @@ -#include "CCBReader.h" - +#include #include +#include "CCDirector.h" +#include "platform/CCFileUtils.h" +#include "CCScene.h" +#include "CCTextureCache.h" +#include "CCSpriteFrameCache.h" + +#include "CCBReader.h" #include "CCNodeLoader.h" #include "CCNodeLoaderLibrary.h" #include "CCNodeLoaderListener.h" @@ -11,7 +17,7 @@ #include "CCBSequenceProperty.h" #include "CCBKeyframe.h" -#include + using namespace std; using namespace cocos2d; diff --git a/cocos/editor-support/cocosbuilder/CCBReader.h b/cocos/editor-support/cocosbuilder/CCBReader.h index 69306227ed..3c2a39c763 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.h +++ b/cocos/editor-support/cocosbuilder/CCBReader.h @@ -1,9 +1,12 @@ #ifndef _CCB_CCBREADER_H_ #define _CCB_CCBREADER_H_ -#include "cocos2d.h" #include #include +#include "CCNode.h" +#include "CCData.h" +#include "CCMap.h" + #include "CCBSequence.h" #include "extensions/GUI/CCControlExtension/CCControl.h" diff --git a/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h b/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h index f054c284c5..110d2ced61 100644 --- a/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h +++ b/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h @@ -1,7 +1,6 @@ #ifndef _CCB_CCBSELECTORRESOLVER_H_ #define _CCB_CCBSELECTORRESOLVER_H_ -#include "cocos2d.h" #include "extensions//GUI/CCControlExtension/CCInvocation.h" diff --git a/cocos/editor-support/cocosbuilder/CCBSequence.h b/cocos/editor-support/cocosbuilder/CCBSequence.h index dd7c1a899f..045fa536b5 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequence.h +++ b/cocos/editor-support/cocosbuilder/CCBSequence.h @@ -2,7 +2,8 @@ #define __CCB_CCSEQUENCE_H__ #include -#include "cocos2d.h" + +#include "CCObject.h" #include "CCBSequenceProperty.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h index 03ca04799f..fe19b15596 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h +++ b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h @@ -1,7 +1,8 @@ #ifndef __CCB_SEQUENCE_PROPERTY_H__ #define __CCB_SEQUENCE_PROPERTY_H__ -#include "cocos2d.h" +#include "CCObject.h" +#include "CCVector.h" #include "CCBKeyframe.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h index ae5cb20011..c24239c3f2 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h @@ -1,6 +1,9 @@ #ifndef _CCB_CCLABELBMFONTLOADER_H_ #define _CCB_CCLABELBMFONTLOADER_H_ +#include "CCObject.h" +#include "CCLabelBMFont.h" + #include "CCNodeLoader.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h index de0ca00d42..aa0fc0cdfe 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h @@ -1,6 +1,9 @@ #ifndef _CCB_CCLABELTTFLOADER_H_ #define _CCB_CCLABELTTFLOADER_H_ +#include "CCObject.h" +#include "CCLabelTTF.h" + #include "CCNodeLoader.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h index 5db15eacba..1156a46f13 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h @@ -1,6 +1,9 @@ #ifndef _CCB_CCMENUITEMLOADER_H_ #define _CCB_CCMENUITEMLOADER_H_ +#include "CCObject.h" +#include "CCMenuItem.h" + #include "CCLayerLoader.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCMenuLoader.h b/cocos/editor-support/cocosbuilder/CCMenuLoader.h index 851913c74c..75ff815f26 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuLoader.h @@ -2,6 +2,8 @@ #define _CCB_CCMENULOADER_H_ #include "CCLayerLoader.h" +#include "CCObject.h" +#include "CCMenu.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h index 7923d3c681..7dd0ed5ea8 100644 --- a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h +++ b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h @@ -1,7 +1,6 @@ #ifndef __CCB_CCNODE_RELATIVEPOSITIONING_H__ #define __CCB_CCNODE_RELATIVEPOSITIONING_H__ -#include "cocos2d.h" #include "CCBReader.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp index adb7b8d095..598f6cad11 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp @@ -1,9 +1,12 @@ +#include "cocos2d.h" + #include "CCNodeLoader.h" #include "CCBSelectorResolver.h" #include "CCBMemberVariableAssigner.h" #include "CCBAnimationManager.h" #include "CCNode+CCBRelativePositioning.h" + using namespace std; using namespace cocos2d; using namespace cocos2d::extension; diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.h b/cocos/editor-support/cocosbuilder/CCNodeLoader.h index bb18d03866..e67fcb047f 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.h @@ -2,7 +2,6 @@ #define _CCB_CCNODELOADER_H_ #include "extensions/GUI/CCControlExtension/CCInvocation.h" -#include "cocos2d.h" #include "CCBReader.h" #include "extensions/GUI/CCControlExtension/CCControl.h" diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h index c75276d22f..6fe711feda 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h @@ -1,7 +1,6 @@ #ifndef _CCB_CCNODELOADERLIBRARY_H_ #define _CCB_CCNODELOADERLIBRARY_H_ -#include "cocos2d.h" #include "CCBReader.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h index cf6c53e543..dedaafa51e 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h @@ -1,7 +1,6 @@ #ifndef _CCB_CCNODELOADERLISTENER_H_ #define _CCB_CCNODELOADERLISTENER_H_ -#include "cocos2d.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h index feced7312e..64efbdecba 100644 --- a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h +++ b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h @@ -1,6 +1,9 @@ #ifndef _CCB_CCPARTICLESYSTEMQUADLOADER_H_ #define _CCB_CCPARTICLESYSTEMQUADLOADER_H_ +#include "CCObject.h" +#include "CCParticleSystemQuad.h" + #include "CCNodeLoader.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocostudio/CCActionEaseEx.h b/cocos/editor-support/cocostudio/CCActionEaseEx.h index 0350d4d590..0a88c77e69 100644 --- a/cocos/editor-support/cocostudio/CCActionEaseEx.h +++ b/cocos/editor-support/cocostudio/CCActionEaseEx.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __ActionEaseEx_H__ #define __ActionEaseEx_H__ -#include "cocos2d.h" #include "cocostudio/CocoStudio.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCActionFrame.h b/cocos/editor-support/cocostudio/CCActionFrame.h index 5b152f4eb3..9ff01ddf05 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.h +++ b/cocos/editor-support/cocostudio/CCActionFrame.h @@ -25,7 +25,8 @@ THE SOFTWARE. #ifndef __ActionFRAME_H__ #define __ActionFRAME_H__ -#include "cocos2d.h" +#include "CCGeometry.h" +#include "CCActionInterval.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/CCActionFrameEasing.h index 65c9ad3a05..1ae824e482 100644 --- a/cocos/editor-support/cocostudio/CCActionFrameEasing.h +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __ActionFrameEasing_H__ #define __ActionFrameEasing_H__ -#include "cocos2d.h" +#include "CCObject.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.h b/cocos/editor-support/cocostudio/CCActionManagerEx.h index e24c48d436..ba4e0c7804 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __ActionMANAGER_H__ #define __ActionMANAGER_H__ -#include "cocos2d.h" #include "cocostudio/CCActionObject.h" #include "cocostudio/DictionaryHelper.h" diff --git a/cocos/editor-support/cocostudio/CCActionNode.h b/cocos/editor-support/cocostudio/CCActionNode.h index 42e4d0e4ee..9a2195327d 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.h +++ b/cocos/editor-support/cocostudio/CCActionNode.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __ActionNODE_H__ #define __ActionNODE_H__ -#include "cocos2d.h" #include "cocostudio/CCActionFrame.h" #include "cocostudio/DictionaryHelper.h" diff --git a/cocos/editor-support/cocostudio/CCActionObject.cpp b/cocos/editor-support/cocostudio/CCActionObject.cpp index eeba39d121..57291ae369 100644 --- a/cocos/editor-support/cocostudio/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/CCActionObject.cpp @@ -25,6 +25,10 @@ THE SOFTWARE. #include "cocostudio/CCActionObject.h" #include "cocostudio/DictionaryHelper.h" +#include "CCDirector.h" +#include "CCScheduler.h" +#include "CCActionInstant.h" + using namespace cocos2d; namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCActionObject.h b/cocos/editor-support/cocostudio/CCActionObject.h index 8d33a2017f..249489b620 100644 --- a/cocos/editor-support/cocostudio/CCActionObject.h +++ b/cocos/editor-support/cocostudio/CCActionObject.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __ActionObject_H__ #define __ActionObject_H__ -#include "cocos2d.h" #include "CCActionNode.h" #include "cocostudio/DictionaryHelper.h" diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index decc3cc0c2..80d6a4dca7 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -28,9 +28,12 @@ THE SOFTWARE. #include "cocostudio/CCDataReaderHelper.h" #include "cocostudio/CCDatas.h" #include "cocostudio/CCSkin.h" + #include "renderer/CCQuadCommand.h" -#include "CCRenderer.h" -#include "CCGroupCommand.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCGroupCommand.h" +#include "CCShaderCache.h" +#include "CCDrawingPrimitives.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" @@ -570,7 +573,7 @@ void CCArmature::drawContour() } DrawPrimitives::drawPoly( points, (unsigned int)length, true ); - delete points; + delete []points; } } } diff --git a/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp index 0848ab6226..de05838940 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCSpriteFrameCache.h" #include "cocostudio/CCArmatureDataManager.h" #include "cocostudio/CCTransformHelp.h" diff --git a/cocos/editor-support/cocostudio/CCArmatureDefine.h b/cocos/editor-support/cocostudio/CCArmatureDefine.h index 934b7bc43d..8c8eca2608 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDefine.h +++ b/cocos/editor-support/cocostudio/CCArmatureDefine.h @@ -26,8 +26,6 @@ THE SOFTWARE. #define __CCARMATUREDEFINE_H__ -#include "cocos2d.h" - #define VERSION_COMBINED 0.30f #define VERSION_CHANGE_ROTATION_RANGE 1.0f #define VERSION_COLOR_READING 1.1f diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index 45dcade7d6..634630ec64 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -26,8 +26,11 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCArmature.h" #include "cocostudio/CCSkin.h" -#include "CCRenderer.h" -#include "CCGroupCommand.h" + +#include "renderer/CCRenderer.h" +#include "renderer/CCGroupCommand.h" +#include "CCShaderCache.h" +#include "CCDirector.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/CCBatchNode.h b/cocos/editor-support/cocostudio/CCBatchNode.h index 1de8a963a2..f0ce41df2f 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/CCBatchNode.h @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __CCBATCHNODE_H__ #define __CCBATCHNODE_H__ +#include "CCNode.h" #include "cocostudio/CCArmatureDefine.h" namespace cocos2d { diff --git a/cocos/editor-support/cocostudio/CCComBase.h b/cocos/editor-support/cocostudio/CCComBase.h index 59dfccbe7f..2f32d20045 100644 --- a/cocos/editor-support/cocostudio/CCComBase.h +++ b/cocos/editor-support/cocostudio/CCComBase.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __CC_EXTENTIONS_CCCOMBASE_H__ #define __CC_EXTENTIONS_CCCOMBASE_H__ -#include "cocos2d.h" #include "ObjectFactory.h" #include "DictionaryHelper.h" #include diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index 452f25d9b8..13ceb9db6d 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -22,7 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "platform/CCFileUtils.h" +#include "CCDirector.h" +#include "CCScheduler.h" + #include "tinyxml2.h" + #include "cocostudio/CCDataReaderHelper.h" #include "cocostudio/CCArmatureDataManager.h" #include "cocostudio/CCTransformHelp.h" @@ -288,7 +293,7 @@ void DataReaderHelper::addDataFromFile(const std::string& filePath) std::string str = &filePathStr[startPos]; // Read content from file - std::string fullPath = CCFileUtils::getInstance()->fullPathForFilename(filePath); + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath); std::string contentStr = FileUtils::getInstance()->getStringFromFile(fullPath); DataInfo dataInfo; @@ -384,7 +389,7 @@ void DataReaderHelper::addDataFromFileAsync(const std::string& imagePath, const size_t startPos = filePathStr.find_last_of("."); std::string str = &filePathStr[startPos]; - std::string fullPath = CCFileUtils::getInstance()->fullPathForFilename(filePath); + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath); // XXX fileContent is being leaked data->fileContent = FileUtils::getInstance()->getStringFromFile(fullPath); @@ -461,7 +466,7 @@ void DataReaderHelper::addDataAsyncCallBack(float dt) if (0 == _asyncRefCount) { _asyncRefTotalCount = 0; - CCDirector::getInstance()->getScheduler()->unscheduleSelector(schedule_selector(DataReaderHelper::addDataAsyncCallBack), this); + Director::getInstance()->getScheduler()->unscheduleSelector(schedule_selector(DataReaderHelper::addDataAsyncCallBack), this); } } } diff --git a/cocos/editor-support/cocostudio/CCDatas.h b/cocos/editor-support/cocostudio/CCDatas.h index 42ac9ae2f6..6ee2adbcf6 100644 --- a/cocos/editor-support/cocostudio/CCDatas.h +++ b/cocos/editor-support/cocostudio/CCDatas.h @@ -25,6 +25,12 @@ THE SOFTWARE. #ifndef __CCARMATURE_DATAS_H__ #define __CCARMATURE_DATAS_H__ +#include "CCObject.h" +#include "ccTypes.h" +#include "CCVector.h" +#include "CCMap.h" +#include "CCAffineTransform.h" +#include "CCNode.h" #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCTweenFunction.h" diff --git a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp index 7463ff54ff..72428edfff 100644 --- a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp @@ -30,6 +30,8 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDataManager.h" #include "cocostudio/CCTransformHelp.h" +#include "CCParticleSystemQuad.h" + using namespace cocos2d; namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp index c2ce242a47..ca07edaae7 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -28,6 +28,8 @@ THE SOFTWARE. #include "cocostudio/CCUtilMath.h" #include "cocostudio/CCSkin.h" +#include "CCParticleSystemQuad.h" + using namespace cocos2d; namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/CCInputDelegate.cpp index 3f3d94745e..14e5f4b6f5 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/CCInputDelegate.cpp @@ -23,6 +23,11 @@ THE SOFTWARE. ****************************************************************************/ #include "cocostudio/CCInputDelegate.h" +#include "CCDirector.h" +#include "CCDevice.h" +#include "CCEventListenerTouch.h" +#include "CCEventListenerAcceleration.h" +#include "CCEventListenerKeyboard.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.h b/cocos/editor-support/cocostudio/CCInputDelegate.h index 81cd4c9218..9341179bf8 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.h +++ b/cocos/editor-support/cocostudio/CCInputDelegate.h @@ -25,7 +25,12 @@ THE SOFTWARE. #ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__ #define __CC_EXTENTIONS_CCINPUTDELEGATE_H__ -#include "cocos2d.h" +#include "CCPlatformMacros.h" +#include "CCTouch.h" +#include "CCEvent.h" +#include "ccTypes.h" +#include "CCEventKeyboard.h" +#include "CCEventListener.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index 6b72b82574..19ca837c6a 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __CCSSCENEREADER_H__ #define __CCSSCENEREADER_H__ -#include "cocos2d.h" #include "cocostudio/DictionaryHelper.h" diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index d26199c205..da98e5a736 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -22,11 +22,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCSpriteFrame.h" +#include "CCSpriteFrameCache.h" +#include "CCDirector.h" +#include "renderer/CCRenderer.h" + #include "cocostudio/CCSkin.h" #include "cocostudio/CCTransformHelp.h" #include "cocostudio/CCSpriteFrameCacheHelper.h" #include "cocostudio/CCArmature.h" + using namespace cocos2d; namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h index e0f255e70d..4798b2345b 100644 --- a/cocos/editor-support/cocostudio/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -25,9 +25,11 @@ THE SOFTWARE. #ifndef __CCSKIN_H__ #define __CCSKIN_H__ +#include "CCSprite.h" +#include "renderer/CCQuadCommand.h" + #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCBone.h" -#include "renderer/CCQuadCommand.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp index c5399ba479..1c226668db 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp @@ -24,6 +24,8 @@ THE SOFTWARE. #include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "CCSpriteFrameCache.h" + using namespace cocos2d; @@ -49,7 +51,7 @@ void SpriteFrameCacheHelper::purge() void SpriteFrameCacheHelper::addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath) { - CCSpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath, imagePath); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath, imagePath); } SpriteFrameCacheHelper::SpriteFrameCacheHelper() diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index 75797c1aa2..d60154f901 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -24,6 +24,7 @@ THE SOFTWARE. #ifndef __CCSPRITEFRAMECACHEHELPER_H__ #define __CCSPRITEFRAMECACHEHELPER_H__ +#include "CCPlatformMacros.h" #include "cocostudio/CCArmatureDefine.h" #include diff --git a/cocos/editor-support/cocostudio/CCUtilMath.h b/cocos/editor-support/cocostudio/CCUtilMath.h index b10690d620..cc27ccae86 100644 --- a/cocos/editor-support/cocostudio/CCUtilMath.h +++ b/cocos/editor-support/cocostudio/CCUtilMath.h @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __CCUTILMATH_H__ #define __CCUTILMATH_H__ +#include "CCSprite.h" #include "cocostudio/CCArmatureDefine.h" #include diff --git a/cocos/editor-support/cocostudio/DictionaryHelper.cpp b/cocos/editor-support/cocostudio/DictionaryHelper.cpp index 0c46694e7b..436c345d0c 100644 --- a/cocos/editor-support/cocostudio/DictionaryHelper.cpp +++ b/cocos/editor-support/cocostudio/DictionaryHelper.cpp @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformMacros.h" #include "cocostudio/DictionaryHelper.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/DictionaryHelper.h b/cocos/editor-support/cocostudio/DictionaryHelper.h index 58f58455f5..cefb9610ff 100644 --- a/cocos/editor-support/cocostudio/DictionaryHelper.h +++ b/cocos/editor-support/cocostudio/DictionaryHelper.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __DICTIONARYHELPER_H__ #define __DICTIONARYHELPER_H__ -#include "cocos2d.h" #include "json/document.h" #define DICTOOL DictionaryHelper::getInstance() diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index f1cffffea6..a2460ca690 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -35,7 +35,11 @@ #define SPINE_CCSKELETON_H_ #include -#include "cocos2d.h" + +#include "CCNode.h" +#include "CCProtocols.h" +#include "CCTextureAtlas.h" +#include "renderer/CCCustomCommand.h" namespace spine { diff --git a/cocos/editor-support/spine/CCSkeletonAnimation.h b/cocos/editor-support/spine/CCSkeletonAnimation.h index 228a07b88e..3c09ee28c3 100644 --- a/cocos/editor-support/spine/CCSkeletonAnimation.h +++ b/cocos/editor-support/spine/CCSkeletonAnimation.h @@ -36,7 +36,6 @@ #include #include -#include "cocos2d.h" namespace spine { diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index e4c9c1f66f..38c73c5a65 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -30,9 +30,9 @@ THE SOFTWARE. #include "CCShaderCache.h" #include "CCDirector.h" #include "CCDrawingPrimitives.h" -#include "CCRenderer.h" -#include "CCGroupCommand.h" -#include "CCCustomCommand.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCGroupCommand.h" +#include "renderer/CCCustomCommand.h" NS_CC_BEGIN diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index cc19b72524..0e833ef6e0 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -25,10 +25,15 @@ ****************************************************************************/ #include "HttpClient.h" + #include #include #include +#include "CCVector.h" +#include "CCDirector.h" +#include "CCScheduler.h" + #include "curl/curl.h" #include "platform/CCFileUtils.h" diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index 74f498e942..8c57bb2586 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -27,8 +27,6 @@ #ifndef __CCHTTPREQUEST_H__ #define __CCHTTPREQUEST_H__ -#include "cocos2d.h" - #include "network/HttpRequest.h" #include "network/HttpResponse.h" #include "network/HttpClient.h" diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index 50d660bca3..8ca5eee84d 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -26,7 +26,8 @@ #ifndef __HTTP_REQUEST_H__ #define __HTTP_REQUEST_H__ -#include "cocos2d.h" +#include "CCPlatformMacros.h" +#include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/network/HttpResponse.h b/cocos/network/HttpResponse.h index 764ddde120..ebad23ec64 100644 --- a/cocos/network/HttpResponse.h +++ b/cocos/network/HttpResponse.h @@ -26,7 +26,6 @@ #ifndef __HTTP_RESPONSE__ #define __HTTP_RESPONSE__ -#include "cocos2d.h" #include "network/HttpRequest.h" NS_CC_BEGIN diff --git a/cocos/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h index 52ba0f527d..09574a22cc 100644 --- a/cocos/physics/CCPhysicsBody.h +++ b/cocos/physics/CCPhysicsBody.h @@ -300,29 +300,29 @@ protected: virtual ~PhysicsBody(); protected: - Node* _node; - std::vector _joints; - Vector _shapes; - PhysicsWorld* _world; - PhysicsBodyInfo* _info; - bool _dynamic; - bool _enable; - bool _rotationEnable; - bool _gravityEnable; - bool _massDefault; - bool _momentDefault; - float _mass; - float _area; - float _density; - float _moment; - float _linearDamping; - float _angularDamping; - int _tag; + Node* _node; + std::vector _joints; + Vector _shapes; + PhysicsWorld* _world; + PhysicsBodyInfo* _info; + bool _dynamic; + bool _enable; + bool _rotationEnable; + bool _gravityEnable; + bool _massDefault; + bool _momentDefault; + float _mass; + float _area; + float _density; + float _moment; + float _linearDamping; + float _angularDamping; + int _tag; - int _categoryBitmask; - int _collisionBitmask; - int _contactTestBitmask; - int _group; + int _categoryBitmask; + int _collisionBitmask; + int _contactTestBitmask; + int _group; friend class PhysicsWorld; friend class PhysicsShape; diff --git a/cocos/scripting/lua/bindings/lua_xml_http_request.h b/cocos/scripting/lua/bindings/lua_xml_http_request.h index 8d0ae45394..c76f1ba383 100644 --- a/cocos/scripting/lua/bindings/lua_xml_http_request.h +++ b/cocos/scripting/lua/bindings/lua_xml_http_request.h @@ -32,6 +32,8 @@ extern "C" { } #endif +#include +#include #include "network/HttpClient.h" diff --git a/extensions/GUI/CCControlExtension/CCControl.h b/extensions/GUI/CCControlExtension/CCControl.h index 4e36bbe753..5c1815291f 100644 --- a/extensions/GUI/CCControlExtension/CCControl.h +++ b/extensions/GUI/CCControlExtension/CCControl.h @@ -31,12 +31,11 @@ #define __CCCONTROL_H__ #include "CCControlUtils.h" -#include "cocos2d.h" +#include "CCLayer.h" NS_CC_EXT_BEGIN - class Invocation; /** diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index d4208c0566..35202c6cec 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -33,6 +33,7 @@ #include "CCControl.h" #include "CCInvocation.h" #include "CCScale9Sprite.h" +#include "CCMap.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp index ab3fccdb74..b813750887 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp @@ -26,7 +26,6 @@ */ #include "CCControlPotentiometer.h" -#include "cocos2d.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h index bebe39b382..74d0219bc9 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h @@ -28,6 +28,7 @@ #define __CCCONTROLPOTENTIOMETER_H__ #include "CCControl.h" +#include "CCProgressTimer.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.h b/extensions/GUI/CCControlExtension/CCControlStepper.h index 1741e8c8a8..2376db9c99 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.h +++ b/extensions/GUI/CCControlExtension/CCControlStepper.h @@ -29,6 +29,7 @@ #define __CCCONTROLSTEPPER_H__ #include "CCControl.h" +#include "CCLabelTTF.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index f583398f06..9e18e6c496 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -26,7 +26,12 @@ */ #include "CCControlSwitch.h" -#include "cocos2d.h" +#include "CCSprite.h" +#include "CCActionTween.h" +#include "CClabelTTF.h" +#include "CCClippingNode.h" +#include "ccShaders.h" +#include "CCRenderTexture.h" NS_CC_EXT_BEGIN // ControlSwitchSprite diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp index 532c7fcf06..9f1a19e813 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp @@ -26,6 +26,9 @@ THE SOFTWARE. ****************************************************************************/ #include "CCScale9Sprite.h" +#include "CCPlatformMacros.h" +#include "CCSprite.h" +#include "CCSpriteFrameCache.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/extensions/GUI/CCControlExtension/CCScale9Sprite.h index 6b91aac717..fbeca870eb 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -28,7 +28,10 @@ THE SOFTWARE. #ifndef __CCScale9Sprite_H__ #define __CCScale9Sprite_H__ -#include "cocos2d.h" +#include "CCNode.h" +#include "CCSpriteFrame.h" +#include "CCSpriteBatchNode.h" + #include "../../ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h index a1aac55d6e..ff6a4149b4 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ b/extensions/GUI/CCEditBox/CCEditBox.h @@ -26,7 +26,7 @@ #ifndef __CCEDITTEXT_H__ #define __CCEDITTEXT_H__ -#include "cocos2d.h" +#include "CCIMEDelegate.h" #include "extensions/ExtensionMacros.h" #include "../CCControlExtension/CCControlExtensions.h" diff --git a/extensions/GUI/CCEditBox/CCEditBoxImpl.h b/extensions/GUI/CCEditBox/CCEditBoxImpl.h index b01362eff0..7cb6c6ed1c 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImpl.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImpl.h @@ -26,7 +26,6 @@ #ifndef __CCEditBoxIMPL_H__ #define __CCEditBoxIMPL_H__ -#include "cocos2d.h" #include "extensions/ExtensionMacros.h" #include "CCEditBox.h" diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 05200d32cb..01bfb8ab82 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -24,6 +24,13 @@ ****************************************************************************/ #include "CCScrollView.h" +#include "CCEGLView.h" +#include "CCDevice.h" +#include "CCActionInstant.h" +#include "CCActionInterval.h" +#include "CCActionTween.h" +#include "CCDirector.h" +#include "renderer/CCRenderer.h" #include diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index c77d74bc13..88fc9b4523 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -26,7 +26,9 @@ #ifndef __CCSCROLLVIEW_H__ #define __CCSCROLLVIEW_H__ -#include "cocos2d.h" +#include "CCLayer.h" +#include "CCEventListenerTouch.h" + #include "extensions/ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index ff143f77d5..ad639e4986 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -23,7 +23,6 @@ THE SOFTWARE. ****************************************************************************/ -#include "cocos2d.h" #include "CCTableView.h" #include "CCTableViewCell.h" diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index 7df9c478fd..aa1cf70bca 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -33,7 +33,7 @@ void TableViewCell::reset() _idx = CC_INVALID_INDEX; } -ssize_t TableViewCell::getIdx() +ssize_t TableViewCell::getIdx() const { return _idx; } diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index 33438a0f96..fb0a509df1 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -26,8 +26,8 @@ #ifndef __CCTABLEVIEWCELL_H__ #define __CCTABLEVIEWCELL_H__ -#include "cocos2d.h" #include "extensions/ExtensionMacros.h" +#include "CCNode.h" NS_CC_EXT_BEGIN @@ -43,7 +43,7 @@ public: /** * The index used internally by SWTableView and its subclasses */ - ssize_t getIdx(); + ssize_t getIdx() const; void setIdx(ssize_t uIdx); /** * Cleans up any resources linked to this cell and resets idx property. diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index fe4d167bff..5d4eb2f2f0 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -23,11 +23,12 @@ #ifndef __PHYSICSNODES_DEBUGNODE_H__ #define __PHYSICSNODES_DEBUGNODE_H__ -#include "cocos2d.h" #include "extensions/ExtensionMacros.h" #if CC_ENABLE_CHIPMUNK_INTEGRATION +#include "CCDrawNode.h" + #include "chipmunk.h" NS_CC_EXT_BEGIN diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index fcedfca031..e8f9284a98 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -24,7 +24,7 @@ #ifndef __PHYSICSNODES_CCPHYSICSSPRITE_H__ #define __PHYSICSNODES_CCPHYSICSSPRITE_H__ -#include "cocos2d.h" +#include "CCSprite.h" #include "extensions/ExtensionMacros.h" struct cpBody; From cfbceb0e22f7b725d7336d432e66945f2063b772 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 16 Jan 2014 21:49:14 -0800 Subject: [PATCH 2/3] Fixes compilation issues on Linux --- cocos/2d/platform/linux/CCImage.cpp | 2 +- cocos/2d/renderer/CCRenderer.cpp | 10 +++++----- cocos/editor-support/cocostudio/CCDataReaderHelper.h | 1 + .../cocostudio/CCSpriteFrameCacheHelper.h | 1 + cocos/network/HttpClient.cpp | 2 ++ extensions/GUI/CCControlExtension/CCControlSwitch.cpp | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cocos/2d/platform/linux/CCImage.cpp b/cocos/2d/platform/linux/CCImage.cpp index 45602638b5..0d53db0c19 100644 --- a/cocos/2d/platform/linux/CCImage.cpp +++ b/cocos/2d/platform/linux/CCImage.cpp @@ -459,7 +459,7 @@ bool Image::initWithString( { bool bRet = false; do - { + { CC_BREAK_IF(! pText); BitmapDC &dc = sharedBitmapDC(); diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 30495a8aa3..61d0038df6 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -338,16 +338,16 @@ void Renderer::convertToWorldCoordiantes(V3F_C4B_T2F_Quad* quads, ssize_t quanti V3F_C4B_T2F_Quad *q = &quads[i]; kmVec3 *vec1 = (kmVec3*)&q->bl.vertices; - kmVec3TransformCoord(vec1, vec1, &modelView); + kmVec3Transform(vec1, vec1, &modelView); kmVec3 *vec2 = (kmVec3*)&q->br.vertices; - kmVec3TransformCoord(vec2, vec2, &modelView); + kmVec3Transform(vec2, vec2, &modelView); kmVec3 *vec3 = (kmVec3*)&q->tr.vertices; - kmVec3TransformCoord(vec3, vec3, &modelView); + kmVec3Transform(vec3, vec3, &modelView); kmVec3 *vec4 = (kmVec3*)&q->tl.vertices; - kmVec3TransformCoord(vec4, vec4, &modelView); + kmVec3Transform(vec4, vec4, &modelView); } } @@ -465,4 +465,4 @@ void Renderer::flush() _lastMaterialID = 0; } -NS_CC_END \ No newline at end of file +NS_CC_END diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h index 03ed25133b..ac580d6385 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -35,6 +35,7 @@ THE SOFTWARE. #include #include #include +#include namespace tinyxml2 { diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index d60154f901..452666a67d 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include "CCPlatformMacros.h" #include "cocostudio/CCArmatureDefine.h" #include +#include namespace cocostudio { diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index 0e833ef6e0..771a23c6f8 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -28,6 +28,8 @@ #include #include +#include + #include #include "CCVector.h" diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index 9e18e6c496..e37c76735f 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -28,7 +28,7 @@ #include "CCControlSwitch.h" #include "CCSprite.h" #include "CCActionTween.h" -#include "CClabelTTF.h" +#include "CCLabelTTF.h" #include "CCClippingNode.h" #include "ccShaders.h" #include "CCRenderTexture.h" From 1b5b9da102053ca96c15b7c2c1e8d3bfdf417327 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 16 Jan 2014 21:58:14 -0800 Subject: [PATCH 3/3] compiles on Android compiles on Android --- cocos/editor-support/cocostudio/CCInputDelegate.cpp | 2 +- extensions/GUI/CCScrollView/CCScrollView.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/CCInputDelegate.cpp index 14e5f4b6f5..1bafbe42f2 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/CCInputDelegate.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "cocostudio/CCInputDelegate.h" #include "CCDirector.h" -#include "CCDevice.h" +#include "platform/CCDevice.h" #include "CCEventListenerTouch.h" #include "CCEventListenerAcceleration.h" #include "CCEventListenerKeyboard.h" diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 01bfb8ab82..e1c21ce3a6 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -25,7 +25,7 @@ #include "CCScrollView.h" #include "CCEGLView.h" -#include "CCDevice.h" +#include "platform/CCDevice.h" #include "CCActionInstant.h" #include "CCActionInterval.h" #include "CCActionTween.h"