#include #include #include #include "textures.hpp" #include "levelmanager.hpp" using namespace fmt; TEST_CASE("test texture management", "[textures]") { textures::init(); auto spider = textures::get("hairy_spider"); REQUIRE(spider.sprite != nullptr); REQUIRE(spider.texture != nullptr); auto image = textures::load_image("assets/hairy_spider-256.png"); auto img_ptr = textures::get_surface(0); REQUIRE(img_ptr != nullptr); auto floor_ptr = textures::get_floor(); REQUIRE(floor_ptr != nullptr); auto ceiling_ptr = textures::get_ceiling(); REQUIRE(ceiling_ptr != nullptr); LevelManager levels; GameLevel level = levels.current(); auto& tiles = level.map->tiles(); auto& walls = level.map->walls(); REQUIRE(matrix::width(tiles) == matrix::width(walls)); REQUIRE(matrix::height(tiles) == matrix::height(walls)); }