aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/extantz/crappisspuke.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ClientHamr/extantz/crappisspuke.cpp')
-rw-r--r--ClientHamr/extantz/crappisspuke.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/ClientHamr/extantz/crappisspuke.cpp b/ClientHamr/extantz/crappisspuke.cpp
index 41bd95d..47a6353 100644
--- a/ClientHamr/extantz/crappisspuke.cpp
+++ b/ClientHamr/extantz/crappisspuke.cpp
@@ -1,11 +1,14 @@
1 1
2#include <irrlicht.h> 2#include <irrlicht.h>
3#include "extantz.h" 3#include "extantz.h"
4#include "CDemo.h"
4 5
6#define USE_DEMO 1
5 7
6SExposedVideoData videoData; 8SExposedVideoData videoData;
7 9
8IAnimatedMeshSceneNode* node; 10IAnimatedMeshSceneNode *node;
11CDemo *myDemo;
9// This is the movemen speed in units per second. 12// This is the movemen speed in units per second.
10const f32 MOVEMENT_SPEED = 5.f; 13const f32 MOVEMENT_SPEED = 5.f;
11// In order to do framerate independent movement, we have to know 14// In order to do framerate independent movement, we have to know
@@ -22,6 +25,7 @@ EAPI int startIrr(GLData *gld)
22 IrrlichtDevice *device; 25 IrrlichtDevice *device;
23 IVideoDriver *driver; 26 IVideoDriver *driver;
24 ISceneManager *smgr; 27 ISceneManager *smgr;
28 bool additive = true;
25 29
26 if (!gld->useIrr) 30 if (!gld->useIrr)
27 return 0; 31 return 0;
@@ -31,6 +35,10 @@ EAPI int startIrr(GLData *gld)
31 unsigned long sfc = 0; 35 unsigned long sfc = 0;
32 void *ctx = NULL; 36 void *ctx = NULL;
33 37
38#if USE_DEMO
39 myDemo = new CDemo(gld, additive);
40#endif
41
34 evas_gl_make_current(gld->evasgl, gld->sfc, gld->ctx); 42 evas_gl_make_current(gld->evasgl, gld->sfc, gld->ctx);
35 43
36 display = glXGetCurrentDisplay(); 44 display = glXGetCurrentDisplay();
@@ -88,9 +96,10 @@ EAPI int startIrr(GLData *gld)
88 params.Fullscreen = false; // The default anyway. 96 params.Fullscreen = false; // The default anyway.
89 params.Stencilbuffer = false; // For shadows. 97 params.Stencilbuffer = false; // For shadows.
90 params.Vsync = false; 98 params.Vsync = false;
99 params.AntiAlias=true;
91 params.WithAlphaChannel = true; 100 params.WithAlphaChannel = true;
92 params.IgnoreInput = true; 101 params.IgnoreInput = true;
93 params.EventReceiver = 0; 102 params.EventReceiver = myDemo; // Probably useless, EFL might not let Irrlicht grab the input.
94 params.WindowId = (void *) videoData.OpenGLLinux.X11Window; 103 params.WindowId = (void *) videoData.OpenGLLinux.X11Window;
95 params.VideoData = &videoData; 104 params.VideoData = &videoData;
96 105
@@ -109,6 +118,10 @@ EAPI int startIrr(GLData *gld)
109 118
110 // set ambient light 119 // set ambient light
111 smgr->setAmbientLight (video::SColorf(0x00c0c0c0)); 120 smgr->setAmbientLight (video::SColorf(0x00c0c0c0));
121
122#if USE_DEMO
123 myDemo->setup(gld);
124#else
112 /* 125 /*
113 To show something interesting, we load a Quake 2 model and display it. 126 To show something interesting, we load a Quake 2 model and display it.
114 We only have to get the Mesh from the Scene Manager with getMesh() and add 127 We only have to get the Mesh from the Scene Manager with getMesh() and add
@@ -150,6 +163,7 @@ EAPI int startIrr(GLData *gld)
150 approximately the place where our md2 model is. 163 approximately the place where our md2 model is.
151 */ 164 */
152 smgr->addCameraSceneNode(0, vector3df(50, 70, -65), vector3df(0, 50, 0)); 165 smgr->addCameraSceneNode(0, vector3df(50, 70, -65), vector3df(0, 50, 0));
166#endif
153 167
154 then = device->getTimer()->getTime(); 168 then = device->getTimer()->getTime();
155#endif 169#endif
@@ -172,9 +186,13 @@ EAPI void drawIrr_start(GLData *gld)
172 const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds 186 const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds
173 then = now; 187 then = now;
174 188
189#if USE_DEMO
190 myDemo->preDraw(gld, now);
191#else
175 core::vector3df nodePosition = node->getPosition(); 192 core::vector3df nodePosition = node->getPosition();
176// nodePosition.Y -= MOVEMENT_SPEED * frameDeltaTime; 193// nodePosition.Y -= MOVEMENT_SPEED * frameDeltaTime;
177 node->setPosition(nodePosition); 194 node->setPosition(nodePosition);
195#endif
178 196
179 /* 197 /*
180 Anything can be drawn between a beginScene() and an endScene() 198 Anything can be drawn between a beginScene() and an endScene()