Skip to content

Commit

Permalink
Adding static_cast to received UDP packets #77
Browse files Browse the repository at this point in the history
  • Loading branch information
kroyee committed Mar 28, 2017
1 parent dc16b4b commit 008a1c5
Showing 1 changed file with 5 additions and 5 deletions.
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 008a1c5

Please sign in to comment.