make GEODE_DEBUG obey if it's already set and make private members in CCMotionStreak protected

This commit is contained in:
altalk23 2022-11-16 17:41:14 +03:00 committed by alk
parent 3c5fbc2754
commit b7bbee5669
4 changed files with 59 additions and 41 deletions

View file

@ -17,7 +17,7 @@ jobs:
os_identifier: "win" os_identifier: "win"
os: windows-2019 os: windows-2019
prefixes: '' prefixes: ''
extra_flags: '-G "Visual Studio 16 2019" -T host=x86 -A win32' extra_flags: '-G "Visual Studio 16 2019" -T host=x86 -A win32 -DGEODE_DEBUG=On'
out_paths: './bin/nightly/Geode.dll ./bin/nightly/GeodeBootstrapper.dll ./bin/nightly/Geode.lib ./bin/nightly/XInput9_1_0.dll' out_paths: './bin/nightly/Geode.dll ./bin/nightly/GeodeBootstrapper.dll ./bin/nightly/Geode.lib ./bin/nightly/XInput9_1_0.dll'
cli_cmd: '' cli_cmd: ''
@ -25,7 +25,7 @@ jobs:
os_identifier: "mac" os_identifier: "mac"
os: macos-latest os: macos-latest
prefixes: 'PATH="/usr/local/opt/ccache/libexec:$PATH"' prefixes: 'PATH="/usr/local/opt/ccache/libexec:$PATH"'
extra_flags: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++" extra_flags: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DGEODE_DEBUG=On"
out_paths: './bin/nightly/Geode.dylib ./bin/nightly/GeodeBootstrapper.dylib ./loader/include/link/libfmod.dylib' out_paths: './bin/nightly/Geode.dylib ./bin/nightly/GeodeBootstrapper.dylib ./loader/include/link/libfmod.dylib'
cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode' cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode'

View file

