diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e562da8..02c57b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,10 @@ jobs: - name: macOS os: macos-latest + - name: iOS + os: macos-latest + target: iOS + - name: Android32 os: ubuntu-latest target: Android32 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fd6a28..2852111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,11 @@ cmake_minimum_required(VERSION 3.21) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS) + set(CMAKE_OSX_ARCHITECTURES "arm64") +else() + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +endif() project(DevTools VERSION 1.0.0) diff --git a/mod.json b/mod.json index e9ab706..dbab282 100644 --- a/mod.json +++ b/mod.json @@ -1,10 +1,11 @@ { - "geode": "4.4.0", + "geode": "4.5.0", "version": "v1.9.1", "gd": { "win": "*", "android": "*", - "mac": "2.2074" + "mac": "2.2074", + "ios": "2.2074" }, "id": "geode.devtools", "name": "DevTools", diff --git a/src/backend.cpp b/src/backend.cpp index 68cd0b0..cf94671 100644 --- a/src/backend.cpp +++ b/src/backend.cpp @@ -260,6 +260,7 @@ void DevTools::renderDrawData(ImDrawData* draw_data) { static float SCROLL_SENSITIVITY = 10; +#ifndef GEODE_IS_IOS class $modify(CCMouseDispatcher) { bool dispatchScrollMSG(float y, float x) { if(!DevTools::get()->isSetup()) return true; @@ -274,6 +275,7 @@ class $modify(CCMouseDispatcher) { return true; } }; +#endif class $modify(CCTouchDispatcher) { void touches(CCSet* touches, CCEvent* event, unsigned int type) { diff --git a/src/pages/Advanced.cpp b/src/pages/Advanced.cpp index b7eb159..ccf0661 100644 --- a/src/pages/Advanced.cpp +++ b/src/pages/Advanced.cpp @@ -12,7 +12,7 @@ void DevTools::drawAdvancedSettings() { void DevTools::drawModGraph() { // TODO: function to get loader mod - this->drawModGraphNode(Mod::get()->getMetadata().getDependencies()[0].mod); + this->drawModGraphNode(Mod::get()->getMetadataRef().getDependencies()[0].mod); } namespace { @@ -175,7 +175,7 @@ void DevTools::drawModGraphNode(Mod* node) { if (!treeNode) return; - node->setMetadata(this->inputMetadata(node, node->getMetadata())); + node->setMetadata(this->inputMetadata(node, node->getMetadataRef())); ImGui::Text("isInternal: %s", node->isInternal() ? "true" : "false"); ImGui::Text("early: %s", node->needsEarlyLoad() ? "true" : "false"); diff --git a/src/platform/Mac.mm b/src/platform/Mac.mm index da6df32..6a28dcb 100644 --- a/src/platform/Mac.mm +++ b/src/platform/Mac.mm @@ -1,6 +1,6 @@ #include -#ifdef GEODE_IS_MACOS +#if defined(GEODE_IS_MACOS) || defined(GEODE_IS_IOS) #include "utils.hpp" diff --git a/src/platform/platform.cpp b/src/platform/platform.cpp index 6a7f9d3..6088a7f 100644 --- a/src/platform/platform.cpp +++ b/src/platform/platform.cpp @@ -51,8 +51,9 @@ ImVec2 GLRenderCtx::size() const { } bool GLRenderCtx::begin() { - // save currently bound fbo + // save currently bound fbo and rbo glGetIntegerv(GL_FRAMEBUFFER_BINDING, &m_prevDrawBuffer); + glGetIntegerv(GL_RENDERBUFFER_BINDING, &m_prevReadBuffer); if (!m_buffer) { glGenFramebuffers(1, &m_buffer); @@ -76,6 +77,8 @@ bool GLRenderCtx::begin() { 0,GL_RGB, GL_UNSIGNED_BYTE, 0 ); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); } @@ -106,7 +109,8 @@ bool GLRenderCtx::begin() { void GLRenderCtx::end() { - // bind the framebuffer that was bound before us + // bind the renderbuffer and framebuffer that was bound before us + glBindRenderbuffer(GL_RENDERBUFFER, m_prevReadBuffer); glBindFramebuffer(GL_FRAMEBUFFER, m_prevDrawBuffer); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); //glFlush(); diff --git a/src/platform/platform.hpp b/src/platform/platform.hpp index ac4b352..1e6e2f6 100644 --- a/src/platform/platform.hpp +++ b/src/platform/platform.hpp @@ -3,8 +3,10 @@ #include #include #include -#ifdef __APPLE__ +#if defined(GEODE_IS_MACOS) #include +#elif defined(GEODE_IS_IOS) +#include #endif ImRect& getGDWindowRect();