diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-05-10 01:34:21 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-06-24 20:32:43 +0200 |
commit | 6537dfe7f103161676a8850801383b0d63efd40e (patch) | |
tree | f5c7fc57cd126bfcdc27f17076d8c390efa5aa22 /src/control/Pickups.cpp | |
parent | update librw (diff) | |
download | re3-6537dfe7f103161676a8850801383b0d63efd40e.tar re3-6537dfe7f103161676a8850801383b0d63efd40e.tar.gz re3-6537dfe7f103161676a8850801383b0d63efd40e.tar.bz2 re3-6537dfe7f103161676a8850801383b0d63efd40e.tar.lz re3-6537dfe7f103161676a8850801383b0d63efd40e.tar.xz re3-6537dfe7f103161676a8850801383b0d63efd40e.tar.zst re3-6537dfe7f103161676a8850801383b0d63efd40e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/Pickups.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp index be9f734d..a1e2a851 100644 --- a/src/control/Pickups.cpp +++ b/src/control/Pickups.cpp @@ -689,8 +689,7 @@ CPickups::DoPickUpEffects(CEntity *entity) entity->bDoNotRender = CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame; if (!entity->bDoNotRender) { - float s = Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x7FF) * DEGTORAD(360.0f / 0x800)); - float modifiedSin = 0.3f * (s + 1.0f); + float modifiedSin = 0.3f * (Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x7FF) * DEGTORAD(360.0f / 0x800)) + 1.0f); int16 colorId; @@ -749,7 +748,20 @@ CPickups::DoPickUpEffects(CEntity *entity) } } - entity->GetMatrix().SetRotateZOnlyScaled((float)(CTimer::GetTimeInMilliseconds() & 0x7FF) * DEGTORAD(360.0f / 0x800), aWeaponScale[colorId]); + float angle = (float)(CTimer::GetTimeInMilliseconds() & 0x7FF) * DEGTORAD(360.0f / 0x800); + float c = Cos(angle) * aWeaponScale[colorId]; + float s = Sin(angle) * aWeaponScale[colorId]; + + // we know from SA they were setting each field manually like this + entity->GetMatrix().rx = c; + entity->GetMatrix().ry = s; + entity->GetMatrix().rz = 0.0f; + entity->GetMatrix().fx = -s; + entity->GetMatrix().fy = c; + entity->GetMatrix().fz = 0.0f; + entity->GetMatrix().ux = 0.0f; + entity->GetMatrix().uy = 0.0f; + entity->GetMatrix().uz = aWeaponScale[colorId]; } } |