-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLuna.h
188 lines (146 loc) · 3.59 KB
/
Luna.h
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#ifndef Luna_H
#define Luna_H
#include <unistd.h>
#include <vector>
#include <string>
#include <sstream>
#include <map>
#include "config.h" // has the defines in it for compile
//#include <pthread.h>
#include "Events/Events.h"
#include "Events/InGameEventReceiver.h"
#include "Scene/customNodes.h"
#ifdef SOUND
#include <cAudio.h>
#endif
#ifdef FPS
#include "entities/player.h"
#endif
//#include "Encryption/Blowfish.h"
#ifdef IRRBULLET
#include "Physics/irrBullet-0.1.9/include/irrBullet.h"
#endif
#ifdef PHYSICS
#include "Physics/Physics.h"
#include "Physics/Vehicle.h"
#endif
#include "Scene/Scene.h"
#ifdef DECALS2
#include "./Scene/decals/decalscenenode.h"
#endif
#ifdef TERRAIN
#include "TerrainFactory/Terrain.h"
#endif
#ifdef NETWORK
#include <irrNet.h>
//#include "Net/irrNetClient.h"
#endif
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <libtar.h>
#endif
#ifdef AgAudio
#include "./Input/AgAudio/Sound.h"
#endif
#ifdef CODEEDITOR
#include "GUI/CodeEditor/CGUIEditBoxIRB.h"
#endif // CODEEDITOR
//#include "TerrainFactory/GrassSceneNode/CGrassPatchSceneNode.h"
//#include "Input/Model/IrrAssimp/IrrAssimp.h"
class Luna
{
public:
Luna ( int argc, char** argv );
~Luna(); // Cleans up the engine
int Run();
IrrlichtDevice *device;
unsigned int resolution[2];
IVideoDriver *driver;
ISceneManager *smgr;
char * pyloader="../media/gameloader.pys";
int init();
int shutdown();
int lobby();
int mainloop();
int devloop();
int doLogin ( const std::wstring &username, const std::wstring &password );
int handleMessages();
void rendermain();
void main_loop();
bool iinit=false;
u32 then ;
int lastFPS;
bool bshutdown=false;
int countr;
//char * returnString="../media/gameloader.pys";
#ifdef JOYSTICK
core::array<SJoystickInfo> joystickInfo;
#endif
// #ifdef AgAudio
//// Sound *m_sound;
// Sound *m_sound;
// Sound m_default_sound_buffer;
// #endif
// void sound_loop_then_quit();
// int SDLPlay();
int AddShader();
void CheckKeyStates(void);
IGUIEnvironment *guienv;
#ifdef EVENTS
EventRec events;
InGameEventReceiver m_cInGameEvents;
#endif
// Factory threads
//pthread_t soundThread
//AUDIO--------------------------
#ifdef SOUND
cAudio::IAudioManager* manager;
cAudio::IAudioSource* mysound;
#endif
#include "./Input/SDLMixer.h"
// Encryption--------------------
//Encryption::Blowfish enc;
// Network related
// net::SOutPacket packet;
// Character related
std::wstring username;
std::wstring password;
#ifdef FPS
// Player Physics---------------
Player *m_cPlayer;
#endif
// Scene *m_cScene;
#ifdef PHYSICS
Physics *m_cPhysics;
#endif
#ifdef IRRBULLET
irrBulletWorld *world;
#endif // IRRBULLET
SKeyMap keyMap[8]; // KEYMAP
f32 frameDeltaTime;
//video::ITexture *tex1;
//video::ITexture *tex2;
// scene::CGrassPatchSceneNode *grass[100];
//core::array<video::E_MATERIAL_TYPE> modes;
//
//scene::IWindGenerator *wind;
int MakeTrees();
void recursiveFillMetaSelector(scene::ISceneNode* node, scene::IMetaTriangleSelector* meta );
scene::IMetaTriangleSelector* metaSelector;
scene::ISceneNodeAnimatorCollisionResponse* anim;
// ICameraSceneNode* camera;
struct SAppContext
{
IrrlichtDevice *device;
s32 counter;
IGUIListBox* listbox;
};
#ifdef CODEEDITOR
CGUIEditBoxIRB * codeEditor;
IGUIContextMenu * menu;
#endif
IGUIWindow* windows;
private:
protected:
};
#endif