diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-09 01:55:32 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-05-09 01:56:53 +0200 |
commit | 4b8d6a3223c9eeaeebb979945553704987b3c625 (patch) | |
tree | 42ec648eaa09e35d68f8f13f4dfad277f8bd3946 | |
parent | anims streaming (diff) | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | re3-4b8d6a3223c9eeaeebb979945553704987b3c625.tar re3-4b8d6a3223c9eeaeebb979945553704987b3c625.tar.gz re3-4b8d6a3223c9eeaeebb979945553704987b3c625.tar.bz2 re3-4b8d6a3223c9eeaeebb979945553704987b3c625.tar.lz re3-4b8d6a3223c9eeaeebb979945553704987b3c625.tar.xz re3-4b8d6a3223c9eeaeebb979945553704987b3c625.tar.zst re3-4b8d6a3223c9eeaeebb979945553704987b3c625.zip |
-rw-r--r-- | src/animation/AnimBlendAssociation.cpp | 1 | ||||
-rw-r--r-- | src/core/Cam.cpp | 2 | ||||
-rw-r--r-- | src/core/Camera.h | 2 | ||||
-rw-r--r-- | src/render/Sprite.cpp | 12 |
4 files changed, 11 insertions, 6 deletions
diff --git a/src/animation/AnimBlendAssociation.cpp b/src/animation/AnimBlendAssociation.cpp index 183cc2de..78f8eb95 100644 --- a/src/animation/AnimBlendAssociation.cpp +++ b/src/animation/AnimBlendAssociation.cpp @@ -159,6 +159,7 @@ CAnimBlendAssociation::Start(float time) flags |= ASSOC_RUNNING; SetCurrentTime(time); } + bool CAnimBlendAssociation::UpdateTime(float timeDelta, float relSpeed) { diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 3d229e7e..f7749712 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -25,8 +25,6 @@ #include "Camera.h" #include "DMAudio.h" -const float DefaultFOV = 70.0f; // beta: 80.0f - bool PrintDebugCode = false; int16 DebugCamMode; diff --git a/src/core/Camera.h b/src/core/Camera.h index 02122dfe..51138f99 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -40,6 +40,8 @@ enum #define DEFAULT_CAR_ZOOM_VALUE_2 (1.9f) #define DEFAULT_CAR_ZOOM_VALUE_3 (3.9f) +const float DefaultFOV = 70.0f; // beta: 80.0f + class CCam { public: diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp index 30eaf840..1dd1aaab 100644 --- a/src/render/Sprite.cpp +++ b/src/render/Sprite.cpp @@ -29,13 +29,17 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh, float recip = 1.0f/out->z; out->x *= SCREEN_WIDTH * recip; out->y *= SCREEN_HEIGHT * recip; - // What is this? size? - *outw = 70.0f/CDraw::GetFOV() * SCREEN_WIDTH * recip; #ifdef ASPECT_RATIO_SCALE - *outh = 70.0f/CDraw::GetFOV() / (DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO) * SCREEN_HEIGHT * recip; + float fov = CDraw::ConvertFOV(DefaultFOV); #else - *outh = 70.0f/CDraw::GetFOV() * SCREEN_HEIGHT * recip; + const float fov = DefaultFOV; #endif + // this is used to scale correctly if you zoom in with sniper rifle + float fovScale = fov / CDraw::GetFOV(); + + *outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH; + *outh = fovScale * recip * SCREEN_HEIGHT; + return true; } |