add some cocos stuff

This commit is contained in:
ConfiG 2023-06-05 15:45:12 +03:00
parent 892851c6f9
commit faa0c77304
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B
6 changed files with 44 additions and 7 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);
@ -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

@ -55,7 +55,7 @@ class CC_DLL CCParticleSystemQuad : public CCParticleSystem
GEODE_FRIEND_MODIFY
protected:
PAD(0x20);
ccV3F_C4B_T2F_Quad *m_pQuads; // quads to be rendered
GLushort *m_pIndices; // indices
@ -70,6 +70,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