This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
CCoronas.cpp
51 lines (49 loc) · 1.77 KB
/
CCoronas.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "StdInc.h"
static CVector2D gCoronasViewPos;
static RwTexture *gpCoronaTexture[9];
void CCoronas::DoSunAndMoon()
{
float rayEnd = CDraw::GetFarClip() * 0.95;
CVector vectorToSun = CTimeCycle::GetCurrentVectorToSun();
CVector ray = vectorToSun * rayEnd;
CVector rayPos = TheCamera.GetPos() + ray;
if (!CGame::CanSeeOutSideFromCurrArea())
{
return;
}
if (ray.z > -0.1f)
{
RegisterCorona(1, 0,
SLOBYTE(CTimeCycle::GetCurrentColours().m_sunCoreRed),
SLOBYTE(CTimeCycle::GetCurrentColours().m_sunCoreGreen),
SLOBYTE(CTimeCycle::GetCurrentColours().m_sunCoreBlue),
255, rayPos,
CTimeCycle::GetCurrentColours().m_sunSize * 2.7335f,
999999.88, gpCoronaTexture[0], 0, 0, 0,
0, 0, 0, 0x3FC00000, 0, 0x41700000, 0, 0);
if (ray.z > 0.0 && CGame::GetCurrentArea() == 0)
{
RegisterCorona(2, 0,
SLOBYTE(CTimeCycle::GetCurrentColours().m_sunCoronaRed),
SLOBYTE(CTimeCycle::GetCurrentColours().m_sunCoronaGreen),
SLOBYTE(CTimeCycle::GetCurrentColours().m_sunCoronaBlue),
255, rayPos,
CTimeCycle::GetCurrentColours().m_sunSize * 6.0,
999999.88, gpCoronaTexture[0],
1, 0, 1, 0,
0, 0, 1069547520, 0, 1097859072, 0, 0);
}
}
CVector viewPos;
float screenX, screenY;
if (CSprite::CalcScreenCoors(rayPos, &viewPos, &screenX, &screenY, true, true))
{
gCoronasViewPos.x = viewPos.x;
gCoronasViewPos.y = viewPos.y;
}
else
{
gCoronasViewPos.x = 1000000.0f;
gCoronasViewPos.y = 1000000.0f;
}
}