Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Byocbtris Plugin
(1/1)
NickFargo:
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);
}
MortenMacFly:
Does it work correctly if you play the game?
NickFargo:
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! :-)
Navigation
[0] Message Index
Go to full version