Skip to content

Commit

Permalink
fixup messed up whitespace and similar
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed May 16, 2014
1 parent db08784 commit 7b6a1ec
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion data/test/scenarios/test_grunt_tod_damage.cfg
Expand Up @@ -8,7 +8,7 @@

#define TEST_GRUNT_DAMAGE ID X Y EXPECTED_DAMAGE
{UNIT 2 "Orcish Grunt" "$({X} + 1)" {Y} (random_traits=false)}
{UNIT 1 "Elvish Archer" {X} {Y} (id={ID})}
{UNIT 1 "Elvish Archer" {X} {Y} (id={ID})}
[do_command]
[attack]
weapon = 0
Expand Down
2 changes: 1 addition & 1 deletion data/test/scenarios/unit_spawns_at_nearest_vacant_hex.cfg
Expand Up @@ -17,7 +17,7 @@
{UNIT 2 "Orcish Grunt" 2 3 ()}
{UNIT 2 "Orcish Grunt" 2 4 ()}

{UNIT 1 "Orcish Grunt" 3 4 ()}
{UNIT 1 "Orcish Grunt" 3 4 ()}

[store_unit]
variable = test
Expand Down
34 changes: 20 additions & 14 deletions src/game_config.cpp
Expand Up @@ -84,9 +84,9 @@ namespace game_config

namespace images {
std::string game_title,
game_title_background,
game_title_background,
// orbs and hp/xp bar
orb,
orb,
energy,
// flags
flag,
Expand All @@ -106,7 +106,7 @@ namespace game_config
tod_dark,
///@todo de-hardcode this
selected_menu = "buttons/radiobox-pressed.png",
deselected_menu = "buttons/radiobox.png",
deselected_menu = "buttons/radiobox.png",
checked_menu = "buttons/checkbox-pressed.png",
unchecked_menu = "buttons/checkbox.png",
wml_menu = "buttons/WML-custom.png",
Expand Down Expand Up @@ -202,11 +202,11 @@ namespace game_config

if(const config &i = v.child("colors")){
using namespace game_config::colors;
moved_orb_color = i["moved_orb_color"].str();
unmoved_orb_color = i["unmoved_orb_color"].str();
partial_orb_color = i["partial_orb_color"].str();
enemy_orb_color = i["enemy_orb_color"].str();
ally_orb_color = i["ally_orb_color"].str();
moved_orb_color = i["moved_orb_color"].str();
unmoved_orb_color = i["unmoved_orb_color"].str();
partial_orb_color = i["partial_orb_color"].str();
enemy_orb_color = i["enemy_orb_color"].str();
ally_orb_color = i["ally_orb_color"].str();
} // colors

show_ally_orb = v["show_ally_orb"].to_bool(true);
Expand All @@ -218,9 +218,9 @@ namespace game_config
if(const config &i = v.child("images")){
using namespace game_config::images;
game_title = i["game_title"].str();
game_title_background = i["game_title_background"].str();
game_title_background = i["game_title_background"].str();

orb = i["orb"].str();
orb = i["orb"].str();
energy = i["energy"].str();

flag = i["flag"].str();
Expand Down Expand Up @@ -256,8 +256,9 @@ namespace game_config

add_color_info(v);

if (const config::attribute_value *a = v.get("flag_rgb"))
if (const config::attribute_value *a = v.get("flag_rgb")) {
flag_rgb = a->str();
}

std::string color_string = v["red_green_scale"].str();
if(!string2rgb(color_string, red_green_scale)) {
Expand Down Expand Up @@ -311,7 +312,9 @@ namespace game_config
{
const config::attribute_value *a1 = teamC.get("id"),
*a2 = teamC.get("rgb");
if (!a1 || !a2) continue;
if (!a1 || !a2) {
continue;
}
std::string id = *a1;
std::vector<Uint32> temp;
if(!string2rgb(*a2, temp)) {
Expand All @@ -323,7 +326,9 @@ namespace game_config
team_rgb_name[id] = teamC["name"];
//generate palette of same name;
std::vector<Uint32> tp = palette(team_rgb_range[id]);
if (tp.empty()) continue;
if (tp.empty()) {
continue;
}
team_rgb_colors.insert(std::make_pair(id,tp));
//if this is being used, output log of palette for artists use.
DBG_NG << "color palette creation:\n";
Expand Down Expand Up @@ -359,8 +364,9 @@ namespace game_config
std::map<std::string, color_range>::const_iterator i = team_rgb_range.find(name);
if(i == team_rgb_range.end()) {
std::vector<Uint32> temp;
if(!string2rgb(name, temp))
if(!string2rgb(name, temp)) {
throw config::error(_("Invalid color range: ") + name);
}
team_rgb_range.insert(std::make_pair(name,color_range(temp)));
return color_info(name);
}
Expand Down

0 comments on commit 7b6a1ec

Please sign in to comment.