From f8297df9c5a7d65d5658d1a8d85d391fbb15b95a Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 28 Jun 2021 03:59:07 +0300 Subject: Redo ReadSaveBuf + common.h cleanup --- src/entities/Entity.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/entities') diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp index 1545ce95..8d51cae7 100644 --- a/src/entities/Entity.cpp +++ b/src/entities/Entity.cpp @@ -26,6 +26,7 @@ #include "Ped.h" #include "Dummy.h" #include "WindModifiers.h" +#include "SaveBuf.h" int gBuildings; @@ -850,7 +851,8 @@ CEntity::SaveEntityFlags(uint8*& buf) void CEntity::LoadEntityFlags(uint8*& buf) { - uint32 tmp = ReadSaveBuf(buf); + uint32 tmp; + ReadSaveBuf(&tmp, buf); m_type = (tmp & ((BIT(3) - 1))); m_status = ((tmp >> 3) & (BIT(5) - 1)); @@ -881,7 +883,7 @@ CEntity::LoadEntityFlags(uint8*& buf) bStreamingDontDelete = !!(tmp & BIT(30)); bRemoveFromWorld = !!(tmp & BIT(31)); - tmp = ReadSaveBuf(buf); + ReadSaveBuf(&tmp, buf); bHasHitWall = !!(tmp & BIT(0)); bImBeingRendered = !!(tmp & BIT(1)); -- cgit v1.2.3 From d17d437de319ca4c388dc724cffea91702d3a699 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 28 Jun 2021 13:57:05 +0200 Subject: rename clamp macro to Clamp to fix compilation with g++11 (and clamp2 for consistency sake) --- src/entities/Physical.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/entities') diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 86ef0669..890e7876 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -553,7 +553,7 @@ CPhysical::ApplyGravity(void) surfaceUp = point.normal; else surfaceUp = CVector(0.0f, 0.0f, 1.0f); - float t = clamp(CTimer::GetTimeStep() * 0.5f, 0.05f, 0.8f); + float t = Clamp(CTimer::GetTimeStep() * 0.5f, 0.05f, 0.8f); gravityUp = gravityUp * (1.0f - t) + surfaceUp * t; if (gravityUp.MagnitudeSqr() < 0.1f) gravityUp = CVector(0.0f, 0.0f, 1.0f); -- cgit v1.2.3