* Move SpriteID enum to engine.h.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 19:28:20 +0000 (21:28 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 19:28:20 +0000 (21:28 +0200)
 * Make Playground draw the background.
 * Add "Data/" to sprite filenames.

ABM2/Engine/engine.h
ABM2/Playground.cpp
ABM2/main.cpp

index 629e8a34f4224c5f4a81d5a164a0478efce3c521..78a7e8be49c9e9b8279b06bb4f1d3dad5465ded9 100755 (executable)
 #include "misc.h"\r
 #include "math.h"\r
 \r
+/** Where should this be? */\r
+enum SpriteID {\r
+       SPR_NONE = 0,\r
+       SPR_FIELD,\r
+       SPR_SOLID,\r
+       SPR_BRICK,\r
+       SPR_BLANK,\r
+       SPR_PLAYER,\r
+};\r
+\r
 #endif\r
index ec8002428c39c270ccb84a2afd09735b2e27571e..c1876418a4713d0203b61a96359092fe0df83a56 100755 (executable)
@@ -1,5 +1,6 @@
 #include "Playground.h"\r
 \r
+#include "Engine/engine.h"\r
 #include "Engine/VideoUpdate.h"\r
 #include "SchemeReader.h"\r
 \r
@@ -126,6 +127,9 @@ bool Playground::Start()
 \r
 void Playground::Update()\r
 {\r
+       CMMPointer<Sprite> s = this->kernel->getSpriteManager()->getSprite(SPR_FIELD);\r
+       \r
+       s->blit(0, 0, 1.0, 1.0, 0, 0, COLOUR_RGBA(0, 0, 255, 255));\r
        #ifdef WIN32\r
        if(CInputTask::keyDown(DIK_ESCAPE))CKernel::GetSingleton().KillAllTasks();\r
 \r
index 5e1a52ac19125ccf5f86576fbdae4a52557badd5..40efd1104e8ded8b8359c0a6b961724ab3c892d3 100755 (executable)
 #define SCREEN_WIDTH  640\r
 #define SCREEN_HEIGHT 480\r
 \r
-enum SpriteID {\r
-       SPR_NONE = 0,\r
-       SPR_FIELD,\r
-       SPR_SOLID,\r
-       SPR_BRICK,\r
-       SPR_BLANK,\r
-       SPR_PLAYER,\r
-};\r
-\r
 SpriteData defaultSprites[] = {\r
-       {SPR_FIELD, "FIELD0.png", 640, 480},\r
-       {SPR_BLANK, "FIELD0.png", 640, 480},\r
+       {SPR_FIELD, "Data/FIELD0.png", 640, 480},\r
+       {SPR_BLANK, "Data/FIELD0.png", 640, 480},\r
        {SPR_NONE, NULL, 0, 0}\r
 };\r
 \r
@@ -178,6 +169,7 @@ void CApplication::Run(int argc, char *argv[])
        game.priority=100;\r
        CKernel::GetSingleton().AddTask(CMMPointer<ITask>(&game));\r
 \r
+\r
        //set up the profiler with an output handler\r
        CProfileLogHandler profileLogHandler;\r
        CProfileSample::outputHandler=&profileLogHandler;\r