Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MarathonRecomp/api/Marathon.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@
#include "boost/smart_ptr/make_shared_object.h"
#include "boost/smart_ptr/shared_ptr.h"
#include "stdx/string.h"
#include "SoX/Math/Vector.h"
31 changes: 31 additions & 0 deletions MarathonRecomp/api/SoX/Math/Vector.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include "Marathon.inl"

namespace SoX::Math
{
class Vector2
{
public:
be<float> X;
be<float> Y;
};

class Vector
{
public:
be<float> X;
be<float> Y;
be<float> Z;
be<float> W;
};

class Vector4
{
public:
be<float> X;
be<float> Y;
be<float> Z;
be<float> W;
};
}
31 changes: 31 additions & 0 deletions MarathonRecomp/patches/misc_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,34 @@ bool DisableHints()
{
return !Config::Hints;
}

// Change Y position in Shadow Sonicteam::Player::Object to move it closer to the glider's Y position
PPC_FUNC_IMPL(__imp__sub_8219FAE0);
PPC_FUNC(sub_8219FAE0)
{
struct OBJPlayerSpawnData
{
public:
xpointer<const char> PlayerName;
be<uint32_t> PlayerIndex;
be<uint32_t> PlayerControllerID;
be<uint32_t> CameraActorID;
be<uint32_t> SetupModuleIndex;
be<uint32_t> Unk0x14;
be<uint32_t> Unk0x18;
be<uint32_t> Unk0x1C;
SoX::Math::Vector4 PlayerRotation;
SoX::Math::Vector4 PlayerPosition;
uint32_t PlayerStartRingsCount;
uint32_t PlayerBasedOn;
uint8_t PlayerUnkFlag2;
};

auto pSpawnData = reinterpret_cast<OBJPlayerSpawnData*>(base + ctx.r4.u32);
if (strcmp("shadow_glider.lua", pSpawnData->PlayerName.get()) == 0 && pSpawnData->PlayerPosition.Y.get() == 5626.4f)
{
pSpawnData->PlayerPosition.Y = 5608;
}

__imp__sub_8219FAE0(ctx, base);
}
Loading