X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2FABM2.git;a=blobdiff_plain;f=ABM2%2FEngine%2FVideoUpdate.cpp;fp=ABM2%2FEngine%2FVideoUpdate.cpp;h=1d66b9cc39461de4c26f38eaee734301ffd11aaa;hp=270a67b07a22f9da440f72075da83c601969f0f1;hb=887e744e425c6c25fcfdbad863d3c9287ad91d93;hpb=b5abb5111b87fc7973c1e3f3f989e4adc92362d6 diff --git a/ABM2/Engine/VideoUpdate.cpp b/ABM2/Engine/VideoUpdate.cpp index 270a67b..1d66b9c 100755 --- a/ABM2/Engine/VideoUpdate.cpp +++ b/ABM2/Engine/VideoUpdate.cpp @@ -26,6 +26,8 @@ int CVideoUpdate::scrBPP=16; CVideoUpdate::CVideoUpdate() { + assert(screenWidth && screenHeight && screenBPP); + this->g = new Graphics(scrWidth, scrHeight, 16, false); } CVideoUpdate::~CVideoUpdate() @@ -34,7 +36,6 @@ CVideoUpdate::~CVideoUpdate() bool CVideoUpdate::Start() { - assert(screenWidth && screenHeight && screenBPP); /* if(-1==SDL_InitSubSystem(SDL_INIT_VIDEO)) { @@ -59,24 +60,25 @@ bool CVideoUpdate::Start() //hide the mouse cursor SDL_ShowCursor(SDL_DISABLE); */ - this->g = new Graphics(scrWidth, scrHeight, 16, false); if (this->g->createDisplay()) return false; this->g->setCullingMode(AM_CULL_NONE); this->g->setBackground(COLOUR_RGBA(127, 127, 127, 255)); - - this->s = new Sprite("Data/POWBOMB.png", COLOUR_RGBA(0, 0, 255, 255), 64, 64, this->g); + + /* Start a first scene */ + this->g->beginScene(); return true; } void CVideoUpdate::Update() { - this->g->beginScene(); - this->s->blit(0, 0, 1.0, 1.0, 0, 0, COLOUR_RGBA(255, 255, 255, 255)); this->g->endScene(); + this->g->beginScene(); } void CVideoUpdate::Stop() { + /* End the last scene */ + this->g->endScene(); delete this->g; }