Skip to content

Commit 60e29ed

Browse files
authored
Merge branch 'master' into shadow
2 parents d8fb3f7 + 09699dc commit 60e29ed

File tree

73 files changed

+2297
-1542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2297
-1542
lines changed

Client/game_sa/CCameraSA.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,3 +443,18 @@ float CCameraSA::GetShakeForce()
443443
CCameraSAInterface* pCameraInterface = GetInterface();
444444
return pCameraInterface->m_fCamShakeForce;
445445
}
446+
447+
void CCameraSA::ShakeCamera(float radius, float x, float y, float z) noexcept
448+
{
449+
DWORD dwFunc = FUNC_ShakeCam;
450+
CCameraSAInterface* cameraInterface = GetInterface();
451+
_asm
452+
{
453+
mov ecx, cameraInterface
454+
push z
455+
push y
456+
push x
457+
push radius
458+
call dwFunc
459+
}
460+
}

Client/game_sa/CCameraSA.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define FUNC_GetFading 0x50ADE0
2828
#define FUNC_Fade 0x50AC20
2929
#define FUNC_SetFadeColour 0x50BF00
30+
#define FUNC_ShakeCam 0x50A9F0
3031

3132
#define VAR_CameraRotation 0xB6F178 // used for controling where the player faces
3233
#define VAR_VehicleCameraView 0xB6F0DC
@@ -426,4 +427,6 @@ class CCameraSA : public CCamera
426427
void RestoreLastGoodState();
427428
void SetShakeForce(float fShakeForce);
428429
float GetShakeForce();
430+
431+
void ShakeCamera(float radius, float x, float y, float z) noexcept override;
429432
};

Client/mods/deathmatch/logic/CClient3DMarker.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,11 @@ void CClient3DMarker::DoPulse()
102102
}
103103
}
104104
}
105+
106+
void CClient3DMarker::SetColor(const SColor& color) noexcept
107+
{
108+
m_Color = color;
109+
110+
if (!m_ignoreAlphaLimits && m_dwType == MARKER3D_ARROW)
111+
m_Color.A = 255;
112+
}

Client/mods/deathmatch/logic/CClient3DMarker.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ class CClient3DMarker : public CClientMarkerCommon
4545
void SetVisible(bool bVisible) { m_bVisible = bVisible; };
4646

4747
SColor GetColor() const { return m_Color; }
48-
void SetColor(const SColor& color) { m_Color = color; }
48+
void SetColor(const SColor& color) noexcept;
4949

5050
float GetSize() const { return m_fSize; };
5151
void SetSize(float fSize) { m_fSize = fSize; };
5252

5353
float GetPulseFraction() { return static_cast<float>(m_pMarker->GetPulseFraction()); };
5454
void SetPulseFraction(float fFraction) { m_pMarker->SetPulseFraction(fFraction); };
5555

56+
void SetIgnoreAlphaLimits(bool ignore) noexcept { m_ignoreAlphaLimits = ignore; };
57+
bool AreAlphaLimitsIgnored() const noexcept override { return m_ignoreAlphaLimits; };
58+
5659
protected:
5760
void StreamIn();
5861
void StreamOut();
@@ -70,4 +73,5 @@ class CClient3DMarker : public CClientMarkerCommon
7073
C3DMarker* m_pMarker;
7174
unsigned int m_ulIdentifier;
7275
bool m_bMarkerStreamedIn;
76+
bool m_ignoreAlphaLimits;
7377
};

Client/mods/deathmatch/logic/CClientCamera.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,3 +634,8 @@ void CClientCamera::SetGtaMatrix(const CMatrix& matInNew, CCam* pCam) const
634634
*pCam->GetFront() = matNew.vFront;
635635
*pCam->GetSource() = matNew.vPos;
636636
}
637+
638+
void CClientCamera::ShakeCamera(float radius, float x, float y, float z) noexcept
639+
{
640+
m_pCamera->ShakeCamera(radius, x, y, z);
641+
}

Client/mods/deathmatch/logic/CClientCamera.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class CClientCamera final : public CClientEntity
6464
void SetFocusToLocalPlayer();
6565
void Reset();
6666

67+
void ShakeCamera(float radius, float x, float y, float z) noexcept;
68+
6769
void SetCameraVehicleViewMode(eVehicleCamMode eMode);
6870
void SetCameraPedViewMode(ePedCamMode eMode);
6971
eVehicleCamMode GetCameraVehicleViewMode();

Client/mods/deathmatch/logic/CClientCheckpoint.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ CClientCheckpoint::CClientCheckpoint(CClientMarker* pThis)
2222
m_bStreamedIn = false;
2323
m_bVisible = true;
2424
m_uiIcon = CClientCheckpoint::ICON_NONE;
25-
m_Color = SColorRGBA(255, 0, 0, 255);
25+
m_Color = SColorRGBA(255, 0, 0, 128);
2626
m_fSize = 4.0f;
2727
m_dwType = CHECKPOINT_EMPTYTUBE;
2828
m_vecDirection.fX = 1.0f;
2929
m_bHasTarget = false;
30+
m_ignoreAlphaLimits = false;
3031
m_TargetArrowColor = SColorRGBA(255, 64, 64, 255);
3132
m_TargetArrowSize = m_fSize * 0.625f;
3233
}
@@ -250,8 +251,14 @@ void CClientCheckpoint::SetColor(const SColor& color)
250251
// Different from our current color?
251252
if (m_Color != color)
252253
{
253-
// Set it and recreate
254+
// Set it
254255
m_Color = color;
256+
257+
// Default alpha
258+
if (!m_ignoreAlphaLimits && GetCheckpointType() == CClientCheckpoint::TYPE_NORMAL)
259+
m_Color.A = 128;
260+
261+
// Recreate
255262
ReCreate();
256263
}
257264
}

