diff --git a/gui.cpp b/gui.cpp index bf42d3f..626a966 100644 --- a/gui.cpp +++ b/gui.cpp @@ -14,27 +14,37 @@ using namespace std; #include "EmptyResourcePath.h" #endif -UI::UI(sf::RenderWindow& rwindow, sf::Font& font1, sf::Font& font2, optionSet& opt, soundBank& soundy, gamePlay& gamey, network& _net, textures& _tex) : typewriter(font1), printFont2(font2), printFont(&font2), gui(rwindow) { - training=false; - playonline=false; - quit=false; - adjPieces=false; - updPieces=false; - chatFocused=false; - inroom=false; - startgame=false; - startcount=false; - disconnect=false; - away=false; - - scoreRows=0; - - window=&rwindow; - sounds=&soundy; - options=&opt; - game=&gamey; - net=&_net; - textureBase=&_tex; +UI::UI(sf::RenderWindow& window_, sf::Font& font1, sf::Font& font2, + optionSet& options_, soundBank& sounds_, gamePlay& game_, network& net_, + textures& textureBase_) + : typewriter(font1), + printFont2(font2), + printFont(&font2), + gui(window_), + options(&options_), + sounds(&sounds_), + game(&game_), + net(&net_), + textureBase(&textureBase_), + window(&window_), + training(false), + playonline(false), + quit(false), + setkey(false), + adjPieces(false), + updPieces(false), + chatFocused(false), + inroom(false), + startgame(false), + startcount(false), + disconnect(false), + away(false), + key(nullptr), + linesSent(0), + garbageCleared(0), + linesBlocked(0), + clientVersion(0), + scoreRows(0) { themeTG = tgui::Theme::create(resourcePath() + "media/TransparentGrey.txt"); themeBB = tgui::Theme::create(resourcePath() + "media/BabyBlue.txt"); diff --git a/packetcompress.cpp b/packetcompress.cpp index 58f32a8..ab60b53 100644 --- a/packetcompress.cpp +++ b/packetcompress.cpp @@ -25,16 +25,16 @@ void PacketCompress::extract() { for (; y<22-endy; y++) getBits(square[y][x], 3); } - temp=0; getBits(temp, 4); posX = temp-2; - temp=0; getBits(temp, 5); posY = temp; + temp=0; getBits(temp, 4); posX = static_cast(temp-2); + temp=0; getBits(temp, 5); posY = static_cast(temp); for (int x=0; x<4; x++) for (y=0; y<4; y++) { temp=0; getBits(temp, 3); grid[y][x] = temp; } - temp=0; getBits(temp, 3); nextpiece=temp; - temp=0; getBits(temp, 3); npcol=temp; - temp=0; getBits(temp, 3); nprot=temp; + temp=0; getBits(temp, 3); nextpiece=static_cast(temp); + temp=0; getBits(temp, 3); npcol=static_cast(temp); + temp=0; getBits(temp, 3); nprot=static_cast(temp); } void PacketCompress::getBits(sf::Uint8& byte, sf::Uint8 bits) {