#include <catch2/catch_test_macros.hpp>
#include <fmt/core.h>
#include <string>
#include "textures.hpp"
#include "levelmanager.hpp"

using namespace fmt;

TEST_CASE("test texture management", "[textures]") {
  components::init();
  textures::init();
  auto spider = textures::get("hairy_spider");
  REQUIRE(spider.sprite != nullptr);
  REQUIRE(spider.texture != nullptr);

  auto image = textures::load_image("assets/sprites/hairy_spider.png");

  auto img_ptr = textures::get_surface(0);
  REQUIRE(img_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));
}
