summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-01-01 12:53:37 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2021-01-01 12:53:37 +0100
commit4604b45852eaefb2e9b78d65796b7208532dc298 (patch)
tree5e02b10d89ace7dc43fab6b0dabc3114face46b4
parentmerge master to miami (diff)
parentRestore some marker code (diff)
downloadre3-4604b45852eaefb2e9b78d65796b7208532dc298.tar
re3-4604b45852eaefb2e9b78d65796b7208532dc298.tar.gz
re3-4604b45852eaefb2e9b78d65796b7208532dc298.tar.bz2
re3-4604b45852eaefb2e9b78d65796b7208532dc298.tar.lz
re3-4604b45852eaefb2e9b78d65796b7208532dc298.tar.xz
re3-4604b45852eaefb2e9b78d65796b7208532dc298.tar.zst
re3-4604b45852eaefb2e9b78d65796b7208532dc298.zip
-rw-r--r--src/core/World.cpp8
-rw-r--r--src/render/SpecialFX.cpp18
2 files changed, 18 insertions, 8 deletions
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 6413a620..1af0c4a4 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -1937,11 +1937,11 @@ CWorld::Process(void)
if(csObj->m_rwObject && RwObjectGetType(csObj->m_rwObject) == rpCLUMP &&
RpAnimBlendClumpGetFirstAssociation(csObj->GetClump())) {
if (csObj->IsObject())
- RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), 0.02f * CTimer::GetTimeStepNonClipped());
+ RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepNonClippedInSeconds());
else {
if (!csObj->bOffscreen)
csObj->bOffscreen = !csObj->GetIsOnScreen();
- RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), 0.02f * CTimer::GetTimeStep(), !csObj->bOffscreen);
+ RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), CTimer::GetTimeStepInSeconds(), !csObj->bOffscreen);
}
}
csObj->ProcessControl();
@@ -1958,11 +1958,11 @@ CWorld::Process(void)
if(!movingEnt->bRemoveFromWorld && movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP &&
RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) {
if (movingEnt->IsObject())
- RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), 0.02f * CTimer::GetTimeStepNonClipped());
+ RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepNonClippedInSeconds());
else {
if (!movingEnt->bOffscreen)
movingEnt->bOffscreen = !movingEnt->GetIsOnScreen();
- RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), 0.02f * CTimer::GetTimeStep(), !movingEnt->bOffscreen);
+ RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), CTimer::GetTimeStepInSeconds(), !movingEnt->bOffscreen);
}
}
}
diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp
index d1f7e4a0..b1cce8e2 100644
--- a/src/render/SpecialFX.cpp
+++ b/src/render/SpecialFX.cpp
@@ -849,7 +849,7 @@ C3dMarkers::PlaceMarker(uint32 identifier, uint16 type, CVector &pos, float size
} else {
pMarker->m_fStdSize = size;
}
- } else {
+ } else if (type == MARKERTYPE_CYLINDER) {
if (dist < size + 12.0f) {
if (dist > size + 1.0f)
pMarker->m_Color.alpha = (1.0f - (size + 12.0f - dist) * 0.7f / 11.0f) * (float)a;
@@ -862,8 +862,14 @@ C3dMarkers::PlaceMarker(uint32 identifier, uint16 type, CVector &pos, float size
float someSin = Sin(TWOPI * (float)((pMarker->m_nPulsePeriod - 1) & (CTimer::GetTimeInMilliseconds() - pMarker->m_nStartTime)) / (float)pMarker->m_nPulsePeriod);
pMarker->m_fSize = pMarker->m_fStdSize - pulseFraction * pMarker->m_fStdSize * someSin;
- if (type == MARKERTYPE_ARROW)
+ if (type == MARKERTYPE_ARROW) {
pos.z += 0.25f * pMarker->m_fStdSize * someSin;
+ } else if (type == MARKERTYPE_0) {
+ if (someSin > 0.0f)
+ pMarker->m_Color.alpha = (float)a * 0.7f * someSin + a;
+ else
+ pMarker->m_Color.alpha = (float)a * 0.4f * someSin + a;
+ }
if (pMarker->m_nRotateRate != 0) {
RwV3d pos = pMarker->m_Matrix.m_matrix.pos;
pMarker->m_Matrix.RotateZ(DEGTORAD(pMarker->m_nRotateRate * CTimer::GetTimeStep()));
@@ -888,7 +894,7 @@ C3dMarkers::PlaceMarker(uint32 identifier, uint16 type, CVector &pos, float size
pMarker->DeleteMarkerObject();
pMarker->AddMarker(identifier, type, size, r, g, b, a, pulsePeriod, pulseFraction, rotateRate);
- if (type == MARKERTYPE_CYLINDER) {
+ if (type == MARKERTYPE_CYLINDER || type == MARKERTYPE_0 || type == MARKERTYPE_2) {
if ((playerPos - pos).MagnitudeSqr() < sq(100.f) && CColStore::HasCollisionLoaded(CVector2D(pos))) {
float z = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, pos.z + 1.0f, nil);
if (z != 0.0f)
@@ -899,6 +905,10 @@ C3dMarkers::PlaceMarker(uint32 identifier, uint16 type, CVector &pos, float size
}
}
pMarker->m_Matrix.SetTranslate(pos.x, pos.y, pos.z);
+ if (type == MARKERTYPE_2) {
+ pMarker->m_Matrix.RotateX(PI);
+ pMarker->m_Matrix.GetPosition() = pos;
+ }
pMarker->m_Matrix.UpdateRW();
if (type == MARKERTYPE_ARROW) {
if (dist < 25.0f) {
@@ -909,7 +919,7 @@ C3dMarkers::PlaceMarker(uint32 identifier, uint16 type, CVector &pos, float size
} else {
pMarker->m_fStdSize = size;
}
- } else {
+ } else if (type == MARKERTYPE_CYLINDER) {
if (dist < size + 12.0f) {
if (dist > size + 1.0f)
pMarker->m_Color.alpha = (1.0f - (size + 12.0f - dist) * 0.7f / 11.0f) * (float)a;