Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
22 changes: 1 addition & 21 deletions Client/game_sa/C3DMarkersSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,7 @@ C3DMarker* C3DMarkersSA::CreateMarker(DWORD Identifier, T3DMarkerType dwType, CV
DWORD dwFunc = FUNC_PlaceMarker;
DWORD dwReturn = 0;
// clang-format off
__asm
{
push bZCheck // zCheck ##SA##
push 0 // normalZ ##SA##
push 0 // normalY ##SA##
push 0 // normalX ##SA##
push 0 // rotate rate
push fPulseFraction // pulse
push 0 // period
push a // alpha
push b // blue
push g // green
push r // red
push fSize // size
push pVecPosCopy // position (copy to prevent PlaceMarker from corrupting the caller's vector)
push dwType // type
push Identifier // identifier
call dwFunc
mov dwReturn, eax
add esp, 0x3C
}
dwReturn = gta_call_address<decltype(dwReturn)>(dwFunc, Identifier, dwType, pVecPosCopy, fSize, r, g, b, a, 0, fPulseFraction, 0, 0, 0, 0, bZCheck);
// clang-format on

if (dwReturn)
Expand Down
17 changes: 2 additions & 15 deletions Client/game_sa/CAEAudioHardwareSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ bool CAEAudioHardwareSA::IsSoundBankLoaded(short wSoundBankID, short wSoundBankS
DWORD dwFunc = FUNC_CAEAudioHardware__IsSoundBankLoaded;
bool bReturn = false;
// clang-format off
__asm
{
push dwSoundBankSlotID
push dwSoundBankID
mov ecx, dwThis
call dwFunc
mov bReturn, al
}
bReturn = gta_thiscall_address<decltype(bReturn)>(dwFunc, dwThis, dwSoundBankID, dwSoundBankSlotID);
// clang-format on
return bReturn;
}
Expand All @@ -44,12 +37,6 @@ void CAEAudioHardwareSA::LoadSoundBank(short wSoundBankID, short wSoundBankSlotI
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAEAudioHardware__LoadSoundBank;
// clang-format off
__asm
{
push dwSoundBankSlotID
push dwSoundBankID
mov ecx, dwThis
call dwFunc
}
gta_thiscall_address(dwFunc, dwThis, dwSoundBankID, dwSoundBankSlotID);
// clang-format on
}
53 changes: 7 additions & 46 deletions Client/game_sa/CAERadioTrackManagerSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ BYTE CAERadioTrackManagerSA::GetCurrentRadioStationID()
DWORD dwFunc = FUNC_GetCurrentRadioStationID;
BYTE bReturn = 0;
// clang-format off
__asm
{
mov ecx, CLASS_CAERadioTrackManager
call dwFunc
mov bReturn, al
}
bReturn = gta_thiscall_address<decltype(bReturn)>(dwFunc, 0x8CB6F8);
// clang-format on

return bReturn;
Expand All @@ -33,12 +28,7 @@ BYTE CAERadioTrackManagerSA::IsVehicleRadioActive()
DWORD dwFunc = FUNC_IsVehicleRadioActive;
BYTE bReturn = 0;
// clang-format off
__asm
{
mov ecx, CLASS_CAERadioTrackManager
call dwFunc
mov bReturn, al
}
bReturn = gta_thiscall_address<decltype(bReturn)>(dwFunc, 0x8CB6F8);
// clang-format on

return bReturn;
Expand All @@ -50,13 +40,7 @@ char* CAERadioTrackManagerSA::GetRadioStationName(BYTE bStationID)
char* cReturn = 0;
DWORD dwStationID = bStationID;
// clang-format off
__asm
{
mov ecx, CLASS_CAERadioTrackManager
push dwStationID
call dwFunc
mov cReturn, eax
}
cReturn = gta_thiscall_address<decltype(cReturn)>(dwFunc, 0x8CB6F8, dwStationID);
// clang-format on

return cReturn;
Expand All @@ -67,12 +51,7 @@ bool CAERadioTrackManagerSA::IsRadioOn()
DWORD dwFunc = FUNC_IsRadioOn;
bool bReturn = false;
// clang-format off
__asm
{
mov ecx, CLASS_CAERadioTrackManager
call dwFunc
mov bReturn, al
}
bReturn = gta_thiscall_address<decltype(bReturn)>(dwFunc, 0x8CB6F8);
// clang-format on

return bReturn;
Expand All @@ -82,25 +61,15 @@ void CAERadioTrackManagerSA::SetBassSetting(DWORD dwBass)
{
DWORD dwFunc = FUNC_SetBassSetting;
// clang-format off
__asm
{
mov ecx, CLASS_CAERadioTrackManager
push 0x3F800000 // 1.0f
push dwBass
call dwFunc
}
gta_thiscall_address(dwFunc, 0x8CB6F8, dwBass, 0x3F800000);
// clang-format on
}

void CAERadioTrackManagerSA::Reset()
{
DWORD dwFunc = FUNC_Reset;
// clang-format off
__asm
{
mov ecx, CLASS_CAERadioTrackManager
call dwFunc
}
gta_thiscall_address(dwFunc, 0x8CB6F8);
// clang-format on
}

Expand All @@ -110,15 +79,7 @@ void CAERadioTrackManagerSA::StartRadio(BYTE bStationID, BYTE bUnknown)
DWORD dwStationID = bStationID;
DWORD dwUnknown = bUnknown;
// clang-format off
__asm
{
mov ecx, CLASS_CAERadioTrackManager
push 0
push 0
push dwUnknown
push dwStationID
call dwFunc
}
gta_thiscall_address(dwFunc, 0x8CB6F8, dwStationID, dwUnknown, 0, 0);
// clang-format on
}

