Skyscraper 2.0
sky.h
Go to the documentation of this file.
1/*
2 Skyscraper 2.0 - Sky System
3 Copyright (C)2004-2024 Ryan Thoryk
4 https://www.skyscrapersim.net
5 https://sourceforge.net/projects/skyscraper/
6 Contact - ryan@skyscrapersim.net
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21*/
22
23#ifndef SKY_H
24#define SKY_H
25
26#include <Caelum.h>
27#include "vm.h"
28
29namespace Caelum {
30 class CaelumSystem;
31}
32
33namespace Skyscraper {
34
35class EngineContext;
36
38{
39public:
40 SkySystem(VM *vm);
41 ~SkySystem();
42 void CreateSky(EngineContext *engine);
43 void UnloadSky();
44 bool InitSky(EngineContext *engine);
45 void EnableSky(bool value);
46 void UpdateSky();
47 inline Caelum::CaelumSystem* GetCaelumSystem() { return mCaelumSystem; };
48 void SetLocation(Real latitude, Real longitude);
49 void SetDateTimeNow();
50 void SetDateTime(double julian_date_time);
51 void GetTime(int &hour, int &minute, int &second);
52 void GetDate(int &year, int &month, int &day);
53
54 int SkyMult; //sky time multiplier
55 std::string SkyName;
56
57private:
58
59 Caelum::CaelumSystem *mCaelumSystem;
60
61 //reporting functions
62 void Report(const std::string &message);
63 bool ReportError(const std::string &message);
64 bool ReportFatalError(const std::string &message);
65
66 bool new_location, new_time;
67 Real latitude, longitude;
68 double datetime;
70
72};
73
74}
75
76#endif
Caelum::CaelumSystem * mCaelumSystem
Definition sky.h:59
Caelum::CaelumSystem * GetCaelumSystem()
Definition sky.h:47
double datetime
Definition sky.h:68
std::string SkyName
Definition sky.h:55
Ogre::Real Real
Definition globals.h:57
#define VMIMPEXP
Definition vm.h:49