forked from derandark/DungeonViewerAC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameSky.cpp
122 lines (79 loc) · 1.91 KB
/
GameSky.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
// GameSky.cpp
//
#include "StdAfx.h"
#include "RegionDesc.h"
#include "EnvCell.h"
#include "GameSky.h"
#include "GameTime.h"
#include "PhysicsObj.h"
#define INCLUDE_SKY_CODE FALSE
GameSky::GameSky()
{
#if INCLUDE_SKY_CODE
m_EnvCell24 = new CEnvCell;
m_EnvCell28 = new CEnvCell;
#endif
}
GameSky::~GameSky()
{
#if INCLUDE_SKY_CODE
// Missing code
if (m_EnvCell24)
delete m_EnvCell24;
if (m_EnvCell28)
delete m_EnvCell28;
#endif
}
void GameSky::UseTime(void)
{
#if INCLUDE_SKY_CODE
// MISSING
// CRegionDesc::CalcDayGroup();
double time = (GameTime::current_game_time ? GameTime::current_game_time->m_48 : 0.0);
if (CRegionDesc::GetSky(time, this))
{
CreateDeletePhysicsObjects();
for (DWORD i = 0; i < m_SkyDescs.num_used; i++)
{
CPhysicsObj * object = m_Objs0C.array_data[i];
SkyDesc * skydesc = &m_SkyDescs.array_data[i];
if (Object = m_Objs0C.array_data[i])
{
Frame drawframe;
CalcDrawFrame(&drawframe, skydesc->m_DrawVec);
Object->set_initial_frame(&drawframe);
// Update luminosity, diffusion, and translucency..
}
}
}
#endif
}
CPhysicsObj *GameSky::MakeObject(DWORD ModelID, Vec2D& TexVel, DWORD arg_8)
{
#if INCLUDE_SKY_CODE
if (!ModelID)
return NULL;
CPhysicsObj *Object;
if (Object = CPhysicsObj::makeObject(ModelID, 0, 0))
{
if (TexVel.x != 0 || TexVel.y != 0)
{
// Missing code.
// Object->SetTextureVelocity(TexVel);
}
Object->AddObjectToSingleCell(arg_8 ? m_EnvCell28 : m_EnvCell24);
if (ImgTex::DoChunkification())
UNFINISHED("Object->NotifySurfaceTiles()");
}
return Object;
#else
return NULL;
#endif
}
SkyDesc::SkyDesc()
{
}
SkyDesc::~SkyDesc()
{
}