-
Notifications
You must be signed in to change notification settings - Fork 19
/
Engine.h
66 lines (51 loc) · 1.75 KB
/
Engine.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
#ifndef ENGINE_H
#define ENGINE_H
#include "CommonTypes.h"
class IDriver3D;
class Camera;
class XLFont;
class World;
class Vector4;
struct XLEngine_Plugin_API;
class Engine
{
public:
Engine();
virtual ~Engine();
bool Loop(float fDeltaTime, bool bFullspeed);
void ChangeWindowSize(int32_t w, int32_t h);
bool Init(void **winParam, int32_t paramCnt, int32_t w, int32_t h);
void InitGame(const char *pszGameLib);
XLEngine_Plugin_API *GetEngineAPI() { return m_pPluginAPI; }
World *GetWorld() { return m_pWorld; }
IDriver3D *GetDriver() { return m_pDriver3D; }
XLFont *GetSystemFont(int32_t size);
static void PostExitMessage();
void AddDisplayMessage(const char *pszMsg, Vector4 *color=0, float fShowTime=0.0f);
void WorldUpdate(int32_t newWorldX, int32_t newWorldY);
float GetCurrentBrightness();
float GetCurrentSpeed();
protected:
IDriver3D *m_pDriver3D;
Camera *m_pCamera;
World *m_pWorld;
float m_fTotalTime;
float m_FPS;
int32_t m_nWidth;
int32_t m_nHeight;
XLFont *m_pSystemFont16;
XLFont *m_pSystemFont24;
XLFont *m_pSystemFont32;
//Plugin/Game API.
XLEngine_Plugin_API *m_pPluginAPI;
//Time to exit?
static bool m_bContinueLoop;
static void Engine_SetCameraData(float *pos, float *dir, float fSkew, float fSpeed, uint32_t uSector);
static XL_BOOL Engine_AllowPlayerControls();
static void Object_GetCameraVector(uint32_t uObjID, float& x, float& y, float& z);
private:
void Destroy();
void SetupPluginAPI();
void DisplayMessages(float fDeltaTime);
};
#endif // ENGINE_H