Client/mods/deathmatch/logic/CClientCheckpoint.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class CClientCheckpoint : public CClientMarkerCommon
7474
static bool IconToString(unsigned char ucIcon, SString& strOutString);
7575
void ReCreateWithSameIdentifier();
7676

77+
void SetIgnoreAlphaLimits(bool ignore) noexcept { m_ignoreAlphaLimits = ignore; };
78+
bool AreAlphaLimitsIgnored() const noexcept override { return m_ignoreAlphaLimits; };
79+
7780
SColor GetTargetArrowColor() const noexcept { return m_TargetArrowColor; };
7881
float GetTargetArrowSize() const noexcept { return m_TargetArrowSize; };
7982
void SetTargetArrowProperties(const SColor& arrowColor, float size) noexcept;
@@ -100,6 +103,7 @@ class CClientCheckpoint : public CClientMarkerCommon
100103
float m_fSize;
101104
SColor m_Color;
102105
CCheckpoint* m_pCheckpoint;
106+
bool m_ignoreAlphaLimits;
103107
SColor m_TargetArrowColor;
104108
float m_TargetArrowSize;
105109

Client/mods/deathmatch/logic/CClientCorona.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class CClientCorona : public CClientMarkerCommon
4141
void SetReflectionEnabled(bool bEnabled) { m_bReflectionEnabled = bEnabled; };
4242
bool IsReflectionEnabled() const { return m_bReflectionEnabled; };
4343

44+
void SetIgnoreAlphaLimits(bool ignore) noexcept {};
45+
bool AreAlphaLimitsIgnored() const noexcept override { return true; };
46+
4447
protected:
4548
bool IsStreamedIn() { return m_bStreamedIn; };
4649
void StreamIn();

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,10 +3614,10 @@ bool CClientGame::StaticProcessCollisionHandler(CEntitySAInterface* pThisInterfa
36143614

36153615
bool CClientGame::StaticVehicleCollisionHandler(CVehicleSAInterface*& pCollidingVehicle, CEntitySAInterface* pCollidedVehicle, int iModelIndex,
36163616
float fDamageImpulseMag, float fCollidingDamageImpulseMag, uint16 usPieceType, CVector vecCollisionPos,
3617-
CVector vecCollisionVelocity)
3617+
CVector vecCollisionVelocity, bool isProjectile)
36183618
{
36193619
return g_pClientGame->VehicleCollisionHandler(pCollidingVehicle, pCollidedVehicle, iModelIndex, fDamageImpulseMag, fCollidingDamageImpulseMag, usPieceType,
3620-
vecCollisionPos, vecCollisionVelocity);
3620+
vecCollisionPos, vecCollisionVelocity, isProjectile);
36213621
}
36223622

36233623
bool CClientGame::StaticVehicleDamageHandler(CEntitySAInterface* pVehicleInterface, float fLoss, CEntitySAInterface* pAttackerInterface, eWeaponType weaponType,
@@ -4541,7 +4541,7 @@ void CClientGame::DeathHandler(CPed* pKilledPedSA, unsigned char ucDeathReason,
45414541
}
45424542

45434543
bool CClientGame::VehicleCollisionHandler(CVehicleSAInterface*& pCollidingVehicle, CEntitySAInterface* pCollidedWith, int iModelIndex, float fDamageImpulseMag,
4544-
float fCollidingDamageImpulseMag, uint16 usPieceType, CVector vecCollisionPos, CVector vecCollisionVelocity)
4544+
float fCollidingDamageImpulseMag, uint16 usPieceType, CVector vecCollisionPos, CVector vecCollisionVelocity, bool isProjectile)
45454545
{
45464546
if (pCollidingVehicle && pCollidedWith)
45474547
{
@@ -4556,7 +4556,7 @@ bool CClientGame::VehicleCollisionHandler(CVehicleSAInterface*& pCollidingVehicl
45564556
}
45574557

45584558
CClientVehicle* pClientVehicle = static_cast<CClientVehicle*>(pVehicleClientEntity);
4559-
CClientEntity* pCollidedWithClientEntity = pPools->GetClientEntity((DWORD*)pCollidedWith);
4559+
CClientEntity* pCollidedWithClientEntity = !isProjectile ? pPools->GetClientEntity((DWORD*)pCollidedWith) : m_pManager->GetProjectileManager()->Get(pCollidedWith);
45604560

45614561
CLuaArguments Arguments;
45624562
if (pCollidedWithClientEntity)

0 commit comments

Comments
 (0)