]> git.localhorst.tv Git - l2e.git/commitdiff
added test entity
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 30 Sep 2012 14:26:27 +0000 (16:26 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 30 Sep 2012 14:26:27 +0000 (16:26 +0200)
src/main.cpp
test-data/maxim-map.png [new file with mode: 0644]

index 0a6882a5c4187897f46697d5b34e2337c6d2e744..f6a069c2331eb73a695de2a7f1a3a87c858b4243 100644 (file)
@@ -32,6 +32,7 @@
 #include "loader/Parser.h"
 #include "loader/TypeDescription.h"
 #include "map/Area.h"
+#include "map/Entity.h"
 #include "map/Map.h"
 #include "map/MapState.h"
 #include "map/Tile.h"
@@ -74,6 +75,7 @@ using loader::ParsedSource;
 using loader::Parser;
 using loader::TypeDescription;
 using map::Area;
+using map::Entity;
 using map::Map;
 using map::MapState;
 using map::Tile;
@@ -318,6 +320,12 @@ int main(int argc, char **argv) {
                map.SetTileset(&tileset);
                map.SetWidth(1);
 
+               SDL_Surface *mapMaximImg(IMG_Load("test-data/maxim-map.png"));
+               Sprite mapMaximSprite(mapMaximImg, 32, 64);
+               Entity mapMaxim;
+               mapMaxim.SetSprite(&mapMaximSprite);
+               mapMaxim.Position() = Vector<float>(80, 160);
+
                InitScreen screen(width, height);
 
                app::State *state(0);
@@ -335,6 +343,8 @@ int main(int argc, char **argv) {
                        state = battleState;
                } else {
                        MapState *mapState(new MapState(&map));
+                       mapState->AddEntity(&mapMaxim);
+                       mapState->ControlEntity(&mapMaxim);
                        state = mapState;
                }
 
diff --git a/test-data/maxim-map.png b/test-data/maxim-map.png
new file mode 100644 (file)
index 0000000..65df7dd
Binary files /dev/null and b/test-data/maxim-map.png differ