summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-12 19:23:03 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-12 19:23:03 +0200
commit180a1dc42b4d6fc70e5c3e4fc06b217419d71371 (patch)
tree03d9aee00bd8cc625737079fd0c7201c5dc37674
parentgarages fix (diff)
parentlittle fixes to CClouds; disabled object clipping for SA cam (diff)
downloadre3-180a1dc42b4d6fc70e5c3e4fc06b217419d71371.tar
re3-180a1dc42b4d6fc70e5c3e4fc06b217419d71371.tar.gz
re3-180a1dc42b4d6fc70e5c3e4fc06b217419d71371.tar.bz2
re3-180a1dc42b4d6fc70e5c3e4fc06b217419d71371.tar.lz
re3-180a1dc42b4d6fc70e5c3e4fc06b217419d71371.tar.xz
re3-180a1dc42b4d6fc70e5c3e4fc06b217419d71371.tar.zst
re3-180a1dc42b4d6fc70e5c3e4fc06b217419d71371.zip
-rw-r--r--src/core/Cam.cpp4
-rw-r--r--src/core/main.cpp3
-rw-r--r--src/render/Clouds.cpp11
3 files changed, 10 insertions, 8 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 21569647..8cd44f6f 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -5099,7 +5099,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
CColPoint foundCol;
CEntity* foundEnt;
CWorld::pIgnoreEntity = CamTargetEntity;
- if (CWorld::ProcessLineOfSight(TargetCoors, Source, foundCol, foundEnt, true, dontCollideWithCars < 0.1f, false, true, false, true, false)) {
+ if (CWorld::ProcessLineOfSight(TargetCoors, Source, foundCol, foundEnt, true, dontCollideWithCars < 0.1f, false, false, false, true, false)) {
float obstacleTargetDist = (TargetCoors - foundCol.point).Magnitude();
float obstacleCamDist = newDistance - obstacleTargetDist;
if (!foundEnt->IsPed() || obstacleCamDist <= 1.0f) {
@@ -5108,7 +5108,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
RwCameraSetNearClipPlane(Scene.camera, Max(0.05f, obstacleTargetDist - 0.3f));
}
} else {
- if (!CWorld::ProcessLineOfSight(foundCol.point, Source, foundCol, foundEnt, true, dontCollideWithCars < 0.1f, false, true, false, true, false)) {
+ if (!CWorld::ProcessLineOfSight(foundCol.point, Source, foundCol, foundEnt, true, dontCollideWithCars < 0.1f, false, false, false, true, false)) {
float lessClip = obstacleCamDist - 0.35f;
if (lessClip <= DEFAULT_NEAR)
RwCameraSetNearClipPlane(Scene.camera, lessClip);
diff --git a/src/core/main.cpp b/src/core/main.cpp
index d6af0b2a..bcd6202e 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -263,6 +263,9 @@ DoFade(void)
void
DoRWStuffEndOfFrame(void)
{
+char buf[100];
+sprintf(buf, "timestep: %f %f", CTimer::GetTimeStep(), CTimer::GetTimeStepInMilliseconds());
+CDebug::PrintAt(buf, 10, 10);
CDebug::DisplayScreenStrings(); // custom
CDebug::DebugDisplayTextBuffer();
FlushObrsPrintfs();
diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp
index 07688491..9c0fde0f 100644
--- a/src/render/Clouds.cpp
+++ b/src/render/Clouds.cpp
@@ -93,7 +93,7 @@ CClouds::Render(void)
int minute = CClock::GetHours()*60 + CClock::GetMinutes();
RwV3d campos = *(RwV3d*)&TheCamera.GetPosition();
- float coverage = CWeather::CloudCoverage <= CWeather::Foggyness ? CWeather::Foggyness : CWeather::CloudCoverage;
+ float coverage = Max(CWeather::Foggyness, CWeather::Foggyness);
// Moon
int moonfadeout = Abs(minute - 180); // fully visible at 3AM
@@ -308,20 +308,19 @@ CClouds::Render(void)
bool
UseDarkBackground(void)
{
- return RwFrameGetLTM(RwCameraGetFrame(TheCamera.m_pRwCamera))->up.z < -0.9f ||
- gbShowCollisionPolys;
+ return TheCamera.GetForward().z < -0.9f || gbShowCollisionPolys;
}
void
CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue,
int16 botred, int16 botgreen, int16 botblue, int16 alpha)
{
- RwMatrix *mat = RwFrameGetLTM(RwCameraGetFrame(TheCamera.m_pRwCamera));
- float c = Sqrt(mat->right.x * mat->right.x + mat->right.y * mat->right.y);
+ CVector left = TheCamera.GetRight();
+ float c = left.Magnitude2D();
if(c > 1.0f)
c = 1.0f;
ms_cameraRoll = Acos(c);
- if(mat->right.z < 0.0f)
+ if(left.z < 0.0f)
ms_cameraRoll = -ms_cameraRoll;
if(UseDarkBackground()){