diff --git a/source/code/ReplayPlayer.cpp b/source/code/ReplayPlayer.cpp index a01c583..94dc131 100644 --- a/source/code/ReplayPlayer.cpp +++ b/source/code/ReplayPlayer.cpp @@ -25,6 +25,15 @@ http://www.blockattack.net #include "global.hpp" #include "common.h" #include "MenuSystem.h" +//#include "BlockGameSdl.inc" + + + +/*static void MoveBlockGameSdls( BlockGameSdl& game1, BlockGameSdl& game2 ) { + game1.SetTopXY(50, globalData.ysize/2-284); + game2.SetTopXY(globalData.xsize-500, globalData.ysize/2-284); +}*/ + ReplayPlayer::ReplayPlayer() { } @@ -38,6 +47,8 @@ bool ReplayPlayer::IsActive() { void ReplayPlayer::Draw(SDL_Renderer* target) { DrawBackground(target); + //MoveBlockGameSdls(theGame, theGame2); + //DrawEverything(globalData.xsize, globalData.ysize, &theGame, &theGame2); } void ReplayPlayer::ProcessInput(const SDL_Event& event, bool& processed) { diff --git a/source/code/TextManager.hpp b/source/code/TextManager.hpp new file mode 100644 index 0000000..1e61afa --- /dev/null +++ b/source/code/TextManager.hpp @@ -0,0 +1,109 @@ +/* +=========================================================================== +blockattack - Block Attack - Rise of the Blocks +Copyright (C) 2005-2017 Poul Sander + +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; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see http://www.gnu.org/licenses/ + +Source information and contacts persons can be found at +http://www.blockattack.net +=========================================================================== +*/ + +#ifndef TEXTMANAGER_HPP +#define TEXTMANAGER_HPP + + +class TextMessage { +private: + int x = 0; + int y = 0; + string textt; + unsigned long int time = 0; + unsigned long int placeTime = 0; //Then the text was placed +public: + + TextMessage() { + } + + //constructor: + TextMessage(int X, int Y,const char* Text,unsigned int Time) { + placeTime = currentTime; + x = X; + y = Y; + textt = Text; + time = Time; + } //constructor + + //true if the text has expired + bool removeMe() { + return currentTime-placeTime>time; + } + + int getX() { + return x; + } + + int getY() { + return y; + } + + const char* getText() { + return textt.c_str(); + } +}; //text popup + +class TextManager { + static const int maxNumberOfTexts = 6*12*2*2; +public: + TextMessage textArray[maxNumberOfTexts]; + bool textUsed[maxNumberOfTexts]; + + TextManager() { + for (int i=0; itime; - } - - int getX() { - return x; - } - - int getY() { - return y; - } - - const char* getText() { - return textt.c_str(); - } -}; //text popup - -class TextManager { -public: - TextMessage textArray[maxNumberOfBalls]; - bool textUsed[maxNumberOfBalls]; - - TextManager() { - for (int i=0; i