Add CI for member tests, fix PlayerObject

also adds some offsets for windows
This commit is contained in:
matcool 2022-12-30 23:10:16 -03:00 committed by mat
parent 78f934e91e
commit 09b127527b
4 changed files with 69 additions and 31 deletions

58
.github/workflows/test-offsets.yml vendored Normal file
View file

@ -0,0 +1,58 @@
name: Test Offsets
on:
workflow_dispatch:
push:
branches:
- '**' # every branch
- '!no-build-**' # unless marked as no-build
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: Windows
os_identifier: win
os: windows-2019
prefixes: ''
extra_flags: -A win32 -DGEODE_DEBUG=On
- name: macOS
os_identifier: mac
os: macos-latest
prefixes: PATH="/usr/local/opt/ccache/libexec:$PATH"
extra_flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DGEODE_DEBUG=On
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
if: matrix.config.os_identifier == 'win'
- name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.config.os }}
- name: Configure CMake
run: >
${{ matrix.config.prefixes }} cmake -B
${{ github.workspace }}/build
${{ matrix.config.extra_flags }}
-D GEODE_DISABLE_CLI_CALLS=ON
-D CMAKE_C_COMPILER_LAUNCHER=ccache
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build member test
run: |
cd build
cmake --build . --config RelWithDebInfo --parallel --target TestMembers

View file

@ -74,7 +74,9 @@ class AnimatedShopKeeper : CCAnimatedSprite {
bool m_unknown; bool m_unknown;
} }
class AnimatedSpriteDelegate {} class AnimatedSpriteDelegate {
virtual void animationFinished(const char*);
}
class AppDelegate : cocos2d::CCApplication { class AppDelegate : cocos2d::CCApplication {
void bgScale() = mac 0x3aaab0; void bgScale() = mac 0x3aaab0;
@ -4702,34 +4704,6 @@ class PlayerObject : GameObject, AnimatedSpriteDelegate {
void runRotateAction() = win 0x1e9bf0; void runRotateAction() = win 0x1e9bf0;
void runBallRotation() = win 0x1e9d10; void runBallRotation() = win 0x1e9d10;
// HardStreak* waveStreak = mac 0x600;
// double speed = mac 0x608;
// double gravity = mac 0x618;
// bool inPlayLayer = mac 0x62c;
// GJRobotSprite* robotSprite = mac 0x6a8;
// GJSpiderSprite* spiderSprite = mac 0x6b0;
// bool isHolding = mac 0x745;
// bool hasJustHeld = mac 0x746;
// double yAccel = mac 0x760;
// bool isShip = mac 0x770;
// bool isBird = mac 0x771;
// bool isBall = mac 0x772;
// bool isDart = mac 0x773;
// bool isRobot = mac 0x774;
// bool isSpider = mac 0x775;
// bool upsideDown = mac 0x776;
// bool dead = mac 0x777;
// bool onGround = mac 0x778;
// float vehicleSize = mac 0x77c;
// cocos2d::CCPoint lastPortalLocation = mac 0x78c;
// bool isSliding = mac 0x7a0;
// bool isRising = mac 0x7a1;
// cocos2d::CCPoint lastHitGround = mac 0x7a4;
// GameObject* lastPortal = mac 0x7b8;
// cocos2d::_ccColor3B col1 = mac 0x7c2;
// cocos2d::_ccColor3B col2 = mac 0x7c5;
// float xPos = mac 0x7c8;
// float yPos = mac 0x7cc;
PAD = mac 0x18, win 0x14; PAD = mac 0x18, win 0x14;
bool m_unk480; bool m_unk480;
cocos2d::CCNode* m_unk484; cocos2d::CCNode* m_unk484;
@ -4755,7 +4729,6 @@ class PlayerObject : GameObject, AnimatedSpriteDelegate {
cocos2d::CCSprite* m_unk500; cocos2d::CCSprite* m_unk500;
cocos2d::CCSprite* m_vehicleSpriteWhitener; cocos2d::CCSprite* m_vehicleSpriteWhitener;
cocos2d::CCSprite* m_vehicleGlow; cocos2d::CCSprite* m_vehicleGlow;
PAD = mac 0x8; // idk about windows
cocos2d::CCMotionStreak* m_regularTrail; cocos2d::CCMotionStreak* m_regularTrail;
HardStreak* m_waveTrail; HardStreak* m_waveTrail;
double m_xAccel; double m_xAccel;

View file

@ -18,7 +18,7 @@ struct MemberIsOffsetBy<Difference, Class, Member, true> {
template <class Member, class Class, int Offset, int Expected> template <class Member, class Class, int Offset, int Expected>
struct SingleChecker { struct SingleChecker {
using IsOffsetBy = MemberIsOffsetBy<Expected - Offset, Class, Member, Expected == Offset>; using IsOffsetBy = MemberIsOffsetBy<Offset - Expected, Class, Member, Expected == Offset>;
}; };
#define GEODE_MEMBER_CHECK(Class_, Member_, Offset_) class Member_; SingleChecker<Member_, Class_, offsetof(Class_, Member_), Offset_>::IsOffsetBy GEODE_CONCAT(OffsetBy, __LINE__) #define GEODE_MEMBER_CHECK(Class_, Member_, Offset_) class Member_; SingleChecker<Member_, Class_, offsetof(Class_, Member_), Offset_>::IsOffsetBy GEODE_CONCAT(OffsetBy, __LINE__)

View file

@ -2,4 +2,11 @@
#ifdef GEODE_IS_WINDOWS #ifdef GEODE_IS_WINDOWS
GEODE_MEMBER_CHECK(GameObject, m_effectPlistName, 0x278);
GEODE_MEMBER_CHECK(GameObject, m_effectManager, 0x454);
GEODE_MEMBER_CHECK(PlayerObject, m_unk484, 0x484);
GEODE_MEMBER_CHECK(PlayerObject, m_ghostTrail, 0x4E4);
GEODE_MEMBER_CHECK(PlayerObject, m_waveTrail, 0x514);
#endif #endif