* Remove most unused WIN32 stuff.
[matthijs/ABM2.git] / ABM2 / Engine / VideoUpdate.cpp
index 270a67b07a22f9da440f72075da83c601969f0f1..e3f36c585e29616602c53f7f1f8fcd7b04afb29d 100755 (executable)
@@ -7,16 +7,6 @@
 #include "VideoUpdate.h"\r
 \r
 \r
-// include the Direct3D Library file\r
-#ifdef WIN32\r
-#pragma comment (lib, "d3d9.lib")\r
-#pragma comment (lib, "d3dx9.lib")\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// Construction/Destruction\r
-//////////////////////////////////////////////////////////////////////\r
-LPDIRECT3DDEVICE9 d3ddev;    // the pointer to the device class\r
-#endif //WIN32\r
 CMMPointer<Dator<int> > CVideoUpdate::screenWidth=0;\r
 CMMPointer<Dator<int> > CVideoUpdate::screenHeight=0;\r
 CMMPointer<Dator<int> > CVideoUpdate::screenBPP=0;\r
@@ -24,8 +14,10 @@ int CVideoUpdate::scrWidth=640;
 int CVideoUpdate::scrHeight=480;\r
 int CVideoUpdate::scrBPP=16;\r
 \r
-CVideoUpdate::CVideoUpdate()\r
+CVideoUpdate::CVideoUpdate(CKernel* kernel) : ITask(kernel)\r
 {\r
+       assert(screenWidth && screenHeight && screenBPP);\r
+       this->g = new Graphics(scrWidth, scrHeight, 16, false);\r
 }\r
 \r
 CVideoUpdate::~CVideoUpdate()\r
@@ -34,7 +26,6 @@ CVideoUpdate::~CVideoUpdate()
 \r
 bool CVideoUpdate::Start()\r
 {\r
-       assert(screenWidth && screenHeight && screenBPP);\r
 /*\r
        if(-1==SDL_InitSubSystem(SDL_INIT_VIDEO))\r
        {\r
@@ -59,24 +50,25 @@ bool CVideoUpdate::Start()
        //hide the mouse cursor\r
        SDL_ShowCursor(SDL_DISABLE);\r
 */\r
-       this->g = new Graphics(scrWidth, scrHeight, 16, false);\r
        if (this->g->createDisplay())\r
                return false;\r
        this->g->setCullingMode(AM_CULL_NONE);\r
        this->g->setBackground(COLOUR_RGBA(127, 127, 127, 255));\r
-\r
-       this->s = new Sprite("Data/POWBOMB.png", COLOUR_RGBA(0, 0, 255, 255), 64, 64, this->g);\r
+       \r
+       /* Start a first scene */\r
+       this->g->beginScene();\r
        return true;\r
 }\r
 \r
 void CVideoUpdate::Update()\r
 {\r
-       this->g->beginScene();\r
-       this->s->blit(0, 0, 1.0, 1.0, 0, 0, COLOUR_RGBA(255, 255, 255, 255));\r
        this->g->endScene();\r
+       this->g->beginScene();\r
 }\r
 \r
 void CVideoUpdate::Stop()\r
 {\r
+       /* End the last scene */\r
+       this->g->endScene();\r
        delete this->g;\r
 }\r