Skip to content

Commit

Permalink
Merge branch 'master' into curl
Browse files Browse the repository at this point in the history
  • Loading branch information
kroyee committed Mar 28, 2017
2 parents 142c5d0 + 008a1c5 commit df8d122
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 26 deletions.
52 changes: 31 additions & 21 deletions gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
10 changes: 5 additions & 5 deletions packetcompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<short>(temp-2);
temp=0; getBits(temp, 5); posY = static_cast<short>(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<short>(temp);
temp=0; getBits(temp, 3); npcol=static_cast<short>(temp);
temp=0; getBits(temp, 3); nprot=static_cast<short>(temp);
}

void PacketCompress::getBits(sf::Uint8& byte, sf::Uint8 bits) {
Expand Down

0 comments on commit df8d122

Please sign in to comment.