aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz/CDemo.h
blob: 035c01fca07ac04a82badc6322ce1433079a6a6b (plain)
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
// This is a Demo of the Irrlicht Engine (c) 2006 by N.Gebhardt.
// This file is not documented.

#ifndef __C_DEMO_H_INCLUDED__
#define __C_DEMO_H_INCLUDED__

#ifdef _IRR_WINDOWS_
#include <windows.h>
#endif

const int CAMERA_COUNT = 7;

class CDemo : public IEventReceiver
{
public:

	CDemo(GLData *gld, bool additive);

	~CDemo();

	void setup(GLData *gld);
	void preDraw(GLData *gld, u32 now);

	virtual bool OnEvent(const SEvent& event);

private:

	void createLoadingScreen();
	void loadSceneData();
	void switchToNextScene(GLData *gld);
	void shoot();
	void createParticleImpacts();

	bool additive;
	IrrlichtDevice *device;

	struct SParticleImpact
	{
		u32 when;
		core::vector3df pos;
		core::vector3df outVector;
	};

	int currentScene;

	scene::IQ3LevelMesh* quakeLevelMesh;
	scene::ISceneNode* quakeLevelNode;
	scene::ISceneNode* skyboxNode;
	scene::IAnimatedMeshSceneNode* model1;
	scene::IAnimatedMeshSceneNode* model2;
	scene::IParticleSystemSceneNode* campFire;

	scene::IMetaTriangleSelector* metaSelector;
	scene::ITriangleSelector* mapSelector;

	s32 sceneStartTime;
	s32 timeForThisScene;

	core::array<SParticleImpact> Impacts;
};

#endif