From d91dfd3bf6081b07a615d5b83e57c0d2448c4f6d Mon Sep 17 00:00:00 2001 From: thesillydoggo Date: Fri, 6 Nov 2026 12:48:26 +1100 Subject: [PATCH 1/3] add blending support --- mod.json | 2 +- src/DevTools.hpp | 1 + src/pages/Attributes.cpp | 68 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/mod.json b/mod.json index 6fbbccb..e251c4a 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "5.11.2", + "geode": "6.0.0-alpha.1", "version": "v1.14.0", "gd": { "win": "2.2091", diff --git a/src/DevTools.hpp b/src/DevTools.hpp index dbcdb38..6225f93 100644 --- a/src/DevTools.hpp +++ b/src/DevTools.hpp @@ -101,6 +101,7 @@ class DevTools { void drawLabelAttributes(CCNode* node); void drawAxisGapAttribute(CCNode* node); void drawTextureAttributes(CCNode* node); + void drawBlendingAttributes(CCNode* node); void drawMenuItemAttributes(CCNode* node); void drawLayoutOptionsAttributes(CCNode* node); void drawLayoutAttributes(CCNode* node); diff --git a/src/pages/Attributes.cpp b/src/pages/Attributes.cpp index 80eb888..8eb6380 100644 --- a/src/pages/Attributes.cpp +++ b/src/pages/Attributes.cpp @@ -49,6 +49,7 @@ void DevTools::drawNodeAttributes(CCNode* node) { ImGui::NewLine(); drawTextureAttributes(node); + drawBlendingAttributes(node); drawMenuItemAttributes(node); setUsedAPI(false); @@ -349,6 +350,73 @@ void DevTools::drawTextureAttributes(CCNode* node) { } } +void DevTools::drawBlendingAttributes(CCNode* node) { + if (auto nineSlice = typeinfo_cast(node)) { + node = nineSlice->getBatchNode(); + } + if (auto blendProtocol = typeinfo_cast(node)) { + const std::unordered_map blend_map = { + { GL_ZERO, "GL_ZERO" }, + { GL_ONE, "GL_ONE" }, + { GL_SRC_COLOR, "GL_SRC_COLOR" }, + { GL_ONE_MINUS_SRC_COLOR, "GL_ONE_MINUS_SRC_COLOR" }, + { GL_DST_COLOR, "GL_DST_COLOR" }, + { GL_ONE_MINUS_DST_COLOR, "GL_ONE_MINUS_DST_COLOR" }, + { GL_SRC_ALPHA, "GL_SRC_ALPHA" }, + { GL_ONE_MINUS_SRC_ALPHA, "GL_ONE_MINUS_SRC_ALPHA" }, + { GL_DST_ALPHA, "GL_DST_ALPHA" }, + { GL_ONE_MINUS_DST_ALPHA, "GL_ONE_MINUS_DST_ALPHA" }, + { GL_CONSTANT_COLOR, "GL_CONSTANT_COLOR" }, + { GL_ONE_MINUS_CONSTANT_COLOR, "GL_ONE_MINUS_CONSTANT_COLOR" }, + { GL_CONSTANT_ALPHA, "GL_CONSTANT_ALPHA" }, + { GL_ONE_MINUS_CONSTANT_ALPHA, "GL_ONE_MINUS_CONSTANT_ALPHA" }, + { GL_SRC_ALPHA_SATURATE, "GL_SRC_ALPHA_SATURATE" }, + { GL_SRC1_COLOR, "GL_SRC1_COLOR" }, + { GL_ONE_MINUS_SRC1_COLOR, "GL_ONE_MINUS_SRC1_COLOR" }, + { GL_SRC1_ALPHA, "GL_SRC1_ALPHA" }, + { GL_ONE_MINUS_SRC1_ALPHA, "GL_ONE_MINUS_SRC1_ALPHA" }, + }; + + auto func = blendProtocol->getBlendFunc(); + bool changed = false; + + if (ImGui::BeginCombo("Src", blend_map.at(func.src))) { + for (auto& item : blend_map) { + if (ImGui::Selectable(item.second, item.first == func.src)) { + func.src = item.first; + changed = true; + } + + if (item.first == func.src) + ImGui::SetItemDefaultFocus(); + } + + ImGui::EndCombo(); + } + + if (ImGui::BeginCombo("Dst", blend_map.at(func.dst))) { + for (auto& item : blend_map) { + if (ImGui::Selectable(item.second, item.first == func.dst)) { + func.dst = item.first; + changed = true; + } + + if (item.first == func.dst) + ImGui::SetItemDefaultFocus(); + } + + ImGui::EndCombo(); + } + + if (changed) + blendProtocol->setBlendFunc(func); + + ImGui::NewLine(); + ImGui::Separator(); + ImGui::NewLine(); + } +} + void DevTools::drawMenuItemAttributes(CCNode* node) { if (auto menuItemNode = typeinfo_cast(node)) { const auto selector = menuItemNode->m_pfnSelector; From de3cb6cd26044c3c152909e6cfc77d8e9e75973d Mon Sep 17 00:00:00 2001 From: thesillydoggo Date: Fri, 6 Nov 2026 13:03:35 +1100 Subject: [PATCH 2/3] i forgot mobile doesnt have full opengl --- src/pages/Attributes.cpp | 4 ---- src/pages/Memory.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pages/Attributes.cpp b/src/pages/Attributes.cpp index bfb3c80..b1da255 100644 --- a/src/pages/Attributes.cpp +++ b/src/pages/Attributes.cpp @@ -428,10 +428,6 @@ void DevTools::drawBlendingAttributes(CCNode* node) { { GL_CONSTANT_ALPHA, "GL_CONSTANT_ALPHA" }, { GL_ONE_MINUS_CONSTANT_ALPHA, "GL_ONE_MINUS_CONSTANT_ALPHA" }, { GL_SRC_ALPHA_SATURATE, "GL_SRC_ALPHA_SATURATE" }, - { GL_SRC1_COLOR, "GL_SRC1_COLOR" }, - { GL_ONE_MINUS_SRC1_COLOR, "GL_ONE_MINUS_SRC1_COLOR" }, - { GL_SRC1_ALPHA, "GL_SRC1_ALPHA" }, - { GL_ONE_MINUS_SRC1_ALPHA, "GL_ONE_MINUS_SRC1_ALPHA" }, }; auto func = blendProtocol->getBlendFunc(); diff --git a/src/pages/Memory.cpp b/src/pages/Memory.cpp index 99fc1f1..d7631ba 100644 --- a/src/pages/Memory.cpp +++ b/src/pages/Memory.cpp @@ -257,7 +257,7 @@ std::optional findStdString(SafePtr ptr) { data = reinterpret_cast(ptr.read_ptr().as_ptr()); } #elif defined(GEODE_IS_ANDROID) - static gd::string emptyStdString; + static std::string emptyStdString; auto internalData = ptr.read_ptr(); if (!internalData.addr) return {}; auto size = (internalData - (3 * sizeof(void*))).read(); From 028a7f1c0effcf71947f3e58047003e953e475da Mon Sep 17 00:00:00 2001 From: thesillydoggo Date: Sat, 7 Nov 2026 08:15:01 +1100 Subject: [PATCH 3/3] make static for mat --- src/pages/Attributes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Attributes.cpp b/src/pages/Attributes.cpp index b1da255..ce52c0d 100644 --- a/src/pages/Attributes.cpp +++ b/src/pages/Attributes.cpp @@ -412,7 +412,7 @@ void DevTools::drawBlendingAttributes(CCNode* node) { node = nineSlice->getBatchNode(); } if (auto blendProtocol = typeinfo_cast(node)) { - const std::unordered_map blend_map = { + static const std::unordered_map blend_map = { { GL_ZERO, "GL_ZERO" }, { GL_ONE, "GL_ONE" }, { GL_SRC_COLOR, "GL_SRC_COLOR" },