unhardcoding missing-image to game_config.cfg
This commit is contained in:
parent
35a1ee8267
commit
a47218be5a
7 changed files with 13 additions and 10 deletions
|
@ -104,7 +104,8 @@
|
|||
tod_bright="misc/tod-bright.png"
|
||||
tod_dark="misc/tod-dark.png"
|
||||
level="misc/icon-advance.png"
|
||||
ellipsis="misc/icon-ellipsis.png"
|
||||
|
||||
missing="misc/missing-image.png"
|
||||
[/images]
|
||||
|
||||
fog_prefix="terrain/fog/fog"
|
||||
|
|
|
@ -666,7 +666,7 @@ namespace {
|
|||
void do_addon_icon_fixups(std::string& icon, const std::string& addon_name)
|
||||
{
|
||||
static const std::string default_icon = "misc/blank-hex.png";
|
||||
static const std::string debug_default_icon = "misc/missing-image.png";
|
||||
static const std::string debug_default_icon = game_config::images::missing;
|
||||
|
||||
if(icon.empty()) {
|
||||
ERR_CFG << "remote add-on '" << addon_name << "' has no icon\n";
|
||||
|
|
|
@ -266,7 +266,7 @@ void arrow::update_symbols()
|
|||
if (!image.file_exists())
|
||||
{
|
||||
ERR_ARR << "Image " << image_filename << " not found.\n";
|
||||
image = image::locator("misc/missing-image.png");
|
||||
image = image::locator(game_config::images::missing);
|
||||
}
|
||||
symbols_map_[*hex] = image;
|
||||
}
|
||||
|
|
|
@ -446,7 +446,7 @@ void terrain_palette::draw(bool force) {
|
|||
if(base_image == NULL) {
|
||||
tooltip_text << "BASE IMAGE NOT FOUND\n";
|
||||
ERR_ED << "image for terrain " << counter << ": '" << base_filename << "' not found\n";
|
||||
base_image = image::get_image("misc/missing-image.png");
|
||||
base_image = image::get_image(game_config::images::missing);
|
||||
if (base_image == NULL) {
|
||||
ERR_ED << "Placeholder image not found\n";
|
||||
return;
|
||||
|
@ -468,7 +468,7 @@ void terrain_palette::draw(bool force) {
|
|||
if(image == NULL) {
|
||||
tooltip_text << "IMAGE NOT FOUND\n";
|
||||
ERR_ED << "image for terrain " << counter << ": '" << filename << "' not found\n";
|
||||
image = image::get_image("misc/missing-image.png");
|
||||
image = image::get_image(game_config::images::missing);
|
||||
if (image == NULL) {
|
||||
ERR_ED << "Placeholder image not found\n";
|
||||
return;
|
||||
|
|
|
@ -94,7 +94,8 @@ namespace game_config
|
|||
unchecked_menu = "buttons/checkbox.png",
|
||||
wml_menu = "buttons/WML-custom.png",
|
||||
level,
|
||||
ellipsis;
|
||||
ellipsis,
|
||||
missing;
|
||||
} //images
|
||||
|
||||
std::string shroud_prefix, fog_prefix;
|
||||
|
@ -211,6 +212,7 @@ namespace game_config
|
|||
tod_dark = i["tod_dark"].str();
|
||||
level = i["level"].str();
|
||||
ellipsis = i["ellipsis"].str();
|
||||
missing = i["missing"].str();
|
||||
} // images
|
||||
|
||||
hp_bar_scaling = v["hp_bar_scaling"].to_double(0.666);
|
||||
|
|
|
@ -100,7 +100,8 @@ namespace game_config
|
|||
unchecked_menu,
|
||||
wml_menu,
|
||||
level,
|
||||
ellipsis;
|
||||
ellipsis,
|
||||
missing;
|
||||
} //images
|
||||
|
||||
|
||||
|
|
|
@ -472,9 +472,8 @@ surface locator::load_image_file() const
|
|||
|
||||
if (res.null() && !val_.filename_.empty()) {
|
||||
ERR_DP << "could not open image '" << val_.filename_ << "'\n";
|
||||
static const std::string missing = "misc/missing-image.png";
|
||||
if (game_config::debug && val_.filename_ != missing)
|
||||
return get_image(missing, UNSCALED);
|
||||
if (game_config::debug && val_.filename_ != game_config::images::missing)
|
||||
return get_image(game_config::images::missing, UNSCALED);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Add table
Reference in a new issue