playback_demo_stream->seekg(0); // old style w/o seed, restart at beg
}
-namespace {
- inline const char* chain(const char* c1, const char* c2) {
- return (std::string(c1) + std::string(c2)).c_str();
- }
- inline const char* chain(const char* c1, const char* c2, const char* c3) {
- return (std::string(c1) + std::string(c2) + std::string(c3)).c_str();
- }
-}
-
void
GameSession::levelintro()
{
- char str[60];
-
sound_manager->stop_music();
DrawingContext context;
context.draw_center_text(gold_text, level->get_name(), Vector(0, 160),
LAYER_FOREGROUND1);
- snprintf(str, sizeof(str), chain(_("Coins"), ": %d"), player_status->coins);
- context.draw_text(white_text, str, Vector(SCREEN_WIDTH/2, 210),
+ std::stringstream ss_coins;
+ ss_coins << _("Coins") << ": " << player_status->coins;
+ context.draw_text(white_text, ss_coins.str(), Vector(SCREEN_WIDTH/2, 210),
CENTER_ALLIGN, LAYER_FOREGROUND1);
if((level->get_author().size()) && (level->get_author() != "SuperTux Team"))
#include <assert.h>
#include <math.h>
+#include <sstream>
#include "video/drawing_context.hpp"
#include "gettext.hpp"
#include "lisp/lisp.hpp"
const float WMAP_INFO_TOP_Y1 = 600 - 128 - 16;
const float WMAP_INFO_TOP_Y2 = 600 - 128;
-namespace {
- inline const char* chain(const char* c1, const char* c2) {
- return (std::string(c1) + std::string(c2)).c_str();
- }
- inline const char* chain(const char* c1, const char* c2, const char* c3) {
- return (std::string(c1) + std::string(c2) + std::string(c3)).c_str();
- }
-}
-
void
Statistics::draw_worldmap_info(DrawingContext& context)
{
// skip draw if stats were declared invalid
if (!valid) return;
- context.draw_text(white_small_text, ::chain("- ", _("Best Level Statistics"), " -"), Vector((WMAP_INFO_LEFT_X + WMAP_INFO_RIGHT_X) / 2, WMAP_INFO_TOP_Y1), CENTER_ALLIGN, LAYER_GUI);
+ context.draw_text(white_small_text, std::string("- ") + _("Best Level Statistics") + " -", Vector((WMAP_INFO_LEFT_X + WMAP_INFO_RIGHT_X) / 2, WMAP_INFO_TOP_Y1), CENTER_ALLIGN, LAYER_GUI);
float alpha;
if(timer.get_timegone() < FADING_TIME)