This commit is contained in:
altalk23 2022-10-10 11:22:16 +03:00
commit e6065b210f
9 changed files with 36 additions and 227 deletions
bindings
loader
include/Geode
lilac

View file

@ -1121,7 +1121,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
cocos2d::CCArray* getSelectedObjects() = mac 0x23f30, win 0x86900, ios 0x0;
bool init(LevelEditorLayer*) = mac 0x8ae0, win 0x76310, ios 0x0;
virtual bool ccTouchBegan(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x2ed60, win 0x907b0, ios 0x0;
virtual void ccTouchMoved(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x2f3d0, win 0x0, ios 0x0;
virtual void ccTouchMoved(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x2f3d0, win 0x90cd0, ios 0x0;
virtual void ccTouchEnded(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x2fb00, win 0x911a0, ios 0x0;
virtual void keyDown(cocos2d::enumKeyCodes) = mac 0x30790, win 0x91a30, ios 0x0;
CreateMenuItem* menuItemFromObjectString(gd::string, int) = mac 0x1e130, win 0x84d00;
@ -1168,6 +1168,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
void editObject2(cocos2d::CCObject* sender) = mac 0x0, win 0x8d1b0, ios 0x0;
void editGroup(cocos2d::CCObject* sender) = mac 0x0, win 0x8d720, ios 0x0;
void moveObjectCall(cocos2d::CCObject* sender) = mac 0x29830, win 0x8db30, ios 0x0;
void moveObjectCall(EditCommand command) = mac 0x0, win 0x8db30, ios 0x0;
void transformObjectCall(cocos2d::CCObject* sender) = mac 0x29860, win 0x8def0, ios 0x0;
void onDelete(cocos2d::CCObject* sender) = mac 0x1b3d0, win 0x7b8d0;
void onDeleteSelected(cocos2d::CCObject* sender) = mac 0xb990, win 0x7bf50, ios 0x0;

View file

@ -4,7 +4,7 @@
#include "callconv.hpp"
#include "common.hpp"
#include "function.hpp"
#include "preproc.hpp"
#include "../platform/platform.hpp"
#include "defaultconv.hpp"
namespace geode::core::meta {}

View file

@ -1,73 +0,0 @@
#ifndef GEODE_CORE_META_PREPROC_HPP
#define GEODE_CORE_META_PREPROC_HPP
#if !defined(GEODE_CALL)
// Windows
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#define GEODE_WINDOWS(...) __VA_ARGS__
#define GEODE_IS_WINDOWS
#define GEODE_IS_DESKTOP
#define GEODE_PLATFORM_NAME "Windows"
#define GEODE_PLATFORM_TARGET PlatformID::Windows
#define GEODE_CALL __stdcall
#define GEODE_PLATFORM_EXTENSION ".dll"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "win"
#else
#define GEODE_WINDOWS(...)
#endif
// Darwin
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#define GEODE_MACOS(...)
#define GEODE_IOS(...) __VA_ARGS__
#define GEODE_IS_IOS
#define GEODE_IS_MOBILE
#define GEODE_PLATFORM_NAME "iOS"
#define GEODE_PLATFORM_TARGET PlatformID::iOS
#define GEODE_PLATFORM_EXTENSION ".ios.dylib"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "ios"
#else
#define GEODE_IOS(...)
#define GEODE_MACOS(...) __VA_ARGS__
#define GEODE_IS_MACOS
#define GEODE_IS_DESKTOP
#define GEODE_PLATFORM_NAME "MacOS"
#define GEODE_PLATFORM_TARGET PlatformID::MacOS
#define GEODE_PLATFORM_EXTENSION ".dylib"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "mac"
#endif
#define GEODE_CALL
#else
#define GEODE_MACOS(...)
#define GEODE_IOS(...)
#endif
// Android
#if defined(__ANDROID__)
#define GEODE_ANDROID(...) __VA_ARGS__
#define GEODE_IS_ANDROID
#define GEODE_IS_MOBILE
#define GEODE_PLATFORM_NAME "Android"
#define GEODE_PLATFORM_TARGET PlatformID::Android
#define GEODE_CALL
#define GEODE_PLATFORM_EXTENSION ".so"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "android"
#else
#define GEODE_ANDROID(...)
#endif
#ifndef GEODE_PLATFORM_NAME
#error "Unsupported PlatformID!"
#endif
#ifdef GEODE_EXPORTING
#define GEODE_DLL GEODE_WINDOWS(__declspec(dllexport))
#else
#define GEODE_DLL GEODE_WINDOWS(__declspec(dllimport))
#endif
#define GEODE_API GEODE_WINDOWS() // idk where this is
#endif
#endif /* GEODE_CORE_META_PREPROC_HPP */

View file

@ -1,10 +1,7 @@
#pragma once
#include <functional>
#if defined(GEODE_CALL)
#undef GEODE_CALL
#endif
#include "cplatform.h"
namespace geode {
class PlatformID {
@ -70,20 +67,13 @@ namespace std {
#endif
// Windows
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#ifdef GEODE_IS_WINDOWS
#define GEODE_WINDOWS(...) __VA_ARGS__
#define GEODE_IS_WINDOWS
#define GEODE_IS_DESKTOP
#define GEODE_PLATFORM_NAME "Windows"
#define GEODE_PLATFORM_TARGET PlatformID::Windows
#define GEODE_CALL __stdcall
#define GEODE_HIDDEN
#define GEODE_DUPABLE __forceinline
#define GEODE_VIRTUAL_CONSTEXPR
#define GEODE_NOINLINE __declspec(noinline)
#define GEODE_PLATFORM_EXTENSION ".dll"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "win"
#ifdef GEODE_EXPORTING
#define GEODE_DLL __declspec(dllexport)
@ -96,56 +86,13 @@ namespace std {
#include "windows.hpp"
#else
#define GEODE_WINDOWS(...)
#endif
#elif defined(GEODE_IS_MACOS)
// MacOS / iOS
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#define GEODE_MACOS(...)
#define GEODE_IOS(...) __VA_ARGS__
#define GEODE_IS_IOS
#define GEODE_IS_MOBILE
#define GEODE_PLATFORM_NAME "iOS"
#define GEODE_PLATFORM_TARGET PlatformID::iOS
#define GEODE_CALL
#define GEODE_HIDDEN __attribute__((visibility("hidden")))
#define GEODE_DUPABLE __attribute__((always_inline))
#define GEODE_VIRTUAL_CONSTEXPR constexpr
#define GEODE_NOINLINE __attribute__((noinline))
#define GEODE_PLATFORM_EXTENSION ".ios.dylib"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "ios"
#ifdef GEODE_EXPORTING
#define GEODE_DLL __attribute__((visibility("default")))
#else
#define GEODE_DLL
#endif
#define GEODE_API extern "C" __attribute__((visibility("default")))
#define GEODE_EXPORT __attribute__((visibility("default")))
#include "ios.hpp"
#else
#define GEODE_IOS(...)
#define GEODE_MACOS(...) __VA_ARGS__
#define GEODE_IS_MACOS
#define GEODE_IS_DESKTOP
#define GEODE_PLATFORM_NAME "MacOS"
#define GEODE_PLATFORM_TARGET PlatformID::MacOS
#define GEODE_CALL
#define GEODE_HIDDEN __attribute__((visibility("hidden")))
#define GEODE_DUPABLE __attribute__((always_inline))
#define GEODE_VIRTUAL_CONSTEXPR constexpr
#define GEODE_NOINLINE __attribute__((noinline))
#define GEODE_PLATFORM_EXTENSION ".dylib"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "mac"
#ifdef GEODE_EXPORTING
#define GEODE_DLL __attribute__((visibility("default")))
@ -157,28 +104,33 @@ namespace std {
#define GEODE_EXPORT __attribute__((visibility("default")))
#include "macos.hpp"
#endif
#else
#define GEODE_IOS(...)
#define GEODE_MACOS(...)
#elif defined(GEODE_IS_IOS)
#endif
// Android
#if defined(__ANDROID__)
#define GEODE_ANDROID(...) __VA_ARGS__
#define GEODE_IS_ANDROID
#define GEODE_IS_MOBILE
#define GEODE_PLATFORM_NAME "Android"
#define GEODE_PLATFORM_TARGET PlatformID::Android
#define GEODE_CALL
#define GEODE_PLATFORM_TARGET PlatformID::iOS
#define GEODE_HIDDEN __attribute__((visibility("hidden")))
#define GEODE_DUPABLE __attribute__((always_inline))
#define GEODE_VIRTUAL_CONSTEXPR constexpr
#define GEODE_NOINLINE __attribute__((noinline))
#ifdef GEODE_EXPORTING
#define GEODE_DLL __attribute__((visibility("default")))
#else
#define GEODE_DLL
#endif
#define GEODE_API extern "C" __attribute__((visibility("default")))
#define GEODE_EXPORT __attribute__((visibility("default")))
#include "ios.hpp"
#elif defined(GEODE_IS_ANDROID)
#define GEODE_PLATFORM_TARGET PlatformID::Android
#define GEODE_HIDDEN __attribute__((visibility("hidden")))
#define GEODE_DUPABLE __attribute__((always_inline))
#define GEODE_VIRTUAL_CONSTEXPR constexpr
#define GEODE_NOINLINE __attribute__((noinline))
#define GEODE_PLATFORM_EXTENSION ".so"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "android"
#ifdef GEODE_EXPORTING
#define GEODE_DLL __attribute__((visibility("default")))
@ -189,12 +141,10 @@ namespace std {
#define GEODE_API extern "C" __attribute__((visibility("default")))
#define GEODE_EXPORT __attribute__((visibility("default")))
#include "windows.hpp"
#include "android.hpp"
#else
#define GEODE_ANDROID(...)
#endif
#ifndef GEODE_PLATFORM_NAME
#error "Unsupported PlatformID!"
#error "Unsupported Platform!"
#endif

View file

@ -11,9 +11,12 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory("test")
endif()
message(STATUS ${GEODE_LOADER_PATH}/include)
target_include_directories(
lilac_hook INTERFACE
${lilac_SOURCE_DIR}/include/geode
${lilac_SOURCE_DIR}/include/geode/core
${lilac_SOURCE_DIR}/include/geode/core/hook
${GEODE_LOADER_PATH}/include
)

View file

@ -1,7 +1,7 @@
#ifndef GEODE_CORE_HOOK_HPP
#define GEODE_CORE_HOOK_HPP
#include "../meta/preproc.hpp"
#include <Geode/platform/platform.hpp>
#include <cstddef>

View file

@ -5,7 +5,7 @@
#include "common.hpp"
#include "function.hpp"
#include "hook.hpp"
#include "preproc.hpp"
#include <Geode/platform/platform.hpp>
#if defined(LILAC_IS_WINDOWS)
#include "cdecl.hpp"

View file

@ -1,73 +0,0 @@
#ifndef LILAC_CORE_META_PREPROC_HPP
#define LILAC_CORE_META_PREPROC_HPP
#if !defined(GEODE_CALL)
// Windows
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#define GEODE_WINDOWS(...) __VA_ARGS__
#define GEODE_IS_WINDOWS
#define GEODE_IS_DESKTOP
#define GEODE_PLATFORM_NAME "Windows"
#define GEODE_PLATFORM_TARGET PlatformID::Windows
#define GEODE_CALL __stdcall
#define GEODE_PLATFORM_EXTENSION ".dll"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "win"
#else
#define GEODE_WINDOWS(...)
#endif
// Darwin
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#define GEODE_MACOS(...)
#define GEODE_IOS(...) __VA_ARGS__
#define GEODE_IS_IOS
#define GEODE_IS_MOBILE
#define GEODE_PLATFORM_NAME "iOS"
#define GEODE_PLATFORM_TARGET PlatformID::iOS
#define GEODE_PLATFORM_EXTENSION ".ios.dylib"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "ios"
#else
#define GEODE_IOS(...)
#define GEODE_MACOS(...) __VA_ARGS__
#define GEODE_IS_MACOS
#define GEODE_IS_DESKTOP
#define GEODE_PLATFORM_NAME "MacOS"
#define GEODE_PLATFORM_TARGET PlatformID::MacOS
#define GEODE_PLATFORM_EXTENSION ".dylib"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "mac"
#endif
#define GEODE_CALL
#else
#define GEODE_MACOS(...)
#define GEODE_IOS(...)
#endif
// Android
#if defined(__ANDROID__)
#define GEODE_ANDROID(...) __VA_ARGS__
#define GEODE_IS_ANDROID
#define GEODE_IS_MOBILE
#define GEODE_PLATFORM_NAME "Android"
#define GEODE_PLATFORM_TARGET PlatformID::Android
#define GEODE_CALL
#define GEODE_PLATFORM_EXTENSION ".so"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "android"
#else
#define GEODE_ANDROID(...)
#endif
#ifndef GEODE_PLATFORM_NAME
#error "Unsupported PlatformID!"
#endif
#ifdef GEODE_EXPORTING
#define GEODE_DLL GEODE_WINDOWS(__declspec(dllexport))
#else
#define GEODE_DLL GEODE_WINDOWS(__declspec(dllimport))
#endif
#define GEODE_API GEODE_WINDOWS() // idk where this is
#endif
#endif /* LILAC_CORE_META_PREPROC_HPP */

View file

@ -30,6 +30,7 @@ target_compile_features(lilac_hook PUBLIC cxx_std_17)
target_include_directories(lilac_hook
PRIVATE
${lilac_SOURCE_DIR}/include/geode/core/hook
${GEODE_LOADER_PATH}/include
INTERFACE
$<BUILD_INTERFACE:${lilac_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${lilac_SOURCE_DIR}/include/geode>