summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-25 20:36:18 +0200
committeraap <aap@papnet.eu>2020-05-25 20:36:23 +0200
commit3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235 (patch)
treed1e86b5e9fe98616c3bb83554381e681330b6b6e /src/render
parentEven more audio cleanups (diff)
downloadre3-3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235.tar
re3-3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235.tar.gz
re3-3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235.tar.bz2
re3-3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235.tar.lz
re3-3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235.tar.xz
re3-3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235.tar.zst
re3-3c3b1aadc0bfd3b8d58cc9dcc269d83f6a003235.zip
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Coronas.cpp6
-rw-r--r--src/render/Shadows.cpp8
-rw-r--r--src/render/Timecycle.cpp2
-rw-r--r--src/render/Timecycle.h2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp
index de3b5c78..5bf89403 100644
--- a/src/render/Coronas.cpp
+++ b/src/render/Coronas.cpp
@@ -506,18 +506,18 @@ CCoronas::DoSunAndMoon(void)
{
// yeah, moon is done somewhere else....
- CVector sunCoors = CTimeCycle::GetSunPosition();
+ CVector sunCoors = CTimeCycle::GetSunDirection();
sunCoors *= 150.0f;
sunCoors += TheCamera.GetPosition();
- if(CTimeCycle::GetSunPosition().z > -0.2f){
+ if(CTimeCycle::GetSunDirection().z > -0.2f){
float size = ((CGeneral::GetRandomNumber()&0xFF) * 0.005f + 10.0f) * CTimeCycle::GetSunSize();
RegisterCorona(SUN_CORE,
CTimeCycle::GetSunCoreRed(), CTimeCycle::GetSunCoreGreen(), CTimeCycle::GetSunCoreBlue(),
255, sunCoors, size,
999999.88f, TYPE_STAR, FLARE_NONE, REFLECTION_OFF, LOSCHECK_OFF, STREAK_OFF, 0.0f);
- if(CTimeCycle::GetSunPosition().z > 0.0f)
+ if(CTimeCycle::GetSunDirection().z > 0.0f)
RegisterCorona(SUN_CORONA,
CTimeCycle::GetSunCoronaRed(), CTimeCycle::GetSunCoronaGreen(), CTimeCycle::GetSunCoronaBlue(),
255, sunCoors, 25.0f * CTimeCycle::GetSunSize(),
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index 69f9dce0..d07c302a 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -642,12 +642,12 @@ CShadows::StoreShadowForPole(CEntity *pPole, float fOffsetX, float fOffsetY, flo
PolePos.y += fOffsetX * pPole->GetRight().y + fOffsetY * pPole->GetForward().y;
PolePos.z += fOffsetZ;
- PolePos.x += -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2);
- PolePos.y += -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2);
+ PolePos.x += -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2);
+ PolePos.y += -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2);
StoreStaticShadow((uintptr)pPole + nID + _TODOCONST(51), SHADOWTYPE_DARK, gpPostShadowTex, &PolePos,
- -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2),
- -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2),
+ -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2),
+ -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2),
CTimeCycle::GetShadowSideX() * fPoleWidth,
CTimeCycle::GetShadowSideY() * fPoleWidth,
2 * (int32)((pPole->GetUp().z - 0.5f) * CTimeCycle::GetShadowStrength() * 2.0f) / 3,
diff --git a/src/render/Timecycle.cpp b/src/render/Timecycle.cpp
index cf3426d7..1989db5c 100644
--- a/src/render/Timecycle.cpp
+++ b/src/render/Timecycle.cpp
@@ -298,7 +298,7 @@ CTimeCycle::Update(void)
m_CurrentStoredValue = (m_CurrentStoredValue+1)&0xF;
float sunAngle = 2*PI*(CClock::GetMinutes() + CClock::GetHours()*60)/(24*60);
- CVector &sunPos = GetSunPosition();
+ CVector &sunPos = GetSunDirection();
sunPos.x = Sin(sunAngle);
sunPos.y = 1.0f;
sunPos.z = 0.2f - Cos(sunAngle);
diff --git a/src/render/Timecycle.h b/src/render/Timecycle.h
index 9af4df49..0cb02b67 100644
--- a/src/render/Timecycle.h
+++ b/src/render/Timecycle.h
@@ -142,7 +142,7 @@ public:
static void Initialise(void);
static void Update(void);
- static CVector &GetSunPosition(void) { return m_VectorToSun[m_CurrentStoredValue]; }
+ static CVector &GetSunDirection(void) { return m_VectorToSun[m_CurrentStoredValue]; }
static float GetShadowFrontX(void) { return m_fShadowFrontX[m_CurrentStoredValue]; }
static float GetShadowFrontY(void) { return m_fShadowFrontY[m_CurrentStoredValue]; }
static float GetShadowSideX(void) { return m_fShadowSideX[m_CurrentStoredValue]; }