From: Daniel Karbach Date: Sun, 30 Sep 2012 14:26:27 +0000 (+0200) Subject: added test entity X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=350233c2834eb36e66220aba490f1876bd6b19bf;p=l2e.git added test entity --- diff --git a/src/main.cpp b/src/main.cpp index 0a6882a..f6a069c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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(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 index 0000000..65df7dd Binary files /dev/null and b/test-data/maxim-map.png differ