Merge branch 'main' of github.com:geode-sdk/geode

This commit is contained in:
matcool 2023-12-23 11:00:52 -03:00
commit a3ce94cdaf
14 changed files with 73 additions and 21 deletions

View file

@ -8,7 +8,11 @@ if (NOT DEFINED GEODE_TARGET_PLATFORM)
elseif(WIN32) elseif(WIN32)
set(GEODE_TARGET_PLATFORM "Win32") set(GEODE_TARGET_PLATFORM "Win32")
elseif(ANDROID) elseif(ANDROID)
set(GEODE_TARGET_PLATFORM "Android") if (ANDROID_ABI STREQUAL "arm64-v8a")
set(GEODE_TARGET_PLATFORM "Android64")
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
set(GEODE_TARGET_PLATFORM "Android32")
endif()
else() else()
message(FATAL_ERROR "Unable to detect platform, please set GEODE_TARGET_PLATFORM in the root CMake file.") message(FATAL_ERROR "Unable to detect platform, please set GEODE_TARGET_PLATFORM in the root CMake file.")
endif() endif()
@ -25,6 +29,7 @@ if (GEODE_TARGET_PLATFORM STREQUAL "iOS")
OSX_ARCHITECTURES arm64 OSX_ARCHITECTURES arm64
) )
set(GEODE_OUTPUT_NAME "GeodeIOS")
set(GEODE_PLATFORM_BINARY "GeodeIOS.dylib") set(GEODE_PLATFORM_BINARY "GeodeIOS.dylib")
elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS") elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS")
set_target_properties(${PROJECT_NAME} PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES
@ -55,6 +60,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS")
-DCommentType=CommentTypeDummy -DCommentType=CommentTypeDummy
) )
set(GEODE_OUTPUT_NAME "Geode")
set(GEODE_PLATFORM_BINARY "Geode.dylib") set(GEODE_PLATFORM_BINARY "Geode.dylib")
elseif (GEODE_TARGET_PLATFORM STREQUAL "Win32") elseif (GEODE_TARGET_PLATFORM STREQUAL "Win32")
@ -75,19 +81,39 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "Win32")
) )
# Windows links against .lib and not .dll # Windows links against .lib and not .dll
set(GEODE_OUTPUT_NAME "Geode")
set(GEODE_PLATFORM_BINARY "Geode.lib") set(GEODE_PLATFORM_BINARY "Geode.lib")
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android") elseif (GEODE_TARGET_PLATFORM STREQUAL "Android32")
set_target_properties(${PROJECT_NAME} PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES
SYSTEM_NAME Android SYSTEM_NAME Android
) )
target_link_libraries(${PROJECT_NAME} INTERFACE target_link_libraries(${PROJECT_NAME} INTERFACE
${GEODE_LOADER_PATH}/include/link/android/libcurl.a ${GEODE_LOADER_PATH}/include/link/android32/libcurl.a
${GEODE_LOADER_PATH}/include/link/android/libssl.a ${GEODE_LOADER_PATH}/include/link/android32/libssl.a
${GEODE_LOADER_PATH}/include/link/android/libcrypto.a ${GEODE_LOADER_PATH}/include/link/android32/libcrypto.a
${GEODE_LOADER_PATH}/include/link/android/libcocos2dcpp.so ${GEODE_LOADER_PATH}/include/link/android32/libcocos2dcpp.so
log log
) )
set(GEODE_PLATFORM_BINARY "Geode.so") set(GEODE_OUTPUT_NAME "Geode.v7")
set(GEODE_PLATFORM_BINARY "Geode.v7.so")
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android64")
set_target_properties(${PROJECT_NAME} PROPERTIES
SYSTEM_NAME Android
)
target_link_libraries(${PROJECT_NAME} INTERFACE
${GEODE_LOADER_PATH}/include/link/android64/libcurl.a
${GEODE_LOADER_PATH}/include/link/android64/libssl.a
${GEODE_LOADER_PATH}/include/link/android64/libcrypto.a
${GEODE_LOADER_PATH}/include/link/android64/libcocos2dcpp.so
log
)
set(GEODE_OUTPUT_NAME "Geode.v8")
set(GEODE_PLATFORM_BINARY "Geode.v8.so")
else()
message(FATAL_ERROR "Unknown platform ${GEODE_TARGET_PLATFORM}")
endif() endif()

