Merge pull request #184 from cgytrus/cocos-stuff

Add some cocos stuff
This commit is contained in:
mat 2023-06-05 13:52:01 -03:00 committed by GitHub
commit 2a1a08ef24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 64 additions and 12 deletions

View file

@ -157,9 +157,9 @@ class cocos2d::CCDrawNode {
auto drawDot(cocos2d::CCPoint const&, float, cocos2d::_ccColor4F const&) = mac 0x379100;
auto getBlendFunc() const = mac 0x379ea0;
auto init() = mac 0x378e00;
virtual auto init() = mac 0x378e00;
auto setBlendFunc(cocos2d::_ccBlendFunc const&) = mac 0x379eb0;
auto draw() = mac 0x379020;
virtual auto draw() = mac 0x379020;
virtual ~CCDrawNode() = mac 0x378cc0;
}
@ -218,6 +218,7 @@ class cocos2d::CCEGLView {
virtual void swapBuffers() = mac 0x295510;
void updateWindow(int width, int height);
void setupWindow(cocos2d::CCRect);
bool initGlew();
void toggleFullScreen(bool fullscreen);
void pollEvents();
void onGLFWCharCallback(GLFWwindow* window, unsigned int entered);
@ -396,7 +397,7 @@ class cocos2d::CCLayer {
}
class cocos2d::CCLayerColor {
CCLayerColor() = mac 0x274320, ios 0xc8aec, win 0xa1710;
CCLayerColor() = mac 0x274320, ios 0xc8aec;
static cocos2d::CCLayerColor* create(cocos2d::_ccColor4B const&, float, float) = mac 0x2745e0;
static cocos2d::CCLayerColor* create(cocos2d::_ccColor4B const&) = mac 0x2744c0;
virtual auto draw() = mac 0x274b50, ios 0xc8fe0;
@ -409,7 +410,7 @@ class cocos2d::CCLayerColor {
virtual auto setContentSize(cocos2d::CCSize const&) = mac 0x2749f0, ios 0xc8f64;
virtual auto setOpacity(unsigned char) = mac 0x274db0, ios 0xc9108;
virtual auto updateColor() = mac 0x274ae0, ios 0xc8f80;
virtual ~CCLayerColor() = mac 0x2743d0, ios 0x2743e0, win 0xa1a20;
virtual ~CCLayerColor() = mac 0x2743d0, ios 0x2743e0;
}
class cocos2d::CCLayerRGBA {
@ -511,6 +512,7 @@ class cocos2d::CCMotionStreak {
auto resumeStroke() = mac 0x2edb30;
auto stopStroke() = mac 0x2edb20;
bool initWithFade(float fade, float minSeg, float stroke, cocos2d::ccColor3B const& color, cocos2d::CCTexture2D* texture) = mac 0x2ed6f0;
virtual auto draw();
}
class cocos2d::CCMouseDispatcher {
@ -688,6 +690,7 @@ class cocos2d::CCParticleSystem {
CCParticleSystem();
virtual ~CCParticleSystem();
virtual auto update(float);
virtual auto draw();
auto initParticle(cocos2d::tCCParticle*);
auto resetSystem() = mac 0x46bd50;
auto resumeSystem() = mac 0x46bd40;
@ -695,7 +698,11 @@ class cocos2d::CCParticleSystem {
}
class cocos2d::CCParticleSystemQuad {
CCParticleSystemQuad();
virtual ~CCParticleSystemQuad();
static cocos2d::CCParticleSystemQuad* create(char const*) = mac 0x36b000;
virtual auto draw();
auto setupVBO();
}
class cocos2d::CCPoolManager {
@ -940,6 +947,13 @@ class cocos2d::CCTexture2D {
auto setTexParameters(cocos2d::_ccTexParams*) = mac 0x247980;
}
class cocos2d::CCTextureAtlas {
CCTextureAtlas();
virtual ~CCTextureAtlas();
auto drawNumberOfQuads(unsigned int, unsigned int);
auto mapBuffers();
}
class cocos2d::CCTextFieldTTF {
static auto textFieldWithPlaceHolder(char const*, char const*, float) = mac 0x126220;
}

View file

@ -92,6 +92,11 @@ void CC_DLL ccDrawPoints( const CCPoint *points, unsigned int numberOfPoints );
/** draws a line given the origin and destination point measured in points */
void CC_DLL ccDrawLine( const CCPoint& origin, const CCPoint& destination );
RT_ADD(
/** draws an array of lines. */
void CC_DLL ccDrawLines( const CCPoint *lines, unsigned int numberOfLines );
)
/** draws a rectangle given the origin and destination point measured in points. */
void CC_DLL ccDrawRect( CCPoint origin, CCPoint destination );
@ -112,6 +117,7 @@ void CC_DLL ccDrawSolidPoly( const CCPoint *poli, unsigned int numberOfPoints, c
/** draws a circle given the center, radius and number of segments. */
void CC_DLL ccDrawCircle( const CCPoint& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY);
void CC_DLL ccDrawCircle( const CCPoint& center, float radius, float angle, unsigned int segments, bool drawLineToCenter);
RT_ADD(void CC_DLL ccDrawFilledCircle( const CCPoint& center, float radius, float angle, unsigned int segments);)
/** draws a quad bezier path
@warning This function could be pretty slow. Use it only for debugging purposes.

View file

@ -51,12 +51,13 @@ class CC_DLL CCMotionStreak :
public CCGLBufferedNode
#endif // EMSCRIPTEN
{
GEODE_FRIEND_MODIFY
public:
/**
* @js ctor
*/
CCMotionStreak();
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMotionStreak, CCNodeRGBA)
/**
* @js NA
* @lua NA
@ -112,7 +113,10 @@ public:
virtual void setOpacityModifyRGB(bool bValue);
virtual bool isOpacityModifyRGB(void);
RT_ADD(void resumeStroke(); void stopStroke(););
RT_ADD(
void resumeStroke();
void stopStroke();
)
/** When fast mode is enabled, new points are added faster but with lower precision */
inline bool isFastMode() {
@ -134,6 +138,7 @@ public:
protected:
bool m_bFastMode;
bool m_bStartingPositionInitialized;
bool m_bStroke;
/** texture used for the motion streak */
CCTexture2D* m_pTexture;
ccBlendFunc m_tBlendFunc;
@ -155,6 +160,15 @@ protected:
ccVertex2F* m_pVertices;
GLubyte* m_pColorPointer;
ccTex2F* m_pTexCoords;
RT_ADD(
bool m_bRepeatMode;
float m_fRepeatSpeed;
float m_fRepeatTime;
bool m_idk;
float m_fMaxSeg;
bool m_bDontOpacityFade;
)
};
// end of misc_nodes group

View file

@ -424,6 +424,9 @@ public:
void stopSystem();
//! Kill all living particles.
void resetSystem();
RT_ADD(
void resumeSystem();
)
//! whether or not the system is full
bool isFull();
@ -437,13 +440,26 @@ public:
protected:
virtual void updateBlendFunc();
RT_ADD(
// saved/loaded in loadDefaults, loadScaledDefaults and saveDefaults
float m_fDefaultStartSize;
float m_fDefaultStartSizeVar;
// saved as m_fEndSize but not loaded,
// probably was supposed to be m_fDefaultEndSizeVar and saved and loaded as m_fEndSizeVar but was scrapped?
float m_fDefaultEndSize2;
float m_fDefaultEndSize;
float m_fDefaultModeASpeed;
float m_fDefaultModeASpeedVar;
CCPoint m_tDefaultPosVar;
)
public:
RT_ADD(
void saveDefaults(void);
void loadDefaults(void);
void loadScaledDefaults(float);
void resumeSystem(void);
void saveDefaults(void);
);
)
};
// end of particle_nodes group

View file

@ -55,7 +55,6 @@ class CC_DLL CCParticleSystemQuad : public CCParticleSystem
GEODE_FRIEND_MODIFY
protected:
ccV3F_C4B_T2F_Quad *m_pQuads; // quads to be rendered
GLushort *m_pIndices; // indices
@ -70,6 +69,7 @@ public:
* @js ctor
*/
CCParticleSystemQuad();
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCParticleSystemQuad, CCParticleSystem)
/**
* @js NA
* @lua NA

View file

@ -64,10 +64,11 @@ public:
protected:
RT_REMOVE( virtual bool Create(); )
void setupWindow(cocos2d::CCRect rect);
RT_ADD(bool initGlew();)
public:
bool initGL();
void destroyGL();
RT_REMOVE(bool initGL();)
RT_REMOVE(void destroyGL();)
RT_REMOVE( virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); )

View file

@ -81,6 +81,7 @@ public:
* @js ctor
*/
CCTextureAtlas();
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTextureAtlas, CCObject)
/**
* @js NA
* @lua NA