Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 1, 2015, 2:50:46 PM (10 years ago)
Author:
landauf
Message:

fixed warnings & details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameBoard.cc

    r10225 r10229  
    8484        @param the position where to put the stone plus the player who makes the move
    8585    */
    86     bool Mini4DgameBoard::isValidMove(const Vector4 move)
     86    bool Mini4DgameBoard::isValidMove(const Mini4DgamePosition& move)
    8787    {
    8888        return (move.x<4 && move.y<4 && move.z<4 && move.w<4
    8989                        && move.x>=0 && move.y>=0 && move.z>=0 && move.w>=0
    90                         && this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] == mini4DgamePlayerColor::none);
     90                        && this->board[move.x][move.y][move.z][move.w] == mini4DgamePlayerColor::none);
    9191    }
    9292
    9393        void Mini4DgameBoard::undoMove()
    9494        {
    95                 Vector4 move = moves.back();
     95            const Mini4DgamePosition& move = moves.back();
    9696                moves.pop_back();
    97         this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = mini4DgamePlayerColor::none;
    98         this->blinkingBillboards[(int)move.x][(int)move.y][(int)move.z][(int)move.w]->destroy();
    99         this->blinkingBillboards[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = 0;
     97        this->board[move.x][move.y][move.z][move.w] = mini4DgamePlayerColor::none;
     98        this->blinkingBillboards[move.x][move.y][move.z][move.w]->destroy();
     99        this->blinkingBillboards[move.x][move.y][move.z][move.w] = 0;
    100100        if(player_toggle_){
    101101                this->player_toggle_ = false;
     
    109109    @param the position where to put the stone plus the player who makes the move
    110110    */
    111     void Mini4DgameBoard::makeMove(const Vector4 move)
     111    void Mini4DgameBoard::makeMove(const Mini4DgamePosition& move)
    112112    {
    113113        if(this->isValidMove(move))
     
    116116                {
    117117                        //stop blinking of last move
    118                         Vector4 lastMove = moves.back();
    119                         this->blinkingBillboards[(int)lastMove.x][(int)lastMove.y][(int)lastMove.z][(int)lastMove.w]
     118                    const Mini4DgamePosition& lastMove = moves.back();
     119                        this->blinkingBillboards[lastMove.x][lastMove.y][lastMove.z][lastMove.w]
    120120                                        ->setActive(false);
    121                         this->blinkingBillboards[(int)lastMove.x][(int)lastMove.y][(int)lastMove.z][(int)lastMove.w]
     121                        this->blinkingBillboards[lastMove.x][lastMove.y][lastMove.z][lastMove.w]
    122122                                        ->setScale(0.1);
    123123                }
     
    133133                }
    134134
    135                 this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = (mini4DgamePlayerColor::color) playerColor;
     135                this->board[move.x][move.y][move.z][move.w] = (mini4DgamePlayerColor::color) playerColor;
    136136
    137137                BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
     
    139139                        bb->setAmplitude(0.1);
    140140
    141                         switch((int)move.w){
     141                        switch(move.w){
    142142                        case 0: bb->setMaterial("Numbers/One");
    143                                         bb->setPosition(60*(int)move.x-95,60*(int)move.y-95,60*(int)move.z-95);
     143                                        bb->setPosition(60.0f*move.x-95,60.0f*move.y-95,60.0f*move.z-95);
    144144                                        break;
    145145                        case 1: bb->setMaterial("Numbers/Two");
    146                                         bb->setPosition(60*(int)move.x-85,60*(int)move.y-85,60*(int)move.z-95);
     146                                        bb->setPosition(60.0f*move.x-85,60.0f*move.y-85,60.0f*move.z-95);
    147147                                        break;
    148148                        case 2: bb->setMaterial("Numbers/Three");
    149                                         bb->setPosition(60*(int)move.x-85,60*(int)move.y-95,60*(int)move.z-85);
     149                                        bb->setPosition(60.0f*move.x-85,60.0f*move.y-95,60.0f*move.z-85);
    150150                                        break;
    151151                        case 3: bb->setMaterial("Numbers/Four");
    152                                         bb->setPosition(60*(int)move.x-85,60*(int)move.y-85,60*(int)move.z-85);
     152                                        bb->setPosition(60.0f*move.x-85,60.0f*move.y-85,60.0f*move.z-85);
    153153                                        break;
    154154                        }
     
    165165
    166166                        this->attach(bb);
    167                         this->blinkingBillboards[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = bb;
     167                        this->blinkingBillboards[move.x][move.y][move.z][move.w] = bb;
    168168
    169169
     
    176176                                        redFlare->setFrequency(0.5);
    177177                                        redFlare->setAmplitude(3);
    178                                         redFlare->setPosition(60*(int)winner.winningRow[i]-90,
    179                                                                         60*(int)winner.winningColumn[i]-90,
    180                                                                         60*(int)winner.winningHeight[i]-90);
     178                                        redFlare->setPosition(60.0f*(int)winner.winningRow[i]-90,
     179                                                                        60.0f*(int)winner.winningColumn[i]-90,
     180                                                                        60.0f*(int)winner.winningHeight[i]-90);
    181181                                        redFlare->setMaterial("Flares/lensflare");
    182182                                        redFlare->setColour(ColourValue(1,0,0));
Note: See TracChangeset for help on using the changeset viewer.