@ -8,13 +8,15 @@ project(geode-sdk VERSION ${GEODE_VERSION} LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (PROJECT_IS_TOP_LEVEL AND APPLE)
set(CMAKE_BUILD_TYPE Debug)
endif()
add_library(${PROJECT_NAME} INTERFACE) add_library(${PROJECT_NAME} INTERFACE)
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo) if (NOT DEFINED GEODE_DEBUG AND (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo))
set(GEODE_DEBUG ON)
endif()
# define it in command line or your project system
if (GEODE_DEBUG)
target_compile_definitions(${PROJECT_NAME} INTERFACE -DGEODE_DEBUG) target_compile_definitions(${PROJECT_NAME} INTERFACE -DGEODE_DEBUG)
endif() endif()
@ -23,10 +25,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CMAKE_CONFIGURE_DEPENDS VERSION
target_compile_definitions(${PROJECT_NAME} INTERFACE -DPROJECT_NAME=${CMAKE_PROJECT_NAME}) target_compile_definitions(${PROJECT_NAME} INTERFACE -DPROJECT_NAME=${CMAKE_PROJECT_NAME})
if (GEODE_DEBUG)
target_compile_definitions(${PROJECT_NAME} INTERFACE GEODE_DEBUG)
endif()
set(GEODE_CODEGEN_PATH ${CMAKE_CURRENT_BINARY_DIR}/codegenned) set(GEODE_CODEGEN_PATH ${CMAKE_CURRENT_BINARY_DIR}/codegenned)
set(GEODE_BIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin) set(GEODE_BIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(GEODE_LOADER_PATH ${CMAKE_CURRENT_SOURCE_DIR}/loader) set(GEODE_LOADER_PATH ${CMAKE_CURRENT_SOURCE_DIR}/loader)

View file

@ -830,6 +830,7 @@ class CountTriggerAction : cocos2d::CCNode {
int m_targetCount; int m_targetCount;
int m_targetID; int m_targetID;
bool m_activateGroup; bool m_activateGroup;
bool m_multiActivate;
} }
class CreateGuidelinesLayer : FLAlertLayer, FLAlertLayerProtocol { class CreateGuidelinesLayer : FLAlertLayer, FLAlertLayerProtocol {
@ -1221,7 +1222,6 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
void editObject2(cocos2d::CCObject* sender) = win 0x8d1b0; void editObject2(cocos2d::CCObject* sender) = win 0x8d1b0;
void editGroup(cocos2d::CCObject* sender) = win 0x8d720; void editGroup(cocos2d::CCObject* sender) = win 0x8d720;
void moveObjectCall(cocos2d::CCObject* sender) = mac 0x29830, win 0x8db30; void moveObjectCall(cocos2d::CCObject* sender) = mac 0x29830, win 0x8db30;
void moveObjectCall(EditCommand command) = win 0x8db30;
void transformObjectCall(cocos2d::CCObject* sender) = mac 0x29860, win 0x8def0; void transformObjectCall(cocos2d::CCObject* sender) = mac 0x29860, win 0x8def0;
void onDelete(cocos2d::CCObject* sender) = mac 0x1b3d0, win 0x7b8d0; void onDelete(cocos2d::CCObject* sender) = mac 0x1b3d0, win 0x7b8d0;
void onDeleteSelected(cocos2d::CCObject* sender) = mac 0xb990, win 0x7bf50; void onDeleteSelected(cocos2d::CCObject* sender) = mac 0xb990, win 0x7bf50;
@ -4202,7 +4202,7 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate,
return GameManager::sharedState()->getPlayLayer(); return GameManager::sharedState()->getPlayLayer();
} }
PlayLayer() = win 0x1FAA90; PlayLayer() = mac 0x80e20, win 0x1faa90;
void addCircle(CCCircleWave*) = mac 0x7e0f0; void addCircle(CCCircleWave*) = mac 0x7e0f0;
void addObject(GameObject*) = mac 0x70e50, win 0x2017e0; void addObject(GameObject*) = mac 0x70e50, win 0x2017e0;
@ -5308,7 +5308,7 @@ class TextArea : cocos2d::CCSprite {
virtual void draw() {} virtual void draw() {}
virtual void setOpacity(unsigned char) = mac 0x19f760, win 0x33800; virtual void setOpacity(unsigned char) = mac 0x19f760, win 0x33800;
bool init(gd::string str, char const* font, float width, float height, cocos2d::CCPoint anchor, float scale, bool disableColor) = mac 0x19ec70, win 0x33370, ios 0x92444; bool init(gd::string str, char const* font, float width, float height, cocos2d::CCPoint anchor, float scale, bool disableColor) = mac 0x19ec70, win 0x33370, ios 0x92444;
static TextArea* create(gd::string str, char const* font, float width, float height, cocos2d::CCPoint const& anchor, float scale, bool disableColor) = mac 0x19eb40, win 0x33270; static TextArea* create(gd::string str, char const* font, float scale, float width, cocos2d::CCPoint const& anchor, float height, bool disableColor) = mac 0x19eb40, win 0x33270;
void colorAllCharactersTo(cocos2d::ccColor3B color) = win 0x33830; void colorAllCharactersTo(cocos2d::ccColor3B color) = win 0x33830;
void setString(gd::string str) = mac 0x19eda0, win 0x33480; void setString(gd::string str) = mac 0x19eda0, win 0x33480;

View file

@ -25,12 +25,12 @@ THE SOFTWARE.
#ifndef __CCMOTION_STREAK_H__ #ifndef __CCMOTION_STREAK_H__
#define __CCMOTION_STREAK_H__ #define __CCMOTION_STREAK_H__
#include "../include/CCProtocols.h"
#include "../textures/CCTexture2D.h"
#include "../include/ccTypes.h"
#include "../base_nodes/CCNode.h" #include "../base_nodes/CCNode.h"
#include "../include/CCProtocols.h"
#include "../include/ccTypes.h"
#include "../textures/CCTexture2D.h"
#ifdef EMSCRIPTEN #ifdef EMSCRIPTEN
#include "../base_nodes/CCGLBufferedNode.h" #include "../base_nodes/CCGLBufferedNode.h"
#endif // EMSCRIPTEN #endif // EMSCRIPTEN
NS_CC_BEGIN NS_CC_BEGIN
@ -43,11 +43,15 @@ NS_CC_BEGIN
/** MotionStreak. /** MotionStreak.
Creates a trailing path. Creates a trailing path.
*/ */
class CC_DLL CCMotionStreak : public CCNodeRGBA, public CCTextureProtocol class CC_DLL CCMotionStreak :
public CCNodeRGBA,
public CCTextureProtocol
#ifdef EMSCRIPTEN #ifdef EMSCRIPTEN
, public CCGLBufferedNode ,
public CCGLBufferedNode
#endif // EMSCRIPTEN #endif // EMSCRIPTEN
{ {
public: public:
/** /**
* @js ctor * @js ctor
@ -59,15 +63,27 @@ public:
*/ */
virtual ~CCMotionStreak(); virtual ~CCMotionStreak();
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */ /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's
static CCMotionStreak* create(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path); * width, color, texture filename */
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */ static CCMotionStreak* create(
static CCMotionStreak* create(float fade, float minSeg, float stroke, const ccColor3B& color, CCTexture2D* texture); float fade, float minSeg, float stroke, ccColor3B const& color, char const* path
);
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's
* width, color, texture */
static CCMotionStreak* create(
float fade, float minSeg, float stroke, ccColor3B const& color, CCTexture2D* texture
);
/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename */ /** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color
bool initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path); * and texture filename */
/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture */ bool initWithFade(
bool initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, CCTexture2D* texture); float fade, float minSeg, float stroke, ccColor3B const& color, char const* path
);
/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color
* and texture */
bool initWithFade(
float fade, float minSeg, float stroke, ccColor3B const& color, CCTexture2D* texture
);
/** color used for the tint */ /** color used for the tint */
void tintWithColor(ccColor3B colors); void tintWithColor(ccColor3B colors);
@ -76,13 +92,13 @@ public:
void reset(); void reset();
/** Override super methods */ /** Override super methods */
virtual void setPosition(const CCPoint& position); virtual void setPosition(CCPoint const& position);
virtual void draw(); virtual void draw();
virtual void update(float delta); virtual void update(float delta);
/* Implement interfaces */ /* Implement interfaces */
virtual CCTexture2D* getTexture(void); virtual CCTexture2D* getTexture(void);
virtual void setTexture(CCTexture2D *texture); virtual void setTexture(CCTexture2D* texture);
/** /**
* @js NA * @js NA
*/ */
@ -96,24 +112,28 @@ public:
virtual void setOpacityModifyRGB(bool bValue); virtual void setOpacityModifyRGB(bool bValue);
virtual bool isOpacityModifyRGB(void); virtual bool isOpacityModifyRGB(void);
RT_ADD( RT_ADD(void resumeStroke(); void stopStroke(););
void resumeStroke();
void stopStroke();
);
/** When fast mode is enabled, new points are added faster but with lower precision */ /** When fast mode is enabled, new points are added faster but with lower precision */
inline bool isFastMode() { return m_bFastMode; } inline bool isFastMode() {
inline void setFastMode(bool bFastMode) { m_bFastMode = bFastMode; } return m_bFastMode;
inline bool isStartingPositionInitialized() { return m_bStartingPositionInitialized; }
inline void setStartingPositionInitialized(bool bStartingPositionInitialized)
{
m_bStartingPositionInitialized = bStartingPositionInitialized;
} }
inline void setFastMode(bool bFastMode) {
m_bFastMode = bFastMode;
}
inline bool isStartingPositionInitialized() {
return m_bStartingPositionInitialized;
}
inline void setStartingPositionInitialized(bool bStartingPositionInitialized) {
m_bStartingPositionInitialized = bStartingPositionInitialized;
}
protected: protected:
bool m_bFastMode; bool m_bFastMode;
bool m_bStartingPositionInitialized; bool m_bStartingPositionInitialized;
private:
/** texture used for the motion streak */ /** texture used for the motion streak */
CCTexture2D* m_pTexture; CCTexture2D* m_pTexture;
ccBlendFunc m_tBlendFunc; ccBlendFunc m_tBlendFunc;