diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-04 20:47:58 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-04 20:47:58 (GMT) |
| commit | ea51cde1f07d2a63f824e78c44adad0993115853 (patch) | |
| tree | a6afee4bafb5de2f91caf1235351b7cc6fc2e606 /src/game/GameController.cpp | |
| parent | 89cdeef9ad9c164e9f484cded3096bcbc72b7207 (diff) | |
| download | powder-ea51cde1f07d2a63f824e78c44adad0993115853.zip powder-ea51cde1f07d2a63f824e78c44adad0993115853.tar.gz | |
Change brush size with [ and ] keys, change order of drawing for Lua, Fix print and tpt.log so they log to the console when it is open
Diffstat (limited to 'src/game/GameController.cpp')
| -rw-r--r-- | src/game/GameController.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index b8f60f5..dfdc12d 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -174,9 +174,13 @@ void GameController::PlaceClipboard(ui::Point position) } } -void GameController::AdjustBrushSize(int direction) +void GameController::AdjustBrushSize(int direction, bool logarithmic) { - ui::Point newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction, direction); + ui::Point newSize(0, 0); + if(logarithmic) + newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction * ((gameModel->GetBrush()->GetRadius().X/10)>0?gameModel->GetBrush()->GetRadius().X/10:1), direction * ((gameModel->GetBrush()->GetRadius().Y/10)>0?gameModel->GetBrush()->GetRadius().Y/10:1)); + else + newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction, direction); if(newSize.X<0) newSize.X = 0; if(newSize.Y<0) @@ -184,9 +188,13 @@ void GameController::AdjustBrushSize(int direction) gameModel->GetBrush()->SetRadius(newSize); } -void GameController::AdjustZoomSize(int direction) +void GameController::AdjustZoomSize(int direction, bool logarithmic) { - int newSize = gameModel->GetZoomSize()+direction; + int newSize; + if(logarithmic) + newSize = gameModel->GetZoomSize()+direction; + else + newSize = gameModel->GetZoomSize()+(((gameModel->GetZoomSize()/10)>0?(gameModel->GetZoomSize()/10):1)*direction); if(newSize<5) newSize = 5; if(newSize>64) @@ -333,9 +341,13 @@ bool GameController::KeyRelease(int key, Uint16 character, bool shift, bool ctrl return commandInterface->OnKeyRelease(key, character, shift, ctrl, alt); } +void GameController::Tick() +{ + commandInterface->OnTick(); +} + void GameController::Update() { - commandInterface->OnTick(1.0f); gameModel->GetSimulation()->update_particles(); if(renderOptions && renderOptions->HasExited) { |
