News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Byocbtris Plugin

Started by NickFargo, April 28, 2015, 11:41:51 PM

Previous topic - Next topic

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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

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! :-)