mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
uncomment some stuff
This commit is contained in:
parent
4294177be6
commit
86de5ff7dd
8 changed files with 65 additions and 66 deletions
|
@ -96,7 +96,7 @@ if (PROJECT_IS_TOP_LEVEL AND NOT GEODE_BUILDING_DOCS)
|
|||
set(TULIP_LINK_SOURCE ON)
|
||||
endif()
|
||||
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
|
||||
CPMAddPackage("gh:geode-sdk/TulipHook#5959b87")
|
||||
CPMAddPackage("gh:geode-sdk/TulipHook#5ba74ed")
|
||||
set(CMAKE_WARN_DEPRECATED ON CACHE BOOL "" FORCE)
|
||||
|
||||
# Silence warnings from dependencies
|
||||
|
|
|
@ -123,7 +123,7 @@ std::string generateAddressHeader(Root const& root) {
|
|||
else if (codegen::shouldAndroidBind(fn)) {
|
||||
auto const mangled = generateAndroidSymbol(c, fn);
|
||||
address_str = fmt::format( // thumb
|
||||
"reinterpret_cast<uintptr_t>(dlsym(reinterpret_cast<void*>(geode::base::get()), \"{}\")) + 1",
|
||||
"reinterpret_cast<uintptr_t>(dlsym(dlopen(\"libcocos2dcpp.so\", RTLD_NOW), \"{}\"))",
|
||||
mangled
|
||||
);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,6 @@ void CCFileUtils::updatePaths() {
|
|||
|
||||
struct FileUtilsUpdatePaths : Modify<FileUtilsUpdatePaths, CCFileUtils> {
|
||||
static CCFileUtils* sharedFileUtils() {
|
||||
log::debug("im here");
|
||||
static bool doAddPaths = true;
|
||||
auto ret = CCFileUtils::sharedFileUtils();
|
||||
|
||||
|
|
|
@ -29,12 +29,6 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
|
|||
|
||||
// hook
|
||||
bool init(bool fromReload) {
|
||||
if (!fromReload) {
|
||||
LoaderImpl::get()->addSearchPaths();
|
||||
}
|
||||
|
||||
CCFileUtils::get()->updatePaths();
|
||||
|
||||
if (!LoadingLayer::init(fromReload)) return false;
|
||||
|
||||
auto winSize = CCDirector::sharedDirector()->getWinSize();
|
||||
|
@ -49,6 +43,8 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
|
|||
}
|
||||
|
||||
void setupLoadingMods() {
|
||||
CCFileUtils::get()->updatePaths();
|
||||
|
||||
if (Loader::get()->getLoadingState() != Loader::LoadingState::Done) {
|
||||
this->updateLoadedModsLabel();
|
||||
this->waitLoadAssets();
|
||||
|
@ -59,6 +55,8 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
|
|||
}
|
||||
|
||||
void setupLoaderResources() {
|
||||
LoaderImpl::get()->addSearchPaths();
|
||||
|
||||
// verify loader resources
|
||||
if (!LoaderImpl::get()->verifyLoaderResources()) {
|
||||
this->setSmallText("Downloading Loader Resources");
|
||||
|
@ -112,7 +110,7 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
|
|||
}
|
||||
|
||||
int getTotalStep() {
|
||||
return 18;
|
||||
return 17;
|
||||
}
|
||||
|
||||
void updateLoadingBar() {
|
||||
|
@ -141,23 +139,29 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
|
|||
}
|
||||
|
||||
// hook
|
||||
void loadAssets() {
|
||||
switch (m_fields->m_geodeLoadStep) {
|
||||
case 0:
|
||||
if (this->skipOnRefresh()) this->setupLoadingMods();
|
||||
break;
|
||||
case 1:
|
||||
if (this->skipOnRefresh()) this->setupLoaderResources();
|
||||
break;
|
||||
case 2:
|
||||
this->setupModResources();
|
||||
break;
|
||||
case 3:
|
||||
default:
|
||||
this->setSmallText("Loading game resources");
|
||||
LoadingLayer::loadAssets();
|
||||
break;
|
||||
}
|
||||
void loadAssets() {
|
||||
log::debug("Load step {}", this->getCurrentStep());
|
||||
if (m_loadStep == 14) {
|
||||
switch (m_fields->m_geodeLoadStep) {
|
||||
case 0:
|
||||
if (this->skipOnRefresh()) this->setupLoadingMods();
|
||||
break;
|
||||
case 1:
|
||||
if (this->skipOnRefresh()) this->setupLoaderResources();
|
||||
break;
|
||||
case 2:
|
||||
this->setupModResources();
|
||||
break;
|
||||
case 3:
|
||||
default:
|
||||
LoadingLayer::loadAssets();
|
||||
this->updateLoadingBar();
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
this->setSmallText("Loading game resources");
|
||||
LoadingLayer::loadAssets();
|
||||
this->updateLoadingBar();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -6,8 +6,6 @@ using namespace geode::prelude;
|
|||
|
||||
struct FunctionQueue : Modify<FunctionQueue, CCScheduler> {
|
||||
void update(float dt) {
|
||||
log::debug("Scheduler update");
|
||||
|
||||
LoaderImpl::get()->executeGDThreadQueue();
|
||||
return CCScheduler::update(dt);
|
||||
}
|
||||
|
|
|
@ -6,26 +6,26 @@
|
|||
// ignoreAnchorPointForPosition which causes the content size of
|
||||
// text input nodes to be way off
|
||||
|
||||
// struct $modify(CCTextInputNode) {
|
||||
// bool init(float width, float height, const char* caption, const char* thonburi, int maxCharCount, const char* font) {
|
||||
// if (!CCTextInputNode::init(width, height, caption, thonburi, maxCharCount, font))
|
||||
// return false;
|
||||
struct $modify(CCTextInputNode) {
|
||||
bool init(float width, float height, const char* caption, const char* thonburi, int maxCharCount, const char* font) {
|
||||
if (!CCTextInputNode::init(width, height, caption, thonburi, maxCharCount, font))
|
||||
return false;
|
||||
|
||||
// this->ignoreAnchorPointForPosition(false);
|
||||
// this->fixPosition();
|
||||
this->ignoreAnchorPointForPosition(false);
|
||||
this->fixPosition();
|
||||
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
// void fixPosition() {
|
||||
// if (!m_bIgnoreAnchorPointForPosition && m_placeholderLabel) {
|
||||
// this->setAnchorPoint(m_placeholderLabel->getAnchorPoint());
|
||||
// m_placeholderLabel->setPosition(m_obContentSize * m_obAnchorPoint);
|
||||
// }
|
||||
// }
|
||||
void fixPosition() {
|
||||
if (!m_bIgnoreAnchorPointForPosition && m_placeholderLabel) {
|
||||
this->setAnchorPoint(m_placeholderLabel->getAnchorPoint());
|
||||
m_placeholderLabel->setPosition(m_obContentSize * m_obAnchorPoint);
|
||||
}
|
||||
}
|
||||
|
||||
// void updateLabel(gd::string text) {
|
||||
// CCTextInputNode::updateLabel(text);
|
||||
// this->fixPosition();
|
||||
// }
|
||||
// };
|
||||
void updateLabel(gd::string text) {
|
||||
CCTextInputNode::updateLabel(text);
|
||||
this->fixPosition();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -87,8 +87,6 @@ Result<> Loader::Impl::setup() {
|
|||
|
||||
this->createDirectories();
|
||||
|
||||
// this->addSearchPaths();
|
||||
|
||||
this->refreshModGraph();
|
||||
|
||||
m_isSetup = true;
|
||||
|
@ -97,8 +95,8 @@ Result<> Loader::Impl::setup() {
|
|||
}
|
||||
|
||||
void Loader::Impl::addSearchPaths() {
|
||||
// CCFileUtils::get()->addPriorityPath(dirs::getGeodeResourcesDir().string().c_str());
|
||||
// CCFileUtils::get()->addPriorityPath(dirs::getModRuntimeDir().string().c_str());
|
||||
CCFileUtils::get()->addPriorityPath(dirs::getGeodeResourcesDir().string().c_str());
|
||||
CCFileUtils::get()->addPriorityPath(dirs::getModRuntimeDir().string().c_str());
|
||||
}
|
||||
|
||||
void Loader::Impl::updateResources() {
|
||||
|
@ -218,7 +216,7 @@ void Loader::Impl::updateModResources(Mod* mod) {
|
|||
if (mod != Mod::get()) {
|
||||
// geode.loader resource is stored somewhere else, which is already added anyway
|
||||
auto searchPathRoot = dirs::getModRuntimeDir() / mod->getID() / "resources";
|
||||
// CCFileUtils::get()->addSearchPath(searchPathRoot.string().c_str());
|
||||
CCFileUtils::get()->addSearchPath(searchPathRoot.string().c_str());
|
||||
}
|
||||
|
||||
// only thing needs previous setup is spritesheets
|
||||
|
@ -232,19 +230,19 @@ void Loader::Impl::updateModResources(Mod* mod) {
|
|||
log::debug("Adding sheet {}", sheet);
|
||||
auto png = sheet + ".png";
|
||||
auto plist = sheet + ".plist";
|
||||
// auto ccfu = CCFileUtils::get();
|
||||
auto ccfu = CCFileUtils::get();
|
||||
|
||||
// if (png == std::string(ccfu->fullPathForFilename(png.c_str(), false)) ||
|
||||
// plist == std::string(ccfu->fullPathForFilename(plist.c_str(), false))) {
|
||||
// log::warn(
|
||||
// R"(The resource dir of "{}" is missing "{}" png and/or plist files)",
|
||||
// mod->getID(), sheet
|
||||
// );
|
||||
// }
|
||||
// else {
|
||||
// CCTextureCache::get()->addImage(png.c_str(), false);
|
||||
// CCSpriteFrameCache::get()->addSpriteFramesWithFile(plist.c_str());
|
||||
// }
|
||||
if (png == std::string(ccfu->fullPathForFilename(png.c_str(), false)) ||
|
||||
plist == std::string(ccfu->fullPathForFilename(plist.c_str(), false))) {
|
||||
log::warn(
|
||||
R"(The resource dir of "{}" is missing "{}" png and/or plist files)",
|
||||
mod->getID(), sheet
|
||||
);
|
||||
}
|
||||
else {
|
||||
CCTextureCache::get()->addImage(png.c_str(), false);
|
||||
CCSpriteFrameCache::get()->addSpriteFramesWithFile(plist.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace {
|
|||
}
|
||||
|
||||
void Loader::Impl::platformMessageBox(char const* title, std::string const& info) {
|
||||
// cocos2d::CCMessageBox(info.c_str(), title);
|
||||
cocos2d::CCMessageBox(info.c_str(), title);
|
||||
}
|
||||
|
||||
void Loader::Impl::logConsoleMessageWithSeverity(std::string const& msg, Severity severity) {
|
||||
|
|
Loading…
Reference in a new issue