Expand Down
24 changes: 4 additions & 20 deletions Client/game_sa/CAEVehicleAudioEntitySA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ void CAEVehicleAudioEntitySA::JustGotInVehicleAsDriver()
DWORD dwFunc = FUNC_CAEVehicleAudioEntity__JustGotInVehicleAsDriver;
DWORD dwThis = (DWORD)m_pInterface;
// clang-format off
__asm
{
mov ecx, dwThis
call dwFunc
}
gta_thiscall_address(dwFunc, dwThis);
// clang-format on
}

Expand All @@ -37,11 +33,7 @@ void CAEVehicleAudioEntitySA::JustGotOutOfVehicleAsDriver()
DWORD dwFunc = FUNC_CAEVehicleAudioEntity__JustGotOutOfVehicleAsDriver;
DWORD dwThis = (DWORD)m_pInterface;
// clang-format off
__asm
{
mov ecx, dwThis
call dwFunc
}
gta_thiscall_address(dwFunc, dwThis);
// clang-format on
}

Expand All @@ -50,11 +42,7 @@ void CAEVehicleAudioEntitySA::TurnOnRadioForVehicle()
DWORD dwFunc = FUNC_CAEVehicleAudioEntity__TurnOnRadioForVehicle;
DWORD dwThis = (DWORD)m_pInterface;
// clang-format off
__asm
{
mov ecx, dwThis
call dwFunc
}
gta_thiscall_address(dwFunc, dwThis);
// clang-format on
}

Expand All @@ -66,11 +54,7 @@ void CAEVehicleAudioEntitySA::StopVehicleEngineSound(unsigned char ucSlot)
{
DWORD dwThis = (DWORD)pVehicleSound->m_pSound;
// clang-format off
__asm
{
mov ecx, dwThis
call dwFunc
}
gta_thiscall_address(dwFunc, dwThis);
// clang-format on
}
}
44 changes: 6 additions & 38 deletions Client/game_sa/CAnimBlendAssocGroupSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ CAnimBlendAssociationSAInterface* CAnimBlendAssocGroupSA::CopyAnimation(unsigned
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_CopyAnimation;
// clang-format off
__asm
{
mov ecx, dwThis
push AnimID
call dwFunc
mov pAnimAssociationReturn, eax
}
pAnimAssociationReturn = gta_thiscall_address<decltype(pAnimAssociationReturn)>(dwFunc, dwThis, AnimID);
// clang-format on
return pAnimAssociationReturn;
}
Expand All @@ -46,12 +40,7 @@ void CAnimBlendAssocGroupSA::InitEmptyAssociations(RpClump* pClump)
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_InitEmptyAssociations;
// clang-format off
__asm
{
mov ecx, dwThis
push pClump
call dwFunc
}
gta_thiscall_address(dwFunc, dwThis, pClump);
// clang-format on
}

