mirror of
https://github.com/geode-sdk/geode.git
synced 2025-07-28 15:08:57 -04:00
Merge branch 'geode-sdk:main' into main
This commit is contained in:
commit
55edcaf2d3
91 changed files with 815 additions and 51 deletions
CHANGELOG.mdVERSION
loader
CMakeLists.txt
include/Geode
c++stl/gnustl
cocos
CCCamera.hCCConfiguration.hCCScheduler.h
actions
CCAction.hCCActionCatmullRom.hCCActionEase.hCCActionGrid.hCCActionInstant.hCCActionInterval.hCCActionTiledGrid.h
base_nodes
cocoa
effects
extensions
GUI
CCControlExtension
CCControlButton.hCCControlHuePicker.hCCControlPotentiometer.hCCControlSaturationBrightnessPicker.hCCControlSlider.hCCControlStepper.hCCControlSwitch.h
CCEditBox
CCEditBox.hCCEditBoxImpl.hCCEditBoxImplAndroid.hCCEditBoxImplIOS.hCCEditBoxImplMac.hCCEditBoxImplTizen.hCCEditBoxImplWin.hCCEditBoxImplWp8.h
CCScrollView
network
keypad_dispatcher
label_nodes
layers_scenes_transitions_nodes
menu_nodes
misc_nodes
particle_nodes
platform
robtop
content
keyboard_dispatcher
mouse_dispatcher
sprite_nodes
xml
script_support
shaders
sprite_nodes
support
text_input_node
textures
tilemap_parallax_nodes
touch_dispatcher
src
cocos2d-ext
hooks
platform
ui/nodes
utils
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,21 +1,33 @@
|
|||
# Geode Changelog
|
||||
|
||||
## v4.3.1
|
||||
* Fix `SimpleAxisLayout` not respecting `Layout::ignoreInvisibleChildren` (a16d230)
|
||||
* Fix MacOS arrow keys (#1267)
|
||||
* Fix ScrollLayer culling with scaled children (f03cee8)
|
||||
|
||||
## v4.3.0
|
||||
* Event export macro (#1243)
|
||||
* See [the docs](https://docs.geode-sdk.org/mods/dependencies#event-macro) for more info
|
||||
* Fix settings `enable-if` parsing (315bf46, 1542e29)
|
||||
* Add `SimpleAxisLayout` (#1223)
|
||||
* A simpler and faster alternative to `AxisLayout`. Some features may be missing
|
||||
* Add environment variable for forcing terminal colors (39b1bef)
|
||||
* Fix crashlog PDB search paths (#1222)
|
||||
* Add support for missing keys and mouse buttons (#1258)
|
||||
* Add utils::string::trim* overloads for specific charset (0d4dcb3, 17faf36)
|
||||
* Round number settings to 5 decimal places (c9dbc4b)
|
||||
* Allow number inputs to be invalid while typing and active (6c6215b)
|
||||
* Optimize m_fields access to perform no allocations (7548421)
|
||||
* Allow `Task<void>`, useful for coroutines (2bfff1a, 463ea22)
|
||||
* Add some coroutine utils (99cefab)
|
||||
* Fix culling on ScrollLayer (b136e3b, b733c36)
|
||||
* Fix `WeakRef` behavior with nullptr (9a8939f)
|
||||
* Remove handler from function if no hooks are active (dc14d4c)
|
||||
* Fix some bugs in `geode::utils::ranges` methods (#1236, #1239)
|
||||
* Add patch for `CCGLProgram::compileShader` on remaining platforms (#1241)
|
||||
* Update the pugixml headers to be v1.15 compatible (#1247)
|
||||
* Allow auto update across major versions if running in forward compat mode (4bb17a9)
|
||||
* Re-add console log level to android (b1dc29a)
|
||||
|
||||
## v4.2.0
|
||||
* Implement gd::set for android (#1197, #1207)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
4.2.1
|
||||
4.3.1
|
||||
|
|
|
@ -88,10 +88,19 @@ file(GLOB SOURCES CONFIGURE_DEPENDS
|
|||
)
|
||||
|
||||
# Obj-c sources
|
||||
file(GLOB OBJC_SOURCES
|
||||
src/platform/Objcpp.mm
|
||||
src/load.mm
|
||||
)
|
||||
if (IOS)
|
||||
file(GLOB OBJC_SOURCES CONFIGURE_DEPENDS
|
||||
src/platform/ios/*.mm
|
||||
src/load.mm
|
||||
src/hooks/AddExtraKeys.mm
|
||||
)
|
||||
else()
|
||||
file(GLOB OBJC_SOURCES CONFIGURE_DEPENDS
|
||||
src/platform/mac/*.mm
|
||||
src/load.mm
|
||||
src/hooks/AddExtraKeys.mm
|
||||
)
|
||||
endif()
|
||||
set_source_files_properties(${OBJC_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||
|
||||
if (WIN32)
|
||||
|
@ -142,7 +151,7 @@ endif()
|
|||
|
||||
|
||||
if (ANDROID AND GEODE_USE_BREAKPAD)
|
||||
CPMAddPackage("gh:qimiko/breakpad#161e908")
|
||||
CPMAddPackage("gh:qimiko/breakpad#169df6a")
|
||||
endif()
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCES})
|
||||
|
|
|
@ -425,7 +425,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
* Insertion requires logarithmic time.
|
||||
*/
|
||||
template<typename... _Args>
|
||||
std::pair<iterator, bool>
|
||||
pair<iterator, bool>
|
||||
emplace(_Args&&... __args)
|
||||
{ return _M_t._M_emplace_unique(std::forward<_Args>(__args)...); }
|
||||
|
||||
|
@ -472,21 +472,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
*
|
||||
* Insertion requires logarithmic time.
|
||||
*/
|
||||
std::pair<iterator, bool>
|
||||
pair<iterator, bool>
|
||||
insert(const value_type& __x)
|
||||
{
|
||||
std::pair<typename _Rep_type::iterator, bool> __p =
|
||||
pair<typename _Rep_type::iterator, bool> __p =
|
||||
_M_t._M_insert_unique(__x);
|
||||
return std::pair<iterator, bool>(__p.first, __p.second);
|
||||
return pair<iterator, bool>(__p.first, __p.second);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
std::pair<iterator, bool>
|
||||
pair<iterator, bool>
|
||||
insert(value_type&& __x)
|
||||
{
|
||||
std::pair<typename _Rep_type::iterator, bool> __p =
|
||||
pair<typename _Rep_type::iterator, bool> __p =
|
||||
_M_t._M_insert_unique(std::move(__x));
|
||||
return std::pair<iterator, bool>(__p.first, __p.second);
|
||||
return pair<iterator, bool>(__p.first, __p.second);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -749,11 +749,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
*
|
||||
* This function probably only makes sense for multisets.
|
||||
*/
|
||||
std::pair<iterator, iterator>
|
||||
pair<iterator, iterator>
|
||||
equal_range(const key_type& __x)
|
||||
{ return _M_t.equal_range(__x); }
|
||||
|
||||
std::pair<const_iterator, const_iterator>
|
||||
pair<const_iterator, const_iterator>
|
||||
equal_range(const key_type& __x) const
|
||||
{ return _M_t.equal_range(__x); }
|
||||
//@}
|
||||
|
|
1
loader/include/Geode/cocos/CCCamera.h
vendored
1
loader/include/Geode/cocos/CCCamera.h
vendored
|
@ -80,6 +80,7 @@ public:
|
|||
bool m_bDirty;
|
||||
kmMat4 m_lookupMatrix;
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCCamera, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
1
loader/include/Geode/cocos/CCConfiguration.h
vendored
1
loader/include/Geode/cocos/CCConfiguration.h
vendored
|
@ -63,6 +63,7 @@ public:
|
|||
static void purgeConfiguration(void);
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCConfiguration, CCObject)
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
|
1
loader/include/Geode/cocos/CCScheduler.h
vendored
1
loader/include/Geode/cocos/CCScheduler.h
vendored
|
@ -53,6 +53,7 @@ class CC_DLL CCTimer : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTimer, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
* @lua NA
|
||||
|
|
|
@ -185,6 +185,7 @@ class CC_DLL CCSpeed : public CCAction
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSpeed, CCAction)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -243,6 +244,7 @@ class CC_DLL CCFollow : public CCAction
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCFollow, CCAction)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -59,6 +59,7 @@ class CC_DLL CCPointArray : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCPointArray, CCObject)
|
||||
|
||||
/** creates and initializes a Points array with capacity
|
||||
* @lua NA
|
||||
|
@ -121,6 +122,7 @@ class CC_DLL CCCardinalSplineTo : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCCardinalSplineTo, CCActionInterval)
|
||||
|
||||
/** creates an action with a Cardinal Spline array of points and tension
|
||||
* @code
|
||||
|
@ -193,6 +195,7 @@ class CC_DLL CCCardinalSplineBy : public CCCardinalSplineTo
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCCardinalSplineBy, CCCardinalSplineTo)
|
||||
|
||||
/** creates an action with a Cardinal Spline array of points and tension
|
||||
* @code
|
||||
|
|
|
@ -86,6 +86,9 @@ class CC_DLL CCEaseRateAction : public CCActionEase
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEaseRateAction, CCActionEase);
|
||||
CCEaseRateAction() {}
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
|
|
@ -42,6 +42,9 @@ class CC_DLL CCGridAction : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCGridAction, CCActionInterval)
|
||||
CCGridAction() {}
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
@ -98,6 +101,9 @@ class CC_DLL CCTiledGrid3DAction : public CCGridAction
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTiledGrid3DAction, CCGridAction)
|
||||
CCTiledGrid3DAction() {}
|
||||
|
||||
/** returns the tile that belongs to a certain position of the grid */
|
||||
ccQuad3 tile(const CCPoint& position);
|
||||
/** returns the non-transformed tile that belongs to a certain position of the grid */
|
||||
|
|
|
@ -301,6 +301,7 @@ class CC_DLL CCCallFunc : public CCActionInstant //<NSCopying>
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCCallFunc, CCActionInstant)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -485,6 +486,8 @@ class CC_DLL CCCallFuncO : public CCCallFunc, public TypeInfo
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCCallFuncO, CCCallFunc)
|
||||
|
||||
CCCallFuncO();
|
||||
virtual ~CCCallFuncO();
|
||||
|
||||
|
|
|
@ -107,6 +107,9 @@ class CC_DLL CCSequence : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSequence, CCActionInterval)
|
||||
CCSequence() {}
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
@ -178,6 +181,9 @@ class CC_DLL CCRepeat : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCRepeat, CCActionInterval)
|
||||
CCRepeat() {}
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
@ -288,6 +294,9 @@ class CC_DLL CCSpawn : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSpawn, CCActionInterval)
|
||||
CCSpawn() {}
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
@ -470,6 +479,7 @@ class CC_DLL CCSkewTo : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSkewTo, CCActionInterval)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -890,6 +900,7 @@ class CC_DLL CCReverseTime : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCReverseTime, CCActionInterval)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -925,6 +936,7 @@ class CC_DLL CCAnimate : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAnimate, CCActionInterval)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -972,6 +984,7 @@ class CC_DLL CCTargetedAction : public CCActionInterval
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTargetedAction, CCActionInterval)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -90,6 +90,8 @@ class CC_DLL CCShuffleTiles : public CCTiledGrid3DAction
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCShuffleTiles, CCTiledGrid3DAction)
|
||||
CCShuffleTiles() {}
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
@ -191,6 +193,8 @@ class CC_DLL CCTurnOffTiles : public CCTiledGrid3DAction
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTurnOffTiles, CCTiledGrid3DAction)
|
||||
CCTurnOffTiles() {}
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
bool m_bIgnoreContentScaleFactor;
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAtlasNode, CCNodeRGBA)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
1
loader/include/Geode/cocos/cocoa/CCArray.h
vendored
1
loader/include/Geode/cocos/cocoa/CCArray.h
vendored
|
@ -115,6 +115,7 @@ class CC_DLL CCArray : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCArray, CCObject)
|
||||
/**
|
||||
* @lua NA
|
||||
*/
|
||||
|
|
|
@ -41,6 +41,8 @@ class CC_DLL CCAutoreleasePool : public CCObject
|
|||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
CCArray* m_pManagedObjectArray;
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAutoreleasePool, CCObject)
|
||||
|
||||
CCAutoreleasePool(void);
|
||||
~CCAutoreleasePool(void);
|
||||
|
||||
|
@ -62,6 +64,8 @@ class CC_DLL CCPoolManager
|
|||
|
||||
CCAutoreleasePool* getCurReleasePool();
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCPoolManager)
|
||||
|
||||
CCPoolManager();
|
||||
~CCPoolManager();
|
||||
void finalize();
|
||||
|
|
4
loader/include/Geode/cocos/effects/CCGrid.h
vendored
4
loader/include/Geode/cocos/effects/CCGrid.h
vendored
|
@ -53,6 +53,8 @@ class CC_DLL CCGridBase : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCGridBase, CCObject)
|
||||
CCGridBase() {}
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
@ -170,6 +172,7 @@ class CC_DLL CCGrid3D : public CCGridBase
|
|||
#endif // EMSCRIPTEN
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCGrid3D, CCGridBase)
|
||||
CCGrid3D();
|
||||
~CCGrid3D(void);
|
||||
|
||||
|
@ -209,6 +212,7 @@ class CC_DLL CCTiledGrid3D : public CCGridBase
|
|||
#endif // EMSCRIPTEN
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTiledGrid3D, CCGridBase)
|
||||
CCTiledGrid3D();
|
||||
~CCTiledGrid3D(void);
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ NS_CC_EXT_BEGIN
|
|||
class CC_DLL CCControlButton : public CCControl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlButton, CCControl)
|
||||
CCControlButton();
|
||||
virtual ~CCControlButton();
|
||||
virtual void needsLayout(void);
|
||||
|
|
|
@ -60,6 +60,7 @@ class CC_DLL CCControlHuePicker : public CCControl
|
|||
CC_SYNTHESIZE_READONLY(CCPoint, m_startPos, StartPos);
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlHuePicker, CCControl)
|
||||
CCControlHuePicker();
|
||||
virtual ~CCControlHuePicker();
|
||||
virtual bool initWithTargetAndPos(CCNode* target, CCPoint pos);
|
||||
|
|
|
@ -42,6 +42,7 @@ NS_CC_EXT_BEGIN
|
|||
class CC_DLL CCControlPotentiometer : public CCControl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlPotentiometer, CCControl)
|
||||
CCControlPotentiometer();
|
||||
virtual ~CCControlPotentiometer();
|
||||
/**
|
||||
|
|
|
@ -64,6 +64,7 @@ public:
|
|||
int boxSize;
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlSaturationBrightnessPicker, CCControl)
|
||||
CCControlSaturationBrightnessPicker();
|
||||
virtual ~CCControlSaturationBrightnessPicker();
|
||||
virtual bool initWithTargetAndPos(CCNode* target, CCPoint pos);
|
||||
|
|
|
@ -69,6 +69,7 @@ class CC_DLL CCControlSlider: public CCControl
|
|||
CC_SYNTHESIZE_RETAIN(CCSprite*, m_backgroundSprite, BackgroundSprite);
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlSlider, CCControl)
|
||||
CCControlSlider();
|
||||
virtual ~CCControlSlider();
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ typedef enum
|
|||
class CC_DLL CCControlStepper : public CCControl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlStepper, CCControl)
|
||||
CCControlStepper();
|
||||
virtual ~CCControlStepper();
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ class CC_DLL CCControlSwitchSprite;
|
|||
class CC_DLL CCControlSwitch : public CCControl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCControlSwitch, CCControl)
|
||||
CCControlSwitch();
|
||||
virtual ~CCControlSwitch();
|
||||
/** Initializes a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. */
|
||||
|
|
|
@ -176,6 +176,8 @@ class CC_DLL CCEditBox
|
|||
, public CCIMEDelegate
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEditBox, CCControlButton)
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
|
|
|
@ -36,6 +36,9 @@ NS_CC_EXT_BEGIN
|
|||
class CC_DLL CCEditBoxImpl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCEditBoxImpl)
|
||||
CCEditBoxImpl() {}
|
||||
|
||||
CCEditBoxImpl(CCEditBox* pEditBox) : m_pDelegate(NULL),m_pEditBox(pEditBox) {}
|
||||
virtual ~CCEditBoxImpl() {}
|
||||
|
||||
|
|
|
@ -40,6 +40,9 @@ class CC_DLL CCEditBox;
|
|||
class CC_DLL CCEditBoxImplAndroid : public CCEditBoxImpl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEditBoxImplAndroid, CCEditBoxImpl)
|
||||
CCEditBoxImplAndroid() {}
|
||||
|
||||
CCEditBoxImplAndroid(CCEditBox* pEditText);
|
||||
virtual ~CCEditBoxImplAndroid();
|
||||
|
||||
|
|
|
@ -74,6 +74,9 @@ class CC_DLL CCEditBox;
|
|||
class CC_DLL CCEditBoxImplIOS : public CCEditBoxImpl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEditBoxImplIOS, CCEditBoxImpl)
|
||||
CCEditBoxImplIOS() {}
|
||||
|
||||
CCEditBoxImplIOS(CCEditBox* pEditText);
|
||||
virtual ~CCEditBoxImplIOS();
|
||||
|
||||
|
|
|
@ -73,6 +73,9 @@ class CC_DLL CCEditBox;
|
|||
class CC_DLL CCEditBoxImplMac : public CCEditBoxImpl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEditBoxImplMac, CCEditBoxImpl)
|
||||
CCEditBoxImplMac() {}
|
||||
|
||||
CCEditBoxImplMac(CCEditBox* pEditText);
|
||||
virtual ~CCEditBoxImplMac();
|
||||
|
||||
|
|
|
@ -44,6 +44,9 @@ class CC_DLL CCEditBox;
|
|||
class CC_DLL CCEditBoxImplTizen : public CCEditBoxImpl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEditBoxImplTizen, CCEditBoxImpl)
|
||||
CCEditBoxImplTizen() {}
|
||||
|
||||
CCEditBoxImplTizen(CCEditBox* pEditText);
|
||||
virtual ~CCEditBoxImplTizen();
|
||||
|
||||
|
|
|
@ -43,6 +43,9 @@ class CC_DLL CCEditBox;
|
|||
class CC_DLL CCEditBoxImplWin : public CCEditBoxImpl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEditBoxImplWin, CCEditBoxImpl)
|
||||
CCEditBoxImplWin() {}
|
||||
|
||||
CCEditBoxImplWin(CCEditBox* pEditText);
|
||||
virtual ~CCEditBoxImplWin();
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@ class CC_DLL CCEditBox;
|
|||
class CC_DLL CCEditBoxImplWp8 : public CCEditBoxImpl
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCEditBoxImplWp8, CCEditBoxImpl)
|
||||
CCEditBoxImplWp8() {}
|
||||
|
||||
CCEditBoxImplWp8(CCEditBox* pEditText);
|
||||
virtual ~CCEditBoxImplWp8();
|
||||
|
||||
|
|
|
@ -140,6 +140,7 @@ public:
|
|||
class CC_DLL CCTableView : public CCScrollView, public CCScrollViewDelegate
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTableView, CCScrollView)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -49,6 +49,8 @@ class CC_DLL CCHttpClient : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCHttpClient, CCObject)
|
||||
|
||||
/** Return the shared instance **/
|
||||
static CCHttpClient *getInstance();
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ class CC_DLL CCKeypadDispatcher : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCKeypadDispatcher, CCObject);
|
||||
CCKeypadDispatcher();
|
||||
~CCKeypadDispatcher();
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ public://@public
|
|||
// Character Set defines the letters that actually exist in the font
|
||||
gd::set<unsigned int> *m_pCharacterSet;
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCBMFontConfiguration, CCObject)
|
||||
CCBMFontConfiguration();
|
||||
/**
|
||||
* @js NA
|
||||
|
|
|
@ -430,6 +430,7 @@ protected:
|
|||
unsigned int m_nEnabledLayer;
|
||||
CCArray* m_pLayers;
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCLayerMultiplex, CCLayer)
|
||||
/**
|
||||
* @js ctor
|
||||
* @lua NA
|
||||
|
|
|
@ -195,6 +195,7 @@ class CC_DLL CCTransitionJumpZoom : public CCTransitionScene
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionJumpZoom, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -220,6 +221,7 @@ class CC_DLL CCTransitionMoveInL : public CCTransitionScene, public CCTransition
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionMoveInL, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -251,6 +253,7 @@ class CC_DLL CCTransitionMoveInR : public CCTransitionMoveInL
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionMoveInR, CCTransitionMoveInL)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -272,6 +275,7 @@ class CC_DLL CCTransitionMoveInT : public CCTransitionMoveInL
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionMoveInT, CCTransitionMoveInL)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -293,6 +297,7 @@ class CC_DLL CCTransitionMoveInB : public CCTransitionMoveInL
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionMoveInB, CCTransitionMoveInL)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -314,6 +319,7 @@ class CC_DLL CCTransitionSlideInL : public CCTransitionScene, public CCTransitio
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionSlideInL, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -348,6 +354,7 @@ class CC_DLL CCTransitionSlideInR : public CCTransitionSlideInL
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionSlideInR, CCTransitionSlideInL)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -375,6 +382,7 @@ class CC_DLL CCTransitionSlideInB : public CCTransitionSlideInL
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionSlideInB, CCTransitionSlideInL)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -402,6 +410,7 @@ class CC_DLL CCTransitionSlideInT : public CCTransitionSlideInL
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionSlideInT, CCTransitionSlideInL)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -429,6 +438,7 @@ class CC_DLL CCTransitionShrinkGrow : public CCTransitionScene , public CCTransi
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionShrinkGrow, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -456,6 +466,7 @@ class CC_DLL CCTransitionFlipX : public CCTransitionSceneOriented
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFlipX, CCTransitionSceneOriented)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -483,6 +494,7 @@ class CC_DLL CCTransitionFlipY : public CCTransitionSceneOriented
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFlipY, CCTransitionSceneOriented)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -510,6 +522,7 @@ class CC_DLL CCTransitionFlipAngular : public CCTransitionSceneOriented
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFlipAngular, CCTransitionSceneOriented)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -537,6 +550,7 @@ class CC_DLL CCTransitionZoomFlipX : public CCTransitionSceneOriented
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionZoomFlipX, CCTransitionSceneOriented)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -564,6 +578,7 @@ class CC_DLL CCTransitionZoomFlipY : public CCTransitionSceneOriented
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionZoomFlipY, CCTransitionSceneOriented)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -591,6 +606,7 @@ class CC_DLL CCTransitionZoomFlipAngular : public CCTransitionSceneOriented
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionZoomFlipAngular, CCTransitionSceneOriented)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -664,6 +680,7 @@ class CC_DLL CCTransitionCrossFade : public CCTransitionScene
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public :
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionCrossFade, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -697,6 +714,7 @@ class CC_DLL CCTransitionTurnOffTiles : public CCTransitionScene ,public CCTrans
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public :
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionTurnOffTiles, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -726,6 +744,7 @@ class CC_DLL CCTransitionSplitCols : public CCTransitionScene , public CCTransit
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionSplitCols, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -756,6 +775,7 @@ class CC_DLL CCTransitionSplitRows : public CCTransitionSplitCols
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionSplitRows, CCTransitionSplitCols)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -780,6 +800,7 @@ class CC_DLL CCTransitionFadeTR : public CCTransitionScene , public CCTransition
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFadeTR, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -811,6 +832,7 @@ class CC_DLL CCTransitionFadeBL : public CCTransitionFadeTR
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFadeBL, CCTransitionFadeTR)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -834,6 +856,7 @@ class CC_DLL CCTransitionFadeUp : public CCTransitionFadeTR
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFadeUp, CCTransitionFadeTR)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -857,6 +880,7 @@ class CC_DLL CCTransitionFadeDown : public CCTransitionFadeTR
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFadeDown, CCTransitionFadeTR)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -55,6 +55,7 @@ public:
|
|||
bool m_bBack;
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionPageTurn, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -44,6 +44,8 @@ class CC_DLL CCTransitionProgress : public CCTransitionScene
|
|||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
static CCTransitionProgress* create(float t, CCScene* scene);
|
||||
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionProgress, CCTransitionScene)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -393,6 +393,7 @@ class CC_DLL CCMenuItemToggle : public CCMenuItem
|
|||
*/
|
||||
CC_PROPERTY(CCArray*, m_pSubItems, SubItems);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMenuItemToggle, CCMenuItem)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -60,6 +60,7 @@ class CC_DLL CCProgressTimer : public CCNodeRGBA
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCProgressTimer, CCNodeRGBA)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -68,6 +68,7 @@ class CC_DLL CCParticleBatchNode : public CCNode, public CCTextureProtocol
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCParticleBatchNode, CCNode)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -16,6 +16,7 @@ private:
|
|||
|
||||
CCDevice();
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCDevice)
|
||||
/**
|
||||
* Gets the DPI of device
|
||||
* @return The DPI of device.
|
||||
|
|
|
@ -59,6 +59,7 @@ class CC_DLL CCSAXParser
|
|||
CCSAXDelegator* m_pDelegator;
|
||||
public:
|
||||
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCSAXParser)
|
||||
CCSAXParser();
|
||||
~CCSAXParser(void);
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ class CC_DLL CCThread
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCThread)
|
||||
CCThread() : m_pAutoreasePool(0) {}
|
||||
~CCThread();
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ class CC_DLL CCAccelerometer
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCAccelerometer)
|
||||
CCAccelerometer();
|
||||
~CCAccelerometer();
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ class CC_DLL CCAccelerometer
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCAccelerometer)
|
||||
CCAccelerometer();
|
||||
~CCAccelerometer();
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ class CC_DLL CCAccelerometer
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCAccelerometer)
|
||||
CCAccelerometer() {}
|
||||
~CCAccelerometer() {}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ class CC_DLL CCAccelerometer
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCAccelerometer)
|
||||
CCAccelerometer();
|
||||
~CCAccelerometer();
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ class CC_DLL CCFileUtilsWin32 : public CCFileUtils
|
|||
friend class CCFileUtils;
|
||||
CCFileUtilsWin32();
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCFileUtilsWin32, CCFileUtils)
|
||||
/* override funtions */
|
||||
bool init();
|
||||
virtual void addSearchPath(const char* path);
|
||||
|
|
|
@ -12,7 +12,9 @@ class CC_DLL CCContentManager : public cocos2d::CCObject
|
|||
{
|
||||
public:
|
||||
static CCContentManager* sharedManager();
|
||||
CCContentManager();
|
||||
CCContentManager() {}
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCContentManager, CCObject)
|
||||
|
||||
bool init();
|
||||
|
||||
cocos2d::CCDictionary* addDict(const char* dict, bool unk);
|
||||
|
|
|
@ -14,7 +14,6 @@ NS_CC_BEGIN
|
|||
*/
|
||||
typedef enum
|
||||
{
|
||||
// this one might not actually exist in gd itself
|
||||
KEY_Unknown = -0x01,
|
||||
KEY_None = 0x00,
|
||||
KEY_Backspace = 0x08,
|
||||
|
@ -198,6 +197,28 @@ typedef enum
|
|||
CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
|
||||
CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
|
||||
CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
|
||||
|
||||
// Geode additions
|
||||
KEY_GraveAccent = 0x1000,
|
||||
KEY_OEMEqual = 0x1001,
|
||||
KEY_LeftBracket = 0x1002,
|
||||
KEY_RightBracket = 0x1003,
|
||||
KEY_Backslash = 0x1004,
|
||||
KEY_Semicolon = 0x1005,
|
||||
KEY_Apostrophe = 0x1006,
|
||||
KEY_Slash = 0x1007,
|
||||
KEY_Equal = 0x1008,
|
||||
KEY_NumEnter = 0x1009,
|
||||
// Keys used by some non-US keyboard layouts
|
||||
KEY_World1 = 0x100A,
|
||||
KEY_World2 = 0x100B,
|
||||
|
||||
// Mouse buttons (excluding clicks)
|
||||
MOUSE_4 = 0x1100,
|
||||
MOUSE_5 = 0x1101,
|
||||
MOUSE_6 = 0x1102,
|
||||
MOUSE_7 = 0x1103,
|
||||
MOUSE_8 = 0x1104
|
||||
} enumKeyCodes;
|
||||
|
||||
// @note RobTop Addition
|
||||
|
|
|
@ -11,6 +11,7 @@ NS_CC_BEGIN
|
|||
class CC_DLL CCKeyboardDispatcher : public CCObject
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCKeyboardDispatcher, CCObject)
|
||||
CCKeyboardDispatcher();
|
||||
virtual ~CCKeyboardDispatcher();
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ class CC_DLL CCMouseDispatcher : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCMouseDispatcher, CCObject)
|
||||
CCMouseDispatcher();
|
||||
virtual ~CCMouseDispatcher();
|
||||
|
||||
|
|
|
@ -9,7 +9,15 @@ NS_CC_BEGIN
|
|||
// @note RobTop Addition
|
||||
class CC_DLL CCFontSprite : public CCSpriteExtra {
|
||||
public:
|
||||
CCFontSprite() {}
|
||||
CCFontSprite()
|
||||
: m_bUseInstant(false)
|
||||
, m_fInstantTime(0.0f)
|
||||
, m_fDelay(0.0f)
|
||||
, m_fShakesPerSecond(0.0f)
|
||||
, m_fShakeIntensity(0.0f)
|
||||
, m_fShakeElapsed(0.0f)
|
||||
, m_nShakeIndex(0)
|
||||
{}
|
||||
virtual ~CCFontSprite() {}
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCFontSprite, CCSpriteExtra);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ NS_CC_BEGIN
|
|||
// @note RobTop Addition
|
||||
class CC_DLL CCSpriteExtra : public CCSprite {
|
||||
public:
|
||||
CCSpriteExtra() {}
|
||||
CCSpriteExtra() : m_fXOffset(0.0f), m_fYOffset(0.0f) {}
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSpriteExtra, CCSprite);
|
||||
|
||||
inline float getXOffset() const { return m_fXOffset; }
|
||||
|
|
|
@ -12,9 +12,9 @@ public:
|
|||
// @note RobTop Addition
|
||||
class CC_DLL ObjectDecoder : public cocos2d::CCNode {
|
||||
public:
|
||||
ObjectDecoder();
|
||||
ObjectDecoder() : m_delegate(nullptr) {}
|
||||
~ObjectDecoder() {}
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(ObjectDecoder)
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(ObjectDecoder, cocos2d::CCNode);
|
||||
|
||||
static ObjectDecoder* sharedDecoder();
|
||||
|
||||
|
|
|
@ -271,6 +271,7 @@ class CC_DLL CCScriptEngineManager
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCScriptEngineManager)
|
||||
~CCScriptEngineManager(void);
|
||||
|
||||
CCScriptEngineProtocol* getScriptEngine(void) {
|
||||
|
|
|
@ -46,6 +46,7 @@ class CC_DLL CCShaderCache : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCShaderCache, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -56,6 +56,7 @@ class CC_DLL CCAnimationFrame : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAnimationFrame, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
@ -98,6 +99,7 @@ class CC_DLL CCAnimation : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAnimation, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -51,6 +51,7 @@ class CC_DLL CCAnimationCache : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCAnimationCache, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -67,6 +67,8 @@ protected:
|
|||
*/
|
||||
CCSpriteFrameCache(void) : m_pSpriteFrames(NULL), m_pSpriteFramesAliases(NULL){}
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSpriteFrameCache, CCObject)
|
||||
|
||||
bool init(void);
|
||||
/**
|
||||
* @js NA
|
||||
|
|
|
@ -36,6 +36,8 @@ class CC_DLL CCNotificationCenter : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCNotificationCenter, CCObject)
|
||||
|
||||
/** CCNotificationCenter constructor */
|
||||
CCNotificationCenter();
|
||||
|
||||
|
@ -123,6 +125,9 @@ class CC_DLL CCNotificationObserver : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCNotificationObserver, CCObject)
|
||||
CCNotificationObserver() {}
|
||||
|
||||
/** @brief CCNotificationObserver constructor
|
||||
* @param target The target which wants to observer notification events.
|
||||
* @param selector The callback function which will be invoked when the specified notification event was posted.
|
||||
|
|
|
@ -52,6 +52,9 @@ class CC_DLL CCProfiler : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCProfiler, CCObject)
|
||||
CCProfiler() {}
|
||||
|
||||
~CCProfiler(void);
|
||||
/** display the timers */
|
||||
void displayTimers(void);
|
||||
|
@ -76,6 +79,7 @@ public:
|
|||
class CCProfilingTimer : public CCObject
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCProfilingTimer, CCObject)
|
||||
CCProfilingTimer();
|
||||
~CCProfilingTimer();
|
||||
bool initWithName(const char* timerName);
|
||||
|
|
|
@ -38,6 +38,7 @@ protected:
|
|||
|
||||
CCComponent(void);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCComponent, CCObject)
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
|
|
|
@ -44,6 +44,9 @@ protected:
|
|||
CCComponentContainer(CCNode *pNode);
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCComponentContainer)
|
||||
CCComponentContainer() {}
|
||||
|
||||
virtual ~CCComponentContainer(void);
|
||||
virtual CCComponent* get(const char *pName) const;
|
||||
virtual bool add(CCComponent *pCom);
|
||||
|
|
|
@ -46,6 +46,7 @@ class CC_DLL CCUserDefault
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCUserDefault)
|
||||
~CCUserDefault();
|
||||
|
||||
// get value methods
|
||||
|
|
|
@ -21,7 +21,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#ifndef GEODE_IS_MEMBER_TEST
|
||||
#ifndef __SUPPORT_ZIPUTILS_H__
|
||||
#define __SUPPORT_ZIPUTILS_H__
|
||||
|
||||
|
@ -272,5 +271,3 @@ namespace cocos2d
|
|||
};
|
||||
} // end of namespace cocos2d
|
||||
#endif // __SUPPORT_ZIPUTILS_H__
|
||||
|
||||
#endif
|
||||
|
|
|
@ -43,6 +43,7 @@ class CC_DLL CCIMEDispatcher
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCIMEDispatcher)
|
||||
~CCIMEDispatcher();
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,6 +67,7 @@ private:
|
|||
/// todo: void addImageWithAsyncObject(CCAsyncObject* async);
|
||||
void addImageAsyncCallBack(float dt);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTextureCache, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
* @lua NA
|
||||
|
|
|
@ -38,6 +38,7 @@ class CC_DLL CCTextureETC : public CCObject
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTextureETC, CCObject)
|
||||
CCTextureETC();
|
||||
virtual ~CCTextureETC();
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ enum {
|
|||
class CCTexturePVR : public CCObject
|
||||
{
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTexturePVR, CCObject)
|
||||
CCTexturePVR();
|
||||
virtual ~CCTexturePVR();
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ class CC_DLL CCParallaxNode : public CCNode
|
|||
CC_SYNTHESIZE(struct _ccArray *, m_pParallaxArray, ParallaxArray)
|
||||
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCParallaxNode, CCNode)
|
||||
/** Adds a child to the container with a z-order, a parallax ratio and a position offset
|
||||
It returns self, so you can chain several addChilds.
|
||||
@since v0.8
|
||||
|
|
|
@ -87,6 +87,7 @@ class CC_DLL CCTMXLayer : public CCSpriteBatchNode
|
|||
/** properties from the layer. They can be added using Tiled */
|
||||
CC_PROPERTY(CCDictionary*, m_pProperties, Properties);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTMXLayer, CCSpriteBatchNode)
|
||||
/**
|
||||
* @js ctor
|
||||
* @lua NA
|
||||
|
|
|
@ -52,6 +52,7 @@ class CC_DLL CCTMXObjectGroup : public CCObject
|
|||
/** array of the objects */
|
||||
CC_PROPERTY(CCArray*, m_pObjects, Objects);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTMXObjectGroup, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -120,6 +120,7 @@ class CC_DLL CCTMXTiledMap : public CCNode
|
|||
/** properties */
|
||||
CC_PROPERTY(CCDictionary*, m_pProperties, Properties);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTMXTiledMap, CCNode)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -101,6 +101,7 @@ public:
|
|||
unsigned int m_uMaxGID;
|
||||
CCPoint m_tOffset;
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTMXLayerInfo, CCObject)
|
||||
CCTMXLayerInfo();
|
||||
virtual ~CCTMXLayerInfo();
|
||||
};
|
||||
|
@ -129,6 +130,7 @@ public:
|
|||
//! size in pixels of the image
|
||||
CCSize m_tImageSize;
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTMXTilesetInfo, CCObject)
|
||||
CCTMXTilesetInfo();
|
||||
virtual ~CCTMXTilesetInfo();
|
||||
CCRect rectForGID(unsigned int gid);
|
||||
|
@ -174,6 +176,7 @@ public:
|
|||
/// properties
|
||||
CC_PROPERTY(CCDictionary*, m_pProperties, Properties);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTMXMapInfo, CCObject)
|
||||
/**
|
||||
* @js ctor
|
||||
* @lua NA
|
||||
|
|
|
@ -60,6 +60,7 @@ class CC_DLL CCTileMapAtlas : public CCAtlasNode
|
|||
/** TileMap info */
|
||||
CC_PROPERTY(struct sImageTGA*, m_pTGAInfo, TGAInfo);
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTileMapAtlas, CCAtlasNode)
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
|
|
|
@ -118,6 +118,7 @@ class CC_DLL CCTouchDispatcher : public CCObject, public EGLTouchDelegate
|
|||
{
|
||||
GEODE_FRIEND_MODIFY
|
||||
public:
|
||||
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTouchDispatcher, CCObject)
|
||||
/**
|
||||
* @lua NA
|
||||
*/
|
||||
|
|
|
@ -59,11 +59,12 @@ public:
|
|||
float m_gap = 0.f;
|
||||
std::optional<float> m_minRelativeScale = 0.5f;
|
||||
std::optional<float> m_maxRelativeScale = 2.f;
|
||||
SimpleAxisLayout* m_layout = nullptr;
|
||||
|
||||
std::unordered_map<CCNode*, float> m_originalScalesPerNode;
|
||||
std::unordered_map<CCNode*, float> m_relativeScalesPerNode;
|
||||
|
||||
Impl(Axis axis) : m_axis(axis) {
|
||||
Impl(Axis axis, SimpleAxisLayout* parent) : m_axis(axis), m_layout(parent) {
|
||||
switch (axis) {
|
||||
case Axis::Column:
|
||||
m_mainAxisDirection = AxisDirection::TopToBottom;
|
||||
|
@ -161,6 +162,10 @@ public:
|
|||
}
|
||||
|
||||
void setScale(CCNode* on, float scale) {
|
||||
// CCMenuItemSpriteExtra is quirky af
|
||||
if (auto btn = typeinfo_cast<CCMenuItemSpriteExtra*>(on)) {
|
||||
btn->m_baseScale = scale;
|
||||
}
|
||||
on->setScale(scale);
|
||||
}
|
||||
|
||||
|
@ -678,7 +683,7 @@ void SimpleAxisLayout::Impl::apply(cocos2d::CCNode* layout) {
|
|||
std::vector<AxisGap*> gaps;
|
||||
float totalGap = 0.f;
|
||||
CCNode* lastChild = nullptr;
|
||||
for (auto child : CCArrayExt<CCNode*>(layout->getChildren())) {
|
||||
for (auto child : CCArrayExt<CCNode*>(m_layout->getNodesToPosition(layout))) {
|
||||
if (auto spacer = typeinfo_cast<SpacerNode*>(child)) {
|
||||
spacers.push_back(spacer);
|
||||
positionChildren.push_back(spacer);
|
||||
|
@ -756,7 +761,7 @@ void SimpleAxisLayout::Impl::apply(cocos2d::CCNode* layout) {
|
|||
this->applyMainPositioning(layout, positionChildren, spacers, totalGap);
|
||||
}
|
||||
|
||||
SimpleAxisLayout::SimpleAxisLayout(Axis axis) : m_impl(std::make_unique<Impl>(axis)) {}
|
||||
SimpleAxisLayout::SimpleAxisLayout(Axis axis) : m_impl(std::make_unique<Impl>(axis, this)) {}
|
||||
|
||||
SimpleAxisLayout::~SimpleAxisLayout() = default;
|
||||
|
||||
|
|
209
loader/src/hooks/AddExtraKeys.cpp
Normal file
209
loader/src/hooks/AddExtraKeys.cpp
Normal file
|
@ -0,0 +1,209 @@
|
|||
#include <Geode/DefaultInclude.hpp>
|
||||
|
||||
#ifdef GEODE_IS_WINDOWS
|
||||
// GLEW needs to be included before GL but GLFW3 doesn't do that so this is
|
||||
// just to make sure all of the GL-related headers are in order
|
||||
#include <Geode/cocos/include/cocos2d.h>
|
||||
#include <Geode/cocos/robtop/glfw/glfw3.h>
|
||||
#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h>
|
||||
#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h>
|
||||
#include <Geode/cocos/text_input_node/CCIMEDispatcher.h>
|
||||
#include <Geode/modify/Modify.hpp>
|
||||
#include <Geode/modify/CCEGLView.hpp>
|
||||
#include <Geode/modify/CCKeyboardDispatcher.hpp>
|
||||
|
||||
using namespace geode::prelude;
|
||||
|
||||
class $modify(GeodeCCEGLView, CCEGLView) {
|
||||
void onGLFWKeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) {
|
||||
bool extraKey = isExtraKey(key);
|
||||
bool numpad = isKeyNumpad(key);
|
||||
if (!extraKey && !numpad) {
|
||||
return CCEGLView::onGLFWKeyCallback(window, key, scancode, action, mods);
|
||||
}
|
||||
if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
|
||||
return CCEGLView::onGLFWKeyCallback(window, key, scancode, action, mods);
|
||||
}
|
||||
bool down = action == 1 || action == 2;
|
||||
bool repeat = action == 2;
|
||||
enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
|
||||
if (extraKey) {
|
||||
keyCode = this->extraKeyToKeyCode(key);
|
||||
}
|
||||
if (numpad) {
|
||||
keyCode = this->numpadToKeyCode(key);
|
||||
}
|
||||
CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, down, repeat);
|
||||
}
|
||||
|
||||
void onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int mods) {
|
||||
if (!isExtraMouseButton(button)) {
|
||||
return CCEGLView::onGLFWMouseCallBack(window, button, action, mods);
|
||||
}
|
||||
bool down = action == 1;
|
||||
// mouse buttons never repeat
|
||||
bool repeat = false;
|
||||
enumKeyCodes keyCode = this->mouseButtonToKeyCode(button);
|
||||
CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, down, repeat);
|
||||
}
|
||||
|
||||
bool isExtraMouseButton(int code) {
|
||||
return code > GLFW_MOUSE_BUTTON_3;
|
||||
}
|
||||
|
||||
enumKeyCodes mouseButtonToKeyCode(int button) {
|
||||
switch (button) {
|
||||
case GLFW_MOUSE_BUTTON_4:
|
||||
return enumKeyCodes::MOUSE_4;
|
||||
case GLFW_MOUSE_BUTTON_5:
|
||||
return enumKeyCodes::MOUSE_5;
|
||||
case GLFW_MOUSE_BUTTON_6:
|
||||
return enumKeyCodes::MOUSE_6;
|
||||
case GLFW_MOUSE_BUTTON_7:
|
||||
return enumKeyCodes::MOUSE_7;
|
||||
case GLFW_MOUSE_BUTTON_8:
|
||||
return enumKeyCodes::MOUSE_8;
|
||||
default:
|
||||
return enumKeyCodes::KEY_Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
bool isExtraKey(int code) {
|
||||
switch (code) {
|
||||
case GLFW_KEY_WORLD_1:
|
||||
case GLFW_KEY_WORLD_2:
|
||||
case GLFW_KEY_SEMICOLON:
|
||||
case GLFW_KEY_APOSTROPHE:
|
||||
case GLFW_KEY_SLASH:
|
||||
case GLFW_KEY_EQUAL:
|
||||
case GLFW_KEY_LEFT_BRACKET:
|
||||
case GLFW_KEY_BACKSLASH:
|
||||
case GLFW_KEY_RIGHT_BRACKET:
|
||||
case GLFW_KEY_GRAVE_ACCENT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
enumKeyCodes extraKeyToKeyCode(int key) {
|
||||
switch (key) {
|
||||
case GLFW_KEY_SEMICOLON:
|
||||
return enumKeyCodes::KEY_Semicolon;
|
||||
case GLFW_KEY_APOSTROPHE:
|
||||
return enumKeyCodes::KEY_Apostrophe;
|
||||
case GLFW_KEY_SLASH:
|
||||
return enumKeyCodes::KEY_Slash;
|
||||
case GLFW_KEY_EQUAL:
|
||||
return enumKeyCodes::KEY_OEMEqual;
|
||||
case GLFW_KEY_LEFT_BRACKET:
|
||||
return enumKeyCodes::KEY_LeftBracket;
|
||||
case GLFW_KEY_BACKSLASH:
|
||||
return enumKeyCodes::KEY_Backslash;
|
||||
case GLFW_KEY_RIGHT_BRACKET:
|
||||
return enumKeyCodes::KEY_RightBracket;
|
||||
case GLFW_KEY_GRAVE_ACCENT:
|
||||
return enumKeyCodes::KEY_GraveAccent;
|
||||
case GLFW_KEY_WORLD_1:
|
||||
return enumKeyCodes::KEY_World1;
|
||||
case GLFW_KEY_WORLD_2:
|
||||
return enumKeyCodes::KEY_World2;
|
||||
default:
|
||||
return enumKeyCodes::KEY_Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
bool isKeyNumpad(int code) {
|
||||
return code >= GLFW_KEY_KP_0 && code <= GLFW_KEY_KP_EQUAL;
|
||||
}
|
||||
|
||||
enumKeyCodes numpadToKeyCode(int key) {
|
||||
switch (key) {
|
||||
case GLFW_KEY_KP_0:
|
||||
return enumKeyCodes::KEY_NumPad0;
|
||||
case GLFW_KEY_KP_1:
|
||||
return enumKeyCodes::KEY_NumPad1;
|
||||
case GLFW_KEY_KP_2:
|
||||
return enumKeyCodes::KEY_NumPad2;
|
||||
case GLFW_KEY_KP_3:
|
||||
return enumKeyCodes::KEY_NumPad3;
|
||||
case GLFW_KEY_KP_4:
|
||||
return enumKeyCodes::KEY_NumPad4;
|
||||
case GLFW_KEY_KP_5:
|
||||
return enumKeyCodes::KEY_NumPad5;
|
||||
case GLFW_KEY_KP_6:
|
||||
return enumKeyCodes::KEY_NumPad6;
|
||||
case GLFW_KEY_KP_7:
|
||||
return enumKeyCodes::KEY_NumPad7;
|
||||
case GLFW_KEY_KP_8:
|
||||
return enumKeyCodes::KEY_NumPad8;
|
||||
case GLFW_KEY_KP_9:
|
||||
return enumKeyCodes::KEY_NumPad9;
|
||||
case GLFW_KEY_KP_DECIMAL:
|
||||
return enumKeyCodes::KEY_Decimal;
|
||||
case GLFW_KEY_KP_DIVIDE:
|
||||
return enumKeyCodes::KEY_Divide;
|
||||
case GLFW_KEY_KP_MULTIPLY:
|
||||
return enumKeyCodes::KEY_Multiply;
|
||||
case GLFW_KEY_KP_SUBTRACT:
|
||||
return enumKeyCodes::KEY_Subtract;
|
||||
case GLFW_KEY_KP_ADD:
|
||||
return enumKeyCodes::KEY_Add;
|
||||
case GLFW_KEY_KP_ENTER:
|
||||
return enumKeyCodes::KEY_NumEnter;
|
||||
case GLFW_KEY_KP_EQUAL:
|
||||
return enumKeyCodes::KEY_Equal;
|
||||
default:
|
||||
return enumKeyCodes::KEY_Unknown;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class $modify(CCKeyboardDispatcher) {
|
||||
GEODE_FORWARD_COMPAT_DISABLE_HOOKS("CCKeyboardDispatcher new keys")
|
||||
|
||||
const char* keyToString(enumKeyCodes key) {
|
||||
if (key < 0x1000) {
|
||||
return CCKeyboardDispatcher::keyToString(key);
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case KEY_GraveAccent:
|
||||
return "`";
|
||||
case KEY_OEMEqual:
|
||||
return "=";
|
||||
case KEY_LeftBracket:
|
||||
return "[";
|
||||
case KEY_RightBracket:
|
||||
return "]";
|
||||
case KEY_Backslash:
|
||||
return "\\";
|
||||
case KEY_Semicolon:
|
||||
return ";";
|
||||
case KEY_Apostrophe:
|
||||
return "'";
|
||||
case KEY_Slash:
|
||||
return "/";
|
||||
case KEY_NumEnter:
|
||||
return "NumEnter";
|
||||
case KEY_World1:
|
||||
return "INTL-1";
|
||||
case KEY_World2:
|
||||
return "INTL-2";
|
||||
case MOUSE_4:
|
||||
return "Mouse 4";
|
||||
case MOUSE_5:
|
||||
return "Mouse 5";
|
||||
case MOUSE_6:
|
||||
return "Mouse 6";
|
||||
case MOUSE_7:
|
||||
return "Mouse 7";
|
||||
case MOUSE_8:
|
||||
return "Mouse 8";
|
||||
default:
|
||||
return CCKeyboardDispatcher::keyToString(KEY_Unknown);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
294
loader/src/hooks/AddExtraKeys.mm
Normal file
294
loader/src/hooks/AddExtraKeys.mm
Normal file
|
@ -0,0 +1,294 @@
|
|||
#include <Geode/DefaultInclude.hpp>
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include <objc/runtime.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#ifdef GEODE_IS_IOS
|
||||
#include <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h>
|
||||
#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h>
|
||||
#import <Geode/cocos/platform/mac/EAGLView.h>
|
||||
#include <Geode/cocos/text_input_node/CCIMEDispatcher.h>
|
||||
#include <Geode/modify/Modify.hpp>
|
||||
#include <Geode/modify/CCKeyboardDispatcher.hpp>
|
||||
|
||||
using namespace geode::prelude;
|
||||
|
||||
// https://github.com/SpaghettDev/BetterInputs/blob/44f249cd94f4cc19fca4de570dfab28f4efa3db8/src/platform/macos.mm#L121
|
||||
// we use this instead of [event keyCode] because the returned value of keyCode for letters is keyboard locale-specific
|
||||
int normalizedCodeFromEvent(NSEvent* event) {
|
||||
if ([[event characters] length] > 0) {
|
||||
return [[event characters] characterAtIndex:0];
|
||||
} else if ([[event charactersIgnoringModifiers] length] > 0) {
|
||||
return [[event charactersIgnoringModifiers] characterAtIndex:0];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
enumKeyCodes mouseButtonToKeyCode(NSEvent* event) {
|
||||
switch ([event buttonNumber]) {
|
||||
case 2:
|
||||
return enumKeyCodes::MOUSE_4;
|
||||
case 3:
|
||||
return enumKeyCodes::MOUSE_5;
|
||||
case 4:
|
||||
return enumKeyCodes::MOUSE_6;
|
||||
case 5:
|
||||
return enumKeyCodes::MOUSE_7;
|
||||
case 6:
|
||||
return enumKeyCodes::MOUSE_8;
|
||||
default:
|
||||
return enumKeyCodes::KEY_Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
bool isExtraMouseButton(NSEvent* event) {
|
||||
return [event buttonNumber] > 1;
|
||||
}
|
||||
|
||||
enumKeyCodes extraKeyToKeyCode(NSEvent* event) {
|
||||
switch (normalizedCodeFromEvent(event)) {
|
||||
case ';':
|
||||
return enumKeyCodes::KEY_Semicolon;
|
||||
case '\'':
|
||||
return enumKeyCodes::KEY_Apostrophe;
|
||||
case '/':
|
||||
return enumKeyCodes::KEY_Slash;
|
||||
case '=':
|
||||
return enumKeyCodes::KEY_OEMEqual;
|
||||
case '[':
|
||||
return enumKeyCodes::KEY_LeftBracket;
|
||||
case '\\':
|
||||
return enumKeyCodes::KEY_Backslash;
|
||||
case ']':
|
||||
return enumKeyCodes::KEY_RightBracket;
|
||||
case '`':
|
||||
return enumKeyCodes::KEY_GraveAccent;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch ([event keyCode]) {
|
||||
case kVK_ISO_Section:
|
||||
return enumKeyCodes::KEY_World2;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return enumKeyCodes::KEY_Unknown;
|
||||
}
|
||||
|
||||
bool isExtraKey(NSEvent* event) {
|
||||
return extraKeyToKeyCode(event) != enumKeyCodes::KEY_Unknown;
|
||||
}
|
||||
|
||||
enumKeyCodes numpadToKeyCode(NSEvent* event) {
|
||||
switch (normalizedCodeFromEvent(event)) {
|
||||
case '0':
|
||||
return enumKeyCodes::KEY_NumPad0;
|
||||
case '1':
|
||||
return enumKeyCodes::KEY_NumPad1;
|
||||
case '2':
|
||||
return enumKeyCodes::KEY_NumPad2;
|
||||
case '3':
|
||||
return enumKeyCodes::KEY_NumPad3;
|
||||
case '4':
|
||||
return enumKeyCodes::KEY_NumPad4;
|
||||
case '5':
|
||||
return enumKeyCodes::KEY_NumPad5;
|
||||
case '6':
|
||||
return enumKeyCodes::KEY_NumPad6;
|
||||
case '7':
|
||||
return enumKeyCodes::KEY_NumPad7;
|
||||
case '8':
|
||||
return enumKeyCodes::KEY_NumPad8;
|
||||
case '9':
|
||||
return enumKeyCodes::KEY_NumPad9;
|
||||
case '.':
|
||||
return enumKeyCodes::KEY_Decimal;
|
||||
case '/':
|
||||
return enumKeyCodes::KEY_Divide;
|
||||
case '*':
|
||||
return enumKeyCodes::KEY_Multiply;
|
||||
case '-':
|
||||
return enumKeyCodes::KEY_Subtract;
|
||||
case '+':
|
||||
return enumKeyCodes::KEY_Add;
|
||||
case 3:
|
||||
return enumKeyCodes::KEY_NumEnter;
|
||||
case '=':
|
||||
return enumKeyCodes::KEY_Equal;
|
||||
case NSUpArrowFunctionKey:
|
||||
return enumKeyCodes::KEY_Up;
|
||||
case NSDownArrowFunctionKey:
|
||||
return enumKeyCodes::KEY_Down;
|
||||
case NSLeftArrowFunctionKey:
|
||||
return enumKeyCodes::KEY_Left;
|
||||
case NSRightArrowFunctionKey:
|
||||
return enumKeyCodes::KEY_Right;
|
||||
default:
|
||||
return enumKeyCodes::KEY_Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
bool isKeyNumpad(NSEvent* event) {
|
||||
return ([event modifierFlags] & NSEventModifierFlagNumericPad) != 0;
|
||||
}
|
||||
|
||||
|
||||
void keyDownExecHook(EAGLView* self, SEL sel, NSEvent* event) {
|
||||
bool extraKey = isExtraKey(event);
|
||||
bool numpad = isKeyNumpad(event);
|
||||
if (!extraKey && !numpad) {
|
||||
GEODE_MACOS([self performSelector:sel withObject:event]);
|
||||
return;
|
||||
}
|
||||
if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
|
||||
GEODE_MACOS([self performSelector:sel withObject:event]);
|
||||
return;
|
||||
}
|
||||
|
||||
enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
|
||||
if (extraKey) {
|
||||
keyCode = extraKeyToKeyCode(event);
|
||||
}
|
||||
if (numpad) {
|
||||
keyCode = numpadToKeyCode(event);
|
||||
}
|
||||
CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, [event isARepeat]);
|
||||
}
|
||||
|
||||
void keyUpExecHook(EAGLView* self, SEL sel, NSEvent* event) {
|
||||
bool extraKey = isExtraKey(event);
|
||||
bool numpad = isKeyNumpad(event);
|
||||
if (!extraKey && !numpad) {
|
||||
GEODE_MACOS([self performSelector:sel withObject:event]);
|
||||
return;
|
||||
}
|
||||
if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
|
||||
GEODE_MACOS([self performSelector:sel withObject:event]);
|
||||
return;
|
||||
}
|
||||
|
||||
enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
|
||||
if (extraKey) {
|
||||
keyCode = extraKeyToKeyCode(event);
|
||||
}
|
||||
if (numpad) {
|
||||
keyCode = numpadToKeyCode(event);
|
||||
}
|
||||
CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, [event isARepeat]);
|
||||
}
|
||||
|
||||
void mouseDownExecHook(EAGLView* self, SEL sel, NSEvent* event) {
|
||||
if (!isExtraMouseButton(event)) {
|
||||
GEODE_MACOS([self performSelector:sel withObject:event]);
|
||||
return;
|
||||
}
|
||||
|
||||
enumKeyCodes keyCode = mouseButtonToKeyCode(event);
|
||||
CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, false);
|
||||
}
|
||||
|
||||
void mouseUpExecHook(EAGLView* self, SEL sel, NSEvent* event) {
|
||||
if (!isExtraMouseButton(event)) {
|
||||
GEODE_MACOS([self performSelector:sel withObject:event]);
|
||||
return;
|
||||
}
|
||||
|
||||
enumKeyCodes keyCode = mouseButtonToKeyCode(event);
|
||||
CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, false);
|
||||
}
|
||||
|
||||
#ifdef GEODE_IS_MACOS
|
||||
class $modify(CCKeyboardDispatcher) {
|
||||
GEODE_FORWARD_COMPAT_DISABLE_HOOKS("CCKeyboardDispatcher new keys")
|
||||
|
||||
const char* keyToString(enumKeyCodes key) {
|
||||
if (key < 0x1000) {
|
||||
return CCKeyboardDispatcher::keyToString(key);
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case KEY_GraveAccent:
|
||||
return "`";
|
||||
case KEY_OEMEqual:
|
||||
return "=";
|
||||
case KEY_LeftBracket:
|
||||
return "[";
|
||||
case KEY_RightBracket:
|
||||
return "]";
|
||||
case KEY_Backslash:
|
||||
return "\\";
|
||||
case KEY_Semicolon:
|
||||
return ";";
|
||||
case KEY_Apostrophe:
|
||||
return "'";
|
||||
case KEY_Slash:
|
||||
return "/";
|
||||
case KEY_NumEnter:
|
||||
return "NumEnter";
|
||||
case KEY_World1:
|
||||
return "INTL-1";
|
||||
case KEY_World2:
|
||||
return "INTL-2";
|
||||
case MOUSE_4:
|
||||
return "Mouse 4";
|
||||
case MOUSE_5:
|
||||
return "Mouse 5";
|
||||
case MOUSE_6:
|
||||
return "Mouse 6";
|
||||
case MOUSE_7:
|
||||
return "Mouse 7";
|
||||
case MOUSE_8:
|
||||
return "Mouse 8";
|
||||
default:
|
||||
return CCKeyboardDispatcher::keyToString(KEY_Unknown);
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#define HOOK_OBJC_METHOD(klass, methodName) \
|
||||
auto methodName##Addr = class_getInstanceMethod(klass, @selector(methodName:)); \
|
||||
static_cast<void>(Mod::get()->hook(reinterpret_cast<void*>(method_getImplementation(methodName##Addr)), &methodName##Hook, #klass " " #methodName));
|
||||
|
||||
__attribute__((constructor)) void initialize_newKeyboardMSGKeysHooks() {
|
||||
#if defined(GEODE_IS_MACOS)
|
||||
auto eaglView = objc_getClass("EAGLView");
|
||||
|
||||
HOOK_OBJC_METHOD(eaglView, keyDownExec);
|
||||
HOOK_OBJC_METHOD(eaglView, keyUpExec);
|
||||
|
||||
HOOK_OBJC_METHOD(eaglView, mouseDownExec);
|
||||
HOOK_OBJC_METHOD(eaglView, mouseUpExec);
|
||||
#elif defined(GEODE_IS_IOS)
|
||||
@autoreleasepool
|
||||
{
|
||||
[NSEvent addGlobalMonitorForEventsMatchingMask:NSEventTypeKeyDown handler: ^(NSEvent* event) {
|
||||
keyDownExecHook(nullptr, 0, event);
|
||||
}];
|
||||
[NSEvent addGlobalMonitorForEventsMatchingMask:NSEventTypeKeyUp handler: ^(NSEvent* event) {
|
||||
keyUpExecHook(nullptr, 0, event);
|
||||
}];
|
||||
|
||||
[NSEvent
|
||||
addGlobalMonitorForEventsMatchingMask:NSEventTypeLeftMouseDown | NSEventTypeRightMouseDown | NSEventTypeOtherMouseDown
|
||||
handler: ^(NSEvent* event) {
|
||||
mouseDownExecHook(nullptr, 0, event);
|
||||
}
|
||||
];
|
||||
[NSEvent
|
||||
addGlobalMonitorForEventsMatchingMask:NSEventTypeLeftMouseUp | NSEventTypeRightMouseUp | NSEventTypeOtherMouseUp
|
||||
handler: ^(NSEvent* event) {
|
||||
mouseUpExecHook(nullptr, 0, event);
|
||||
}
|
||||
];
|
||||
}
|
||||
#endif
|
||||
}
|
35
loader/src/hooks/AndroidSaveFix.cpp
Normal file
35
loader/src/hooks/AndroidSaveFix.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <Geode/platform/cplatform.h>
|
||||
|
||||
#ifdef GEODE_IS_ANDROID
|
||||
#include <Geode/loader/Mod.hpp>
|
||||
|
||||
using namespace geode::prelude;
|
||||
|
||||
void* g_decodeAddress = nullptr;
|
||||
|
||||
int base64DecodeHook(uint8_t* input, uint32_t length, uint8_t** output, bool urlSafe) {
|
||||
*output = new uint8_t[(size_t)(length * 3) / 4 + 4];
|
||||
|
||||
uint32_t outLength = 0;
|
||||
int ret = reinterpret_cast<int(*)(uint8_t*, uint32_t, uint8_t*, uint32_t*, bool)>(g_decodeAddress)(input, length, *output, &outLength, urlSafe);
|
||||
if (ret > 0) {
|
||||
delete[] *output;
|
||||
*output = nullptr;
|
||||
outLength = 0;
|
||||
}
|
||||
|
||||
return outLength;
|
||||
}
|
||||
|
||||
$execute {
|
||||
// This fixes a crash when using the base64Decode function in cocos2d-x, due to
|
||||
// floating-point precision errors causing the output buffer to be too small.
|
||||
// This issue can cause large save files to crash the game.
|
||||
|
||||
auto handle = dlopen("libcocos2dcpp.so", RTLD_LAZY | RTLD_NOLOAD);
|
||||
g_decodeAddress = dlsym(handle, "_ZN7cocos2d13_base64DecodeEPKhjPhPjb");
|
||||
auto decodeAddress = dlsym(handle, "base64Decode");
|
||||
|
||||
if (g_decodeAddress && decodeAddress) (void)Mod::get()->hook(decodeAddress, &base64DecodeHook, "base64Decode");
|
||||
}
|
||||
#endif
|
|
@ -1,19 +0,0 @@
|
|||
// Only a single objc++ file is used because since pch doesnt work, each file adds a lot to the compile times
|
||||
#include <Geode/DefaultInclude.hpp>
|
||||
|
||||
using namespace geode::prelude;
|
||||
|
||||
#if defined(GEODE_IS_MACOS)
|
||||
|
||||
#include "mac/LoaderImpl.mm"
|
||||
#include "mac/main.mm"
|
||||
#include "mac/crashlog.mm"
|
||||
#include "mac/FileWatcher.mm"
|
||||
#include "mac/util.mm"
|
||||
|
||||
#elif defined(GEODE_IS_IOS)
|
||||
|
||||
#include "ios/FileWatcher.mm"
|
||||
#include "ios/util.mm"
|
||||
|
||||
#endif
|
|
@ -84,6 +84,33 @@ namespace {
|
|||
{AKEYCODE_BUTTON_L1, cocos2d::CONTROLLER_LB},
|
||||
{AKEYCODE_BUTTON_R2, cocos2d::CONTROLLER_RT},
|
||||
{AKEYCODE_BUTTON_L2, cocos2d::CONTROLLER_LT},
|
||||
|
||||
// Geode Additions
|
||||
{AKEYCODE_SEMICOLON, cocos2d::KEY_Semicolon},
|
||||
{AKEYCODE_APOSTROPHE, cocos2d::KEY_Apostrophe},
|
||||
{AKEYCODE_SLASH, cocos2d::KEY_Slash},
|
||||
{AKEYCODE_EQUALS, cocos2d::KEY_OEMEqual},
|
||||
{AKEYCODE_LEFT_BRACKET, cocos2d::KEY_LeftBracket},
|
||||
{AKEYCODE_BACKSLASH, cocos2d::KEY_Backslash},
|
||||
{AKEYCODE_RIGHT_BRACKET, cocos2d::KEY_RightBracket},
|
||||
{AKEYCODE_GRAVE, cocos2d::KEY_GraveAccent},
|
||||
{AKEYCODE_NUMPAD_0, cocos2d::KEY_NumPad0},
|
||||
{AKEYCODE_NUMPAD_1, cocos2d::KEY_NumPad1},
|
||||
{AKEYCODE_NUMPAD_2, cocos2d::KEY_NumPad2},
|
||||
{AKEYCODE_NUMPAD_3, cocos2d::KEY_NumPad3},
|
||||
{AKEYCODE_NUMPAD_4, cocos2d::KEY_NumPad4},
|
||||
{AKEYCODE_NUMPAD_5, cocos2d::KEY_NumPad5},
|
||||
{AKEYCODE_NUMPAD_6, cocos2d::KEY_NumPad6},
|
||||
{AKEYCODE_NUMPAD_7, cocos2d::KEY_NumPad7},
|
||||
{AKEYCODE_NUMPAD_8, cocos2d::KEY_NumPad8},
|
||||
{AKEYCODE_NUMPAD_9, cocos2d::KEY_NumPad9},
|
||||
{AKEYCODE_NUMPAD_DOT, cocos2d::KEY_Decimal},
|
||||
{AKEYCODE_NUMPAD_DIVIDE, cocos2d::KEY_Divide},
|
||||
{AKEYCODE_NUMPAD_MULTIPLY, cocos2d::KEY_Multiply},
|
||||
{AKEYCODE_NUMPAD_SUBTRACT, cocos2d::KEY_Subtract},
|
||||
{AKEYCODE_NUMPAD_ADD, cocos2d::KEY_Add},
|
||||
{AKEYCODE_NUMPAD_ENTER, cocos2d::KEY_NumEnter},
|
||||
{AKEYCODE_NUMPAD_EQUALS, cocos2d::KEY_Equal}
|
||||
};
|
||||
|
||||
cocos2d::enumKeyCodes translateAndroidKeyCodeToWindows(int keyCode) {
|
||||
|
|
|
@ -11,7 +11,11 @@
|
|||
|
||||
#include <mach-o/dyld_images.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#define CommentType CommentTypeDummy
|
||||
#import <Foundation/Foundation.h>
|
||||
#undef CommentType
|
||||
|
||||
using namespace geode::prelude;
|
||||
|
||||
// https://gist.github.com/jvranish/4441299
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <array>
|
||||
#include <filesystem>
|
||||
#include <Geode/Loader.hpp>
|
||||
#include "../../loader/console.hpp"
|
||||
#include "../../loader/LoaderImpl.hpp"
|
||||
#include <thread>
|
||||
#include <variant>
|
||||
|
|
|
@ -26,8 +26,9 @@ void GenericContentLayer::setPosition(CCPoint const& pos) {
|
|||
for (auto child : CCArrayExt<CCNode*>(m_pChildren)) {
|
||||
float childY = this->getPositionY() + child->getPositionY();
|
||||
auto anchor = child->isIgnoreAnchorPointForPosition() ? CCPoint{ 0, 0 } : child->getAnchorPoint();
|
||||
float childTop = childY + (1.f - anchor.y) * child->getScaledContentSize().height;
|
||||
float childBottom = childY - child->getAnchorPoint().y * child->getScaledContentSize().height;
|
||||
float scaleY = child->getScaleY();
|
||||
float childTop = scaleY * (childY + (1.f - anchor.y) * child->getScaledContentSize().height);
|
||||
float childBottom = scaleY * (childY - child->getAnchorPoint().y * child->getScaledContentSize().height);
|
||||
bool visible = childTop > 0 && childBottom < scrollLayerSize.height;
|
||||
|
||||
child->setVisible(visible);
|
||||
|
|
|
@ -169,7 +169,8 @@ std::string& utils::string::trimIP(std::string& str) {
|
|||
}
|
||||
|
||||
std::string utils::string::trimLeft(std::string const& str, std::string const& chars) {
|
||||
return str.substr(str.find_first_not_of(chars));
|
||||
size_t start = str.find_first_not_of(chars);
|
||||
return start == -1 ? std::string() : str.substr(start);
|
||||
}
|
||||
std::string utils::string::trimLeft(std::string const& str) {
|
||||
return utils::string::trimLeft(str, WHITESPACE);
|
||||
|
@ -184,7 +185,7 @@ std::string utils::string::trimRight(std::string const& str) {
|
|||
|
||||
std::string utils::string::trim(std::string const& str, std::string const& chars) {
|
||||
size_t start = str.find_first_not_of(chars);
|
||||
return str.substr(start, str.find_last_not_of(chars) + 1 - start);
|
||||
return start == -1 ? std::string() : str.substr(start, str.find_last_not_of(chars) + 1 - start);
|
||||
}
|
||||
std::string utils::string::trim(std::string const& str) {
|
||||
return utils::string::trim(str, WHITESPACE);
|
||||
|
@ -216,4 +217,4 @@ std::strong_ordering utils::string::caseInsensitiveCompare(std::string_view str1
|
|||
else if (str1.size() > str2.size())
|
||||
return std::strong_ordering::greater;
|
||||
return std::strong_ordering::equal;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue