int Game::GetBrickCount() { int brickcount = 0; for (int i=0; i<BOARD_WIDTH; i++) { for (int j=0; j<BOARD_HEIGHT; j++) { Brick brick = board->bricks[i][j]; if (brick.state) { brickcount++; } } } // SoVGA - Update the parameter of bricks left only when we need to if (brickcount != oldBrickCount) { musicBricksLeftParameter->setValue((float)brickcount/(BOARD_WIDTH*BOARD_HEIGHT)); oldBrickCount = brickcount; } return brickcount; }
{}