Removed old code for [portrait]

This was an experimental feature that was never finished. Any [portrait]
tags were removed from the unit type WML a while back
This commit is contained in:
Charles Dang 2016-03-21 03:47:13 +11:00
parent 11e1917d21
commit 33a04c32e2
7 changed files with 2 additions and 108 deletions

View file

@ -985,8 +985,6 @@
<Unit filename="../../src/playturn.hpp" />
<Unit filename="../../src/playturn_network_adapter.cpp" />
<Unit filename="../../src/playturn_network_adapter.hpp" />
<Unit filename="../../src/portrait.cpp" />
<Unit filename="../../src/portrait.hpp" />
<Unit filename="../../src/preferences.cpp" />
<Unit filename="../../src/preferences.hpp" />
<Unit filename="../../src/preferences_display.cpp" />

View file

@ -975,7 +975,6 @@ set(wesnoth-main_SRC
playsingle_controller.cpp
playturn.cpp
playturn_network_adapter.cpp
portrait.cpp
random_new.cpp
random_new_deterministic.cpp
random_new_synced.cpp

View file

@ -555,7 +555,6 @@ wesnoth_sources = Split("""
playsingle_controller.cpp
playturn.cpp
playturn_network_adapter.cpp
portrait.cpp
random_new.cpp
random_new_deterministic.cpp
random_new_synced.cpp

View file

@ -1,48 +0,0 @@
/*
Copyright (C) 2008 - 2016 by mark de wever <koraq@xs4all.nl>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#include "portrait.hpp"
#include "config.hpp"
#include "log.hpp"
#include "util.hpp"
#include "wml_exception.hpp"
static lg::log_domain log_config("config");
#define WRN_CF LOG_STREAM(warn, log_config)
static tportrait::tside get_side(const std::string& side)
{
if(side == "both") {
return tportrait::BOTH;
} else if(side == "right") {
return tportrait::RIGHT;
} else if(side == "left") {
return tportrait::LEFT;
} else {
WRN_CF << "Unknown portrait side '" << side << "' defaulting to left." << std::endl;
return tportrait::LEFT;
}
}
tportrait::tportrait(const config& cfg) :
image(cfg["image"]),
side(get_side(cfg["side"])),
size(cfg["size"].to_unsigned()),
mirror(cfg["mirror"].to_bool())
{
VALIDATE(!image.empty(), missing_mandatory_wml_key("portrait", "image"));
VALIDATE(size != 0, missing_mandatory_wml_key("portrait", "size"));
}

View file

@ -1,41 +0,0 @@
/*
Copyright (C) 2008 - 2016 by mark de wever <koraq@xs4all.nl>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#ifndef PORTRAIT_HPP_INCLUDED
#define PORTRAIT_HPP_INCLUDED
class config;
#include <string>
/**
* @todo this is a proof-of-concept version and undocumented. It should be
* documented later and also allow WML to modify the portraits. This all
* starts to make sense when the new dialogs become mainline.
*/
/** Contains the definition of a portrait for a unit(type). */
struct tportrait {
tportrait(const config& cfg);
enum tside { LEFT, RIGHT, BOTH };
std::string image;
tside side;
unsigned size;
bool mirror;
};
#endif

View file

@ -27,7 +27,6 @@
#include "loadscreen.hpp"
#include "log.hpp"
#include "make_enum.hpp"
#include "portrait.hpp"
#include "unit.hpp"
#include "unit_abilities.hpp"
#include "unit_animation.hpp"
@ -99,8 +98,7 @@ unit_type::unit_type(const unit_type& o) :
possible_traits_(o.possible_traits_),
genders_(o.genders_),
animations_(o.animations_),
build_status_(o.build_status_),
portraits_(o.portraits_)
build_status_(o.build_status_)
{
gender_types_[0] = o.gender_types_[0] != NULL ? new unit_type(*o.gender_types_[0]) : NULL;
gender_types_[1] = o.gender_types_[1] != NULL ? new unit_type(*o.gender_types_[1]) : NULL;
@ -159,8 +157,7 @@ unit_type::unit_type(const config &cfg, const std::string & parent_id) :
possible_traits_(),
genders_(),
animations_(),
build_status_(NOT_BUILT),
portraits_()
build_status_(NOT_BUILT)
{
gender_types_[0] = NULL;
gender_types_[1] = NULL;
@ -227,10 +224,6 @@ void unit_type::build_full(const movement_type_map &mv_types,
game_config::add_color_info(cfg_);
BOOST_FOREACH(const config &portrait, cfg_.child_range("portrait")) {
portraits_.push_back(tportrait(portrait));
}
hp_bar_scaling_ = cfg_["hp_bar_scaling"].to_double(game_config::hp_bar_scaling);
xp_bar_scaling_ = cfg_["xp_bar_scaling"].to_double(game_config::xp_bar_scaling);

View file

@ -28,7 +28,6 @@
#include <string>
#include <vector>
struct tportrait;
class unit_ability_list;
class unit_animation;
@ -210,8 +209,6 @@ public:
bool hide_help() const;
bool do_not_list() const { return do_not_list_; }
const std::vector<tportrait>& portraits() const { return portraits_; }
const config &get_cfg() const { return cfg_; }
/// Returns a trimmed config suitable for use with units.
const config & get_cfg_for_units() const
@ -293,9 +290,6 @@ private:
mutable std::vector<unit_animation> animations_;
BUILD_STATUS build_status_;
/** List with the portraits available for the unit. */
std::vector<tportrait> portraits_;
};
class unit_type_data