From 62835dc3316ffae6f9b4bda5a3bfe01d6e9ca434 Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:53:27 +0200 Subject: [PATCH 01/22] fix(file-api): do utf conversion for json paths on windows --- loader/include/Geode/utils/file.hpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/loader/include/Geode/utils/file.hpp b/loader/include/Geode/utils/file.hpp index 3cc7f7c54..d7d638648 100644 --- a/loader/include/Geode/utils/file.hpp +++ b/loader/include/Geode/utils/file.hpp @@ -7,21 +7,39 @@ #include #include +#include #include #include #include template <> struct matjson::Serialize { - static geode::Result fromJson(Value const& value) + static geode::Result fromJson(matjson::Value const& value) { - GEODE_UNWRAP_INTO(auto str, value.asString()); + GEODE_UNWRAP_INTO(const std::string str, value.asString()); + +#ifdef GEODE_IS_WINDOWS + // On Windows, paths are stored as utf16, and matjson uses utf8 internally + // This is not an issue until paths actually use unicode characters + // So we do this conversion to make sure it stores the characters correctly + return geode::Ok( + std::filesystem::path(geode::utils::string::utf8ToWide(str)).make_preferred() + ); +#else return geode::Ok(std::filesystem::path(str).make_preferred()); +#endif } - static Value toJson(std::filesystem::path const& value) + static matjson::Value toJson(std::filesystem::path const& value) { - return Value(value.string()); +#ifdef GEODE_IS_WINDOWS + // On Windows, paths are stored as utf16, and matjson uses utf8 internally + // This is not an issue until paths actually use unicode characters + // So we do this conversion to make sure it stores the characters correctly + return matjson::Value(geode::utils::string::wideToUtf8(value.wstring())); +#else + return matjson::Value(value.string()); +#endif } }; From 42ece10b04c74739326d2e5b726bebc5f6daee8c Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Tue, 7 Jan 2025 19:07:21 +0200 Subject: [PATCH 02/22] chore: fix ugly formatting --- loader/include/Geode/utils/file.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/loader/include/Geode/utils/file.hpp b/loader/include/Geode/utils/file.hpp index d7d638648..f9964d0aa 100644 --- a/loader/include/Geode/utils/file.hpp +++ b/loader/include/Geode/utils/file.hpp @@ -14,8 +14,7 @@ template <> struct matjson::Serialize { - static geode::Result fromJson(matjson::Value const& value) - { + static geode::Result fromJson(matjson::Value const& value) { GEODE_UNWRAP_INTO(const std::string str, value.asString()); #ifdef GEODE_IS_WINDOWS @@ -30,8 +29,7 @@ struct matjson::Serialize { #endif } - static matjson::Value toJson(std::filesystem::path const& value) - { + static matjson::Value toJson(std::filesystem::path const& value) { #ifdef GEODE_IS_WINDOWS // On Windows, paths are stored as utf16, and matjson uses utf8 internally // This is not an issue until paths actually use unicode characters From 203c81963e69ab7af40bdfd14932be671b516521 Mon Sep 17 00:00:00 2001 From: mat <26722564+matcool@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:17:35 -0300 Subject: [PATCH 03/22] Loader -> Geode in LoadingLayer status text --- loader/src/hooks/LoadingLayer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/loader/src/hooks/LoadingLayer.cpp b/loader/src/hooks/LoadingLayer.cpp index ff8ae0361..702faaf19 100644 --- a/loader/src/hooks/LoadingLayer.cpp +++ b/loader/src/hooks/LoadingLayer.cpp @@ -94,19 +94,19 @@ struct CustomLoadingLayer : Modify { void setupLoaderResources() { log::debug("Verifying Loader Resources"); - this->setSmallText("Verifying Loader Resources"); + this->setSmallText("Verifying Geode Resources"); // verify loader resources Loader::get()->queueInMainThread([&]() { if (!updater::verifyLoaderResources()) { log::debug("Downloading Loader Resources"); - this->setSmallText("Downloading Loader Resources"); + this->setSmallText("Downloading Geode Resources"); this->addChild(EventListenerNode::create( this, &CustomLoadingLayer::updateResourcesProgress )); } else { log::debug("Loading Loader Resources"); - this->setSmallText("Loading Loader Resources"); + this->setSmallText("Loading Geode Resources"); updater::updateSpecialFiles(); this->continueLoadAssets(); } @@ -117,12 +117,12 @@ struct CustomLoadingLayer : Modify { std::visit(makeVisitor { [&](updater::UpdateProgress const& progress) { this->setSmallText(fmt::format( - "Downloading Loader Resources: {}%", progress.first + "Downloading Geode Resources: {}%", progress.first )); }, [&](updater::UpdateFinished) { log::debug("Downloaded Loader Resources"); - this->setSmallText("Downloaded Loader Resources"); + this->setSmallText("Downloaded Geode Resources"); this->continueLoadAssets(); }, [&](updater::UpdateFailed const& error) { @@ -136,7 +136,7 @@ struct CustomLoadingLayer : Modify { "The game will be loaded as normal, but please be aware " "that it is very likely to crash. " ); - this->setSmallText("Failed Loader Resources"); + this->setSmallText("Failed to Download Geode Resources"); this->continueLoadAssets(); } }, event->status); From 241be1b46d13d950690bc934590c0bafc89f2aea Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Tue, 7 Jan 2025 23:55:17 -0600 Subject: [PATCH 04/22] annual camila314 commit: fix file picker on mac --- loader/include/Geode/cocos/include/ccTypes.h | 4 ++++ loader/src/platform/mac/util.mm | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/loader/include/Geode/cocos/include/ccTypes.h b/loader/include/Geode/cocos/include/ccTypes.h index 107a460f7..0a3dfdfe3 100644 --- a/loader/include/Geode/cocos/include/ccTypes.h +++ b/loader/include/Geode/cocos/include/ccTypes.h @@ -28,7 +28,11 @@ THE SOFTWARE. #define __CCTYPES_H__ #include + +#ifdef __cplusplus #include +#endif + #include "../cocoa/CCGeometry.h" #include "../platform/CCGL.h" diff --git a/loader/src/platform/mac/util.mm b/loader/src/platform/mac/util.mm index ea863c9da..6fcd09944 100644 --- a/loader/src/platform/mac/util.mm +++ b/loader/src/platform/mac/util.mm @@ -95,7 +95,7 @@ @implementation FileDialog // default path if (options.defaultPath) { auto defaultPath = [NSString stringWithUTF8String:options.defaultPath->c_str()]; - [panel setDirectoryURL: [NSURL URLWithString: defaultPath]]; + [panel setDirectoryURL: [NSURL fileURLWithPath: defaultPath]]; } // other @@ -153,8 +153,9 @@ @implementation FileDialog } +(void) dispatchFilePickerWithMode:(file::PickMode)mode options:(file::FilePickOptions const&)options multiple:(bool)mult onCompletion:(void(^)(FileResult&&))onCompletion { + file::FilePickOptions optionsCopy = options; dispatch_async(dispatch_get_main_queue(), ^{ - auto result = [self filePickerWithMode:mode options:options multiple:mult]; + auto result = [self filePickerWithMode:mode options:optionsCopy multiple:mult]; onCompletion(std::move(result)); }); } From 0b61b501c8b243bb7beea2bf25e89d0301e82c3e Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Wed, 8 Jan 2025 00:21:41 -0600 Subject: [PATCH 05/22] allowed file types for macos file picker --- loader/src/platform/mac/util.mm | 54 +++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/loader/src/platform/mac/util.mm b/loader/src/platform/mac/util.mm index 6fcd09944..8ea3c97d1 100644 --- a/loader/src/platform/mac/util.mm +++ b/loader/src/platform/mac/util.mm @@ -15,9 +15,15 @@ #import #undef CommentType + +NSString* intoNS(std::string const& str) { + return [NSString stringWithUTF8String:str.c_str()]; +} + + bool utils::clipboard::write(std::string const& data) { [[NSPasteboard generalPasteboard] clearContents]; - [[NSPasteboard generalPasteboard] setString:[NSString stringWithUTF8String:data.c_str()] + [[NSPasteboard generalPasteboard] setString:intoNS(data) forType:NSPasteboardTypeString]; return true; @@ -31,7 +37,7 @@ } bool utils::file::openFolder(std::filesystem::path const& path) { - NSURL* fileURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:path.string().c_str()]]; + NSURL* fileURL = [NSURL fileURLWithPath:intoNS(path.string())]; NSURL* folderURL = [fileURL URLByDeletingLastPathComponent]; [[NSWorkspace sharedWorkspace] openURL:folderURL]; return true; @@ -39,7 +45,7 @@ void utils::web::openLinkInBrowser(std::string const& url) { [[NSWorkspace sharedWorkspace] - openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]]]; + openURL:[NSURL URLWithString:intoNS(url)]]; } /*@interface FileDialog : NSObject @@ -94,11 +100,21 @@ @implementation FileDialog // default path if (options.defaultPath) { - auto defaultPath = [NSString stringWithUTF8String:options.defaultPath->c_str()]; - [panel setDirectoryURL: [NSURL fileURLWithPath: defaultPath]]; + auto path = options.defaultPath.value(); + + if (std::filesystem::is_directory(path) || mode == file::PickMode::OpenFolder) { + auto defaultPath = intoNS(options.defaultPath.value()); + [panel setDirectoryURL: [NSURL fileURLWithPath: defaultPath]]; + } else { + auto defaultPath = intoNS(options.defaultPath->parent_path()); + auto name = intoNS(options.defaultPath->filename()); + + [panel setDirectoryURL: [NSURL fileURLWithPath: defaultPath]]; + [panel setNameFieldStringValue: name]; + } } - // other + // title if (mode != file::PickMode::SaveFile) { auto openPanel = (NSOpenPanel*)panel; @@ -113,21 +129,15 @@ @implementation FileDialog [openPanel setAllowsMultipleSelection: mult]; - // allowed files - // TODO: allowed files using the NSOpenSavePanelDelegate xd - // NSMutableArray* allowed = [NSMutableArray array]; - - // for (auto& f : options.filters) { - // for (auto& i : f.files) { - // auto nsstr = [NSString stringWithUTF8String: i.c_str()]; - - // if (![allowed containsObject: nsstr]) - // [allowed addObject: nsstr]; - // } - // } - - // if (options.filters.size()) - // [panel setAllowedFileTypes: allowed]; + if (options.filters.size() > 0) { + NSMutableArray* allowedFileTypes = [NSMutableArray new]; + for (auto& filter : options.filters) { + for (auto& ext : filter.files) { + [allowedFileTypes addObject: intoNS(ext)]; + } + } + [openPanel setAllowedFileTypes: allowedFileTypes]; + } } // run thing @@ -269,7 +279,7 @@ void shutdown() { auto gdExec = dirs::getGameDir() / "MacOS" / "Geometry Dash"; NSTask *task = [NSTask new]; - [task setLaunchPath: [NSString stringWithUTF8String: gdExec.string().c_str()]]; + [task setLaunchPath: intoNS(gdExec.string())]; [task launch]; }; From b5034ee29fe5348f8127affcb53d4c163b3e461a Mon Sep 17 00:00:00 2001 From: Jasmine <52604018+hiimjustin000@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:40:53 -0500 Subject: [PATCH 06/22] Fix gd::set probably (#1207) * Try to fix gd::set * Fix algobase --- .../Geode/c++stl/gnustl/stl_algobase.h | 2 +- loader/include/Geode/c++stl/gnustl/stl_tree.h | 376 +++++++++++++++++- 2 files changed, 363 insertions(+), 15 deletions(-) diff --git a/loader/include/Geode/c++stl/gnustl/stl_algobase.h b/loader/include/Geode/c++stl/gnustl/stl_algobase.h index 17b944dd0..c47582ba2 100644 --- a/loader/include/Geode/c++stl/gnustl/stl_algobase.h +++ b/loader/include/Geode/c++stl/gnustl/stl_algobase.h @@ -990,7 +990,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typename iterator_traits<_ForwardIterator>::value_type, _Tp>) __glibcxx_requires_partitioned_lower(__first, __last, __val); - return std::__lower_bound(__first, __last, __val, + return geode::stl::__lower_bound(__first, __last, __val, __gnu_cxx::__ops::__iter_less_val()); } diff --git a/loader/include/Geode/c++stl/gnustl/stl_tree.h b/loader/include/Geode/c++stl/gnustl/stl_tree.h index 1a22ce4dd..fb7a5d3f7 100644 --- a/loader/include/Geode/c++stl/gnustl/stl_tree.h +++ b/loader/include/Geode/c++stl/gnustl/stl_tree.h @@ -141,17 +141,66 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_storage._M_ptr(); } }; - _GLIBCXX_PURE _Rb_tree_node_base* - _Rb_tree_increment(_Rb_tree_node_base* __x) throw (); + inline _GLIBCXX_PURE _Rb_tree_node_base* + _Rb_tree_increment(_Rb_tree_node_base* __x) throw () + { + if (__x->_M_right != 0) + { + __x = __x->_M_right; + while (__x->_M_left != 0) + __x = __x->_M_left; + } + else + { + _Rb_tree_node_base* __y = __x->_M_parent; + while (__x == __y->_M_right) + { + __x = __y; + __y = __y->_M_parent; + } + if (__x->_M_right != __y) + __x = __y; + } + return __x; + } - _GLIBCXX_PURE const _Rb_tree_node_base* - _Rb_tree_increment(const _Rb_tree_node_base* __x) throw (); + inline _GLIBCXX_PURE const _Rb_tree_node_base* + _Rb_tree_increment(const _Rb_tree_node_base* __x) throw () + { + return _Rb_tree_increment(const_cast<_Rb_tree_node_base*>(__x)); + } - _GLIBCXX_PURE _Rb_tree_node_base* - _Rb_tree_decrement(_Rb_tree_node_base* __x) throw (); + inline _GLIBCXX_PURE _Rb_tree_node_base* + _Rb_tree_decrement(_Rb_tree_node_base* __x) throw () + { + if (__x->_M_color == _S_red + && __x->_M_parent->_M_parent == __x) + __x = __x->_M_right; + else if (__x->_M_left != 0) + { + _Rb_tree_node_base* __y = __x->_M_left; + while (__y->_M_right != 0) + __y = __y->_M_right; + __x = __y; + } + else + { + _Rb_tree_node_base* __y = __x->_M_parent; + while (__x == __y->_M_left) + { + __x = __y; + __y = __y->_M_parent; + } + __x = __y; + } + return __x; + } - _GLIBCXX_PURE const _Rb_tree_node_base* - _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw (); + inline _GLIBCXX_PURE const _Rb_tree_node_base* + _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw () + { + return _Rb_tree_decrement(const_cast<_Rb_tree_node_base*>(__x)); + } template struct _Rb_tree_iterator @@ -315,15 +364,299 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER const _Rb_tree_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT { return __x._M_node != __y._M_node; } - void + inline void + _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, + _Rb_tree_node_base*& __root) + { + _Rb_tree_node_base* const __y = __x->_M_right; + + __x->_M_right = __y->_M_left; + if (__y->_M_left !=0) + __y->_M_left->_M_parent = __x; + __y->_M_parent = __x->_M_parent; + + if (__x == __root) + __root = __y; + else if (__x == __x->_M_parent->_M_left) + __x->_M_parent->_M_left = __y; + else + __x->_M_parent->_M_right = __y; + __y->_M_left = __x; + __x->_M_parent = __y; + } + + inline void + _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, + _Rb_tree_node_base*& __root) + { + _Rb_tree_node_base* const __y = __x->_M_left; + + __x->_M_left = __y->_M_right; + if (__y->_M_right != 0) + __y->_M_right->_M_parent = __x; + __y->_M_parent = __x->_M_parent; + + if (__x == __root) + __root = __y; + else if (__x == __x->_M_parent->_M_right) + __x->_M_parent->_M_right = __y; + else + __x->_M_parent->_M_left = __y; + __y->_M_right = __x; + __x->_M_parent = __y; + } + + inline void _Rb_tree_insert_and_rebalance(const bool __insert_left, _Rb_tree_node_base* __x, _Rb_tree_node_base* __p, - _Rb_tree_node_base& __header) throw (); + _Rb_tree_node_base& __header) throw () + { + _Rb_tree_node_base *& __root = __header._M_parent; + + // Initialize fields in new node to insert. + __x->_M_parent = __p; + __x->_M_left = 0; + __x->_M_right = 0; + __x->_M_color = _S_red; + + // Insert. + // Make new node child of parent and maintain root, leftmost and + // rightmost nodes. + // N.B. First node is always inserted left. + if (__insert_left) + { + __p->_M_left = __x; // also makes leftmost = __x when __p == &__header + + if (__p == &__header) + { + __header._M_parent = __x; + __header._M_right = __x; + } + else if (__p == __header._M_left) + __header._M_left = __x; // maintain leftmost pointing to min node + } + else + { + __p->_M_right = __x; + + if (__p == __header._M_right) + __header._M_right = __x; // maintain rightmost pointing to max node + } + // Rebalance. + while (__x != __root + && __x->_M_parent->_M_color == _S_red) + { + _Rb_tree_node_base* const __xpp = __x->_M_parent->_M_parent; + + if (__x->_M_parent == __xpp->_M_left) + { + _Rb_tree_node_base* const __y = __xpp->_M_right; + if (__y && __y->_M_color == _S_red) + { + __x->_M_parent->_M_color = _S_black; + __y->_M_color = _S_black; + __xpp->_M_color = _S_red; + __x = __xpp; + } + else + { + if (__x == __x->_M_parent->_M_right) + { + __x = __x->_M_parent; + _Rb_tree_rotate_left(__x, __root); + } + __x->_M_parent->_M_color = _S_black; + __xpp->_M_color = _S_red; + _Rb_tree_rotate_right(__xpp, __root); + } + } + else + { + _Rb_tree_node_base* const __y = __xpp->_M_left; + if (__y && __y->_M_color == _S_red) + { + __x->_M_parent->_M_color = _S_black; + __y->_M_color = _S_black; + __xpp->_M_color = _S_red; + __x = __xpp; + } + else + { + if (__x == __x->_M_parent->_M_left) + { + __x = __x->_M_parent; + _Rb_tree_rotate_right(__x, __root); + } + __x->_M_parent->_M_color = _S_black; + __xpp->_M_color = _S_red; + _Rb_tree_rotate_left(__xpp, __root); + } + } + } + __root->_M_color = _S_black; + } - _Rb_tree_node_base* + inline _Rb_tree_node_base* _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, - _Rb_tree_node_base& __header) throw (); + _Rb_tree_node_base& __header) throw () + { + _Rb_tree_node_base *& __root = __header._M_parent; + _Rb_tree_node_base *& __leftmost = __header._M_left; + _Rb_tree_node_base *& __rightmost = __header._M_right; + _Rb_tree_node_base* __y = __z; + _Rb_tree_node_base* __x = 0; + _Rb_tree_node_base* __x_parent = 0; + + if (__y->_M_left == 0) // __z has at most one non-null child. y == z. + __x = __y->_M_right; // __x might be null. + else + if (__y->_M_right == 0) // __z has exactly one non-null child. y == z. + __x = __y->_M_left; // __x is not null. + else + { + // __z has two non-null children. Set __y to + __y = __y->_M_right; // __z's successor. __x might be null. + while (__y->_M_left != 0) + __y = __y->_M_left; + __x = __y->_M_right; + } + if (__y != __z) + { + // relink y in place of z. y is z's successor + __z->_M_left->_M_parent = __y; + __y->_M_left = __z->_M_left; + if (__y != __z->_M_right) + { + __x_parent = __y->_M_parent; + if (__x) __x->_M_parent = __y->_M_parent; + __y->_M_parent->_M_left = __x; // __y must be a child of _M_left + __y->_M_right = __z->_M_right; + __z->_M_right->_M_parent = __y; + } + else + __x_parent = __y; + if (__root == __z) + __root = __y; + else if (__z->_M_parent->_M_left == __z) + __z->_M_parent->_M_left = __y; + else + __z->_M_parent->_M_right = __y; + __y->_M_parent = __z->_M_parent; + std::swap(__y->_M_color, __z->_M_color); + __y = __z; + // __y now points to node to be actually deleted + } + else + { // __y == __z + __x_parent = __y->_M_parent; + if (__x) + __x->_M_parent = __y->_M_parent; + if (__root == __z) + __root = __x; + else + if (__z->_M_parent->_M_left == __z) + __z->_M_parent->_M_left = __x; + else + __z->_M_parent->_M_right = __x; + if (__leftmost == __z) + { + if (__z->_M_right == 0) // __z->_M_left must be null also + __leftmost = __z->_M_parent; + // makes __leftmost == _M_header if __z == __root + else + __leftmost = _Rb_tree_node_base::_S_minimum(__x); + } + if (__rightmost == __z) + { + if (__z->_M_left == 0) // __z->_M_right must be null also + __rightmost = __z->_M_parent; + // makes __rightmost == _M_header if __z == __root + else // __x == __z->_M_left + __rightmost = _Rb_tree_node_base::_S_maximum(__x); + } + } + if (__y->_M_color != _S_red) + { + while (__x != __root && (__x == 0 || __x->_M_color == _S_black)) + if (__x == __x_parent->_M_left) + { + _Rb_tree_node_base* __w = __x_parent->_M_right; + if (__w->_M_color == _S_red) + { + __w->_M_color = _S_black; + __x_parent->_M_color = _S_red; + _Rb_tree_rotate_left(__x_parent, __root); + __w = __x_parent->_M_right; + } + if ((__w->_M_left == 0 || + __w->_M_left->_M_color == _S_black) && + (__w->_M_right == 0 || + __w->_M_right->_M_color == _S_black)) + { + __w->_M_color = _S_red; + __x = __x_parent; + __x_parent = __x_parent->_M_parent; + } + else + { + if (__w->_M_right == 0 + || __w->_M_right->_M_color == _S_black) + { + __w->_M_left->_M_color = _S_black; + __w->_M_color = _S_red; + _Rb_tree_rotate_right(__w, __root); + __w = __x_parent->_M_right; + } + __w->_M_color = __x_parent->_M_color; + __x_parent->_M_color = _S_black; + if (__w->_M_right) + __w->_M_right->_M_color = _S_black; + _Rb_tree_rotate_left(__x_parent, __root); + break; + } + } + else + { + // same as above, with _M_right <-> _M_left. + _Rb_tree_node_base* __w = __x_parent->_M_left; + if (__w->_M_color == _S_red) + { + __w->_M_color = _S_black; + __x_parent->_M_color = _S_red; + _Rb_tree_rotate_right(__x_parent, __root); + __w = __x_parent->_M_left; + } + if ((__w->_M_right == 0 || + __w->_M_right->_M_color == _S_black) && + (__w->_M_left == 0 || + __w->_M_left->_M_color == _S_black)) + { + __w->_M_color = _S_red; + __x = __x_parent; + __x_parent = __x_parent->_M_parent; + } + else + { + if (__w->_M_left == 0 || __w->_M_left->_M_color == _S_black) + { + __w->_M_right->_M_color = _S_black; + __w->_M_color = _S_red; + _Rb_tree_rotate_left(__w, __root); + __w = __x_parent->_M_left; + } + __w->_M_color = __x_parent->_M_color; + __x_parent->_M_color = _S_black; + if (__w->_M_left) + __w->_M_left->_M_color = _S_black; + _Rb_tree_rotate_right(__x_parent, __root); + break; + } + } + if (__x) __x->_M_color = _S_black; + } + return __y; + } template_M_color == _S_black) + ++__sum; + if (__node == __root) + break; + __node = __node->_M_parent; + } + while (1); + return __sum; + } template From 3051fc6bb4e54e8d951a0f63bed4036899dda240 Mon Sep 17 00:00:00 2001 From: Jasmine <52604018+hiimjustin000@users.noreply.github.com> Date: Sat, 11 Jan 2025 20:27:40 -0500 Subject: [PATCH 07/22] Add 2.2 macOS UUIDs (#1213) --- loader/src/platform/mac/LoaderImpl.mm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/loader/src/platform/mac/LoaderImpl.mm b/loader/src/platform/mac/LoaderImpl.mm index 329ee6213..af83a1d89 100644 --- a/loader/src/platform/mac/LoaderImpl.mm +++ b/loader/src/platform/mac/LoaderImpl.mm @@ -205,8 +205,19 @@ bool gameVersionIsAmbiguous(std::string gameVersion) { // you can get these hashes from otool, just look for the LC_UUID load command! static std::unordered_map uuidToVersionName{ #if defined(GEODE_IS_ARM_MAC) + {"620B0C9B-8F75-3043-BD34-3BB9DD201C3A", "2.206"}, + {"48C25B63-0D7C-3F67-B831-DF935524C043", "2.207"}, + {"4933391F-D6C1-3188-99E8-23D64C674B64", "2.2071"}, + {"9C1D62A7-7C2F-3514-AEFB-D1AB7BBD48FF", "2.2072"}, + {"0B1FCFE4-79E8-3246-8ECB-500FDBDCFD9A", "2.2073"}, {"27044C8B-76BD-303C-A035-5314AF1D9E6E", "2.2074"}, #elif defined(GEODE_IS_INTEL_MAC) + {"29549F90-F083-35A8-B917-9962262FE112", "2.200"}, + {"AE6DFCCC-153A-32AB-BFD5-6F2478BC41B6", "2.206"}, + {"D497E431-5C3F-3EB4-9DF7-115B861578EE", "2.207"}, + {"08E24832-EC11-3637-910E-7CB6C0EF8EC0", "2.2071"}, + {"E53731FD-D1B6-33D2-BFA4-3B5D8D55279F", "2.2072"}, + {"1F4AFF98-DB51-382D-9BB2-59C911B88EB2", "2.2073"}, {"DB5CADC0-E533-3123-8A63-5A434FE391ED", "2.2074"} #endif }; From a8010def962fdcc128d40d21cf780429d5aded67 Mon Sep 17 00:00:00 2001 From: Cvolton Date: Sun, 12 Jan 2025 02:58:16 +0100 Subject: [PATCH 08/22] fix macOS macRO in dynamic cast fix check --- loader/src/hooks/DynamicCastFix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/hooks/DynamicCastFix.cpp b/loader/src/hooks/DynamicCastFix.cpp index d493bf934..5517f1d5a 100644 --- a/loader/src/hooks/DynamicCastFix.cpp +++ b/loader/src/hooks/DynamicCastFix.cpp @@ -8,7 +8,7 @@ using namespace geode::prelude; // this is needed because the transitions in cocos uses dynamic cast to check // layers, which fail on user layers due to typeinfo not matching - #if defined(GEODE_IS_MAC) && GEODE_COMP_GD_VERSION != 22074 + #if defined(GEODE_IS_MACOS) && GEODE_COMP_GD_VERSION != 22074 #error "Unsupported version for macOS dynamic cast fix, please update the addresses" #endif From 05d6ee2039ef4778c123f9b3cfd195ea4f6a45c3 Mon Sep 17 00:00:00 2001 From: Cvolton Date: Sun, 12 Jan 2025 13:35:45 +0100 Subject: [PATCH 09/22] remove explicit mention of GEODE_LINK_NIGHTLY nightly can be autodetected based on folder structure now, so hardcoding the line in the project is generally not a good idea --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c43d59931..f02362b9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,7 +332,6 @@ elseif (EXISTS ${GEODE_PLATFORM_BIN_PATH}) else() message(FATAL_ERROR "No valid loader binary to link to! Install pre-built binaries with `geode sdk install-binaries`, " - "or build Geode from source and add `set(GEODE_LINK_NIGHTLY ON)` to your CMakeLists.txt " - "in the line before calling add_subdirectory for Geode." + "or build Geode from source." ) endif() From b8cff6d73fdc20779db84171510d469e3887f772 Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:15:09 -0600 Subject: [PATCH 10/22] Allow '*.ext' for allowed file types on mac --- loader/src/platform/mac/util.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/loader/src/platform/mac/util.mm b/loader/src/platform/mac/util.mm index 8ea3c97d1..f8176f3dd 100644 --- a/loader/src/platform/mac/util.mm +++ b/loader/src/platform/mac/util.mm @@ -133,7 +133,10 @@ @implementation FileDialog NSMutableArray* allowedFileTypes = [NSMutableArray new]; for (auto& filter : options.filters) { for (auto& ext : filter.files) { - [allowedFileTypes addObject: intoNS(ext)]; + if (ext.size() > 2 && strncmp(ext.c_str(), "*.", 2) == 0) + [allowedFileTypes addObject: intoNS(ext.substr(2))]; + else + [allowedFileTypes addObject: intoNS(ext)]; } } [openPanel setAllowedFileTypes: allowedFileTypes]; From 728df4e785e340575377c101008fb3d9e8fba7a0 Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Mon, 13 Jan 2025 03:56:25 -0600 Subject: [PATCH 11/22] Event V2 system --- loader/include/Geode/Loader.hpp | 1 + loader/include/Geode/loader/EventV2.hpp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 loader/include/Geode/loader/EventV2.hpp diff --git a/loader/include/Geode/Loader.hpp b/loader/include/Geode/Loader.hpp index a1bb4c37e..94b8143e3 100644 --- a/loader/include/Geode/Loader.hpp +++ b/loader/include/Geode/Loader.hpp @@ -5,6 +5,7 @@ #include "loader/Log.hpp" #include "loader/Mod.hpp" #include "loader/ModEvent.hpp" +#include "loader/EventV2.hpp" #include "loader/Setting.hpp" #include "loader/Dirs.hpp" diff --git a/loader/include/Geode/loader/EventV2.hpp b/loader/include/Geode/loader/EventV2.hpp new file mode 100644 index 000000000..296c472c3 --- /dev/null +++ b/loader/include/Geode/loader/EventV2.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "Event.hpp" + +namespace geode::event::v2 { + template + struct GEODE_DLL WrapFilter : public EventFilter { + std::function m_filterFunc; + + WrapFilter(std::function ff) : m_filterFunc(ff) {} + + ListenerResult handle(std::function fn, T* event) { + if (m_filterFunc(event)) + return fn(event); + return ListenerResult::Propagate; + } + }; + + template + struct GEODE_DLL EventHandler : public EventListener> { + EventHandler(std::function filterFunc) : EventListener>(WrapFilter(filterFunc)) {} + }; +} From 8e3e88234940b1962214bcdb46608f2a024c8ecf Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Mon, 13 Jan 2025 05:34:31 -0600 Subject: [PATCH 12/22] remove geode_dll from event v2 types --- loader/include/Geode/loader/EventV2.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/include/Geode/loader/EventV2.hpp b/loader/include/Geode/loader/EventV2.hpp index 296c472c3..d6966563f 100644 --- a/loader/include/Geode/loader/EventV2.hpp +++ b/loader/include/Geode/loader/EventV2.hpp @@ -4,7 +4,7 @@ namespace geode::event::v2 { template - struct GEODE_DLL WrapFilter : public EventFilter { + struct WrapFilter : public EventFilter { std::function m_filterFunc; WrapFilter(std::function ff) : m_filterFunc(ff) {} @@ -17,7 +17,7 @@ namespace geode::event::v2 { }; template - struct GEODE_DLL EventHandler : public EventListener> { + struct EventHandler : public EventListener> { EventHandler(std::function filterFunc) : EventListener>(WrapFilter(filterFunc)) {} }; } From 9c4ce8094b577f0fb7d44b64cc170f11438bb171 Mon Sep 17 00:00:00 2001 From: Jasmine <52604018+hiimjustin000@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:33:37 -0500 Subject: [PATCH 13/22] CCFontSprite and CCSpriteExtra (#1194) --- loader/include/Geode/cocos/include/cocos2d.h | 3 ++ .../cocos/robtop/sprite_nodes/CCFontSprite.h | 29 +++++++++++++++++++ .../cocos/robtop/sprite_nodes/CCSpriteExtra.h | 28 ++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 loader/include/Geode/cocos/robtop/sprite_nodes/CCFontSprite.h create mode 100644 loader/include/Geode/cocos/robtop/sprite_nodes/CCSpriteExtra.h diff --git a/loader/include/Geode/cocos/include/cocos2d.h b/loader/include/Geode/cocos/include/cocos2d.h index f88e09a06..e10e9a4ee 100644 --- a/loader/include/Geode/cocos/include/cocos2d.h +++ b/loader/include/Geode/cocos/include/cocos2d.h @@ -326,6 +326,9 @@ THE SOFTWARE. #include "../robtop/special_nodes/CCLightning.h" +#include "../robtop/sprite_nodes/CCFontSprite.h" +#include "../robtop/sprite_nodes/CCSpriteExtra.h" + #include "../robtop/xml/DS_Dictionary.h" #include "../robtop/xml/ObjectDecoder.h" diff --git a/loader/include/Geode/cocos/robtop/sprite_nodes/CCFontSprite.h b/loader/include/Geode/cocos/robtop/sprite_nodes/CCFontSprite.h new file mode 100644 index 000000000..07a2eed85 --- /dev/null +++ b/loader/include/Geode/cocos/robtop/sprite_nodes/CCFontSprite.h @@ -0,0 +1,29 @@ +#ifndef __CCFONTSPRITE_H__ +#define __CCFONTSPRITE_H__ + +#include "../../include/ccMacros.h" +#include "CCSpriteExtra.h" + +NS_CC_BEGIN + +// @note RobTop Addition +class CC_DLL CCFontSprite : public CCSpriteExtra { +public: + CCFontSprite() {} + virtual ~CCFontSprite() {} + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCFontSprite, CCSpriteExtra); + +public: + bool m_bUseInstant; + float m_fInstantTime; + float m_fDelay; + float m_fShakesPerSecond; + float m_fShakeIntensity; + float m_fShakeElapsed; + int m_nShakeIndex; + CCPoint m_obShakePosition; +}; + +NS_CC_END + +#endif // __CCFONTSPRITE_H__ diff --git a/loader/include/Geode/cocos/robtop/sprite_nodes/CCSpriteExtra.h b/loader/include/Geode/cocos/robtop/sprite_nodes/CCSpriteExtra.h new file mode 100644 index 000000000..6e23285f5 --- /dev/null +++ b/loader/include/Geode/cocos/robtop/sprite_nodes/CCSpriteExtra.h @@ -0,0 +1,28 @@ +#ifndef __CCSPRITEEXTRA_H__ +#define __CCSPRITEEXTRA_H__ + +#include "../../include/ccMacros.h" +#include "../../sprite_nodes/CCSprite.h" + +NS_CC_BEGIN + +// @note RobTop Addition +class CC_DLL CCSpriteExtra : public CCSprite { +public: + CCSpriteExtra() {} + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCSpriteExtra, CCSprite); + + inline float getXOffset() const { return m_fXOffset; } + inline float getYOffset() const { return m_fYOffset; } + + inline void setXOffset(float offset) { m_fXOffset = offset; } + inline void setYOffset(float offset) { m_fYOffset = offset; } + +protected: + float m_fXOffset; + float m_fYOffset; +}; + +NS_CC_END + +#endif // __CCSPRITEEXTRA_H__ From c1e6be63dec1e1272b61150e7384e7a00c8075e7 Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Mon, 13 Jan 2025 19:38:17 +0200 Subject: [PATCH 14/22] Mark all cocos members public (#1214) --- loader/include/Geode/cocos/CCCamera.h | 2 +- loader/include/Geode/cocos/CCConfiguration.h | 2 +- loader/include/Geode/cocos/CCScheduler.h | 4 +- loader/include/Geode/cocos/actions/CCAction.h | 8 ++-- .../Geode/cocos/actions/CCActionCamera.h | 4 +- .../Geode/cocos/actions/CCActionCatmullRom.h | 6 +-- .../Geode/cocos/actions/CCActionEase.h | 6 +-- .../Geode/cocos/actions/CCActionGrid.h | 10 ++--- .../Geode/cocos/actions/CCActionGrid3D.h | 14 +++---- .../Geode/cocos/actions/CCActionInstant.h | 14 +++---- .../Geode/cocos/actions/CCActionInterval.h | 42 +++++++++---------- .../Geode/cocos/actions/CCActionManager.h | 2 +- .../cocos/actions/CCActionProgressTimer.h | 4 +- .../Geode/cocos/actions/CCActionTiledGrid.h | 16 +++---- .../Geode/cocos/base_nodes/CCAtlasNode.h | 2 +- .../include/Geode/cocos/base_nodes/CCNode.h | 4 +- .../Geode/cocos/cocoa/CCAutoreleasePool.h | 2 +- loader/include/Geode/cocos/cocoa/CCBool.h | 2 +- .../include/Geode/cocos/cocoa/CCDataVisitor.h | 1 + .../include/Geode/cocos/cocoa/CCDictionary.h | 2 +- loader/include/Geode/cocos/cocoa/CCDouble.h | 2 +- loader/include/Geode/cocos/cocoa/CCFloat.h | 2 +- loader/include/Geode/cocos/cocoa/CCInteger.h | 2 +- loader/include/Geode/cocos/cocoa/CCObject.h | 2 +- loader/include/Geode/cocos/cocoa/CCSet.h | 6 +-- .../Geode/cocos/draw_nodes/CCDrawNode.h | 2 +- .../include/Geode/cocos/effects/CCGrabber.h | 2 +- loader/include/Geode/cocos/effects/CCGrid.h | 2 +- .../extensions/AssetsManager/AssetsManager.h | 4 +- .../GUI/CCControlExtension/CCControl.h | 4 +- .../GUI/CCControlExtension/CCControlButton.h | 2 +- .../CCControlColourPicker.h | 2 +- .../CCControlPotentiometer.h | 4 +- .../CCControlSaturationBrightnessPicker.h | 2 +- .../GUI/CCControlExtension/CCControlStepper.h | 1 + .../GUI/CCControlExtension/CCControlSwitch.h | 2 +- .../GUI/CCControlExtension/CCScale9Sprite.h | 5 ++- .../extensions/GUI/CCEditBox/CCEditBox.h | 2 +- .../extensions/GUI/CCEditBox/CCEditBoxImpl.h | 2 +- .../GUI/CCEditBox/CCEditBoxImplAndroid.h | 2 +- .../GUI/CCEditBox/CCEditBoxImplIOS.h | 3 +- .../GUI/CCEditBox/CCEditBoxImplMac.h | 1 + .../GUI/CCEditBox/CCEditBoxImplTizen.h | 2 +- .../GUI/CCEditBox/CCEditBoxImplWin.h | 2 +- .../GUI/CCEditBox/CCEditBoxImplWp8.h | 2 +- .../GUI/CCScrollView/CCScrollView.h | 4 +- .../extensions/GUI/CCScrollView/CCTableView.h | 6 +-- .../GUI/CCScrollView/CCTableViewCell.h | 2 +- .../cocos/extensions/network/HttpClient.h | 2 +- .../cocos/extensions/network/HttpRequest.h | 2 +- .../cocos/extensions/network/HttpResponse.h | 2 +- .../cocos/extensions/network/WebSocket.h | 4 +- .../physics_nodes/CCPhysicsDebugNode.h | 2 +- .../physics_nodes/CCPhysicsSprite.h | 2 +- .../Geode/cocos/extensions/spine/CCSkeleton.h | 3 +- .../extensions/spine/CCSkeletonAnimation.h | 3 +- .../keypad_dispatcher/CCKeypadDelegate.h | 2 +- .../keypad_dispatcher/CCKeypadDispatcher.h | 2 +- .../Geode/cocos/label_nodes/CCLabelAtlas.h | 2 +- .../Geode/cocos/label_nodes/CCLabelBMFont.h | 1 + .../Geode/cocos/label_nodes/CCLabelTTF.h | 2 +- .../layers_scenes_transitions_nodes/CCLayer.h | 5 ++- .../CCTransition.h | 6 +-- .../CCTransitionPageTurn.h | 2 +- .../CCTransitionProgress.h | 1 + .../include/Geode/cocos/menu_nodes/CCMenu.h | 2 + .../Geode/cocos/menu_nodes/CCMenuItem.h | 4 +- .../Geode/cocos/misc_nodes/CCClippingNode.h | 2 +- .../Geode/cocos/misc_nodes/CCMotionStreak.h | 2 +- .../Geode/cocos/misc_nodes/CCProgressTimer.h | 2 +- .../Geode/cocos/misc_nodes/CCRenderTexture.h | 2 +- .../particle_nodes/CCParticleBatchNode.h | 2 +- .../cocos/particle_nodes/CCParticleSystem.h | 6 +-- .../particle_nodes/CCParticleSystemQuad.h | 2 +- .../Geode/cocos/platform/CCFileUtils.h | 6 ++- loader/include/Geode/cocos/platform/CCImage.h | 2 +- .../cocos/platform/android/CCAccelerometer.h | 2 +- .../keyboard_dispatcher/CCKeyboardDelegate.h | 2 +- .../CCKeyboardDispatcher.h | 2 +- .../robtop/mouse_dispatcher/CCMouseDelegate.h | 2 +- .../mouse_dispatcher/CCMouseDispatcher.h | 2 +- .../cocos/robtop/special_nodes/CCLightning.h | 2 +- .../cocos/script_support/CCScriptSupport.h | 8 ++-- .../include/Geode/cocos/shaders/CCGLProgram.h | 2 +- .../Geode/cocos/shaders/CCShaderCache.h | 2 +- .../cocos/sprite_nodes/CCAnimationCache.h | 3 +- .../Geode/cocos/sprite_nodes/CCSprite.h | 1 + .../cocos/sprite_nodes/CCSpriteBatchNode.h | 2 +- .../Geode/cocos/sprite_nodes/CCSpriteFrame.h | 2 +- .../cocos/sprite_nodes/CCSpriteFrameCache.h | 2 +- .../cocos/support/CCNotificationCenter.h | 3 +- .../include/Geode/cocos/support/CCProfiling.h | 2 + .../cocos/support/component/CCComponent.h | 2 +- .../support/component/CCComponentContainer.h | 2 +- .../cocos/text_input_node/CCTextFieldTTF.h | 8 ++-- .../Geode/cocos/textures/CCTexture2D.h | 2 +- .../Geode/cocos/textures/CCTextureAtlas.h | 2 +- .../Geode/cocos/textures/CCTextureCache.h | 2 +- .../Geode/cocos/textures/CCTextureETC.h | 2 +- .../Geode/cocos/textures/CCTexturePVR.h | 2 +- .../tilemap_parallax_nodes/CCParallaxNode.h | 2 +- .../cocos/tilemap_parallax_nodes/CCTMXLayer.h | 2 +- .../tilemap_parallax_nodes/CCTMXObjectGroup.h | 2 +- .../tilemap_parallax_nodes/CCTMXTiledMap.h | 2 +- .../tilemap_parallax_nodes/CCTMXXMLParser.h | 2 +- .../tilemap_parallax_nodes/CCTileMapAtlas.h | 2 +- .../cocos/touch_dispatcher/CCTouchHandler.h | 2 +- 107 files changed, 196 insertions(+), 175 deletions(-) diff --git a/loader/include/Geode/cocos/CCCamera.h b/loader/include/Geode/cocos/CCCamera.h index 3c1bdbce2..1914f9972 100644 --- a/loader/include/Geode/cocos/CCCamera.h +++ b/loader/include/Geode/cocos/CCCamera.h @@ -64,7 +64,7 @@ using the camera. class CC_DLL CCCamera : public CCObject { GEODE_FRIEND_MODIFY -protected: +public: float m_fEyeX; float m_fEyeY; float m_fEyeZ; diff --git a/loader/include/Geode/cocos/CCConfiguration.h b/loader/include/Geode/cocos/CCConfiguration.h index 9955df43c..36056c544 100644 --- a/loader/include/Geode/cocos/CCConfiguration.h +++ b/loader/include/Geode/cocos/CCConfiguration.h @@ -142,7 +142,7 @@ class CC_DLL CCConfiguration : public CCObject static CCConfiguration *s_gSharedConfiguration; static gd::string s_sConfigfile; -protected: +public: GLint m_nMaxTextureSize; GLint m_nMaxModelviewStackDepth; bool m_bSupportsPVRTC; diff --git a/loader/include/Geode/cocos/CCScheduler.h b/loader/include/Geode/cocos/CCScheduler.h index a83bf0456..ab0eab51a 100644 --- a/loader/include/Geode/cocos/CCScheduler.h +++ b/loader/include/Geode/cocos/CCScheduler.h @@ -102,7 +102,7 @@ class CC_DLL CCTimer : public CCObject */ inline int getScriptHandler() { return m_nScriptHandler; }; -protected: +public: CCObject *m_pTarget; float m_fElapsed; bool m_bRunForever; @@ -300,7 +300,7 @@ class CC_DLL CCScheduler : public CCObject void priorityIn(struct _listEntry **ppList, CCObject *pTarget, int nPriority, bool bPaused); void appendIn(struct _listEntry **ppList, CCObject *pTarget, bool bPaused); -protected: +public: float m_fTimeScale; // diff --git a/loader/include/Geode/cocos/actions/CCAction.h b/loader/include/Geode/cocos/actions/CCAction.h index b91b2f539..7a59259c8 100644 --- a/loader/include/Geode/cocos/actions/CCAction.h +++ b/loader/include/Geode/cocos/actions/CCAction.h @@ -120,7 +120,7 @@ class CC_DLL CCAction : public CCObject public: /** Create an action */ static CCAction* create(); -protected: +public: CCNode *m_pOriginalTarget; /** The "target". The target will be set with the 'startWithTarget' method. @@ -167,7 +167,7 @@ class CC_DLL CCFiniteTimeAction : public CCAction /** returns a reversed action */ virtual CCFiniteTimeAction* reverse(void); -protected: +public: //! duration in seconds float m_fDuration; }; @@ -225,7 +225,7 @@ class CC_DLL CCSpeed : public CCAction public: /** create the action */ static CCSpeed* create(CCActionInterval* pAction, float fSpeed); -protected: +public: float m_fSpeed; CCActionInterval *m_pInnerAction; }; @@ -281,7 +281,7 @@ class CC_DLL CCFollow : public CCAction It will work with no boundary if @param rect is equal to CCRectZero. */ static CCFollow* create(CCNode *pFollowedNode, const CCRect& rect = CCRectZero); -protected: +public: // node to follow CCNode *m_pobFollowedNode; diff --git a/loader/include/Geode/cocos/actions/CCActionCamera.h b/loader/include/Geode/cocos/actions/CCActionCamera.h index e19e716ec..d7e5ef9b6 100644 --- a/loader/include/Geode/cocos/actions/CCActionCamera.h +++ b/loader/include/Geode/cocos/actions/CCActionCamera.h @@ -68,7 +68,7 @@ class CC_DLL CCActionCamera : public CCActionInterval // // super methods virtual void startWithTarget(CCNode *pTarget); virtual CCActionInterval * reverse(); -protected: +public: float m_fCenterXOrig; float m_fCenterYOrig; float m_fCenterZOrig; @@ -128,7 +128,7 @@ class CC_DLL CCOrbitCamera : public CCActionCamera // virtual void startWithTarget(CCNode *pTarget); virtual void update(float time); -protected: +public: float m_fRadius; float m_fDeltaRadius; float m_fAngleZ; diff --git a/loader/include/Geode/cocos/actions/CCActionCatmullRom.h b/loader/include/Geode/cocos/actions/CCActionCatmullRom.h index 83bddc217..b019c5486 100644 --- a/loader/include/Geode/cocos/actions/CCActionCatmullRom.h +++ b/loader/include/Geode/cocos/actions/CCActionCatmullRom.h @@ -108,7 +108,7 @@ class CC_DLL CCPointArray : public CCObject const gd::vector* getControlPoints(); void setControlPoints(gd::vector *controlPoints); -private: +public: /** Array that contains the control points */ gd::vector *m_pControlPoints; }; @@ -176,7 +176,7 @@ class CC_DLL CCCardinalSplineTo : public CCActionInterval m_pPoints = points; } -protected: +public: /** Array of control points */ CCPointArray *m_pPoints; float m_fDeltaT; @@ -215,7 +215,7 @@ class CC_DLL CCCardinalSplineBy : public CCCardinalSplineTo * @lua NA */ virtual void updatePosition(CCPoint &newPos); -protected: +public: CCPoint m_startPosition; }; diff --git a/loader/include/Geode/cocos/actions/CCActionEase.h b/loader/include/Geode/cocos/actions/CCActionEase.h index 0a4850a59..334a6cbbe 100644 --- a/loader/include/Geode/cocos/actions/CCActionEase.h +++ b/loader/include/Geode/cocos/actions/CCActionEase.h @@ -73,7 +73,7 @@ class CC_DLL CCActionEase : public CCActionInterval /** creates the action */ static CCActionEase* create(CCActionInterval *pAction); -protected: +public: /** The inner action */ CCActionInterval *m_pInner; }; @@ -111,7 +111,7 @@ class CC_DLL CCEaseRateAction : public CCActionEase /** Creates the action with the inner action and the rate parameter */ static CCEaseRateAction* create(CCActionInterval* pAction, float fRate); -protected: +public: float m_fRate; }; @@ -338,7 +338,7 @@ class CC_DLL CCEaseElastic : public CCActionEase /** Creates the action with the inner action and the period in radians (default is 0.3) */ static CCEaseElastic* create(CCActionInterval *pAction, float fPeriod); static CCEaseElastic* create(CCActionInterval *pAction); -protected: +public: float m_fPeriod; }; diff --git a/loader/include/Geode/cocos/actions/CCActionGrid.h b/loader/include/Geode/cocos/actions/CCActionGrid.h index 9b80f0627..abebb3582 100644 --- a/loader/include/Geode/cocos/actions/CCActionGrid.h +++ b/loader/include/Geode/cocos/actions/CCActionGrid.h @@ -64,7 +64,7 @@ class CC_DLL CCGridAction : public CCActionInterval /** creates the action with size and duration */ static CCGridAction* create(float duration, const CCSize& gridSize); -protected: +public: CCSize m_sGridSize; }; @@ -145,7 +145,7 @@ class CC_DLL CCAccelDeccelAmplitude : public CCActionInterval /** creates the action with an inner action that has the amplitude property, and a duration time */ static CCAccelDeccelAmplitude* create(CCAction *pAction, float duration); -protected: +public: float m_fRate; CCActionInterval *m_pOther; }; @@ -178,7 +178,7 @@ class CC_DLL CCAccelAmplitude : public CCActionInterval public: /** creates the action with an inner action that has the amplitude property, and a duration time */ static CCAccelAmplitude* create(CCAction *pAction, float duration); -protected: +public: float m_fRate; CCActionInterval *m_pOther; }; @@ -212,7 +212,7 @@ class CC_DLL CCDeccelAmplitude : public CCActionInterval /** creates the action with an inner action that has the amplitude property, and a duration time */ static CCDeccelAmplitude* create(CCAction *pAction, float duration); -protected: +public: float m_fRate; CCActionInterval *m_pOther; }; @@ -246,7 +246,7 @@ class CC_DLL CCReuseGrid : public CCActionInstant public: /** creates an action with the number of times that the current grid will be reused */ static CCReuseGrid* create(int times); -protected: +public: int m_nTimes; }; diff --git a/loader/include/Geode/cocos/actions/CCActionGrid3D.h b/loader/include/Geode/cocos/actions/CCActionGrid3D.h index ce8148c06..f90f903c2 100644 --- a/loader/include/Geode/cocos/actions/CCActionGrid3D.h +++ b/loader/include/Geode/cocos/actions/CCActionGrid3D.h @@ -59,7 +59,7 @@ class CC_DLL CCWaves3D : public CCGrid3DAction public: /** creates an action with duration, grid size, waves and amplitude */ static CCWaves3D* create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude); -protected: +public: unsigned int m_nWaves; float m_fAmplitude; float m_fAmplitudeRate; @@ -129,7 +129,7 @@ class CC_DLL CCLens3D : public CCGrid3DAction public: /** creates the action with center position, radius, a grid size and duration */ static CCLens3D* create(float duration, const CCSize& gridSize, const CCPoint& position, float radius); -protected: +public: /* lens center position */ CCPoint m_position; float m_fRadius; @@ -169,7 +169,7 @@ class CC_DLL CCRipple3D : public CCGrid3DAction public: /** creates the action with radius, number of waves, amplitude, a grid size and duration */ static CCRipple3D* create(float duration, const CCSize& gridSize, const CCPoint& position, float radius, unsigned int waves, float amplitude); -protected: +public: /* center position */ CCPoint m_position; float m_fRadius; @@ -195,7 +195,7 @@ class CC_DLL CCShaky3D : public CCGrid3DAction public: /** creates the action with a range, shake Z vertices, a grid and duration */ static CCShaky3D* create(float duration, const CCSize& gridSize, int range, bool shakeZ); -protected: +public: int m_nRandrange; bool m_bShakeZ; }; @@ -223,7 +223,7 @@ class CC_DLL CCLiquid : public CCGrid3DAction public: /** creates the action with amplitude, a grid and duration */ static CCLiquid* create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude); -protected: +public: unsigned int m_nWaves; float m_fAmplitude; float m_fAmplitudeRate; @@ -253,7 +253,7 @@ class CC_DLL CCWaves : public CCGrid3DAction /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */ static CCWaves* create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical); -protected: +public: unsigned int m_nWaves; float m_fAmplitude; float m_fAmplitudeRate; @@ -289,7 +289,7 @@ class CC_DLL CCTwirl : public CCGrid3DAction public: /** creates the action with center position, number of twirls, amplitude, a grid size and duration */ static CCTwirl* create(float duration, const CCSize& gridSize, CCPoint position, unsigned int twirls, float amplitude); -protected: +public: /* twirl center */ CCPoint m_position; unsigned int m_nTwirls; diff --git a/loader/include/Geode/cocos/actions/CCActionInstant.h b/loader/include/Geode/cocos/actions/CCActionInstant.h index fd12dec36..97e985368 100644 --- a/loader/include/Geode/cocos/actions/CCActionInstant.h +++ b/loader/include/Geode/cocos/actions/CCActionInstant.h @@ -184,7 +184,7 @@ class CC_DLL CCRemoveSelf : public CCActionInstant static CCRemoveSelf * create(bool isNeedCleanUp = true); /** init the action */ bool init(bool isNeedCleanUp); -protected: +public: bool m_bIsNeedCleanUp; }; @@ -222,7 +222,7 @@ class CC_DLL CCFlipX : public CCActionInstant */ virtual CCObject* copyWithZone(CCZone *pZone); -protected: +public: bool m_bFlipX; }; @@ -260,7 +260,7 @@ class CC_DLL CCFlipY : public CCActionInstant */ virtual CCObject* copyWithZone(CCZone *pZone); -protected: +public: bool m_bFlipY; }; @@ -291,7 +291,7 @@ class CC_DLL CCPlace : public CCActionInstant // * @lua NA */ virtual CCObject* copyWithZone(CCZone *pZone); -protected: +public: CCPoint m_tPosition; }; @@ -370,7 +370,7 @@ class CC_DLL CCCallFunc : public CCActionInstant // * @lua NA */ inline int getScriptHandler() { return m_nScriptHandler; }; -protected: +public: /** Target that will be called */ CCObject* m_pSelectorTarget; @@ -468,7 +468,7 @@ class CC_DLL CCCallFuncND : public CCCallFuncN virtual CCObject* copyWithZone(CCZone *pZone); virtual void execute(); -protected: +public: void *m_pData; }; @@ -527,7 +527,7 @@ class CC_DLL CCCallFuncO : public CCCallFunc, public TypeInfo } } -protected: +public: /** object to be passed as argument */ CCObject* m_pObject; }; diff --git a/loader/include/Geode/cocos/actions/CCActionInterval.h b/loader/include/Geode/cocos/actions/CCActionInterval.h index fc1417e5d..ae82e18ec 100644 --- a/loader/include/Geode/cocos/actions/CCActionInterval.h +++ b/loader/include/Geode/cocos/actions/CCActionInterval.h @@ -96,7 +96,7 @@ class CC_DLL CCActionInterval : public CCFiniteTimeAction // 2.2 addition bool getM_bFirstTick(); // rob were you like high on something when you wrote this -protected: +public: float m_elapsed; bool m_bFirstTick; }; @@ -165,7 +165,7 @@ class CC_DLL CCSequence : public CCActionInterval */ static CCSequence* createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo); -protected: +public: CCFiniteTimeAction *m_pActions[2]; float m_split; int m_last; @@ -216,7 +216,7 @@ class CC_DLL CCRepeat : public CCActionInterval /** creates a CCRepeat action. Times is an unsigned integer between 1 and pow(2,30) */ static CCRepeat* create(CCFiniteTimeAction *pAction, unsigned int times); -protected: +public: unsigned int m_uTimes; unsigned int m_uTotal; float m_fNextDt; @@ -276,7 +276,7 @@ class CC_DLL CCRepeatForever : public CCActionInterval /** creates the action */ static CCRepeatForever* create(CCActionInterval *pAction); -protected: +public: /** Inner action */ CCActionInterval *m_pInnerAction; }; @@ -339,7 +339,7 @@ class CC_DLL CCSpawn : public CCActionInterval */ static CCSpawn* createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); -protected: +public: CCFiniteTimeAction *m_pOne; CCFiniteTimeAction *m_pTwo; }; @@ -368,7 +368,7 @@ class CC_DLL CCRotateTo : public CCActionInterval virtual void startWithTarget(CCNode *pTarget); virtual void update(float time); -protected: +public: float m_fDstAngleX; float m_fStartAngleX; float m_fDiffAngleX; @@ -400,7 +400,7 @@ class CC_DLL CCRotateBy : public CCActionInterval virtual void update(float time); virtual CCActionInterval* reverse(void); -protected: +public: float m_fAngleX; float m_fStartAngleX; float m_fAngleY; @@ -431,7 +431,7 @@ class CC_DLL CCMoveBy : public CCActionInterval public: /** creates the action */ static CCMoveBy* create(float duration, const CCPoint& deltaPosition); -protected: +public: CCPoint m_positionDelta; CCPoint m_startPosition; CCPoint m_previousPosition; @@ -458,7 +458,7 @@ class CC_DLL CCMoveTo : public CCMoveBy public: /** creates the action */ static CCMoveTo* create(float duration, const CCPoint& position); -protected: +public: CCPoint m_endPosition; }; @@ -486,7 +486,7 @@ class CC_DLL CCSkewTo : public CCActionInterval /** creates the action */ static CCSkewTo* create(float t, float sx, float sy); -protected: +public: float m_fSkewX; float m_fSkewY; float m_fStartSkewX; @@ -534,7 +534,7 @@ class CC_DLL CCJumpBy : public CCActionInterval public: /** creates the action */ static CCJumpBy* create(float duration, const CCPoint& position, float height, unsigned int jumps); -protected: +public: CCPoint m_startPosition; CCPoint m_delta; float m_height; @@ -604,7 +604,7 @@ class CC_DLL CCBezierBy : public CCActionInterval * @endcode */ static CCBezierBy* create(float t, const ccBezierConfig& c); -protected: +public: ccBezierConfig m_sConfig; CCPoint m_startPosition; CCPoint m_previousPosition; @@ -641,7 +641,7 @@ class CC_DLL CCBezierTo : public CCBezierBy */ bool initWithDuration(float t, const ccBezierConfig &c); -protected: +public: ccBezierConfig m_sToConfig; }; @@ -672,7 +672,7 @@ class CC_DLL CCScaleTo : public CCActionInterval /** creates the action with and X factor and a Y factor */ static CCScaleTo* create(float duration, float sx, float sy); -protected: +public: float m_fScaleX; float m_fScaleY; float m_fStartScaleX; @@ -730,7 +730,7 @@ class CC_DLL CCBlink : public CCActionInterval virtual void startWithTarget(CCNode *pTarget); virtual void stop(); -protected: +public: unsigned int m_nTimes; bool m_bOriginalState; }; @@ -796,7 +796,7 @@ class CC_DLL CCFadeTo : public CCActionInterval public: /** creates an action with duration and opacity */ static CCFadeTo* create(float duration, GLubyte opacity); -protected: +public: GLubyte m_toOpacity; GLubyte m_fromOpacity; }; @@ -822,7 +822,7 @@ class CC_DLL CCTintTo : public CCActionInterval public: /** creates an action with duration and color */ static CCTintTo* create(float duration, GLubyte red, GLubyte green, GLubyte blue); -protected: +public: ccColor3B m_to; ccColor3B m_from; }; @@ -848,7 +848,7 @@ class CC_DLL CCTintBy : public CCActionInterval public: /** creates an action with duration and color */ static CCTintBy* create(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue); -protected: +public: GLshort m_deltaR; GLshort m_deltaG; GLshort m_deltaB; @@ -914,7 +914,7 @@ class CC_DLL CCReverseTime : public CCActionInterval public: /** creates the action */ static CCReverseTime* create(CCFiniteTimeAction *pAction); -protected: +public: CCFiniteTimeAction *m_pOther; }; @@ -957,7 +957,7 @@ class CC_DLL CCAnimate : public CCActionInterval /** creates the action with an Animation and will restore the original frame when the animation is over */ static CCAnimate* create(CCAnimation *pAnimation); CC_SYNTHESIZE_RETAIN(CCAnimation*, m_pAnimation, Animation) -protected: +public: gd::vector* m_pSplitTimes; int m_nNextFrame; CCSpriteFrame* m_pOrigFrame; @@ -997,7 +997,7 @@ class CC_DLL CCTargetedAction : public CCActionInterval /** This is the target that the action will be forced to run with */ CC_SYNTHESIZE_RETAIN(CCNode*, m_pForcedTarget, ForcedTarget); -private: +public: CCFiniteTimeAction* m_pAction; }; diff --git a/loader/include/Geode/cocos/actions/CCActionManager.h b/loader/include/Geode/cocos/actions/CCActionManager.h index a1dab8bc4..d2f0302b2 100644 --- a/loader/include/Geode/cocos/actions/CCActionManager.h +++ b/loader/include/Geode/cocos/actions/CCActionManager.h @@ -131,7 +131,7 @@ class CC_DLL CCActionManager : public CCObject void actionAllocWithHashElement(struct _hashElement *pElement); void update(float dt); -protected: +public: struct _hashElement *m_pTargets; struct _hashElement *m_pCurrentTarget; bool m_bCurrentTargetSalvaged; diff --git a/loader/include/Geode/cocos/actions/CCActionProgressTimer.h b/loader/include/Geode/cocos/actions/CCActionProgressTimer.h index ee5c225e5..59ef64199 100644 --- a/loader/include/Geode/cocos/actions/CCActionProgressTimer.h +++ b/loader/include/Geode/cocos/actions/CCActionProgressTimer.h @@ -55,7 +55,7 @@ class CC_DLL CCProgressTo : public CCActionInterval public: /** Creates and initializes with a duration and a percent */ static CCProgressTo* create(float duration, float fPercent); -protected: +public: float m_fTo; float m_fFrom; }; @@ -83,7 +83,7 @@ class CC_DLL CCProgressFromTo : public CCActionInterval /** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */ static CCProgressFromTo* create(float duration, float fFromPercentage, float fToPercentage); -protected: +public: float m_fTo; float m_fFrom; }; diff --git a/loader/include/Geode/cocos/actions/CCActionTiledGrid.h b/loader/include/Geode/cocos/actions/CCActionTiledGrid.h index 50bc4dca5..a70348ba1 100644 --- a/loader/include/Geode/cocos/actions/CCActionTiledGrid.h +++ b/loader/include/Geode/cocos/actions/CCActionTiledGrid.h @@ -53,7 +53,7 @@ class CC_DLL CCShakyTiles3D : public CCTiledGrid3DAction /** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration */ static CCShakyTiles3D* create(float duration, const CCSize& gridSize, int nRange, bool bShakeZ); -protected: +public: int m_nRandrange; bool m_bShakeZ; }; @@ -76,7 +76,7 @@ class CC_DLL CCShatteredTiles3D : public CCTiledGrid3DAction /** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */ static CCShatteredTiles3D* create(float duration, const CCSize& gridSize, int nRange, bool bShatterZ); -protected: +public: int m_nRandrange; bool m_bOnce; bool m_bShatterZ; @@ -112,7 +112,7 @@ class CC_DLL CCShuffleTiles : public CCTiledGrid3DAction public: /** creates the action with a random seed, the grid size and the duration */ static CCShuffleTiles* create(float duration, const CCSize& gridSize, unsigned int seed); -protected: +public: unsigned int m_nSeed; unsigned int m_nTilesCount; unsigned int* m_pTilesOrder; @@ -216,7 +216,7 @@ class CC_DLL CCTurnOffTiles : public CCTiledGrid3DAction /** creates the action with a random seed, the grid size and the duration */ static CCTurnOffTiles* create(float duration, const CCSize& gridSize, unsigned int seed); -protected: +public: unsigned int m_nSeed; unsigned int m_nTilesCount; unsigned int* m_pTilesOrder; @@ -247,7 +247,7 @@ class CC_DLL CCWavesTiles3D : public CCTiledGrid3DAction public: /** creates the action with a number of waves, the waves amplitude, the grid size and the duration */ static CCWavesTiles3D* create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude); -protected: +public: unsigned int m_nWaves; float m_fAmplitude; float m_fAmplitudeRate; @@ -281,7 +281,7 @@ class CC_DLL CCJumpTiles3D : public CCTiledGrid3DAction /** creates the action with the number of jumps, the sin amplitude, the grid size and the duration */ static CCJumpTiles3D* create(float duration, const CCSize& gridSize, unsigned int numberOfJumps, float amplitude); -protected: +public: unsigned int m_nJumps; float m_fAmplitude; float m_fAmplitudeRate; @@ -306,7 +306,7 @@ public : /** creates the action with the number of rows to split and the duration */ static CCSplitRows* create(float duration, unsigned int nRows); -protected: +public: unsigned int m_nRows; CCSize m_winSize; }; @@ -329,7 +329,7 @@ class CC_DLL CCSplitCols : public CCTiledGrid3DAction public: /** creates the action with the number of columns to split and the duration */ static CCSplitCols* create(float duration, unsigned int nCols); -protected: +public: unsigned int m_nCols; CCSize m_winSize; }; diff --git a/loader/include/Geode/cocos/base_nodes/CCAtlasNode.h b/loader/include/Geode/cocos/base_nodes/CCAtlasNode.h index 60155a75f..1fd488a8f 100644 --- a/loader/include/Geode/cocos/base_nodes/CCAtlasNode.h +++ b/loader/include/Geode/cocos/base_nodes/CCAtlasNode.h @@ -51,7 +51,7 @@ All features from CCNode are valid, plus the following features: class CC_DLL CCAtlasNode : public CCNodeRGBA, public CCTextureProtocol { GEODE_FRIEND_MODIFY -protected: +public: //! chars per row unsigned int m_uItemsPerRow; diff --git a/loader/include/Geode/cocos/base_nodes/CCNode.h b/loader/include/Geode/cocos/base_nodes/CCNode.h index 871ce1c65..3b1e10afc 100644 --- a/loader/include/Geode/cocos/base_nodes/CCNode.h +++ b/loader/include/Geode/cocos/base_nodes/CCNode.h @@ -1761,7 +1761,7 @@ class CC_DLL CCNode : public CCObject */ CCPoint convertToWindowSpace(const CCPoint& nodePoint); -protected: +public: float m_fRotationX; ///< rotation angle on x-axis float m_fRotationY; ///< rotation angle on y-axis @@ -1894,7 +1894,7 @@ class CC_DLL CCNodeRGBA : public CCNode, public CCRGBAProtocol virtual void setOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}; virtual bool isOpacityModifyRGB() { return false; }; -protected: +public: GLubyte _displayedOpacity; GLubyte _realOpacity; ccColor3B _displayedColor; diff --git a/loader/include/Geode/cocos/cocoa/CCAutoreleasePool.h b/loader/include/Geode/cocos/cocoa/CCAutoreleasePool.h index 4ffeaeeb2..274a0adaf 100644 --- a/loader/include/Geode/cocos/cocoa/CCAutoreleasePool.h +++ b/loader/include/Geode/cocos/cocoa/CCAutoreleasePool.h @@ -39,8 +39,8 @@ NS_CC_BEGIN class CC_DLL CCAutoreleasePool : public CCObject { GEODE_FRIEND_MODIFY - CCArray* m_pManagedObjectArray; public: + CCArray* m_pManagedObjectArray; CCAutoreleasePool(void); ~CCAutoreleasePool(void); diff --git a/loader/include/Geode/cocos/cocoa/CCBool.h b/loader/include/Geode/cocos/cocoa/CCBool.h index 68d5c7c23..f6f89ffc9 100644 --- a/loader/include/Geode/cocos/cocoa/CCBool.h +++ b/loader/include/Geode/cocos/cocoa/CCBool.h @@ -58,7 +58,7 @@ class CC_DLL CCBool : public CCObject /* override functions */ virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); } -private: +public: bool m_bValue; }; diff --git a/loader/include/Geode/cocos/cocoa/CCDataVisitor.h b/loader/include/Geode/cocos/cocoa/CCDataVisitor.h index bed8cbb1a..6b8bb9752 100644 --- a/loader/include/Geode/cocos/cocoa/CCDataVisitor.h +++ b/loader/include/Geode/cocos/cocoa/CCDataVisitor.h @@ -105,6 +105,7 @@ class CC_DLL CCPrettyPrinter : public CCDataVisitor virtual void visit(const CCSet *p); private: void setIndentLevel(int indentLevel); +public: int _indentLevel; gd::string _indentStr; gd::string _result; diff --git a/loader/include/Geode/cocos/cocoa/CCDictionary.h b/loader/include/Geode/cocos/cocoa/CCDictionary.h index 4bd8b5c0d..4266c01d5 100644 --- a/loader/include/Geode/cocos/cocoa/CCDictionary.h +++ b/loader/include/Geode/cocos/cocoa/CCDictionary.h @@ -121,7 +121,7 @@ class CC_DLL CCDictElement */ inline CCObject* getObject() const { return m_pObject; } -private: +public: // The max length of string key. #define MAX_KEY_LEN 256 // char array is needed for HASH_ADD_STR in UT_HASH. diff --git a/loader/include/Geode/cocos/cocoa/CCDouble.h b/loader/include/Geode/cocos/cocoa/CCDouble.h index c211011f4..ccdbd35a3 100644 --- a/loader/include/Geode/cocos/cocoa/CCDouble.h +++ b/loader/include/Geode/cocos/cocoa/CCDouble.h @@ -57,7 +57,7 @@ class CC_DLL CCDouble : public CCObject /* override functions */ virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); } -private: +public: double m_dValue; }; diff --git a/loader/include/Geode/cocos/cocoa/CCFloat.h b/loader/include/Geode/cocos/cocoa/CCFloat.h index 6aaa5b4f7..974dea024 100644 --- a/loader/include/Geode/cocos/cocoa/CCFloat.h +++ b/loader/include/Geode/cocos/cocoa/CCFloat.h @@ -57,7 +57,7 @@ class CC_DLL CCFloat : public CCObject /* override functions */ virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); } -private: +public: float m_fValue; }; diff --git a/loader/include/Geode/cocos/cocoa/CCInteger.h b/loader/include/Geode/cocos/cocoa/CCInteger.h index 104d9e995..0638b6ff7 100644 --- a/loader/include/Geode/cocos/cocoa/CCInteger.h +++ b/loader/include/Geode/cocos/cocoa/CCInteger.h @@ -32,7 +32,7 @@ class CC_DLL CCInteger : public CCObject */ virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); } -private: +public: int m_nValue; }; diff --git a/loader/include/Geode/cocos/cocoa/CCObject.h b/loader/include/Geode/cocos/cocoa/CCObject.h index 1e7e083a4..134996c66 100644 --- a/loader/include/Geode/cocos/cocoa/CCObject.h +++ b/loader/include/Geode/cocos/cocoa/CCObject.h @@ -97,7 +97,7 @@ class CC_DLL CCObject : public CCDestructor unsigned int m_uID; // Lua reference id int m_nLuaID; -protected: +public: // the object's tag int m_nTag; // count of references diff --git a/loader/include/Geode/cocos/cocoa/CCSet.h b/loader/include/Geode/cocos/cocoa/CCSet.h index 4ec1c0bf7..23e9daf95 100644 --- a/loader/include/Geode/cocos/cocoa/CCSet.h +++ b/loader/include/Geode/cocos/cocoa/CCSet.h @@ -35,7 +35,7 @@ NS_CC_BEGIN * @{ */ -typedef std::set::iterator CCSetIterator; +typedef gd::set::iterator CCSetIterator; class CC_DLL CCSet : public CCObject { @@ -114,8 +114,8 @@ class CC_DLL CCSet : public CCObject */ virtual void acceptVisitor(CCDataVisitor &visitor); -private: - std::set *m_pSet; +public: + gd::set *m_pSet; }; // end of data_structure group diff --git a/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h b/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h index abb08b80c..f1c69ffc1 100644 --- a/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h +++ b/loader/include/Geode/cocos/draw_nodes/CCDrawNode.h @@ -45,7 +45,7 @@ NS_CC_BEGIN class CC_DLL CCDrawNode : public CCNodeRGBA { GEODE_FRIEND_MODIFY -protected: +public: GLuint m_uVao; GLuint m_uVbo; diff --git a/loader/include/Geode/cocos/effects/CCGrabber.h b/loader/include/Geode/cocos/effects/CCGrabber.h index 320f46644..414428b6a 100644 --- a/loader/include/Geode/cocos/effects/CCGrabber.h +++ b/loader/include/Geode/cocos/effects/CCGrabber.h @@ -52,7 +52,7 @@ class CCGrabber : public CCObject void beforeRender(CCTexture2D *pTexture); void afterRender(CCTexture2D *pTexture); -protected: +public: GLuint m_FBO; GLint m_oldFBO; GLfloat m_oldClearColor[4]; diff --git a/loader/include/Geode/cocos/effects/CCGrid.h b/loader/include/Geode/cocos/effects/CCGrid.h index 829ed4077..f538cbc27 100644 --- a/loader/include/Geode/cocos/effects/CCGrid.h +++ b/loader/include/Geode/cocos/effects/CCGrid.h @@ -147,7 +147,7 @@ class CC_DLL CCGridBase : public CCObject */ void set2DProjection(void); -protected: +public: bool m_bActive; int m_nReuseGrid; CCSize m_sGridSize; diff --git a/loader/include/Geode/cocos/extensions/AssetsManager/AssetsManager.h b/loader/include/Geode/cocos/extensions/AssetsManager/AssetsManager.h index 6c1c2d133..2b8f33ebd 100644 --- a/loader/include/Geode/cocos/extensions/AssetsManager/AssetsManager.h +++ b/loader/include/Geode/cocos/extensions/AssetsManager/AssetsManager.h @@ -172,12 +172,12 @@ class AssetsManager private: void handleUpdateSucceed(Message *msg); - + public: std::list *_messageQueue; pthread_mutex_t _messageQueueMutex; }; -private: +public: //! The path to store downloaded resources. gd::string _storagePath; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h index 75e49910c..d6c9f8fd9 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControl.h @@ -87,7 +87,7 @@ typedef unsigned int CCControlState; */ class CC_DLL CCControl : public CCLayerRGBA { - +public: //CCRGBAProtocol bool m_bIsOpacityModifyRGB; @@ -97,7 +97,7 @@ class CC_DLL CCControl : public CCLayerRGBA CC_SYNTHESIZE_READONLY_NV(CCControlState, m_eState, State); /** True if all of the controls parents are visible */ -protected: +public: bool m_hasVisibleParents; public: diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlButton.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlButton.h index 140e32647..b7c6924f0 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlButton.h @@ -97,7 +97,7 @@ class CC_DLL CCControlButton : public CCControl virtual void setColor(const ccColor3B&); /** Flag to know if the button is currently pushed. */ -protected: +public: bool m_isPushed; bool m_bParentInited; public: diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h index c3ecd6d5b..f479c2b3e 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -62,7 +62,7 @@ class CC_DLL CCControlColourPicker : public CCControl CCControlColourPicker(); virtual ~CCControlColourPicker(); -protected: +public: // @note RobTop Addition ccColor3B m_rgb; HSV m_hsv; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlPotentiometer.h index e44052cde..00ff21628 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlPotentiometer.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlPotentiometer.h @@ -73,7 +73,7 @@ class CC_DLL CCControlPotentiometer : public CCControl virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent); virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent); -protected: +public: CC_SYNTHESIZE_RETAIN(CCSprite*, m_pThumbSprite, ThumbSprite) CC_SYNTHESIZE_RETAIN(CCProgressTimer*, m_pProgressTimer, ProgressTimer) CC_SYNTHESIZE(CCPoint, m_tPreviousLocation, PreviousLocation) @@ -85,6 +85,8 @@ class CC_DLL CCControlPotentiometer : public CCControl /** Contains the maximum value of the receiver. * The default value of this property is 1.0. */ float m_fMaximumValue; + +protected: /** Factorize the event dispath into these methods. */ void potentiometerBegan(CCPoint location); void potentiometerMoved(CCPoint location); diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h index cb6c02176..ac20483d4 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h @@ -59,7 +59,7 @@ class CC_DLL CCControlSaturationBrightnessPicker : public CCControl CC_SYNTHESIZE_READONLY(CCSprite*, m_slider, Slider); CC_SYNTHESIZE_READONLY(CCPoint, m_startPos, StartPos); -protected: +public: int boxPos; int boxSize; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlStepper.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlStepper.h index 3f88dc9d2..52d2fa0cb 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlStepper.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlStepper.h @@ -86,6 +86,7 @@ class CC_DLL CCControlStepper : public CCControl /** Stop the autorepeat. */ void stopAutorepeat(); +public: /** The numeric value of the stepper. */ double m_dValue; /** The continuous vs. noncontinuous state of the stepper. */ diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSwitch.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSwitch.h index e79e59ed2..d3357ccab 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSwitch.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCControlSwitch.h @@ -86,7 +86,7 @@ class CC_DLL CCControlSwitch : public CCControl virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent); virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent); -protected: +public: /** Sprite which represents the view. */ CCControlSwitchSprite* m_pSwitchSprite; float m_fInitialTouchXPosition; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h index 43d9c1360..02027bb6c 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -79,7 +79,7 @@ class CC_DLL CCScale9Sprite : public CCNodeRGBA /** Sets the bottom side inset */ CC_PROPERTY(float, m_insetBottom, InsetBottom); -protected: +public: bool m_bSpritesGenerated; CCRect m_spriteRect; bool m_bSpriteFrameRotated; @@ -100,7 +100,8 @@ class CC_DLL CCScale9Sprite : public CCNodeRGBA bool _opacityModifyRGB; GLubyte _opacity; ccColor3B _color; - + +protected: void updateCapInset(); void updatePositions(); diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBox.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBox.h index 81e36e9f6..2ec6cd6d9 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBox.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBox.h @@ -398,7 +398,7 @@ class CC_DLL CCEditBox */ void touchDownAction(CCObject *sender, CCControlEvent controlEvent); -protected: +public: CCEditBoxImpl* m_pEditBoxImpl; CCEditBoxDelegate* m_pDelegate; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImpl.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImpl.h index f9f692d57..aae865c4a 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImpl.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImpl.h @@ -76,7 +76,7 @@ class CC_DLL CCEditBoxImpl void setDelegate(CCEditBoxDelegate* pDelegate) { m_pDelegate = pDelegate; }; CCEditBoxDelegate* getDelegate() { return m_pDelegate; }; CCEditBox* getCCEditBox() { return m_pEditBox; }; -protected: +public: CCEditBoxDelegate* m_pDelegate; CCEditBox* m_pEditBox; }; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h index f42243eb4..84a4cfca7 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h @@ -71,7 +71,7 @@ class CC_DLL CCEditBoxImplAndroid : public CCEditBoxImpl virtual void openKeyboard(); virtual void closeKeyboard(); -private: +public: CCLabelTTF* m_pLabel; CCLabelTTF* m_pLabelPlaceHolder; EditBoxInputMode m_eEditBoxInputMode; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h index 01317818a..86ffd046c 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h @@ -109,7 +109,8 @@ class CC_DLL CCEditBoxImplIOS : public CCEditBoxImpl void setInactiveText(const char* pText); void adjustTextFieldPosition(); void placeInactiveLabels(); - + +public: CCLabelTTF* m_pLabel; CCLabelTTF* m_pLabelPlaceHolder; CCSize m_tContentSize; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index 1b4369911..c16988cf0 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -103,6 +103,7 @@ class CC_DLL CCEditBoxImplMac : public CCEditBoxImpl private: NSPoint convertDesignCoordToScreenCoord(const CCPoint& designCoord, bool bInRetinaMode); void adjustTextFieldPosition(); +public: CCSize m_tContentSize; CCPoint m_obPosition; CCPoint m_obAnchorPoint; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h index b4ea90b98..20e6ee2c7 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h @@ -72,7 +72,7 @@ class CC_DLL CCEditBoxImplTizen : public CCEditBoxImpl virtual void openKeyboard(); virtual void closeKeyboard(); -private: +public: CCLabelTTF* m_pLabel; CCLabelTTF* m_pLabelPlaceHolder; EditBoxInputMode m_eEditBoxInputMode; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWin.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWin.h index 7eb7ca14b..bde40ea84 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWin.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWin.h @@ -70,7 +70,7 @@ class CC_DLL CCEditBoxImplWin : public CCEditBoxImpl virtual void openKeyboard(); virtual void closeKeyboard(); virtual void onEnter(void); -private: +public: CCLabelTTF* m_pLabel; CCLabelTTF* m_pLabelPlaceHolder; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h index b9bc595ca..125282e88 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h @@ -64,7 +64,7 @@ class CC_DLL CCEditBoxImplWp8 : public CCEditBoxImpl private: Platform::String^ stringToPlatformString(gd::string strSrc); gd::string PlatformStringTostring(Platform::String^ strSrc); -private: +public: CCLabelTTF* m_pLabel; CCLabelTTF* m_pLabelPlaceHolder; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h index 30918b1d7..9fb125b04 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCScrollView.h @@ -253,7 +253,7 @@ class CC_DLL CCScrollView : public CCLayer protected: CCRect getViewRect(); - +public: /** * current zoom scale */ @@ -345,7 +345,7 @@ class CC_DLL CCScrollView : public CCLayer void registerScriptHandler(int nFunID,int nScriptEventType); void unregisterScriptHandler(int nScriptEventType); int getScriptHandler(int nScriptEventType); -private: +public: gd::map m_mapScriptHandler; }; diff --git a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableView.h b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableView.h index aa550b50c..7f8b75da6 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableView.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableView.h @@ -234,8 +234,7 @@ class CC_DLL CCTableView : public CCScrollView, public CCScrollViewDelegate virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent); virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent); -protected: - +public: CCTableViewCell *m_pTouchedCell; /** * vertical direction of cell filling @@ -245,7 +244,7 @@ class CC_DLL CCTableView : public CCScrollView, public CCScrollViewDelegate /** * index set to query the indexes of the cells used. */ - std::set* m_pIndices; + gd::set* m_pIndices; /** * vector with all cell positions @@ -271,6 +270,7 @@ class CC_DLL CCTableView : public CCScrollView, public CCScrollViewDelegate CCScrollViewDirection m_eOldDirection; +protected: int __indexFromOffset(CCPoint offset); unsigned int _indexFromOffset(CCPoint offset); CCPoint __offsetFromIndex(unsigned int index); diff --git a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableViewCell.h b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableViewCell.h index 2bc307b30..5c37c4ec3 100644 --- a/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/loader/include/Geode/cocos/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -51,7 +51,7 @@ class CC_DLL CCTableViewCell: public CCNode, public CCSortableObject void setObjectID(unsigned int uIdx); unsigned int getObjectID(); -private: +public: unsigned int m_uIdx; }; diff --git a/loader/include/Geode/cocos/extensions/network/HttpClient.h b/loader/include/Geode/cocos/extensions/network/HttpClient.h index 1bdfce1de..68ee3961a 100644 --- a/loader/include/Geode/cocos/extensions/network/HttpClient.h +++ b/loader/include/Geode/cocos/extensions/network/HttpClient.h @@ -107,7 +107,7 @@ class CC_DLL CCHttpClient : public CCObject /** Poll function called from main thread to dispatch callbacks when http requests finished **/ void dispatchResponseCallbacks(float delta); -private: +public: int _timeoutForConnect; int _timeoutForRead; diff --git a/loader/include/Geode/cocos/extensions/network/HttpRequest.h b/loader/include/Geode/cocos/extensions/network/HttpRequest.h index b44934b11..f475b26b2 100644 --- a/loader/include/Geode/cocos/extensions/network/HttpRequest.h +++ b/loader/include/Geode/cocos/extensions/network/HttpRequest.h @@ -263,7 +263,7 @@ class CC_DLL CCHttpRequest : public CCObject _connectTimeout = connectTimeout; } -protected: +public: // properties HttpRequestType _requestType; /// kHttpRequestGet, kHttpRequestPost or other enums gd::string _url; /// target url that this request is sent to diff --git a/loader/include/Geode/cocos/extensions/network/HttpResponse.h b/loader/include/Geode/cocos/extensions/network/HttpResponse.h index 30e0b5d7a..6207ac757 100644 --- a/loader/include/Geode/cocos/extensions/network/HttpResponse.h +++ b/loader/include/Geode/cocos/extensions/network/HttpResponse.h @@ -166,7 +166,7 @@ class CC_DLL CCHttpResponse : public CCObject protected: bool initWithRequest(CCHttpRequest* request); - +public: // properties CCHttpRequest* _pHttpRequest; /// the corresponding HttpRequest pointer who leads to this response bool _succeed; /// to indecate if the http reqeust is successful simply diff --git a/loader/include/Geode/cocos/extensions/network/WebSocket.h b/loader/include/Geode/cocos/extensions/network/WebSocket.h index 7a63306b3..a1cdac6d3 100644 --- a/loader/include/Geode/cocos/extensions/network/WebSocket.h +++ b/loader/include/Geode/cocos/extensions/network/WebSocket.h @@ -144,8 +144,8 @@ class WebSocket struct libwebsocket *wsi, enum libwebsocket_callback_reasons reason, void *user, void *in, size_t len); - -private: + +public: State _readyState; gd::string _host; unsigned int _port; diff --git a/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsDebugNode.h b/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsDebugNode.h index fb1722186..9bd083c60 100644 --- a/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsDebugNode.h +++ b/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsDebugNode.h @@ -46,7 +46,7 @@ NS_CC_EXT_BEGIN class CC_DLL CCPhysicsDebugNode : public CCDrawNode { -protected: +public: cpSpace *m_pSpacePtr; public: diff --git a/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsSprite.h b/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsSprite.h index 918d59ee5..c7bec0f51 100644 --- a/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsSprite.h +++ b/loader/include/Geode/cocos/extensions/physics_nodes/CCPhysicsSprite.h @@ -50,7 +50,7 @@ NS_CC_EXT_BEGIN */ class CC_DLL CCPhysicsSprite : public CCSprite { -protected: +public: bool m_bIgnoreBodyRotation; #if CC_ENABLE_CHIPMUNK_INTEGRATION cpBody *m_pCPBody; diff --git a/loader/include/Geode/cocos/extensions/spine/CCSkeleton.h b/loader/include/Geode/cocos/extensions/spine/CCSkeleton.h index 8af7d0b83..f80ad27c1 100644 --- a/loader/include/Geode/cocos/extensions/spine/CCSkeleton.h +++ b/loader/include/Geode/cocos/extensions/spine/CCSkeleton.h @@ -89,9 +89,10 @@ class CC_DLL CCSkeleton: public cocos2d::CCNodeRGBA, public cocos2d::CCBlendProt void setSkeletonData (SkeletonData* skeletonData, bool ownsSkeletonData); cocos2d::CCTextureAtlas* getTextureAtlas (RegionAttachment* regionAttachment) const; -private: +public: bool ownsSkeletonData; Atlas* atlas; +private: void initialize (); }; diff --git a/loader/include/Geode/cocos/extensions/spine/CCSkeletonAnimation.h b/loader/include/Geode/cocos/extensions/spine/CCSkeletonAnimation.h index f933b1cb7..50e603c24 100644 --- a/loader/include/Geode/cocos/extensions/spine/CCSkeletonAnimation.h +++ b/loader/include/Geode/cocos/extensions/spine/CCSkeletonAnimation.h @@ -61,10 +61,11 @@ class CC_DLL CCSkeletonAnimation: public CCSkeleton { protected: CCSkeletonAnimation (); -private: +public: typedef CCSkeleton super; gd::vector stateDatas; +private: void initialize (); }; diff --git a/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h b/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h index 987c2f992..9211e52a3 100644 --- a/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h +++ b/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDelegate.h @@ -74,7 +74,7 @@ class CC_DLL CCKeypadHandler : public CCObject /** allocates a CCKeypadHandler with a delegate */ static CCKeypadHandler* handlerWithDelegate(CCKeypadDelegate *pDelegate); -protected: +public: CCKeypadDelegate* m_pDelegate; }; diff --git a/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDispatcher.h b/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDispatcher.h index 935a5df0a..4dd93a3e5 100644 --- a/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDispatcher.h +++ b/loader/include/Geode/cocos/keypad_dispatcher/CCKeypadDispatcher.h @@ -80,7 +80,7 @@ class CC_DLL CCKeypadDispatcher : public CCObject */ bool dispatchKeypadMSG(ccKeypadMSGType nMsgType); -protected: +public: CCArray* m_pDelegates; bool m_bLocked; diff --git a/loader/include/Geode/cocos/label_nodes/CCLabelAtlas.h b/loader/include/Geode/cocos/label_nodes/CCLabelAtlas.h index 3cc36a548..295bf5c77 100644 --- a/loader/include/Geode/cocos/label_nodes/CCLabelAtlas.h +++ b/loader/include/Geode/cocos/label_nodes/CCLabelAtlas.h @@ -97,7 +97,7 @@ class CC_DLL CCLabelAtlas : public CCAtlasNode, public CCLabelProtocol virtual void draw(); #endif -protected: +public: // string to render gd::string m_sString; // the first char in the charmap diff --git a/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h b/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h index a284f246c..5e0eacce8 100644 --- a/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h +++ b/loader/include/Geode/cocos/label_nodes/CCLabelBMFont.h @@ -296,6 +296,7 @@ class CC_DLL CCLabelBMFont : public CCSpriteBatchNode, public CCLabelProtocol, p protected: virtual void setString(unsigned short *newString, bool needUpdateLabel); +public: // string to render unsigned short* m_sString; diff --git a/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h b/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h index 6bb86c774..047c82697 100644 --- a/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h +++ b/loader/include/Geode/cocos/label_nodes/CCLabelTTF.h @@ -224,7 +224,7 @@ class CC_DLL CCLabelTTF : public CCSprite, public CCLabelProtocol /** set the text definition for this label */ void _updateWithTextDefinition(ccFontDefinition & textDefinition, bool mustUpdateTexture = true); ccFontDefinition _prepareTextDefinition(bool adjustForResolution = false); - +public: /** Dimensions of the label in Points */ CCSize m_tDimensions; /** The alignment of the label */ 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 a180a260c..843dca774 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h @@ -193,7 +193,7 @@ class CC_DLL CCLayer : public CCNode, public CCTouchDelegate, public CCAccelerom inline CCTouchScriptHandlerEntry* getScriptTouchHandlerEntry() { return m_pScriptTouchHandlerEntry; }; inline CCScriptHandlerEntry* getScriptKeypadHandlerEntry() { return m_pScriptKeypadHandlerEntry; }; inline CCScriptHandlerEntry* getScriptAccelerateHandlerEntry() { return m_pScriptAccelerateHandlerEntry; }; -protected: +public: bool m_bTouchEnabled; bool m_bAccelerometerEnabled; bool m_bKeypadEnabled; @@ -202,7 +202,7 @@ class CC_DLL CCLayer : public CCNode, public CCTouchDelegate, public CCAccelerom // @note RobTop Addition bool m_bMouseEnabled; -private: +public: // Script touch events handler CCTouchScriptHandlerEntry* m_pScriptTouchHandlerEntry; CCScriptHandlerEntry* m_pScriptKeypadHandlerEntry; @@ -214,6 +214,7 @@ class CC_DLL CCLayer : public CCNode, public CCTouchDelegate, public CCAccelerom // 2.2 additions int m_uPreviousPriority; // no idea +private: int excuteScriptTouchHandler(int nEventType, CCTouch *pTouch); int excuteScriptTouchHandler(int nEventType, CCSet *pTouches); }; diff --git a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h index d55ec10d1..0ac2f68ca 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h @@ -82,7 +82,7 @@ class CC_DLL CCTransitionScene : public CCScene { GEODE_FRIEND_MODIFY -protected: +public: CCScene * m_pInScene; CCScene * m_pOutScene; float m_fDuration; @@ -138,7 +138,7 @@ class CC_DLL CCTransitionScene : public CCScene class CC_DLL CCTransitionSceneOriented : public CCTransitionScene { GEODE_FRIEND_MODIFY -protected: +public: tOrientation m_eOrientation; @@ -616,7 +616,7 @@ Fade out the outgoing scene and then fade in the incoming scene.''' class CC_DLL CCTransitionFade : public CCTransitionScene { GEODE_FRIEND_MODIFY -protected: +public: ccColor4B m_tColor; diff --git a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionPageTurn.h b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionPageTurn.h index 3f66ebeec..bb461a8e7 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionPageTurn.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionPageTurn.h @@ -49,7 +49,7 @@ is turned on in CCDirector using: class CC_DLL CCTransitionPageTurn : public CCTransitionScene { GEODE_FRIEND_MODIFY -protected: +public: bool m_bBack; diff --git a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionProgress.h b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionProgress.h index a3d1e46d5..1b89ef689 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionProgress.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransitionProgress.h @@ -62,6 +62,7 @@ class CC_DLL CCTransitionProgress : public CCTransitionScene virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture); virtual void setupTransition(); virtual void sceneOrder(); +public: float m_fTo; float m_fFrom; CCScene* m_pSceneToBeModified; diff --git a/loader/include/Geode/cocos/menu_nodes/CCMenu.h b/loader/include/Geode/cocos/menu_nodes/CCMenu.h index 2c41ff236..b46a07da4 100644 --- a/loader/include/Geode/cocos/menu_nodes/CCMenu.h +++ b/loader/include/Geode/cocos/menu_nodes/CCMenu.h @@ -56,6 +56,7 @@ enum { class CC_DLL CCMenu : public CCLayerRGBA { GEODE_FRIEND_MODIFY +public: /** whether or not the menu will receive events */ bool m_bEnabled; @@ -190,6 +191,7 @@ class CC_DLL CCMenu : public CCLayerRGBA protected: CCMenuItem* itemForTouch(CCTouch * touch); CCMenuItem* itemForTouch(CCTouch * touch, bool); +public: tCCMenuState m_eState; CCMenuItem *m_pSelectedItem; }; diff --git a/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h b/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h index 20a8cb635..ee23fa6d3 100644 --- a/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h +++ b/loader/include/Geode/cocos/menu_nodes/CCMenuItem.h @@ -171,7 +171,7 @@ class CC_DLL CCMenuItemLabel : public CCMenuItem */ virtual void setEnabled(bool enabled); -protected: +public: ccColor3B m_tColorBackup; float m_fOriginalScale; }; @@ -265,7 +265,7 @@ class CC_DLL CCMenuItemFont : public CCMenuItemLabel protected: void recreateLabel(); - +public: unsigned int m_uFontSize; gd::string m_strFontName; }; diff --git a/loader/include/Geode/cocos/misc_nodes/CCClippingNode.h b/loader/include/Geode/cocos/misc_nodes/CCClippingNode.h index f9940d833..cb4fefb97 100644 --- a/loader/include/Geode/cocos/misc_nodes/CCClippingNode.h +++ b/loader/include/Geode/cocos/misc_nodes/CCClippingNode.h @@ -41,7 +41,7 @@ NS_CC_BEGIN class CC_DLL CCClippingNode : public CCNode { GEODE_FRIEND_MODIFY -protected: +public: CCNode* m_pStencil; diff --git a/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h b/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h index 6b69ee469..adb92936e 100644 --- a/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h +++ b/loader/include/Geode/cocos/misc_nodes/CCMotionStreak.h @@ -154,7 +154,7 @@ class CC_DLL CCMotionStreak : m_bStartingPositionInitialized = bStartingPositionInitialized; } -protected: +public: bool m_bFastMode; bool m_bStartingPositionInitialized; bool m_bStroke; diff --git a/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h b/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h index c3e8eedf4..544a00f4a 100644 --- a/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h +++ b/loader/include/Geode/cocos/misc_nodes/CCProgressTimer.h @@ -113,7 +113,7 @@ class CC_DLL CCProgressTimer : public CCNodeRGBA void updateColor(void); CCPoint boundaryTexCoord(char index); -protected: +public: CCProgressTimerType m_eType; float m_fPercentage; CCSprite *m_pSprite; diff --git a/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h b/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h index 1e9db9761..ba9dba429 100644 --- a/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h +++ b/loader/include/Geode/cocos/misc_nodes/CCRenderTexture.h @@ -172,7 +172,7 @@ class CC_DLL CCRenderTexture : public CCNode private: void beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue, GLbitfield flags); -protected: +public: GLuint m_uFBO; GLuint m_uDepthRenderBufffer; GLint m_nOldFBO; diff --git a/loader/include/Geode/cocos/particle_nodes/CCParticleBatchNode.h b/loader/include/Geode/cocos/particle_nodes/CCParticleBatchNode.h index 46706b674..6f989046a 100644 --- a/loader/include/Geode/cocos/particle_nodes/CCParticleBatchNode.h +++ b/loader/include/Geode/cocos/particle_nodes/CCParticleBatchNode.h @@ -127,7 +127,7 @@ class CC_DLL CCParticleBatchNode : public CCNode, public CCTextureProtocol void updateBlendFunc(void); /** the texture atlas used for drawing the quads */ CC_SYNTHESIZE(CCTextureAtlas*, m_pTextureAtlas, TextureAtlas); -private: +public: /** the blend function used for drawing the quads */ ccBlendFunc m_tBlendFunc; }; diff --git a/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h b/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h index fe60d137a..464599669 100644 --- a/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h +++ b/loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h @@ -175,7 +175,7 @@ emitter.startSpin = 0; class CC_DLL CCParticleSystem : public CCNode, public CCTextureProtocol { GEODE_FRIEND_MODIFY -protected: +public: gd::string m_sPlistFile; //! time elapsed since the start of the system (in seconds) float m_fElapsed; @@ -408,7 +408,7 @@ class CC_DLL CCParticleSystem : public CCNode, public CCTextureProtocol By default it is false. @since v0.8 */ -protected: +public: bool m_bIsAutoRemoveOnFinish; public: virtual bool isAutoRemoveOnFinish(); @@ -486,7 +486,7 @@ class CC_DLL CCParticleSystem : public CCNode, public CCTextureProtocol protected: virtual void updateBlendFunc(); - +public: // saved/loaded in loadDefaults, loadScaledDefaults and saveDefaults // @note RobTop Addition diff --git a/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h b/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h index c8db4256a..59cd095a7 100644 --- a/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h +++ b/loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h @@ -228,7 +228,7 @@ Special features and Limitations: class CC_DLL CCParticleSystemQuad : public CCParticleSystem { GEODE_FRIEND_MODIFY -protected: +public: ccV3F_C4B_T2F_Quad *m_pQuads; // quads to be rendered GLushort *m_pIndices; // indices diff --git a/loader/include/Geode/cocos/platform/CCFileUtils.h b/loader/include/Geode/cocos/platform/CCFileUtils.h index 8ad4c1928..0d7c6da59 100644 --- a/loader/include/Geode/cocos/platform/CCFileUtils.h +++ b/loader/include/Geode/cocos/platform/CCFileUtils.h @@ -448,7 +448,8 @@ class CC_DLL CCFileUtils : public TypeInfo * @note This method is used internally. */ virtual CCArray* createCCArrayWithContentsOfFile(const gd::string& filename); - + +public: /** Dictionary used to lookup filenames based on a key. * It is used internally by the following methods: * @@ -484,7 +485,8 @@ class CC_DLL CCFileUtils : public TypeInfo * This variable is used for improving the performance of file search. */ gd::map m_fullPathCache; - + +protected: /** * The singleton pointer of CCFileUtils. */ diff --git a/loader/include/Geode/cocos/platform/CCImage.h b/loader/include/Geode/cocos/platform/CCImage.h index 562253407..52596c437 100644 --- a/loader/include/Geode/cocos/platform/CCImage.h +++ b/loader/include/Geode/cocos/platform/CCImage.h @@ -189,7 +189,7 @@ class CC_DLL CCImage : public CCObject bool _saveImageToPNG(const char *pszFilePath, bool bIsToRGB = true); bool _saveImageToJPG(const char *pszFilePath); - +public: unsigned char *m_pData; bool m_bHasAlpha; bool m_bPreMulti; diff --git a/loader/include/Geode/cocos/platform/android/CCAccelerometer.h b/loader/include/Geode/cocos/platform/android/CCAccelerometer.h index d3a69e12a..df36a0367 100644 --- a/loader/include/Geode/cocos/platform/android/CCAccelerometer.h +++ b/loader/include/Geode/cocos/platform/android/CCAccelerometer.h @@ -41,7 +41,7 @@ class CC_DLL CCAccelerometer void setAccelerometerInterval(float interval); void update(float x, float y, float z, long sensorTimeStamp); -private: +public: CCAccelerometerDelegate* m_pAccelDelegate; CCAcceleration m_obAccelerationValue; }; diff --git a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h index a711781ef..f8bf3db4f 100644 --- a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h +++ b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h @@ -230,7 +230,7 @@ class CC_DLL CCKeyboardHandler : public CCObject void setDelegate(CCKeyboardDelegate* pDelegate); -protected: +public: CCKeyboardDelegate* m_pDelegate; }; diff --git a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h index 92bf4b619..1b3e027d2 100644 --- a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h +++ b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h @@ -51,7 +51,7 @@ class CC_DLL CCKeyboardDispatcher : public CCObject this->m_bBlockRepeat = blockRepeat; } -protected: +public: CCArray* m_pDelegates; // 0x34 bool m_bUnknown38; // 0x38 bool m_bUnknown39; // 0x39 diff --git a/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h b/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h index 346382fc7..7b0f2dee0 100644 --- a/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h +++ b/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDelegate.h @@ -38,7 +38,7 @@ class CC_DLL CCMouseHandler : public CCObject void setDelegate(CCMouseDelegate* pDelegate); -protected: +public: CCMouseDelegate* m_pDelegate; }; diff --git a/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDispatcher.h b/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDispatcher.h index a9369a2c1..9432050ef 100644 --- a/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDispatcher.h +++ b/loader/include/Geode/cocos/robtop/mouse_dispatcher/CCMouseDispatcher.h @@ -24,7 +24,7 @@ class CC_DLL CCMouseDispatcher : public CCObject bool dispatchScrollMSG(float x, float y); -protected: +public: CCArray* m_pMouseHandlers; bool m_bLocked; bool m_bToAdd; diff --git a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h index 92ae9a7b8..7e75964a3 100644 --- a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h +++ b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h @@ -43,7 +43,7 @@ class CCLightning : public CCNode, public CCRGBAProtocol { bool isCascadeOpacityEnabled(); void setCascadeColorEnabled(bool); -protected: +public: CCPoint m_strikePoint; CCPoint m_strikePoint2; bool m_split; diff --git a/loader/include/Geode/cocos/script_support/CCScriptSupport.h b/loader/include/Geode/cocos/script_support/CCScriptSupport.h index 50fbd64bf..dd19b7d21 100644 --- a/loader/include/Geode/cocos/script_support/CCScriptSupport.h +++ b/loader/include/Geode/cocos/script_support/CCScriptSupport.h @@ -75,7 +75,7 @@ class CCScriptHandlerEntry : public CCObject newEntryId++; m_nEntryId = newEntryId; } - +public: int m_nHandler; int m_nEntryId; }; @@ -119,7 +119,7 @@ class CCSchedulerScriptHandlerEntry : public CCScriptHandlerEntry { } bool init(float fInterval, bool bPaused); - +public: cocos2d::CCTimer* m_pTimer; bool m_bPaused; bool m_bMarkedForDeletion; @@ -157,7 +157,7 @@ class CCTouchScriptHandlerEntry : public CCScriptHandlerEntry { } bool init(bool bIsMultiTouches, int nPriority, bool bSwallowsTouches); - +public: bool m_bIsMultiTouches; int m_nPriority; bool m_bSwallowsTouches; @@ -287,7 +287,7 @@ class CC_DLL CCScriptEngineManager : m_pScriptEngine(NULL) { } - +public: CCScriptEngineProtocol *m_pScriptEngine; }; diff --git a/loader/include/Geode/cocos/shaders/CCGLProgram.h b/loader/include/Geode/cocos/shaders/CCGLProgram.h index 8aa8f66ce..1f647c03f 100644 --- a/loader/include/Geode/cocos/shaders/CCGLProgram.h +++ b/loader/include/Geode/cocos/shaders/CCGLProgram.h @@ -280,7 +280,7 @@ class CC_DLL CCGLProgram : public CCObject bool compileShader(GLuint * shader, GLenum type, const GLchar* source); const char* logForOpenGLObject(GLuint object, GLInfoFunction infoFunc, GLLogFunction logFunc); -protected: +public: GLuint m_uProgram; GLuint m_uVertShader; GLuint m_uFragShader; diff --git a/loader/include/Geode/cocos/shaders/CCShaderCache.h b/loader/include/Geode/cocos/shaders/CCShaderCache.h index 956c870f1..f097e022a 100644 --- a/loader/include/Geode/cocos/shaders/CCShaderCache.h +++ b/loader/include/Geode/cocos/shaders/CCShaderCache.h @@ -82,7 +82,7 @@ class CC_DLL CCShaderCache : public CCObject private: bool init(); void loadDefaultShader(CCGLProgram *program, int type); - +public: CCDictionary* m_pPrograms; }; diff --git a/loader/include/Geode/cocos/sprite_nodes/CCAnimationCache.h b/loader/include/Geode/cocos/sprite_nodes/CCAnimationCache.h index 1333145ae..52f1178e8 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCAnimationCache.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCAnimationCache.h @@ -104,8 +104,9 @@ class CC_DLL CCAnimationCache : public CCObject private: void parseVersion1(CCDictionary* animations); void parseVersion2(CCDictionary* animations); -private: +public: CCDictionary* m_pAnimations; +private: static CCAnimationCache* s_pSharedAnimationCache; }; diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSprite.h b/loader/include/Geode/cocos/sprite_nodes/CCSprite.h index 401e426d8..fb6f6d840 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSprite.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSprite.h @@ -524,6 +524,7 @@ class CC_DLL CCSprite : public CCNodeRGBA, public CCTextureProtocol virtual void setReorderChildDirtyRecursively(void); virtual void setDirtyRecursively(bool bValue); +public: // // Data used when the sprite is rendered using a CCSpriteSheet // diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h b/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h index 8a2417ede..3c7ee9e1d 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSpriteBatchNode.h @@ -192,7 +192,7 @@ class CC_DLL CCSpriteBatchNode : public CCNode, public CCTextureProtocol void swap(int oldIndex, int newIndex); void updateBlendFunc(); -protected: +public: CCTextureAtlas *m_pobTextureAtlas; ccBlendFunc m_blendFunc; diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h b/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h index 4779d1960..425d2fd71 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrame.h @@ -150,7 +150,7 @@ class CC_DLL CCSpriteFrame : public CCObject gd::string getFrameName() const; void setFrameName(gd::string); -protected: +public: CCPoint m_obOffset; CCSize m_obOriginalSize; CCRect m_obRectInPixels; diff --git a/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrameCache.h b/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrameCache.h index 541cbdf12..722cd6b84 100644 --- a/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrameCache.h +++ b/loader/include/Geode/cocos/sprite_nodes/CCSpriteFrameCache.h @@ -163,7 +163,7 @@ class CC_DLL CCSpriteFrameCache : public CCObject public: CCDictionary* m_pSpriteFrames; CCDictionary* m_pSpriteFramesAliases; - std::set* m_pLoadedFileNames; + gd::set* m_pLoadedFileNames; }; // end of sprite_nodes group diff --git a/loader/include/Geode/cocos/support/CCNotificationCenter.h b/loader/include/Geode/cocos/support/CCNotificationCenter.h index 2d02981a2..ee2c72bff 100644 --- a/loader/include/Geode/cocos/support/CCNotificationCenter.h +++ b/loader/include/Geode/cocos/support/CCNotificationCenter.h @@ -107,7 +107,8 @@ class CC_DLL CCNotificationCenter : public CCObject // Check whether the observer exists by the specified target and name. bool observerExisted(CCObject *target,const char *name); - + +public: // variables // CCArray *m_observers; diff --git a/loader/include/Geode/cocos/support/CCProfiling.h b/loader/include/Geode/cocos/support/CCProfiling.h index 6ee7bc6cf..5556c8a66 100644 --- a/loader/include/Geode/cocos/support/CCProfiling.h +++ b/loader/include/Geode/cocos/support/CCProfiling.h @@ -66,6 +66,7 @@ class CC_DLL CCProfiler : public CCObject /** releases all timers */ void releaseAllTimers(); +public: CCDictionary* m_pActiveTimers; }; /** @@ -83,6 +84,7 @@ class CCProfilingTimer : public CCObject /** resets the timer properties */ void reset(); +public: gd::string m_NameStr; int numberOfCalls; int m_dAverageTime1; diff --git a/loader/include/Geode/cocos/support/component/CCComponent.h b/loader/include/Geode/cocos/support/component/CCComponent.h index 9d6bd8e0c..bec27dfe3 100644 --- a/loader/include/Geode/cocos/support/component/CCComponent.h +++ b/loader/include/Geode/cocos/support/component/CCComponent.h @@ -66,7 +66,7 @@ class CC_DLL CCComponent : public CCObject void setOwner(CCNode *pOwner); CCNode* getOwner() const; -protected: +public: CCNode *m_pOwner; gd::string m_strName; bool m_bEnabled; diff --git a/loader/include/Geode/cocos/support/component/CCComponentContainer.h b/loader/include/Geode/cocos/support/component/CCComponentContainer.h index 48aae02af..7c0e82c65 100644 --- a/loader/include/Geode/cocos/support/component/CCComponentContainer.h +++ b/loader/include/Geode/cocos/support/component/CCComponentContainer.h @@ -57,7 +57,7 @@ class CC_DLL CCComponentContainer private: void alloc(void); -private: +public: CCDictionary *m_pComponents; ///< Dictionary of components CCNode *m_pOwner; diff --git a/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h b/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h index 02db1e722..6d94fedc9 100644 --- a/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h +++ b/loader/include/Geode/cocos/text_input_node/CCTextFieldTTF.h @@ -149,7 +149,7 @@ class CC_DLL CCTextFieldTTF : public CCLabelTTF, public CCIMEDelegate public: virtual void setString(const char *text); virtual const char* getString(void); -protected: +public: gd::string * m_pInputText; // place holder text property @@ -157,13 +157,13 @@ class CC_DLL CCTextFieldTTF : public CCLabelTTF, public CCIMEDelegate public: virtual void setPlaceHolder(const char * text); virtual const char * getPlaceHolder(void); -protected: +public: gd::string * m_pPlaceHolder; ccColor3B m_ColorSpaceHolder; public: virtual void setSecureTextEntry(bool value); virtual bool isSecureTextEntry(); -protected: +public: bool m_bSecureTextEntry; protected: @@ -178,7 +178,7 @@ class CC_DLL CCTextFieldTTF : public CCLabelTTF, public CCIMEDelegate virtual void insertText(const char * text, int len, cocos2d::enumKeyCodes); virtual void deleteBackward(); virtual const char * getContentText(); -private: +public: class LengthStack; LengthStack * m_pLens; public: diff --git a/loader/include/Geode/cocos/textures/CCTexture2D.h b/loader/include/Geode/cocos/textures/CCTexture2D.h index c847a813d..e6e98f880 100644 --- a/loader/include/Geode/cocos/textures/CCTexture2D.h +++ b/loader/include/Geode/cocos/textures/CCTexture2D.h @@ -274,7 +274,7 @@ class CC_DLL CCTexture2D : public CCObject private: bool initPremultipliedATextureWithImage(CCImage * image, unsigned int pixelsWide, unsigned int pixelsHigh); - +public: // By default PVR images are treated as if they don't have the alpha channel premultiplied bool m_bPVRHaveAlphaPremultiplied; diff --git a/loader/include/Geode/cocos/textures/CCTextureAtlas.h b/loader/include/Geode/cocos/textures/CCTextureAtlas.h index 1aa3fddd4..8c986070f 100644 --- a/loader/include/Geode/cocos/textures/CCTextureAtlas.h +++ b/loader/include/Geode/cocos/textures/CCTextureAtlas.h @@ -56,7 +56,7 @@ To render the quads using an interleaved vertex array list, you should modify th class CC_DLL CCTextureAtlas : public CCObject { GEODE_FRIEND_MODIFY -protected: +public: GLushort* m_pIndices; diff --git a/loader/include/Geode/cocos/textures/CCTextureCache.h b/loader/include/Geode/cocos/textures/CCTextureCache.h index 4c0772795..77d7e322c 100644 --- a/loader/include/Geode/cocos/textures/CCTextureCache.h +++ b/loader/include/Geode/cocos/textures/CCTextureCache.h @@ -235,7 +235,7 @@ typedef enum { // if not found, create a new one static VolatileTexture* findVolotileTexture(CCTexture2D *tt); -protected: +public: CCTexture2D *texture; CCImage *uiImage; diff --git a/loader/include/Geode/cocos/textures/CCTextureETC.h b/loader/include/Geode/cocos/textures/CCTextureETC.h index 18b6f0598..585066df5 100644 --- a/loader/include/Geode/cocos/textures/CCTextureETC.h +++ b/loader/include/Geode/cocos/textures/CCTextureETC.h @@ -50,7 +50,7 @@ class CC_DLL CCTextureETC : public CCObject private: bool loadTexture(const char* file); -private: +public: GLuint _name; unsigned int _width; unsigned int _height; diff --git a/loader/include/Geode/cocos/textures/CCTexturePVR.h b/loader/include/Geode/cocos/textures/CCTexturePVR.h index fb7838a4e..b1da9e813 100644 --- a/loader/include/Geode/cocos/textures/CCTexturePVR.h +++ b/loader/include/Geode/cocos/textures/CCTexturePVR.h @@ -126,7 +126,7 @@ class CCTexturePVR : public CCObject bool unpackPVRv3Data(unsigned char* dataPointer, unsigned int dataLength); bool createGLTexture(); -protected: +public: struct CCPVRMipmap m_asMipmaps[CC_PVRMIPMAP_MAX]; // pointer to mipmap images unsigned int m_uNumberOfMipmaps; // number of mipmap used diff --git a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCParallaxNode.h b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCParallaxNode.h index e83d33ac1..a91478752 100644 --- a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCParallaxNode.h +++ b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCParallaxNode.h @@ -71,7 +71,7 @@ class CC_DLL CCParallaxNode : public CCNode virtual void visit(void); private: CCPoint absolutePosition(); -protected: +public: CCPoint m_tLastPosition; }; diff --git a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXLayer.h b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXLayer.h index 2b21e936d..ba26584cd 100644 --- a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXLayer.h +++ b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXLayer.h @@ -200,7 +200,7 @@ class CC_DLL CCTMXLayer : public CCSpriteBatchNode // index unsigned int atlasIndexForExistantZ(unsigned int z); unsigned int atlasIndexForNewZ(int z); -protected: +public: //! name of the layer gd::string m_sLayerName; //! TMX Layer supports opacity diff --git a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXObjectGroup.h b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXObjectGroup.h index 06f8b5dfa..0b691565f 100644 --- a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXObjectGroup.h +++ b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXObjectGroup.h @@ -72,7 +72,7 @@ class CC_DLL CCTMXObjectGroup : public CCObject It will return the 1st object found on the array for the given name. */ CCDictionary* objectNamed(const char *objectName); -protected: +public: /** name of the group */ gd::string m_sGroupName; }; diff --git a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXTiledMap.h b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXTiledMap.h index bd3b7b501..1690b2bdc 100644 --- a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXTiledMap.h +++ b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXTiledMap.h @@ -164,7 +164,7 @@ class CC_DLL CCTMXTiledMap : public CCNode CCTMXLayer * parseLayer(CCTMXLayerInfo *layerInfo, CCTMXMapInfo *mapInfo); CCTMXTilesetInfo * tilesetForLayer(CCTMXLayerInfo *layerInfo, CCTMXMapInfo *mapInfo); void buildWithMapInfo(CCTMXMapInfo* mapInfo); -protected: +public: //! tile properties CCDictionary* m_pTileProperties; diff --git a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h index dce7ed461..3b725cda2 100644 --- a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h +++ b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTMXXMLParser.h @@ -223,7 +223,7 @@ class CC_DLL CCTMXMapInfo : public CCObject, public CCSAXDelegator inline void setTMXFileName(const char *fileName){ m_sTMXFileName = fileName; } private: void internalInit(const char* tmxFileName, const char* resourcePath); -protected: +public: //! tmx filename gd::string m_sTMXFileName; // tmx resource path diff --git a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTileMapAtlas.h b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTileMapAtlas.h index bc207be41..908ee9b17 100644 --- a/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTileMapAtlas.h +++ b/loader/include/Geode/cocos/tilemap_parallax_nodes/CCTileMapAtlas.h @@ -96,7 +96,7 @@ class CC_DLL CCTileMapAtlas : public CCAtlasNode void updateAtlasValueAt(const CCPoint& pos, const ccColor3B& value, unsigned int index); void updateAtlasValues(); -protected: +public: //! x,y to atlas dictionary CCDictionary* m_pPosToAtlasIndex; //! numbers of tiles to render diff --git a/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h b/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h index 9a5d9d286..28d1bae37 100644 --- a/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h +++ b/loader/include/Geode/cocos/touch_dispatcher/CCTouchHandler.h @@ -129,7 +129,7 @@ class CC_DLL CCTargetedTouchHandler : public CCTouchHandler /** allocates a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not */ static CCTargetedTouchHandler* handlerWithDelegate(CCTouchDelegate *pDelegate, int nPriority, bool bSwallow); -protected: +public: bool m_bSwallowsTouches; CCSet *m_pClaimedTouches; }; From 875b7856ccc3f4449c6596df183992d20668d719 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:43:56 -0300 Subject: [PATCH 15/22] update json to 3.2.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f02362b9f..f02e6c72c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,7 @@ endif() set(MAT_JSON_AS_INTERFACE ON) CPMAddPackage("gh:geode-sdk/result@1.3.2") -CPMAddPackage("gh:geode-sdk/json@3.1.5") +CPMAddPackage("gh:geode-sdk/json@3.2.0") CPMAddPackage("gh:fmtlib/fmt#11.0.2") target_compile_definitions(${PROJECT_NAME} INTERFACE MAT_JSON_DYNAMIC=1) From 39b5582e038e1b86061ac83f96c79b3233c89d04 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:27:56 -0300 Subject: [PATCH 16/22] move modtober animation to only show up on modtober tab --- loader/src/ui/mods/ModsLayer.cpp | 9 --------- loader/src/ui/mods/ModsLayer.hpp | 1 - loader/src/ui/mods/list/ModList.cpp | 6 ++++++ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/loader/src/ui/mods/ModsLayer.cpp b/loader/src/ui/mods/ModsLayer.cpp index 2a8504f53..7122079bc 100644 --- a/loader/src/ui/mods/ModsLayer.cpp +++ b/loader/src/ui/mods/ModsLayer.cpp @@ -18,7 +18,6 @@ #include "GeodeStyle.hpp" #include "ui/mods/sources/ModListSource.hpp" #include -#include "events/EventWinnerAnimation.hpp" bool ModsStatusNode::init() { if (!CCNode::init()) @@ -623,14 +622,6 @@ bool ModsLayer::init() { return true; } -void ModsLayer::onEnterTransitionDidFinish() { - CCLayer::onEnterTransitionDidFinish(); - // todo: generic system for this for any contest event - if (!Mod::get()->setSavedValue("shown-modtober-winner", true)) { - this->addChild(EventWinnerAnimation::create()); - } -} - void ModsLayer::gotoTab(ModListSource* src) { // Update selected tab for (auto tab : m_tabs) { diff --git a/loader/src/ui/mods/ModsLayer.hpp b/loader/src/ui/mods/ModsLayer.hpp index e1051bad1..fcf51bef6 100644 --- a/loader/src/ui/mods/ModsLayer.hpp +++ b/loader/src/ui/mods/ModsLayer.hpp @@ -74,7 +74,6 @@ class ModsLayer : public CCLayer, public SetIDPopupDelegate { void keyDown(enumKeyCodes key) override; void keyBackClicked() override; void setIDPopupClosed(SetIDPopup*, int value) override; - void onEnterTransitionDidFinish() override; void onTab(CCObject* sender); void onOpenModsFolder(CCObject*); diff --git a/loader/src/ui/mods/list/ModList.cpp b/loader/src/ui/mods/list/ModList.cpp index e5a94e1d8..503cfef1f 100644 --- a/loader/src/ui/mods/list/ModList.cpp +++ b/loader/src/ui/mods/list/ModList.cpp @@ -5,6 +5,7 @@ #include "../popups/SortPopup.hpp" #include "../GeodeStyle.hpp" #include "../ModsLayer.hpp" +#include "../events/EventWinnerAnimation.hpp" static size_t getDisplayPageSize(ModListSource* src, ModListDisplay display) { if (src->isLocalModsOnly() && Mod::get()->template getSettingValue("infinite-local-mods-list")) { @@ -264,6 +265,11 @@ bool ModList::init(ModListSource* src, CCSize const& size) { auto src = typeinfo_cast(m_source); src && src->getType() == ServerModListType::Modtober24 ) { + // todo: generic system for this for any contest event + if (!Mod::get()->setSavedValue("shown-modtober-winner", true)) { + CCScene::get()->addChild(EventWinnerAnimation::create()); + } + auto menu = CCMenu::create(); menu->setID("modtober-banner"); menu->ignoreAnchorPointForPosition(false); From f1bf2b604dd8b8f8c016a9434d5e1ebb4cf43c81 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:29:42 -0300 Subject: [PATCH 17/22] actually just remove the animation altogether --- loader/src/ui/mods/list/ModList.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/loader/src/ui/mods/list/ModList.cpp b/loader/src/ui/mods/list/ModList.cpp index 503cfef1f..e5a94e1d8 100644 --- a/loader/src/ui/mods/list/ModList.cpp +++ b/loader/src/ui/mods/list/ModList.cpp @@ -5,7 +5,6 @@ #include "../popups/SortPopup.hpp" #include "../GeodeStyle.hpp" #include "../ModsLayer.hpp" -#include "../events/EventWinnerAnimation.hpp" static size_t getDisplayPageSize(ModListSource* src, ModListDisplay display) { if (src->isLocalModsOnly() && Mod::get()->template getSettingValue("infinite-local-mods-list")) { @@ -265,11 +264,6 @@ bool ModList::init(ModListSource* src, CCSize const& size) { auto src = typeinfo_cast(m_source); src && src->getType() == ServerModListType::Modtober24 ) { - // todo: generic system for this for any contest event - if (!Mod::get()->setSavedValue("shown-modtober-winner", true)) { - CCScene::get()->addChild(EventWinnerAnimation::create()); - } - auto menu = CCMenu::create(); menu->setID("modtober-banner"); menu->ignoreAnchorPointForPosition(false); From 961c7c8a4925031f39935d09ec847a6ce20baed3 Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:33:24 +0100 Subject: [PATCH 18/22] add setColor shorthands to CCRGBAProtocol --- .../include/Geode/cocos/include/CCProtocols.h | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/loader/include/Geode/cocos/include/CCProtocols.h b/loader/include/Geode/cocos/include/CCProtocols.h index 8c2d0ba60..1c9069993 100644 --- a/loader/include/Geode/cocos/include/CCProtocols.h +++ b/loader/include/Geode/cocos/include/CCProtocols.h @@ -47,6 +47,27 @@ class CC_DLL CCRGBAProtocol */ virtual void setColor(const ccColor3B& color) = 0; + /** + * Changes the color with R,G,B,A bytes + * + * @param color Example: ccc4(255,100,0,255) means R=255, G=100, B=0, A=255 + * @note Geode addition + */ + inline void setColor(const ccColor4B& color) { + this->setColor(ccColor3B{color.r, color.g, color.b}); + this->setOpacity(color.a); + } + + /** + * Changes the color with R,G,B,A floats + * + * @param color Example: ccc4f(1.0, 0.5, 0.25, 1.0) means R=255, G=127, B=63, A=255 + * @note Geode addition + */ + inline void setColor(const ccColor4F& color) { + this->setColor(ccc4BFromccc4F(color)); + } + /** * Returns color that is currently used. * From 4c9f9909aa46ac622b48cbe5b4a5cb10e678d555 Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:37:08 +0100 Subject: [PATCH 19/22] add log::getCurrentLogPath for getting the path of the current log file --- loader/include/Geode/loader/Log.hpp | 3 +++ loader/src/loader/Log.cpp | 11 ++++++++++- loader/src/loader/LogImpl.hpp | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/loader/include/Geode/loader/Log.hpp b/loader/include/Geode/loader/Log.hpp index 787d7b59b..02318ef2b 100644 --- a/loader/include/Geode/loader/Log.hpp +++ b/loader/include/Geode/loader/Log.hpp @@ -110,6 +110,9 @@ namespace geode { logImpl(Severity::Error, getMod(), str, std::forward(args)...); } + /// Returns the path to the current log file + GEODE_DLL std::filesystem::path const& getCurrentLogPath(); + GEODE_DLL void pushNest(Mod* mod); GEODE_DLL void popNest(Mod* mod); diff --git a/loader/src/loader/Log.cpp b/loader/src/loader/Log.cpp index de3193b05..3546a9b72 100644 --- a/loader/src/loader/Log.cpp +++ b/loader/src/loader/Log.cpp @@ -106,6 +106,10 @@ void log::vlogImpl(Severity sev, Mod* mod, fmt::string_view format, fmt::format_ fmt::vformat(format, args)); } +std::filesystem::path const& log::getCurrentLogPath() { + return Logger::get()->getLogPath(); +} + Log::Log(Severity sev, std::string&& thread, std::string&& source, int32_t nestCount, std::string&& content) : @@ -212,7 +216,8 @@ Logger* Logger::get() { } void Logger::setup() { - m_logStream = std::ofstream(dirs::getGeodeLogDir() / log::generateLogName()); + m_logPath = dirs::getGeodeLogDir() / log::generateLogName(); + m_logStream = std::ofstream(m_logPath); } std::mutex& getLogMutex() { @@ -245,6 +250,10 @@ void Logger::clear() { m_logs.clear(); } +std::filesystem::path const& Logger::getLogPath() const { + return m_logPath; +} + // Misc std::string geode::log::generateLogName() { diff --git a/loader/src/loader/LogImpl.hpp b/loader/src/loader/LogImpl.hpp index 04cc41b46..1d38d3aa1 100644 --- a/loader/src/loader/LogImpl.hpp +++ b/loader/src/loader/LogImpl.hpp @@ -30,6 +30,7 @@ namespace geode::log { private: std::vector m_logs; std::ofstream m_logStream; + std::filesystem::path m_logPath; Logger() = default; public: @@ -42,6 +43,8 @@ namespace geode::log { std::vector const& list(); void clear(); + + std::filesystem::path const& getLogPath() const; }; class Nest::Impl { From 8f60c3c7ae513238de718ec43ac0738bb2ba4c23 Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Mon, 13 Jan 2025 23:25:41 +0100 Subject: [PATCH 20/22] add log auto deletion, fix log file not being created on first launch with geode --- loader/resources/mod.json.in | 15 ++++++++++++-- loader/src/load.cpp | 13 ++++++++++++ loader/src/loader/Log.cpp | 37 ++++++++++++++++++++++++++++++++++- loader/src/loader/LogImpl.hpp | 8 ++++++++ 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/loader/resources/mod.json.in b/loader/resources/mod.json.in index 7ccb494b8..ddef6aaf2 100644 --- a/loader/resources/mod.json.in +++ b/loader/resources/mod.json.in @@ -104,7 +104,10 @@ "default": false, "name": "Show Platform Console", "description": "Show the native console (if one exists). This setting is meant for developers", - "platforms": ["win", "mac"], + "platforms": [ + "win", + "mac" + ], "requires-restart": true }, "server-cache-size-limit": { @@ -114,10 +117,18 @@ "max": 100, "name": "Server Cache Size Limit", "description": "Limits the size of the cache used for loading mods. Higher values result in higher memory usage." + }, + "log-retention-period": { + "type": "int", + "default": 30, + "min": 0, + "max": 365, + "name": "Log Retention Period", + "description": "The number of days to keep logs for. Logs older than this will be deleted every launch. 0 to disable deletion." } }, "issues": { "info": "Post your issues on the Geode Github Repository. Please follow the standard issue format.", "url": "https://github.com/geode-sdk/geode/issues/new" } -} +} \ No newline at end of file diff --git a/loader/src/load.cpp b/loader/src/load.cpp index a2f32f8ce..df0c6d433 100644 --- a/loader/src/load.cpp +++ b/loader/src/load.cpp @@ -179,6 +179,19 @@ int geodeEntry(void* platformData) { crashlog::setupPlatformHandlerPost(); + // delete old log files + + int logMaxAge = Mod::get()->getSettingValue("log-retention-period"); + + // 0 means no deletion + if (logMaxAge > 0) { + // put it in a thread so that it doesn't slow down launch times + std::thread([logMaxAge] { + log::Logger::get()->deleteOldLogs(std::chrono::days{logMaxAge}); + }).detach(); + } + + log::debug("Setting up IPC"); { log::NestScope nest; diff --git a/loader/src/loader/Log.cpp b/loader/src/loader/Log.cpp index 3546a9b72..84d606f3d 100644 --- a/loader/src/loader/Log.cpp +++ b/loader/src/loader/Log.cpp @@ -216,10 +216,45 @@ Logger* Logger::get() { } void Logger::setup() { - m_logPath = dirs::getGeodeLogDir() / log::generateLogName(); + auto logDir = dirs::getGeodeLogDir(); + + // on the first launch, this doesn't exist yet.. + if (!std::filesystem::exists(logDir)) { + std::error_code ec; + std::filesystem::create_directories(logDir, ec); + } + + m_logPath = logDir / log::generateLogName(); m_logStream = std::ofstream(m_logPath); } +void Logger::deleteOldLogs(size_t maxAgeHours) { + auto logDir = dirs::getGeodeLogDir(); + + auto now = std::chrono::file_clock::now(); + + std::error_code ec; + auto iterator = std::filesystem::directory_iterator(logDir, ec); + if (ec != std::error_code{}) { + log::error("Failed to delete old logs: {}", ec.message()); + return; + } + + for (auto const& entry : iterator) { + if (entry.is_regular_file() && entry.path().extension() == ".log") { + auto time = std::filesystem::last_write_time(entry, ec); + if (ec != std::error_code{}) { + continue; + } + + auto diff = now - time; + if (diff > std::chrono::hours(maxAgeHours)) { + std::filesystem::remove(entry, ec); + } + } + } +} + std::mutex& getLogMutex() { static std::mutex mutex; return mutex; diff --git a/loader/src/loader/LogImpl.hpp b/loader/src/loader/LogImpl.hpp index 1d38d3aa1..2bca6a772 100644 --- a/loader/src/loader/LogImpl.hpp +++ b/loader/src/loader/LogImpl.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace geode::log { class Log final { @@ -45,6 +46,13 @@ namespace geode::log { void clear(); std::filesystem::path const& getLogPath() const; + + void deleteOldLogs(size_t maxAgeHours); + + template + void deleteOldLogs(std::chrono::duration const& maxAge) { + this->deleteOldLogs(std::chrono::duration_cast(maxAge).count()); + } }; class Nest::Impl { From 4e3f76451cd18ca950d823c0c9a94d6d20bc9f8a Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Mon, 13 Jan 2025 19:13:43 -0300 Subject: [PATCH 21/22] adjust scale limits on mod title and version labels --- loader/src/ui/mods/list/ModItem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/src/ui/mods/list/ModItem.cpp b/loader/src/ui/mods/list/ModItem.cpp index f7e42fa93..a86c6e54f 100644 --- a/loader/src/ui/mods/list/ModItem.cpp +++ b/loader/src/ui/mods/list/ModItem.cpp @@ -46,12 +46,12 @@ bool ModItem::init(ModSource&& source) { m_titleLabel = CCLabelBMFont::create(m_source.getMetadata().getName().c_str(), "bigFont.fnt"); m_titleLabel->setID("title-label"); - m_titleLabel->setLayoutOptions(AxisLayoutOptions::create()->setScalePriority(1)); + m_titleLabel->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(.3f, std::nullopt)); m_titleContainer->addChild(m_titleLabel); m_versionLabel = CCLabelBMFont::create("", "bigFont.fnt"); m_versionLabel->setID("version-label"); - m_versionLabel->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(std::nullopt, .7f)); + m_versionLabel->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(.5f, .7f)->setScalePriority(1)); m_titleContainer->addChild(m_versionLabel); m_versionDownloadSeparator = CCLabelBMFont::create("•", "bigFont.fnt"); From 5f64d7711283e23762c0859922d367a8b209be9c Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Mon, 13 Jan 2025 19:34:48 -0300 Subject: [PATCH 22/22] only show recommended label for recommended mods, not suggested --- loader/src/loader/Loader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/loader/Loader.cpp b/loader/src/loader/Loader.cpp index b25758503..f22b401cd 100644 --- a/loader/src/loader/Loader.cpp +++ b/loader/src/loader/Loader.cpp @@ -89,7 +89,7 @@ std::vector Loader::getOutdated() const { std::vector Loader::getRecommendations() const { std::vector result; for (auto problem : this->getAllProblems()) { - if (problem.isSuggestion()) { + if (problem.type == LoadProblem::Type::Recommendation) { result.push_back(problem); } }