View file

@ -117,7 +117,7 @@ make_directory("${GEODE_BIN_PATH}/nightly")
# Prevent SDK from activating a loader build # Prevent SDK from activating a loader build
set_target_properties(${PROJECT_NAME} PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES
PREFIX "" PREFIX ""
OUTPUT_NAME "Geode" OUTPUT_NAME ${GEODE_OUTPUT_NAME}
# i'm going to say a slur that not a single soul has uttered in the last 200 years # i'm going to say a slur that not a single soul has uttered in the last 200 years
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${GEODE_BIN_PATH}/nightly" LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${GEODE_BIN_PATH}/nightly"
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${GEODE_BIN_PATH}/nightly" RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${GEODE_BIN_PATH}/nightly"

View file

@ -56,14 +56,32 @@
#define GEODE_ANDROID(...) __VA_ARGS__ #define GEODE_ANDROID(...) __VA_ARGS__
#define GEODE_IS_ANDROID #define GEODE_IS_ANDROID
#define GEODE_IS_MOBILE #define GEODE_IS_MOBILE
#define GEODE_PLATFORM_NAME "Android"
#define GEODE_CALL #define GEODE_CALL
#define GEODE_CDECL_CALL #define GEODE_CDECL_CALL
#define GEODE_PLATFORM_EXTENSION ".so"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "android"
#define CC_TARGET_OS_ANDROID #define CC_TARGET_OS_ANDROID
#if defined(__arm__)
#define GEODE_ANDROID32(...) __VA_ARGS__
#define GEODE_ANDROID64(...)
#define GEODE_IS_ANDROID32
#define GEODE_PLATFORM_NAME "Android32"
#define GEODE_PLATFORM_EXTENSION ".v7.so"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "android32"
#elif defined(__aarch64__)
#define GEODE_ANDROID32(...)
#define GEODE_ANDROID64(...) __VA_ARGS__
#define GEODE_IS_ANDROID64
#define GEODE_PLATFORM_NAME "Android64"
#define GEODE_PLATFORM_EXTENSION ".v8.so"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "android64"
#else
#define GEODE_ANDROID32(...)
#define GEODE_ANDROID64(...)
#endif
#else #else
#define GEODE_ANDROID(...) #define GEODE_ANDROID(...)
#define GEODE_ANDROID32(...)
#define GEODE_ANDROID64(...)
#endif #endif
#ifndef GEODE_PLATFORM_NAME #ifndef GEODE_PLATFORM_NAME

View file

@ -99,7 +99,8 @@ namespace geode {
Windows, Windows,
MacOS, MacOS,
iOS, iOS,
Android, Android32,
Android64,
Linux, Linux,
}; };
@ -149,7 +150,8 @@ namespace geode {
case Windows: return "Windows"; case Windows: return "Windows";
case MacOS: return "MacOS"; case MacOS: return "MacOS";
case iOS: return "iOS"; case iOS: return "iOS";
case Android: return "Android"; case Android32: return "Android32";
case Android64: return "Android64";
case Linux: return "Linux"; case Linux: return "Linux";
default: break; default: break;
} }
@ -189,6 +191,8 @@ namespace std {
#define GEODE_PLATFORM_TARGET PlatformID::MacOS #define GEODE_PLATFORM_TARGET PlatformID::MacOS
#elif defined(GEODE_IS_IOS) #elif defined(GEODE_IS_IOS)
#define GEODE_PLATFORM_TARGET PlatformID::iOS #define GEODE_PLATFORM_TARGET PlatformID::iOS
#elif defined(GEODE_IS_ANDROID) #elif defined(GEODE_IS_ANDROID32)
#define GEODE_PLATFORM_TARGET PlatformID::Android #define GEODE_PLATFORM_TARGET PlatformID::Android32
#elif defined(GEODE_IS_ANDROID64)
#define GEODE_PLATFORM_TARGET PlatformID::Android64
#endif #endif

View file

@ -12,7 +12,7 @@ $execute {
(void)Mod::get()->patch( (void)Mod::get()->patch(
reinterpret_cast<void*>(base::get() + 0x603948), toByteArray(&cast::typeinfoCastInternal) reinterpret_cast<void*>(base::get() + 0x603948), toByteArray(&cast::typeinfoCastInternal)
); );
#elif defined(GEODE_IS_ANDROID) #elif defined(GEODE_IS_ANDROID32)
(void)Mod::get()->addHook(reinterpret_cast<void*>(base::get() + (0x720348 - 0x10000) + 1), &cast::typeinfoCastInternal, "__dynamic_cast"); (void)Mod::get()->addHook(reinterpret_cast<void*>(base::get() + (0x720348 - 0x10000) + 1), &cast::typeinfoCastInternal, "__dynamic_cast");
#endif #endif

View file

@ -1,6 +1,6 @@
#include <crashlog.hpp> #include <crashlog.hpp>
#ifdef GEODE_IS_ANDROID #ifdef GEODE_IS_ANDROID32
using namespace geode::prelude; using namespace geode::prelude;

View file

@ -1,7 +1,7 @@
#include <Geode/c++stl/gdstdlib.hpp> #include <Geode/c++stl/gdstdlib.hpp>
#include "../../c++stl/string-impl.hpp" #include "../../c++stl/string-impl.hpp"
#ifdef GEODE_IS_ANDROID #ifdef GEODE_IS_ANDROID32
// 2.2 addition // 2.2 addition
// zmx please fix this // zmx please fix this

View file

@ -35,10 +35,13 @@ bool SearchFilterPopup::setup(ModListLayer* layer, ModListType type) {
platformBG->setScale(.5f); platformBG->setScale(.5f);
m_mainLayer->addChild(platformBG); m_mainLayer->addChild(platformBG);
// TODO: add scrolllayer
this->enable(this->addPlatformToggle("Windows", PlatformID::Windows, pos), type); this->enable(this->addPlatformToggle("Windows", PlatformID::Windows, pos), type);
this->enable(this->addPlatformToggle("macOS", PlatformID::MacOS, pos), type); this->enable(this->addPlatformToggle("macOS", PlatformID::MacOS, pos), type);
//this->enable(this->addPlatformToggle("IOS", PlatformID::iOS, pos), type); //this->enable(this->addPlatformToggle("IOS", PlatformID::iOS, pos), type);
this->enable(this->addPlatformToggle("Android", PlatformID::Android, pos), type); this->enable(this->addPlatformToggle("Android32", PlatformID::Android32, pos), type);
this->enable(this->addPlatformToggle("Android64", PlatformID::Android64, pos), type);
// show installed // show installed

View file

@ -11,7 +11,8 @@ PlatformID PlatformID::from(const char* str) {
case hash("windows"): return PlatformID::Windows; case hash("windows"): return PlatformID::Windows;
case hash("macos"): return PlatformID::MacOS; case hash("macos"): return PlatformID::MacOS;
case hash("ios"): return PlatformID::iOS; case hash("ios"): return PlatformID::iOS;
case hash("android"): return PlatformID::Android; case hash("android32"): return PlatformID::Android32;
case hash("android64"): return PlatformID::Android64;
case hash("linux"): return PlatformID::Linux; case hash("linux"): return PlatformID::Linux;
} }
} }

View file

@ -1,6 +1,6 @@
#include "Common.hpp" #include "Common.hpp"
#ifdef GEODE_IS_ANDROID #ifdef GEODE_IS_ANDROID32
using namespace geode::prelude; using namespace geode::prelude;