Expand All @@ -61,12 +50,7 @@ bool CAnimBlendAssocGroupSA::IsCreated()
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_IsCreated;
// clang-format off
__asm
{
mov ecx, dwThis
call dwFunc
mov bReturn, al
}
bReturn = gta_thiscall_address<decltype(bReturn)>(dwFunc, dwThis);
// clang-format on
return bReturn;
}
Expand All @@ -77,12 +61,7 @@ int CAnimBlendAssocGroupSA::GetNumAnimations()
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_GetNumAnimations;
// clang-format off
__asm
{
mov ecx, dwThis
call dwFunc
mov iReturn, eax
}
iReturn = gta_thiscall_address<decltype(iReturn)>(dwFunc, dwThis);
// clang-format on
return iReturn;
}
Expand All @@ -101,13 +80,7 @@ CAnimBlendStaticAssociation* CAnimBlendAssocGroupSA::GetAnimation(unsigned int I
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_GetAnimation;
// clang-format off
__asm
{
mov ecx, dwThis
push ID
call dwFunc
mov pReturn, eax
}
pReturn = gta_thiscall_address<decltype(pReturn)>(dwFunc, dwThis, ID);
// clang-format on
return pReturn;
}
Expand Down Expand Up @@ -135,12 +108,7 @@ void CAnimBlendAssocGroupSA::CreateAssociations(const char* szBlockName)
DWORD dwThis = (DWORD)m_pInterface;
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_CreateAssociations;
// clang-format off
__asm
{
mov ecx, dwThis
push szBlockName
call dwFunc
}
gta_thiscall_address(dwFunc, dwThis, szBlockName);
// clang-format on
}

Expand Down
43 changes: 6 additions & 37 deletions Client/game_sa/CAnimBlendAssociationSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ CAnimBlendAssociationSAInterface* CAnimBlendAssociationSA::Constructor(CAnimBlen
DWORD DwFunc = 0x4CF080;
DWORD DwThisInterface = reinterpret_cast<DWORD>(m_pInterface);
// clang-format off
__asm
{
mov ecx, DwThisInterface
push staticAssociationByReference
call DwFunc
}
gta_thiscall_address(DwFunc, DwThisInterface, staticAssociationByReference);
// clang-format on;
}

Expand All @@ -47,13 +42,7 @@ CAnimBlendAssociationSAInterface* CAnimBlendAssociationSA::Constructor(RpClump*
DWORD DwFunc = 0x4CEFC0;
DWORD DwThisInterface = reinterpret_cast<DWORD>(m_pInterface);
// clang-format off
__asm
{
mov ecx, DwThisInterface
push pAnimHierarchy
push pClump
call DwFunc
}
gta_thiscall_address(DwFunc, DwThisInterface, pClump, pAnimHierarchy);
// clang-format on;
}

Expand Down Expand Up @@ -81,13 +70,7 @@ void CAnimBlendAssociationSA::Init(RpClump* pClump, CAnimBlendHierarchySAInterfa
DWORD DwFunc = 0x4CED50;
DWORD DwThisInterface = reinterpret_cast<DWORD>(m_pInterface);
// clang-format off
__asm
{
mov ecx, DwThisInterface
push pAnimHierarchy
push pClump
call DwFunc
}
gta_thiscall_address(DwFunc, DwThisInterface, pClump, pAnimHierarchy);
// clang-format on;
}

Expand All @@ -96,12 +79,7 @@ void CAnimBlendAssociationSA::AllocateAnimBlendNodeArray(int iCount)
DWORD DwFunc = 0x4CE9F0;
DWORD DwThisInterface = reinterpret_cast<DWORD>(m_pInterface);
// clang-format off
__asm
{
mov ecx, DwThisInterface
push iCount
call DwFunc
}
gta_thiscall_address(DwFunc, DwThisInterface, iCount);
// clang-format on;
}

Expand All @@ -110,11 +88,7 @@ void CAnimBlendAssociationSA::FreeAnimBlendNodeArray()
DWORD DwFunc = 0x4CEA40;
DWORD DwThisInterface = reinterpret_cast<DWORD>(m_pInterface);
// clang-format off
__asm
{
mov ecx, DwThisInterface
call DwFunc
}
gta_thiscall_address(DwFunc, DwThisInterface);
// clang-format on;
}

Expand All @@ -135,11 +109,6 @@ void CAnimBlendAssociationSA::SetCurrentProgress(float fProgress)
DWORD DwFunc = 0x4CEA80;
DWORD DwThisInterface = reinterpret_cast<DWORD>(m_pInterface);
// clang-format off
__asm
{
mov ecx, DwThisInterface
push fTime
call DwFunc
}
gta_thiscall_address(DwFunc, DwThisInterface, fTime);
// clang-format on;
}
Loading
Loading