diff --git a/source/code/BlockGame.cpp b/source/code/BlockGame.cpp index 6d1c0e2..9ebf8a2 100644 --- a/source/code/BlockGame.cpp +++ b/source/code/BlockGame.cpp @@ -933,9 +933,8 @@ void BlockGame::ClearBlocks() { if (toBeCleared[j][i]) { if (!dead) { dead=true; - string tempS = std::to_string(chainSize[chain]); if (chainSize[chain]>1) { - AddText(j, i, tempS, 1000); + AddText(j, i, chainSize[chain], 1000); } } } diff --git a/source/code/BlockGame.hpp b/source/code/BlockGame.hpp index 5c4a9e2..70404de 100644 --- a/source/code/BlockGame.hpp +++ b/source/code/BlockGame.hpp @@ -219,7 +219,7 @@ public: int getAIlevel() const; - virtual void AddText(int, int, const std::string&, int) const {} + virtual void AddText(int, int, unsigned int, int) const {} virtual void AddBall(int, int, bool, int) const {} virtual void AddExplosion(int, int) const {} virtual void PlayerWonEvent() const {} diff --git a/source/code/BlockGameSdl.inc b/source/code/BlockGameSdl.inc index 827816c..6607881 100644 --- a/source/code/BlockGameSdl.inc +++ b/source/code/BlockGameSdl.inc @@ -115,7 +115,7 @@ public: return true; } - void AddText(int x, int y, const std::string& text, int time) const override { + void AddText(int x, int y, unsigned int text, int time) const override { globalData.theTextManager.addText(topx-10+x*bsize, topy+12*bsize-y*bsize, text, time); } diff --git a/source/code/TextManager.hpp b/source/code/TextManager.hpp index 5e8a4a4..67c5051 100644 --- a/source/code/TextManager.hpp +++ b/source/code/TextManager.hpp @@ -31,7 +31,7 @@ class TextMessage { private: int x = 0; int y = 0; - std::string textt; + unsigned int textt; unsigned long int time = 0; unsigned long int placeTime = 0; //Then the text was placed public: @@ -41,7 +41,7 @@ public: } //constructor: - TextMessage(int X, int Y,const char* Text,unsigned int Time) { + TextMessage(int X, int Y,unsigned int Text,unsigned int Time) { placeTime = SDL_GetTicks(); x = X; y = Y; @@ -62,8 +62,8 @@ public: return y; } - const char* getText() { - return textt.c_str(); + unsigned int getText() { + return textt; } }; //text popup @@ -75,7 +75,7 @@ public: TextManager() { } - int addText(int x, int y, const std::string& Text,unsigned int Time) { + int addText(int x, int y, unsigned int Text, unsigned int Time) { size_t textNumber = 0; while (textNumberDraw(globalData.screen, x+12, y+7, + getSmallInt(globalData.theTextManager.textArray[i].getText())->Draw(globalData.screen, x+12, y+7, sago::SagoTextField::Alignment::center); } }