summaryrefslogtreecommitdiffstats
path: root/src/control/Pickups.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-05-10 01:34:21 +0200
committerSergeanur <s.anureev@yandex.ua>2021-05-10 01:45:04 +0200
commit3dda658e4296c0b009f0670d6a9c6d2da2878569 (patch)
tree42fd6704034e4ebb218a0b23a5fe727f58822a07 /src/control/Pickups.cpp
parentSmall Acos fix (diff)
downloadre3-3dda658e4296c0b009f0670d6a9c6d2da2878569.tar
re3-3dda658e4296c0b009f0670d6a9c6d2da2878569.tar.gz
re3-3dda658e4296c0b009f0670d6a9c6d2da2878569.tar.bz2
re3-3dda658e4296c0b009f0670d6a9c6d2da2878569.tar.lz
re3-3dda658e4296c0b009f0670d6a9c6d2da2878569.tar.xz
re3-3dda658e4296c0b009f0670d6a9c6d2da2878569.tar.zst
re3-3dda658e4296c0b009f0670d6a9c6d2da2878569.zip
Diffstat (limited to 'src/control/Pickups.cpp')
-rw-r--r--src/control/Pickups.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 7bc88321..0428ddae 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -1008,8 +1008,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);
#ifdef FIX_BUGS
int16 colorId = 0;
@@ -1149,7 +1148,20 @@ CPickups::DoPickUpEffects(CEntity *entity)
if (model == MI_MINIGUN || model == MI_MINIGUN2)
scale = 1.2f;
- entity->GetMatrix().SetRotateZOnlyScaled((float)(CTimer::GetTimeInMilliseconds() & 0x7FF) * DEGTORAD(360.0f / 0x800), scale);
+ float angle = (float)(CTimer::GetTimeInMilliseconds() & 0x7FF) * DEGTORAD(360.0f / 0x800);
+ float c = Cos(angle) * scale;
+ float s = Sin(angle) * scale;
+
+ // 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 = scale;
if (entity->GetModelIndex() == MI_MINIGUN2) {
CMatrix matrix1;