From 5c71bc9e320ab04e16434b387e28324b7cf4ac9b Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Wed, 20 Dec 2023 23:14:53 -0300 Subject: [PATCH] get windows further along --- loader/include/Geode/c++stl/msvcstl.hpp | 32 ++++--- loader/include/Geode/cocos/CCDirector.h | 5 ++ loader/include/Geode/cocos/actions/CCAction.h | 2 + .../Geode/cocos/actions/CCActionCamera.h | 1 + .../Geode/cocos/actions/CCActionEase.h | 3 + .../Geode/cocos/actions/CCActionGrid.h | 9 ++ .../Geode/cocos/actions/CCActionInstant.h | 2 + .../Geode/cocos/actions/CCActionInterval.h | 3 + .../Geode/cocos/actions/CCActionTween.h | 3 + .../include/Geode/cocos/base_nodes/CCNode.h | 13 +++ loader/include/Geode/cocos/cocoa/CCArray.h | 6 ++ loader/include/Geode/cocos/cocoa/CCBool.h | 1 + .../include/Geode/cocos/cocoa/CCDictionary.h | 3 + loader/include/Geode/cocos/cocoa/CCGeometry.h | 15 ++++ loader/include/Geode/cocos/cocoa/CCInteger.h | 1 + loader/include/Geode/cocos/cocoa/CCString.h | 2 +- .../Geode/cocos/draw_nodes/CCDrawNode.h | 6 ++ loader/include/Geode/cocos/include/cocos2d.h | 1 + .../Geode/cocos/label_nodes/CCLabelBMFont.h | 16 +++- .../layers_scenes_transitions_nodes/CCLayer.h | 9 ++ .../include/Geode/cocos/menu_nodes/CCMenu.h | 1 + .../Geode/cocos/misc_nodes/CCMotionStreak.h | 13 +++ .../Geode/cocos/misc_nodes/CCProgressTimer.h | 1 + .../Geode/cocos/misc_nodes/CCRenderTexture.h | 2 + .../cocos/particle_nodes/CCParticleSystem.h | 87 ++++++++++++++++++- .../particle_nodes/CCParticleSystemQuad.h | 11 ++- .../cocos/platform/CCAccelerometerDelegate.h | 3 + .../cocos/platform/CCApplicationProtocol.h | 2 +- .../Geode/cocos/platform/CCEGLViewProtocol.h | 4 + .../Geode/cocos/platform/CCFileUtils.h | 4 + loader/include/Geode/cocos/platform/CCImage.h | 3 +- .../cocos/platform/win32/CCApplication.h | 16 ++++ .../Geode/cocos/platform/win32/CCEGLView.h | 32 +++++++ .../CCKeyboardDispatcher.h | 6 +- .../Geode/cocos/robtop/xml/DS_Dictionary.h | 10 +-- .../include/Geode/cocos/shaders/CCGLProgram.h | 2 + .../Geode/cocos/sprite_nodes/CCSprite.h | 5 ++ .../cocos/sprite_nodes/CCSpriteBatchNode.h | 1 + .../Geode/cocos/sprite_nodes/CCSpriteFrame.h | 2 + .../cocos/support/zip_support/ZipUtils.h | 1 + .../cocos/text_input_node/CCIMEDelegate.h | 4 +- .../cocos/text_input_node/CCIMEDispatcher.h | 7 +- .../cocos/text_input_node/CCTextFieldTTF.h | 4 +- .../Geode/cocos/textures/CCTexture2D.h | 3 + .../Geode/cocos/textures/CCTextureCache.h | 5 +- .../tilemap_parallax_nodes/CCTMXXMLParser.h | 1 + .../CCTouchDelegateProtocol.h | 4 + .../touch_dispatcher/CCTouchDispatcher.h | 5 ++ 48 files changed, 339 insertions(+), 33 deletions(-) diff --git a/loader/include/Geode/c++stl/msvcstl.hpp b/loader/include/Geode/c++stl/msvcstl.hpp index 763f8f8d..dafd11e7 100644 --- a/loader/include/Geode/c++stl/msvcstl.hpp +++ b/loader/include/Geode/c++stl/msvcstl.hpp @@ -7,6 +7,9 @@ #include <utility> #include <map> #include <vector> +#include <unordered_map> +#include <unordered_set> +#include <set> namespace gd { struct InternalString { @@ -41,47 +44,47 @@ namespace gd { } string(string const& param) : string() { - (void)this->winAssign(param.c_str(), param.size()); + // (void)this->winAssign(param.c_str(), param.size()); } string(string&& param) : string() { - (void)this->winAssign(param.c_str(), param.size()); + // (void)this->winAssign(param.c_str(), param.size()); } string(char const* param) : string() { - (void)this->winAssign(param, std::strlen(param)); + // (void)this->winAssign(param, std::strlen(param)); } string(std::string const& param) : string() { - (void)this->winAssign(param.c_str(), param.size()); + // (void)this->winAssign(param.c_str(), param.size()); } string& operator=(string const& param) { - (void)this->winAssign(param.c_str(), param.size()); + // (void)this->winAssign(param.c_str(), param.size()); return *this; } string& operator=(string&& param) { - (void)this->winAssign(param.c_str(), param.size()); + // (void)this->winAssign(param.c_str(), param.size()); return *this; } string& operator=(char const* param) { - (void)this->winAssign(param, std::strlen(param)); + // (void)this->winAssign(param, std::strlen(param)); return *this; } string& operator=(std::string const& param) { - (void)this->winAssign(param.c_str(), param.size()); + // (void)this->winAssign(param.c_str(), param.size()); return *this; } void clear() { - (void)this->winDtor(); + // (void)this->winDtor(); } ~string() { - (void)this->winDtor(); + // (void)this->winDtor(); } char& at(size_t pos) { @@ -144,4 +147,13 @@ namespace gd { template <class K, class V> using map = std::map<K, V>; + + template <class K, class V> + using unordered_map = std::unordered_map<K, V>; + + template <class K> + using set = std::set<K>; + + template <class K> + using unordered_set = std::unordered_set<K>; } diff --git a/loader/include/Geode/cocos/CCDirector.h b/loader/include/Geode/cocos/CCDirector.h index 2b62a7cd..82a45ddb 100644 --- a/loader/include/Geode/cocos/CCDirector.h +++ b/loader/include/Geode/cocos/CCDirector.h @@ -378,6 +378,11 @@ public: void updateContentScale(TextureQuality); void updateScreenScale(CCSize); + void applySmoothFix(); + void createStatsLabel(); + void showFPSLabel(); + void toggleShowFPS(bool, gd::string, cocos2d::CCPoint); + protected: CC_SYNTHESIZE_READONLY_NV(float, m_fScreenScaleFactor, ScreenScaleFactor); CC_SYNTHESIZE_READONLY_NV(float, m_fScreenScaleFactorMax, ScreenScaleFactorMax); diff --git a/loader/include/Geode/cocos/actions/CCAction.h b/loader/include/Geode/cocos/actions/CCAction.h index 2311c362..5425740b 100644 --- a/loader/include/Geode/cocos/actions/CCAction.h +++ b/loader/include/Geode/cocos/actions/CCAction.h @@ -145,6 +145,8 @@ class CC_DLL CCFiniteTimeAction : public CCAction { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCFiniteTimeAction, CCAction) + /** * @js ctor */ diff --git a/loader/include/Geode/cocos/actions/CCActionCamera.h b/loader/include/Geode/cocos/actions/CCActionCamera.h index be554d34..e19e716e 100644 --- a/loader/include/Geode/cocos/actions/CCActionCamera.h +++ b/loader/include/Geode/cocos/actions/CCActionCamera.h @@ -45,6 +45,7 @@ class CC_DLL CCActionCamera : public CCActionInterval //<NSCopying> { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCActionCamera, CCActionInterval) /** * @js ctor */ diff --git a/loader/include/Geode/cocos/actions/CCActionEase.h b/loader/include/Geode/cocos/actions/CCActionEase.h index cf3471d4..0a4850a5 100644 --- a/loader/include/Geode/cocos/actions/CCActionEase.h +++ b/loader/include/Geode/cocos/actions/CCActionEase.h @@ -46,6 +46,9 @@ class CC_DLL CCActionEase : public CCActionInterval { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCActionEase, CCActionInterval); + CCActionEase() {} + /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/actions/CCActionGrid.h b/loader/include/Geode/cocos/actions/CCActionGrid.h index 96dd0abf..9b80f062 100644 --- a/loader/include/Geode/cocos/actions/CCActionGrid.h +++ b/loader/include/Geode/cocos/actions/CCActionGrid.h @@ -121,6 +121,9 @@ class CC_DLL CCAccelDeccelAmplitude : public CCActionInterval { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAccelDeccelAmplitude, CCActionInterval) + CCAccelDeccelAmplitude() {} + /** * @js NA * @lua NA @@ -152,6 +155,9 @@ class CC_DLL CCAccelAmplitude : public CCActionInterval { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAccelAmplitude, CCActionInterval); + CCAccelAmplitude() {} + /** * @js NA * @lua NA @@ -182,6 +188,9 @@ class CC_DLL CCDeccelAmplitude : public CCActionInterval { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCDeccelAmplitude, CCActionInterval); + CCDeccelAmplitude() {} + /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/actions/CCActionInstant.h b/loader/include/Geode/cocos/actions/CCActionInstant.h index 5cbfd53f..fd12dec3 100644 --- a/loader/include/Geode/cocos/actions/CCActionInstant.h +++ b/loader/include/Geode/cocos/actions/CCActionInstant.h @@ -46,6 +46,8 @@ class CC_DLL CCActionInstant : public CCFiniteTimeAction //<NSCopying> { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCActionInstant, CCFiniteTimeAction) + /** * @js ctor */ diff --git a/loader/include/Geode/cocos/actions/CCActionInterval.h b/loader/include/Geode/cocos/actions/CCActionInterval.h index 1308a303..fc1417e5 100644 --- a/loader/include/Geode/cocos/actions/CCActionInterval.h +++ b/loader/include/Geode/cocos/actions/CCActionInterval.h @@ -62,6 +62,9 @@ class CC_DLL CCActionInterval : public CCFiniteTimeAction { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCActionInterval, CCFiniteTimeAction) + CCActionInterval() {} + /** how many seconds had elapsed since the actions started to run. */ inline float getElapsed(void) { return m_elapsed; } diff --git a/loader/include/Geode/cocos/actions/CCActionTween.h b/loader/include/Geode/cocos/actions/CCActionTween.h index e5aec87a..38dbff4a 100644 --- a/loader/include/Geode/cocos/actions/CCActionTween.h +++ b/loader/include/Geode/cocos/actions/CCActionTween.h @@ -70,6 +70,9 @@ class CC_DLL CCActionTween : public CCActionInterval public: /** creates an initializes the action with the property name (key), and the from and to parameters. */ static CCActionTween* create(float aDuration, const char* key, float from, float to); + + static cocos2d::CCActionTween* create(float, int, float, float); + /** initializes the action with the property name (key), and the from and to parameters. */ bool initWithDuration(float aDuration, const char* key, float from, float to); diff --git a/loader/include/Geode/cocos/base_nodes/CCNode.h b/loader/include/Geode/cocos/base_nodes/CCNode.h index aaa7c80c..4775da23 100644 --- a/loader/include/Geode/cocos/base_nodes/CCNode.h +++ b/loader/include/Geode/cocos/base_nodes/CCNode.h @@ -1592,6 +1592,19 @@ public: // 2.2 additions virtual void updateTweenActionInt(float, int); + cocos2d::CCAffineTransform getTransformTemp(); + + bool getUseChildIndex(); + void setUseChildIndex(bool); + void qsortAllChildrenWithIndex(); + + static void resetGlobalOrderOfArrival(); + + void sortAllChildrenNoIndex(); + void sortAllChildrenWithIndex(); + void updateChildIndexes(); + + private: /// lazy allocs void childrenAlloc(void); diff --git a/loader/include/Geode/cocos/cocoa/CCArray.h b/loader/include/Geode/cocos/cocoa/CCArray.h index 282d804c..3fa0afa5 100644 --- a/loader/include/Geode/cocos/cocoa/CCArray.h +++ b/loader/include/Geode/cocos/cocoa/CCArray.h @@ -236,6 +236,12 @@ public: */ void fastRemoveObjectAtIndexNew(unsigned int index); + void fastRemoveObjectAtIndexChild(unsigned int); + + void recreateNewIndexes(); + void removeObjectAtIndexChild(unsigned int, bool); + + // Rearranging Content /** Swap two elements */ diff --git a/loader/include/Geode/cocos/cocoa/CCBool.h b/loader/include/Geode/cocos/cocoa/CCBool.h index 9b795836..61a4adbc 100644 --- a/loader/include/Geode/cocos/cocoa/CCBool.h +++ b/loader/include/Geode/cocos/cocoa/CCBool.h @@ -43,6 +43,7 @@ public: CCBool(bool v) : m_bValue(v) {} bool getValue() const {return m_bValue;} + bool setValue(bool value) { m_bValue = value; } static CCBool* create(bool v) { diff --git a/loader/include/Geode/cocos/cocoa/CCDictionary.h b/loader/include/Geode/cocos/cocoa/CCDictionary.h index cc158917..d85f5bd2 100644 --- a/loader/include/Geode/cocos/cocoa/CCDictionary.h +++ b/loader/include/Geode/cocos/cocoa/CCDictionary.h @@ -400,6 +400,9 @@ public: */ virtual void acceptVisitor(CCDataVisitor &visitor); + char const* charForKey(gd::string const&); + gd::string getFirstKey(); + private: /** * For internal usage, invoked by setObject. diff --git a/loader/include/Geode/cocos/cocoa/CCGeometry.h b/loader/include/Geode/cocos/cocoa/CCGeometry.h index 7fa883e0..7fa2c92e 100644 --- a/loader/include/Geode/cocos/cocoa/CCGeometry.h +++ b/loader/include/Geode/cocos/cocoa/CCGeometry.h @@ -286,6 +286,13 @@ public: { return CCPoint(cosf(a), sinf(a)); } + + void add(int, float); + float at(int); + bool isZero() const; + void set(int, float); + void swap(); + }; /** @@ -367,6 +374,11 @@ public: inline float aspect() const { return this->width / this->height; } + + void add(int, float); + float at(int); + void set(int, float); + }; // alk cont @@ -463,6 +475,9 @@ public: getMaxY() < rect.getMinY() || rect.getMaxY() < getMinY()); } + + float getMax(int); + float getMin(int); }; diff --git a/loader/include/Geode/cocos/cocoa/CCInteger.h b/loader/include/Geode/cocos/cocoa/CCInteger.h index 86e644ed..104d9e99 100644 --- a/loader/include/Geode/cocos/cocoa/CCInteger.h +++ b/loader/include/Geode/cocos/cocoa/CCInteger.h @@ -18,6 +18,7 @@ public: CCInteger(int v) : m_nValue(v) {} int getValue() const {return m_nValue;} + void setValue(int v) { m_nValue = v; }; static CCInteger* create(int v) { diff --git a/loader/include/Geode/cocos/cocoa/CCString.h b/loader/include/Geode/cocos/cocoa/CCString.h index 713aa0d0..d58eaabc 100644 --- a/loader/include/Geode/cocos/cocoa/CCString.h +++ b/loader/include/Geode/cocos/cocoa/CCString.h @@ -115,7 +115,7 @@ public: * it means that you needn't do a release operation unless you retain it. */ // Geode change: this is kind of a hack but i think it will work - static inline CCString* create(std::string const& str) { + static inline CCString* create(gd::string const& str) { return CCString::createWithData(reinterpret_cast<unsigned char const*>(str.c_str()), str.size()); } diff --git a/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h b/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h index 495c52d0..fe215f91 100644 --- a/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h +++ b/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h @@ -78,6 +78,12 @@ public: * @endcode */ void drawPolygon(CCPoint *verts, unsigned int count, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor); + + void drawCircle(cocos2d::CCPoint const&, float, cocos2d::_ccColor4F const&, float, cocos2d::_ccColor4F const&, unsigned int); + void drawCubicBezier(cocos2d::CCPoint const&, cocos2d::CCPoint const&, cocos2d::CCPoint const&, cocos2d::CCPoint const&, unsigned int, cocos2d::_ccColor4F const&); + void drawPreciseCubicBezier(cocos2d::CCPoint const&, cocos2d::CCPoint const&, cocos2d::CCPoint const&, cocos2d::CCPoint const&, unsigned int, cocos2d::_ccColor4F const&); + void drawLines(cocos2d::CCPoint*, unsigned int, float, cocos2d::_ccColor4F const&); + void drawRect(cocos2d::CCPoint const&, cocos2d::CCPoint const&, cocos2d::_ccColor4F const&, float, cocos2d::_ccColor4F const&); /** Clear the geometry in the node's buffer. */ void clear(); diff --git a/loader/include/Geode/cocos/include/cocos2d.h b/loader/include/Geode/cocos/include/cocos2d.h index f984a172..215aa4ae 100644 --- a/loader/include/Geode/cocos/include/cocos2d.h +++ b/loader/include/Geode/cocos/include/cocos2d.h @@ -288,6 +288,7 @@ THE SOFTWARE. #include "../textures/CCTextureAtlas.h" #include "../textures/CCTextureCache.h" #include "../textures/CCTexturePVR.h" +#include "../textures/CCTextureETC.h" // tilemap_parallax_nodes #include "../tilemap_parallax_nodes/CCParallaxNode.h" diff --git a/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h b/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h index 1fa7e2ac..9d7a41e5 100644 --- a/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h +++ b/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h @@ -269,15 +269,25 @@ public: #endif // CC_LABELBMFONT_DEBUG_DRAW RT_ADD( - static CCLabelBMFont* createBatched(const char* str, const char* fntFile, CCArray*); + static CCLabelBMFont* createBatched(const char* str, const char* fntFile, CCArray*, int); void limitLabelWidth(float width, float defaultScale, float minScale); + + int getExtraKerning() const; + void setExtraKerning(int); + + bool getIsBatched() const; + void setIsBatched(bool); + + cocos2d::CCArray* getTargetArray() const; + void setTargetArray(cocos2d::CCArray*); + ) private: char * atlasNameFromFntFile(const char *fntFile); int kerningAmountForFirst(unsigned short first, unsigned short second); - float getLetterPosXLeft( CCSprite* characterSprite ); - float getLetterPosXRight( CCSprite* characterSprite ); + float getLetterPosXLeft( CCSprite* characterSprite, float, bool); + float getLetterPosXRight( CCSprite* characterSprite, float, bool); protected: virtual void setString(unsigned short *newString, bool needUpdateLabel); diff --git a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h index b5d4e454..08325f5d 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h @@ -335,6 +335,10 @@ public: virtual void setColor(const ccColor3B &color); virtual void setOpacity(GLubyte opacity); + void addToVertices(cocos2d::CCPoint, cocos2d::CCPoint, cocos2d::CCPoint); + void setVertices(cocos2d::CCPoint, cocos2d::CCPoint, cocos2d::CCPoint); + + protected: virtual void updateColor(); }; @@ -389,6 +393,11 @@ public: CC_PROPERTY(GLubyte, m_cEndOpacity, EndOpacity) CC_PROPERTY_PASS_BY_REF(CCPoint, m_AlongVector, Vector) + bool getShouldPremultiply() const; + void setShouldPremultiply(bool); + void setValues(cocos2d::_ccColor3B const&, unsigned char, cocos2d::_ccColor3B const&, unsigned char, cocos2d::CCPoint const&); + + /** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors Default: YES */ diff --git a/loader/include/Geode/cocos/menu_nodes/CCMenu.h b/loader/include/Geode/cocos/menu_nodes/CCMenu.h index faecdc79..2c41ff23 100644 --- a/loader/include/Geode/cocos/menu_nodes/CCMenu.h +++ b/loader/include/Geode/cocos/menu_nodes/CCMenu.h @@ -189,6 +189,7 @@ public: protected: CCMenuItem* itemForTouch(CCTouch * touch); + CCMenuItem* itemForTouch(CCTouch * touch, bool); tCCMenuState m_eState; CCMenuItem *m_pSelectedItem; }; diff --git a/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h b/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h index 81dde2b1..ed7f3f52 100644 --- a/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h +++ b/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h @@ -116,6 +116,19 @@ public: RT_ADD( void resumeStroke(); void stopStroke(); + + void enableRepeatMode(float); + + bool getDontOpacityFade() const; + void setDontOpacityFade(bool); + + float getM_fMaxSeg() const; + void setM_fMaxSeg(float); + + void setStroke(float); + void updateFade(float); + + ) /** When fast mode is enabled, new points are added faster but with lower precision */ diff --git a/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h b/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h index d4a694e6..c3e8eedf 100644 --- a/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h +++ b/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h @@ -58,6 +58,7 @@ class CC_DLL CCProgressTimer : public CCNodeRGBA , public CCGLBufferedNode #endif // EMSCRIPTEN { + GEODE_FRIEND_MODIFY public: /** * @js ctor diff --git a/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h b/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h index 434e03c0..9003752b 100644 --- a/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h +++ b/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h @@ -165,6 +165,8 @@ public: bool isAutoDraw() const; void setAutoDraw(bool bAutoDraw); + void updateInternalScale(float, float); + private: void beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue, GLbitfield flags); diff --git a/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h b/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h index d955c12e..d93d745b 100644 --- a/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h +++ b/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h @@ -402,20 +402,20 @@ public: http://particledesigner.71squared.com/ @since v0.99.3 */ - bool initWithFile(const char *plistFile); + bool initWithFile(const char *plistFile, bool); /** initializes a CCQuadParticleSystem from a CCDictionary. @since v0.99.3 */ - bool initWithDictionary(CCDictionary *dictionary); + bool initWithDictionary(CCDictionary *dictionary, bool); /** initializes a particle system from a NSDictionary and the path from where to load the png @since v2.1 */ - bool initWithDictionary(CCDictionary *dictionary, const char *dirname); + bool initWithDictionary(CCDictionary *dictionary, const char *dirname, bool); //! Initializes a system with a fixed number of particles - virtual bool initWithTotalParticles(unsigned int numberOfParticles); + virtual bool initWithTotalParticles(unsigned int numberOfParticles, bool); //! Add a particle to the emitter bool addParticle(); //! Initializes a particle @@ -459,9 +459,88 @@ public: void saveDefaults(void); void loadDefaults(void); void loadScaledDefaults(float); + + void calculateWorldSpace(); + + bool getDontCleanupOnFinish() const; + void setDontCleanupOnFinish(bool); + + bool getDynamicRotationIsDir() const; + void setDynamicRotationIsDir(bool); + + bool getEndRGBVarSync() const; + void setEndRGBVarSync(bool); + + float getFadeInTime() const; + float getFadeInTimeVar() const; + float getFadeOutTime() const; + float getFadeOutTimeVar() const; + float getFrictionPos() const; + float getFrictionPosVar() const; + float getFrictionRot() const; + float getFrictionRotVar() const; + float getFrictionSize() const; + float getFrictionSizeVar() const; + + bool getOrderSensitive() const; + + float getRespawn() const; + float getRespawnVar() const; + + bool getStartRGBVarSync() const; + bool getStartRadiusEqualToEnd() const; + bool getStartSizeEqualToEnd() const; + bool getStartSpinEqualToEnd() const; + + float getTimeElapsed(); + + bool getUseUniformColorMode() const; + + bool getWasRemoved() const; + + bool getUsingSchedule() const; + + + void setEndAlpha(float); + void setFadeInTime(float); + void setFadeInTimeVar(float); + void setFadeOutTime(float); + void setFadeOutTimeVar(float); + void setFrictionPos(float); + void setFrictionPosVar(float); + void setFrictionRot(float); + void setFrictionRotVar(float); + void setFrictionSize(float); + void setFrictionSizeVar(float); + + void setOrderSensitive(bool); + + void setRespawn(float); + void setRespawnVar(float); + + void setStartAlpha(float); + void setStartRGBVarSync(bool); + void setStartRadiusEqualToEnd(bool); + void setStartSizeEqualToEnd(bool); + void setStartSpinEqualToEnd(bool); + + void setUsingSchedule(bool); + + void setWasRemoved(bool); + + void toggleUniformColorMode(bool); + void updateVisible(); + + virtual void updateEmissionRate(); + + ) }; +class ParticleStruct { + +}; + // end of particle_nodes group /// @} diff --git a/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h b/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h index 2add6dbf..72613e66 100644 --- a/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h +++ b/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h @@ -101,7 +101,7 @@ public: * @js NA * @lua NA */ - virtual bool initWithTotalParticles(unsigned int numberOfParticles); + virtual bool initWithTotalParticles(unsigned int numberOfParticles, bool); /** * @js NA */ @@ -135,7 +135,14 @@ public: void listenBackToForeground(CCObject *obj); static CCParticleSystemQuad * create(); - static CCParticleSystemQuad * createWithTotalParticles(unsigned int numberOfParticles); + static CCParticleSystemQuad * create(const char*, bool); + static CCParticleSystemQuad * createWithTotalParticles(unsigned int numberOfParticles, bool); + + unsigned char getOpacity(); + void setOpacity(unsigned char); + + void updateTexCoords(); + private: #if CC_TEXTURE_ATLAS_USE_VAO void setupVBOandVAO(); diff --git a/loader/include/Geode/cocos/platform/CCAccelerometerDelegate.h b/loader/include/Geode/cocos/platform/CCAccelerometerDelegate.h index dc4810fd..424a0934 100644 --- a/loader/include/Geode/cocos/platform/CCAccelerometerDelegate.h +++ b/loader/include/Geode/cocos/platform/CCAccelerometerDelegate.h @@ -52,6 +52,9 @@ class CC_DLL CCAccelerometerDelegate { GEODE_FRIEND_MODIFY public: + GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCAccelerometerDelegate) + CCAccelerometerDelegate() {} + virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUSED_PARAM(pAccelerationValue);} }; diff --git a/loader/include/Geode/cocos/platform/CCApplicationProtocol.h b/loader/include/Geode/cocos/platform/CCApplicationProtocol.h index 4aeb1001..a7bb4505 100644 --- a/loader/include/Geode/cocos/platform/CCApplicationProtocol.h +++ b/loader/include/Geode/cocos/platform/CCApplicationProtocol.h @@ -79,7 +79,7 @@ public: RT_ADD( virtual void applicationWillBecomeActive() {} virtual void applicationWillResignActive() {} - virtual void trySaveGame() {} + virtual void trySaveGame(bool) {} virtual void gameDidSave() {} ) diff --git a/loader/include/Geode/cocos/platform/CCEGLViewProtocol.h b/loader/include/Geode/cocos/platform/CCEGLViewProtocol.h index cdea5806..cd0469c9 100644 --- a/loader/include/Geode/cocos/platform/CCEGLViewProtocol.h +++ b/loader/include/Geode/cocos/platform/CCEGLViewProtocol.h @@ -176,6 +176,10 @@ public: * Get scale factor of the vertical direction. */ float getScaleY() const; + + virtual void pollInputEvents(); + void updateDesignResolutionSize(); + private: void getSetOfTouchesEndOrCancel(CCSet& set, int num, int ids[], float xs[], float ys[]); diff --git a/loader/include/Geode/cocos/platform/CCFileUtils.h b/loader/include/Geode/cocos/platform/CCFileUtils.h index 0df6c7fc..d2a75d7e 100644 --- a/loader/include/Geode/cocos/platform/CCFileUtils.h +++ b/loader/include/Geode/cocos/platform/CCFileUtils.h @@ -374,6 +374,10 @@ public: virtual void setPopupNotify(bool bNotify); virtual bool isPopupNotify(); + gd::string getAndroidPath() const; + void setAndroidPath(gd::string); + + protected: /** * The default constructor. diff --git a/loader/include/Geode/cocos/platform/CCImage.h b/loader/include/Geode/cocos/platform/CCImage.h index a71af4e8..56225340 100644 --- a/loader/include/Geode/cocos/platform/CCImage.h +++ b/loader/include/Geode/cocos/platform/CCImage.h @@ -108,7 +108,8 @@ public: EImageFormat eFmt = kFmtUnKnown, int nWidth = 0, int nHeight = 0, - int nBitsPerComponent = 8); + int nBitsPerComponent = 8, + int whoknows = 0); /** @brief Create image with specified string. diff --git a/loader/include/Geode/cocos/platform/win32/CCApplication.h b/loader/include/Geode/cocos/platform/win32/CCApplication.h index 27d266b2..89db3cc2 100644 --- a/loader/include/Geode/cocos/platform/win32/CCApplication.h +++ b/loader/include/Geode/cocos/platform/win32/CCApplication.h @@ -52,6 +52,22 @@ public: void setupVerticalSync(); void updateVerticalSync(); void updateControllerKeys(); + + int getTimeElapsed(); + void resetForceTimer(); + + void leftMouseDown(); + void leftMouseUp(); + + void logTimeElapsed(gd::string); + + void moveMouse(int, int); + + void shutdownApplication(); + void toggleMouseControl(bool); + void updateController(); + void updateMouseControl(); + ) /** diff --git a/loader/include/Geode/cocos/platform/win32/CCEGLView.h b/loader/include/Geode/cocos/platform/win32/CCEGLView.h index 1cdf225a..de9ae914 100644 --- a/loader/include/Geode/cocos/platform/win32/CCEGLView.h +++ b/loader/include/Geode/cocos/platform/win32/CCEGLView.h @@ -121,6 +121,10 @@ public: */ static CCEGLView* create(const gd::string&); + static cocos2d::CCEGLView* createWithFullScreen(gd::string const&); + static cocos2d::CCEGLView* createWithFullScreen(gd::string const&, GLFWvidmode const&, GLFWmonitor*); + static cocos2d::CCEGLView* createWithRect(gd::string const&, cocos2d::CCRect, float); + /** * @note Geode addition */ @@ -141,6 +145,34 @@ public: */ CCSize getDisplaySize(); + void capture(); + void checkErrorGL(char const*); + + void enableRetina(bool); + + bool getCursorLocked() const; + bool getGameplayActive() const; + bool getIsFullscreen() const; + int getRetinaFactor() const; + bool getShouldHideCursor() const; + void iconify(); + + bool initWithFullScreen(gd::string const&); + bool initWithFullscreen(gd::string const&, GLFWvidmode const&, GLFWmonitor*); + bool initWithRect(gd::string const&, cocos2d::CCRect, float); + + bool isRetinaEnabled() const; + + void onGLFWWindowCloseFunCallback(GLFWwindow*); + void releaseCapture(); + void showMessage(gd::string); + + void toggleGameplayActive(bool); + void toggleLockCursor(bool); + void updateDesignSize(int, int); + void updateFrameSize(); + + protected: static CCEGLView* s_pEglView; bool m_bCaptured; diff --git a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h index c57d7235..1a4af644 100644 --- a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h +++ b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h @@ -21,7 +21,7 @@ RT_ADD( enumKeyCodes convertKeyCode(enumKeyCodes key); - bool dispatchKeyboardMSG(enumKeyCodes key, bool); + bool dispatchKeyboardMSG(enumKeyCodes key, bool, bool); inline bool getAltKeyPressed() const { return m_bAltPressed; @@ -42,6 +42,10 @@ RT_ADD( void updateModifierKeys(bool shft, bool ctrl, bool alt, bool cmd); + bool getBlockRepeat() const; + void setBlockRepeat(bool); + + protected: CCArray* m_pDelegates; // 0x20 bool m_bUnknown24; // 0x24 diff --git a/loader/include/Geode/cocos/robtop/xml/DS_Dictionary.h b/loader/include/Geode/cocos/robtop/xml/DS_Dictionary.h index c280cb74..6e6556a6 100644 --- a/loader/include/Geode/cocos/robtop/xml/DS_Dictionary.h +++ b/loader/include/Geode/cocos/robtop/xml/DS_Dictionary.h @@ -13,7 +13,7 @@ public: public: gd::string cleanStringWhiteSpace(const gd::string&); - void split(const gd::string&, char*, const gd::vector<gd::string>&); + void split(gd::string const&, char const*, gd::vector<gd::string>&); bool splitWithForm(const gd::string&, gd::vector<gd::string>&); bool rectFromString(const gd::string&, cocos2d::CCRect&); bool vec2FromString(const gd::string&, cocos2d::CCPoint&); @@ -29,7 +29,7 @@ public: bool loadRootSubDictFromFile(const char*); bool loadRootSubDictFromCompressedFile(const char*); - bool loadRootSubDictFromString(gd::string); + bool loadRootSubDictFromString(gd::string const&); bool saveRootSubDictToFile(const char*); bool saveRootSubDictToCompressedFile(const char*); @@ -80,14 +80,14 @@ public: void setRectArrayForKey(const char*, const gd::vector<cocos2d::CCRect>&); void setRectArrayForKey(const char*, const gd::vector<cocos2d::CCRect>&, bool); void setArrayForKey(const char*, cocos2d::CCArray*); - void setBoolMapForKey(const char*, const gd::map<gd::string, bool>&); + void setBoolMapForKey(const char*, gd::map<gd::string, bool>&); void setSubDictForKey(const char*); void setSubDictForKey(const char*, bool, bool); void setDictForKey(const char*, cocos2d::CCDictionary*); void setObjectForKey(const char*, cocos2d::CCObject*); - void addBoolValuesToMapForKey(const gd::map<gd::string, bool>&, const char*, bool); - void addBoolValuesToMapForKeySpecial(const gd::map<gd::string, bool>&, const char*, bool); + void addBoolValuesToMapForKey(gd::map<gd::string, bool>&, const char*, bool); + void addBoolValuesToMapForKeySpecial(gd::map<gd::string, bool>&, const char*, bool); void checkCompatibility(); }; diff --git a/loader/include/Geode/cocos/shaders/CCGLProgram.h b/loader/include/Geode/cocos/shaders/CCGLProgram.h index f1fa89fd..7ca4b01e 100644 --- a/loader/include/Geode/cocos/shaders/CCGLProgram.h +++ b/loader/include/Geode/cocos/shaders/CCGLProgram.h @@ -271,6 +271,8 @@ public: */ inline const GLuint getProgram() { return m_uProgram; } + void setUniformLocationWithMatrix3fv(int, float*, unsigned int); + private: bool updateUniformLocation(GLint location, GLvoid* data, unsigned int bytes); const char* description(); diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSprite.h b/loader/include/Geode/cocos/sprite_nodes/CCSprite.h index 4512f4ba..deb6c5f7 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSprite.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSprite.h @@ -511,6 +511,11 @@ public: void setFlipY(bool bFlipY); /// @} End of Sprite properties getter/setters + + cocos2d::CCPoint const& getUnflippedOffsetPosition(); + bool getUseVertexMod() const; + void setUseVertexMod(bool); + protected: void updateColor(void); diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h b/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h index 3d2531b3..c42636eb 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h @@ -176,6 +176,7 @@ protected: public: int getUsedAtlasCapacity(void); void increaseAtlasCapacity(unsigned int); + void increaseAtlasCapacity(); protected: void manualSortAllChildren(void); void setManualSortChildren(bool); diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h b/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h index 7877e6a2..d511e679 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h @@ -147,6 +147,8 @@ public: */ bool initWithTextureFilename(const char* filename, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize); + gd::string getFrameName() const; + void setFrameName(gd::string); protected: CCPoint m_obOffset; diff --git a/loader/include/Geode/cocos/support/zip_support/ZipUtils.h b/loader/include/Geode/cocos/support/zip_support/ZipUtils.h index 4bec8e77..cc5b8d71 100644 --- a/loader/include/Geode/cocos/support/zip_support/ZipUtils.h +++ b/loader/include/Geode/cocos/support/zip_support/ZipUtils.h @@ -57,6 +57,7 @@ namespace cocos2d class CC_DLL ZipUtils { + GEODE_FRIEND_MODIFY; public: /** * Inflates either zlib or gzip deflated memory. The inflated memory is diff --git a/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h b/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h index 786d30d4..d03eb6cd 100644 --- a/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h +++ b/loader/include/Geode/cocos/text_input_node/CCIMEDelegate.h @@ -83,7 +83,7 @@ protected: /** @brief Called by CCIMEDispatcher when text input received from the IME. */ - virtual void insertText(const char * text, int len) {CC_UNUSED_PARAM(text);CC_UNUSED_PARAM(len);} + virtual void insertText(const char * text, int len, cocos2d::enumKeyCodes) {CC_UNUSED_PARAM(text);CC_UNUSED_PARAM(len);} /** @brief Called by CCIMEDispatcher after the user clicks the backward key. @@ -103,6 +103,8 @@ protected: virtual void keyboardWillHide(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);} virtual void keyboardDidHide(CCIMEKeyboardNotificationInfo& info) {CC_UNUSED_PARAM(info);} + virtual void deleteForward(); + protected: CCIMEDelegate(); }; diff --git a/loader/include/Geode/cocos/text_input_node/CCIMEDispatcher.h b/loader/include/Geode/cocos/text_input_node/CCIMEDispatcher.h index d5a07fc9..7d3daed1 100644 --- a/loader/include/Geode/cocos/text_input_node/CCIMEDispatcher.h +++ b/loader/include/Geode/cocos/text_input_node/CCIMEDispatcher.h @@ -58,13 +58,17 @@ public: /** @brief Dispatches the input text from IME. */ - void dispatchInsertText(const char * pText, int nLen); + void dispatchInsertText(const char * pText, int nLen, cocos2d::enumKeyCodes); /** @brief Dispatches the delete-backward operation. */ void dispatchDeleteBackward(); + void dispatchDeleteForward(); + + bool hasDelegate(); + /** @brief Get the content text from CCIMEDelegate, retrieved previously from IME. */ @@ -76,6 +80,7 @@ public: void dispatchKeyboardWillShow(CCIMEKeyboardNotificationInfo& info); void dispatchKeyboardDidShow(CCIMEKeyboardNotificationInfo& info); void dispatchKeyboardWillHide(CCIMEKeyboardNotificationInfo& info); + void dispatchKeyboardWillHide(); void dispatchKeyboardDidHide(CCIMEKeyboardNotificationInfo& info); protected: diff --git a/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h b/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h index 7b5c926f..7b12f1db 100644 --- a/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h +++ b/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h @@ -65,7 +65,7 @@ public: /** @brief If the sender doesn't want to insert the text, return true; */ - virtual bool onTextFieldInsertText(CCTextFieldTTF * sender, const char * text, int nLen) + virtual bool onTextFieldInsertText(CCTextFieldTTF * sender, const char * text, int nLen, cocos2d::enumKeyCodes) { CC_UNUSED_PARAM(sender); CC_UNUSED_PARAM(text); @@ -175,7 +175,7 @@ protected: virtual bool canAttachWithIME(); virtual bool canDetachWithIME(); - virtual void insertText(const char * text, int len); + virtual void insertText(const char * text, int len, cocos2d::enumKeyCodes); virtual void deleteBackward(); virtual const char * getContentText(); private: diff --git a/loader/include/Geode/cocos/textures/CCTexture2D.h b/loader/include/Geode/cocos/textures/CCTexture2D.h index 3ad811ea..c847a813 100644 --- a/loader/include/Geode/cocos/textures/CCTexture2D.h +++ b/loader/include/Geode/cocos/textures/CCTexture2D.h @@ -269,6 +269,9 @@ public: bool hasPremultipliedAlpha(); bool hasMipmaps(); + + void releaseGLTexture(); + private: bool initPremultipliedATextureWithImage(CCImage * image, unsigned int pixelsWide, unsigned int pixelsHigh); diff --git a/loader/include/Geode/cocos/textures/CCTextureCache.h b/loader/include/Geode/cocos/textures/CCTextureCache.h index d5c4c9e0..488ec3dd 100644 --- a/loader/include/Geode/cocos/textures/CCTextureCache.h +++ b/loader/include/Geode/cocos/textures/CCTextureCache.h @@ -117,7 +117,7 @@ public: * @lua NA */ - void addImageAsync(const char *path, CCObject *target, SEL_CallFuncO selector); + void addImageAsync(char const*, cocos2d::CCObject*, cocos2d::SEL_MenuHandler, int, cocos2d::CCTexture2DPixelFormat); /* Returns a Texture2D object given an CGImageRef image * If the image was not previously loaded, it will create a new CCTexture2D object and it will return it. @@ -196,6 +196,9 @@ public: It's only useful when the value of CC_ENABLE_CACHE_TEXTURE_DATA is 1 */ static void reloadAllTextures(); + + void prepareAsyncLoading(); + }; #if CC_ENABLE_CACHE_TEXTURE_DATA diff --git a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h index 90601382..dce7ed46 100644 --- a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h +++ b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h @@ -149,6 +149,7 @@ This information is obtained from the TMX file. */ class CC_DLL CCTMXMapInfo : public CCObject, public CCSAXDelegator { + GEODE_FRIEND_MODIFY public: /// map orientation CC_SYNTHESIZE(int, m_nOrientation, Orientation); diff --git a/loader/include/Geode/cocos/touch_dispatcher/CCTouchDelegateProtocol.h b/loader/include/Geode/cocos/touch_dispatcher/CCTouchDelegateProtocol.h index 318f684e..bc91e9c8 100644 --- a/loader/include/Geode/cocos/touch_dispatcher/CCTouchDelegateProtocol.h +++ b/loader/include/Geode/cocos/touch_dispatcher/CCTouchDelegateProtocol.h @@ -67,6 +67,10 @@ public: virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + virtual void setPreviousPriority(int); + virtual int getPreviousPriority(); + + }; /** @brief diff --git a/loader/include/Geode/cocos/touch_dispatcher/CCTouchDispatcher.h b/loader/include/Geode/cocos/touch_dispatcher/CCTouchDispatcher.h index 9f3cce0b..5e2256b4 100644 --- a/loader/include/Geode/cocos/touch_dispatcher/CCTouchDispatcher.h +++ b/loader/include/Geode/cocos/touch_dispatcher/CCTouchDispatcher.h @@ -201,6 +201,11 @@ public: */ CCTouchHandler* findHandler(CCTouchDelegate *pDelegate); + void addPrioTargetedDelegate(cocos2d::CCTouchDelegate*, int, bool); + bool isUsingForcePrio(); + void registerForcePrio(cocos2d::CCObject*, int); + void unregisterForcePrio(cocos2d::CCObject*); + private: RT_ADD( void incrementForcePrio(int priority);