mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 22:38:14 +00:00
Misc renaming of types to drop t- prefix
This commit is contained in:
parent
b74afeff73
commit
5392e306b9
@ -1160,7 +1160,7 @@ void display::drawing_buffer_add(const drawing_layer layer,
|
|||||||
const map_location& loc, int x, int y, const surface& surf,
|
const map_location& loc, int x, int y, const surface& surf,
|
||||||
const SDL_Rect &clip)
|
const SDL_Rect &clip)
|
||||||
{
|
{
|
||||||
drawing_buffer_.push_back(tblit(layer, loc, x, y, surf, clip));
|
drawing_buffer_.push_back(blit_helper(layer, loc, x, y, surf, clip));
|
||||||
}
|
}
|
||||||
|
|
||||||
void display::drawing_buffer_add(const drawing_layer layer,
|
void display::drawing_buffer_add(const drawing_layer layer,
|
||||||
@ -1168,7 +1168,7 @@ void display::drawing_buffer_add(const drawing_layer layer,
|
|||||||
const std::vector<surface> &surf,
|
const std::vector<surface> &surf,
|
||||||
const SDL_Rect &clip)
|
const SDL_Rect &clip)
|
||||||
{
|
{
|
||||||
drawing_buffer_.push_back(tblit(layer, loc, x, y, surf, clip));
|
drawing_buffer_.push_back(blit_helper(layer, loc, x, y, surf, clip));
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: temporary method. Group splitting should be made
|
// FIXME: temporary method. Group splitting should be made
|
||||||
@ -1257,10 +1257,10 @@ void display::drawing_buffer_commit()
|
|||||||
* avoid decapitation a unit.
|
* avoid decapitation a unit.
|
||||||
*
|
*
|
||||||
* This ended in the following priority order:
|
* This ended in the following priority order:
|
||||||
* layergroup > location > layer > 'tblit' > surface
|
* layergroup > location > layer > 'blit_helper' > surface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (const tblit &blit : drawing_buffer_) {
|
for (const blit_helper &blit : drawing_buffer_) {
|
||||||
for (const surface& surf : blit.surf()) {
|
for (const surface& surf : blit.surf()) {
|
||||||
// Note that dstrect can be changed by sdl_blit
|
// Note that dstrect can be changed by sdl_blit
|
||||||
// and so a new instance should be initialized
|
// and so a new instance should be initialized
|
||||||
|
@ -945,17 +945,17 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Helper structure for rendering the terrains. */
|
/** Helper structure for rendering the terrains. */
|
||||||
class tblit
|
class blit_helper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
tblit(const drawing_layer layer, const map_location& loc,
|
blit_helper(const drawing_layer layer, const map_location& loc,
|
||||||
const int x, const int y, const surface& surf,
|
const int x, const int y, const surface& surf,
|
||||||
const SDL_Rect& clip)
|
const SDL_Rect& clip)
|
||||||
: x_(x), y_(y), surf_(1, surf), clip_(clip),
|
: x_(x), y_(y), surf_(1, surf), clip_(clip),
|
||||||
key_(loc, layer)
|
key_(loc, layer)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
tblit(const drawing_layer layer, const map_location& loc,
|
blit_helper(const drawing_layer layer, const map_location& loc,
|
||||||
const int x, const int y, const std::vector<surface>& surf,
|
const int x, const int y, const std::vector<surface>& surf,
|
||||||
const SDL_Rect& clip)
|
const SDL_Rect& clip)
|
||||||
: x_(x), y_(y), surf_(surf), clip_(clip),
|
: x_(x), y_(y), surf_(surf), clip_(clip),
|
||||||
@ -967,7 +967,7 @@ protected:
|
|||||||
const std::vector<surface> &surf() const { return surf_; }
|
const std::vector<surface> &surf() const { return surf_; }
|
||||||
const SDL_Rect &clip() const { return clip_; }
|
const SDL_Rect &clip() const { return clip_; }
|
||||||
|
|
||||||
bool operator<(const tblit &rhs) const { return key_ < rhs.key_; }
|
bool operator<(const blit_helper &rhs) const { return key_ < rhs.key_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int x_; /**< x screen coordinate to render at. */
|
int x_; /**< x screen coordinate to render at. */
|
||||||
@ -980,8 +980,8 @@ protected:
|
|||||||
drawing_buffer_key key_;
|
drawing_buffer_key key_;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<tblit> tdrawing_buffer;
|
typedef std::list<blit_helper> drawing_buffer;
|
||||||
tdrawing_buffer drawing_buffer_;
|
drawing_buffer drawing_buffer_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -59,9 +59,7 @@ struct ttf_record
|
|||||||
int style;
|
int style;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<font_id, ttf_record> tfont_table;
|
static std::map<font_id, ttf_record> font_table;
|
||||||
|
|
||||||
static tfont_table font_table;
|
|
||||||
static std::vector<std::string> font_names;
|
static std::vector<std::string> font_names;
|
||||||
static std::vector<std::string> bold_names;
|
static std::vector<std::string> bold_names;
|
||||||
static std::vector<std::string> italic_names;
|
static std::vector<std::string> italic_names;
|
||||||
@ -139,8 +137,8 @@ typedef std::map<std::string,SDL_Rect> line_size_cache_map;
|
|||||||
//map of styles -> sizes -> cache
|
//map of styles -> sizes -> cache
|
||||||
static std::map<int,std::map<int,line_size_cache_map> > line_size_cache;
|
static std::map<int,std::map<int,line_size_cache_map> > line_size_cache;
|
||||||
|
|
||||||
typedef std::map<std::pair<std::string, int>, TTF_Font*> topen_font_cache;
|
typedef std::map<std::pair<std::string, int>, TTF_Font*> open_font_cache;
|
||||||
topen_font_cache open_fonts;
|
open_font_cache open_fonts;
|
||||||
|
|
||||||
static TTF_Font* open_font_impl(const std::string & , int);
|
static TTF_Font* open_font_impl(const std::string & , int);
|
||||||
|
|
||||||
@ -150,7 +148,7 @@ static TTF_Font* open_font_impl(const std::string & , int);
|
|||||||
static TTF_Font* open_font(const std::string& fname, int size)
|
static TTF_Font* open_font(const std::string& fname, int size)
|
||||||
{
|
{
|
||||||
const std::pair<std::string, int> key = std::make_pair(fname, size);
|
const std::pair<std::string, int> key = std::make_pair(fname, size);
|
||||||
const topen_font_cache::iterator it = open_fonts.find(key);
|
const open_font_cache::iterator it = open_fonts.find(key);
|
||||||
if (it != open_fonts.end()) {
|
if (it != open_fonts.end()) {
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ namespace implementation {
|
|||||||
, typename ToEnable = void
|
, typename ToEnable = void
|
||||||
, typename FromEnable = void
|
, typename FromEnable = void
|
||||||
>
|
>
|
||||||
struct tlexical_cast;
|
struct lexical_cast;
|
||||||
|
|
||||||
} // namespace implementation
|
} // namespace implementation
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ namespace implementation {
|
|||||||
template<typename To, typename From>
|
template<typename To, typename From>
|
||||||
inline To lexical_cast(From value)
|
inline To lexical_cast(From value)
|
||||||
{
|
{
|
||||||
return implementation::tlexical_cast<To, From>().operator()(value);
|
return implementation::lexical_cast<To, From>().operator()(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Thrown when a lexical_cast fails. */
|
/** Thrown when a lexical_cast fails. */
|
||||||
@ -116,7 +116,7 @@ template<
|
|||||||
, typename ToEnable
|
, typename ToEnable
|
||||||
, typename FromEnable
|
, typename FromEnable
|
||||||
>
|
>
|
||||||
struct tlexical_cast
|
struct lexical_cast
|
||||||
{
|
{
|
||||||
To operator()(From value)
|
To operator()(From value)
|
||||||
{
|
{
|
||||||
@ -140,7 +140,7 @@ struct tlexical_cast
|
|||||||
* integral type.
|
* integral type.
|
||||||
*/
|
*/
|
||||||
template <typename From>
|
template <typename From>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
std::string
|
std::string
|
||||||
, From
|
, From
|
||||||
, void
|
, void
|
||||||
@ -166,7 +166,7 @@ struct tlexical_cast<
|
|||||||
* performance penalty at 32 bit systems.
|
* performance penalty at 32 bit systems.
|
||||||
*/
|
*/
|
||||||
template <class From>
|
template <class From>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
long long
|
long long
|
||||||
, From
|
, From
|
||||||
, void
|
, void
|
||||||
@ -197,7 +197,7 @@ struct tlexical_cast<
|
|||||||
* performance penalty at 32 bit systems.
|
* performance penalty at 32 bit systems.
|
||||||
*/
|
*/
|
||||||
template <>
|
template <>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
long long
|
long long
|
||||||
, std::string
|
, std::string
|
||||||
>
|
>
|
||||||
@ -216,7 +216,7 @@ struct tlexical_cast<
|
|||||||
* Specialized for returning a signed type from a (const) char*.
|
* Specialized for returning a signed type from a (const) char*.
|
||||||
*/
|
*/
|
||||||
template <class To, class From>
|
template <class To, class From>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
To
|
To
|
||||||
, From
|
, From
|
||||||
, typename std::enable_if<std::is_signed<To>::value >::type
|
, typename std::enable_if<std::is_signed<To>::value >::type
|
||||||
@ -245,7 +245,7 @@ struct tlexical_cast<
|
|||||||
* Specialized for returning a signed type from a std::string.
|
* Specialized for returning a signed type from a std::string.
|
||||||
*/
|
*/
|
||||||
template <class To>
|
template <class To>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
To
|
To
|
||||||
, std::string
|
, std::string
|
||||||
, typename std::enable_if<std::is_signed<To>::value >::type
|
, typename std::enable_if<std::is_signed<To>::value >::type
|
||||||
@ -267,7 +267,7 @@ struct tlexical_cast<
|
|||||||
* has a performance penalty at 32 bit systems.
|
* has a performance penalty at 32 bit systems.
|
||||||
*/
|
*/
|
||||||
template <class From>
|
template <class From>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
unsigned long long
|
unsigned long long
|
||||||
, From
|
, From
|
||||||
, void
|
, void
|
||||||
@ -299,7 +299,7 @@ struct tlexical_cast<
|
|||||||
* has a performance penalty at 32 bit systems.
|
* has a performance penalty at 32 bit systems.
|
||||||
*/
|
*/
|
||||||
template <>
|
template <>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
unsigned long long
|
unsigned long long
|
||||||
, std::string
|
, std::string
|
||||||
>
|
>
|
||||||
@ -318,7 +318,7 @@ struct tlexical_cast<
|
|||||||
* Specialized for returning a unsigned type from a (const) char*.
|
* Specialized for returning a unsigned type from a (const) char*.
|
||||||
*/
|
*/
|
||||||
template <class To, class From>
|
template <class To, class From>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
To
|
To
|
||||||
, From
|
, From
|
||||||
, typename std::enable_if<std::is_unsigned<To>::value >::type
|
, typename std::enable_if<std::is_unsigned<To>::value >::type
|
||||||
@ -347,7 +347,7 @@ struct tlexical_cast<
|
|||||||
* Specialized for returning a unsigned type from a std::string.
|
* Specialized for returning a unsigned type from a std::string.
|
||||||
*/
|
*/
|
||||||
template <class To>
|
template <class To>
|
||||||
struct tlexical_cast<
|
struct lexical_cast<
|
||||||
To
|
To
|
||||||
, std::string
|
, std::string
|
||||||
, typename std::enable_if<std::is_unsigned<To>::value >::type
|
, typename std::enable_if<std::is_unsigned<To>::value >::type
|
||||||
|
@ -58,13 +58,13 @@ static std::ostream& output()
|
|||||||
|
|
||||||
namespace lg {
|
namespace lg {
|
||||||
|
|
||||||
tredirect_output_setter::tredirect_output_setter(std::ostream& stream)
|
redirect_output_setter::redirect_output_setter(std::ostream& stream)
|
||||||
: old_stream_(output_stream)
|
: old_stream_(output_stream)
|
||||||
{
|
{
|
||||||
output_stream = &stream;
|
output_stream = &stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
tredirect_output_setter::~tredirect_output_setter()
|
redirect_output_setter::~redirect_output_setter()
|
||||||
{
|
{
|
||||||
output_stream = old_stream_;
|
output_stream = old_stream_;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ namespace lg {
|
|||||||
* The main usage of the redirection is for the unit tests to validate the
|
* The main usage of the redirection is for the unit tests to validate the
|
||||||
* output on the logger with the expected output.
|
* output on the logger with the expected output.
|
||||||
*/
|
*/
|
||||||
class tredirect_output_setter
|
class redirect_output_setter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -77,9 +77,9 @@ public:
|
|||||||
*
|
*
|
||||||
* @param stream The stream to direct the output to.
|
* @param stream The stream to direct the output to.
|
||||||
*/
|
*/
|
||||||
explicit tredirect_output_setter(std::ostream& stream);
|
explicit redirect_output_setter(std::ostream& stream);
|
||||||
|
|
||||||
~tredirect_output_setter();
|
~redirect_output_setter();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ static void test_grid()
|
|||||||
|
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
lg::tredirect_output_setter redirect_output(sstr);
|
lg::redirect_output_setter redirect_output(sstr);
|
||||||
|
|
||||||
gui2::iterator::titerator<gui2::iterator::policy::order::ttop_down<
|
gui2::iterator::titerator<gui2::iterator::policy::order::ttop_down<
|
||||||
true
|
true
|
||||||
@ -212,7 +212,7 @@ static void test_grid()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
lg::tredirect_output_setter redirect_output(sstr);
|
lg::redirect_output_setter redirect_output(sstr);
|
||||||
|
|
||||||
gui2::iterator::titerator<gui2::iterator::policy::order::ttop_down<
|
gui2::iterator::titerator<gui2::iterator::policy::order::ttop_down<
|
||||||
true
|
true
|
||||||
@ -228,7 +228,7 @@ static void test_grid()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
lg::tredirect_output_setter redirect_output(sstr);
|
lg::redirect_output_setter redirect_output(sstr);
|
||||||
|
|
||||||
gui2::iterator::titerator<gui2::iterator::policy::order::tbottom_up<
|
gui2::iterator::titerator<gui2::iterator::policy::order::tbottom_up<
|
||||||
true
|
true
|
||||||
@ -244,7 +244,7 @@ static void test_grid()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
lg::tredirect_output_setter redirect_output(sstr);
|
lg::redirect_output_setter redirect_output(sstr);
|
||||||
|
|
||||||
gui2::iterator::titerator<gui2::iterator::policy::order::tbottom_up<
|
gui2::iterator::titerator<gui2::iterator::policy::order::tbottom_up<
|
||||||
true
|
true
|
||||||
@ -273,7 +273,7 @@ BOOST_AUTO_TEST_CASE(test_gui2_iterator)
|
|||||||
lg::timestamps(false);
|
lg::timestamps(false);
|
||||||
|
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
lg::tredirect_output_setter redirect_output(sstr);
|
lg::redirect_output_setter redirect_output(sstr);
|
||||||
|
|
||||||
test_control();
|
test_control();
|
||||||
test_grid();
|
test_grid();
|
||||||
|
@ -116,7 +116,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::stringstream ignored_stream_;
|
std::stringstream ignored_stream_;
|
||||||
lg::tredirect_output_setter output_redirect_;
|
lg::redirect_output_setter output_redirect_;
|
||||||
filesystem::binary_paths_manager paths_manager_;
|
filesystem::binary_paths_manager paths_manager_;
|
||||||
};
|
};
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user