From: Matthijs Kooijman Date: Mon, 11 Jun 2007 19:28:20 +0000 (+0200) Subject: * Move SpriteID enum to engine.h. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2FABM2.git;a=commitdiff_plain;h=736410d1c7278c0d3290f0cb67705473c87cb3c5 * Move SpriteID enum to engine.h. * Make Playground draw the background. * Add "Data/" to sprite filenames. --- diff --git a/ABM2/Engine/engine.h b/ABM2/Engine/engine.h index 629e8a3..78a7e8b 100755 --- a/ABM2/Engine/engine.h +++ b/ABM2/Engine/engine.h @@ -58,4 +58,14 @@ #include "misc.h" #include "math.h" +/** Where should this be? */ +enum SpriteID { + SPR_NONE = 0, + SPR_FIELD, + SPR_SOLID, + SPR_BRICK, + SPR_BLANK, + SPR_PLAYER, +}; + #endif diff --git a/ABM2/Playground.cpp b/ABM2/Playground.cpp index ec80024..c187641 100755 --- a/ABM2/Playground.cpp +++ b/ABM2/Playground.cpp @@ -1,5 +1,6 @@ #include "Playground.h" +#include "Engine/engine.h" #include "Engine/VideoUpdate.h" #include "SchemeReader.h" @@ -126,6 +127,9 @@ bool Playground::Start() void Playground::Update() { + CMMPointer s = this->kernel->getSpriteManager()->getSprite(SPR_FIELD); + + s->blit(0, 0, 1.0, 1.0, 0, 0, COLOUR_RGBA(0, 0, 255, 255)); #ifdef WIN32 if(CInputTask::keyDown(DIK_ESCAPE))CKernel::GetSingleton().KillAllTasks(); diff --git a/ABM2/main.cpp b/ABM2/main.cpp index 5e1a52a..40efd11 100755 --- a/ABM2/main.cpp +++ b/ABM2/main.cpp @@ -14,18 +14,9 @@ #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 -enum SpriteID { - SPR_NONE = 0, - SPR_FIELD, - SPR_SOLID, - SPR_BRICK, - SPR_BLANK, - SPR_PLAYER, -}; - SpriteData defaultSprites[] = { - {SPR_FIELD, "FIELD0.png", 640, 480}, - {SPR_BLANK, "FIELD0.png", 640, 480}, + {SPR_FIELD, "Data/FIELD0.png", 640, 480}, + {SPR_BLANK, "Data/FIELD0.png", 640, 480}, {SPR_NONE, NULL, 0, 0} }; @@ -178,6 +169,7 @@ void CApplication::Run(int argc, char *argv[]) game.priority=100; CKernel::GetSingleton().AddTask(CMMPointer(&game)); + //set up the profiler with an output handler CProfileLogHandler profileLogHandler; CProfileSample::outputHandler=&profileLogHandler;