Removed dbc and replaced with plain asserts everywhere.
This commit is contained in:
parent
767147c301
commit
adc192c6dc
17 changed files with 69 additions and 185 deletions
|
@ -1,4 +1,3 @@
|
|||
#include "guecs/dbc.hpp"
|
||||
#include "guecs/sfml/textures.hpp"
|
||||
#include "guecs/sfml/config.hpp"
|
||||
#include <SFML/Graphics/Image.hpp>
|
||||
|
@ -36,16 +35,16 @@ namespace textures {
|
|||
}
|
||||
|
||||
SpriteTexture get(const std::string& name) {
|
||||
dbc::check(initialized, "you forgot to call textures::init()");
|
||||
dbc::check(TMGR.sprite_textures.contains(name),
|
||||
fmt::format("!!!!! texture pack does not contain {} sprite", name));
|
||||
assert(initialized && "you forgot to call textures::init()");
|
||||
assert(TMGR.sprite_textures.contains(name) &&
|
||||
"!!!!! texture pack does not contain sprite");
|
||||
|
||||
auto result = TMGR.sprite_textures.at(name);
|
||||
|
||||
dbc::check(result.sprite != nullptr,
|
||||
fmt::format("bad sprite from textures::get named {}", name));
|
||||
dbc::check(result.texture != nullptr,
|
||||
fmt::format("bad texture from textures::get named {}", name));
|
||||
assert(result.sprite != nullptr &&
|
||||
"bad sprite from textures::get named can't be null");
|
||||
assert(result.texture != nullptr &&
|
||||
"bad texture from textures::get named can't be null");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -53,7 +52,7 @@ namespace textures {
|
|||
sf::Image load_image(const std::string& filename) {
|
||||
sf::Image texture;
|
||||
bool good = texture.loadFromFile(filename);
|
||||
dbc::check(good, fmt::format("failed to load {}", filename));
|
||||
assert(good && "failed to load image file");
|
||||
return texture;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue