Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: NickFargo on April 28, 2015, 11:41:51 pm
-
Hi,
I am new here, and I downloaded Code::Blocks 13.12 couple days ago. Following two functions are from file Byocbtris.cpp. It seems that each function name and implementation are not consistent. I think two bolded lines should be swapped or function names should be swapped. What do you think?
void byoCBTris::RotateChunkLeft(const ChunkConfig& chunk,ChunkConfig& newChunk)
{
for ( int y=0; y<4; y++ )
for ( int x=0; x<4; x++ )
newChunk[x+4*y] = chunk[(3-x)*4+y];
AlignChunk(newChunk);
}
void byoCBTris::RotateChunkRight(const ChunkConfig& chunk,ChunkConfig& newChunk)
{
for ( int y=0; y<4; y++ )
for ( int x=0; x<4; x++ )
newChunk[x+4*y] = chunk[x*4+3-y];
AlignChunk(newChunk);
}
-
Does it work correctly if you play the game?
-
I successfully installed C:B IED today. Yes it works correctly when I play the game. Now I know why function AlignChunk() is there. It helps completing the rotate. Thanks for your reply! :-)