summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-16 11:15:29 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-16 11:15:29 (GMT)
commitf19c7f62c77f6a3e8f5728e015166b0c625f5f67 (patch)
treedc4c5067c6a4d6b7108e33da0cc3a18549eb2066 /src/game
parentca30e9f091376e81b61a0f72bc444a4f59fc4ae7 (diff)
downloadpowder-f19c7f62c77f6a3e8f5728e015166b0c625f5f67.zip
powder-f19c7f62c77f6a3e8f5728e015166b0c625f5f67.tar.gz
Air invert and grid mode switching
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameController.cpp14
-rw-r--r--src/game/GameController.h2
-rw-r--r--src/game/GameView.cpp8
3 files changed, 24 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 9831c78..5237af7 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -231,6 +231,20 @@ void GameController::Install()
#endif
}
+void GameController::AdjustGridSize(int direction)
+{
+ if(direction > 0)
+ gameModel->GetRenderer()->SetGridSize((gameModel->GetRenderer()->GetGridSize()+1)%10);
+ else
+ gameModel->GetRenderer()->SetGridSize((gameModel->GetRenderer()->GetGridSize()+9)%10);
+}
+
+void GameController::InvertAirSim()
+{
+ gameModel->GetSimulation()->air->Invert();
+}
+
+
void GameController::AdjustBrushSize(int direction, bool logarithmic, bool xAxis, bool yAxis)
{
if(xAxis && yAxis)
diff --git a/src/game/GameController.h b/src/game/GameController.h
index 72ebd37..c6d41b5 100644
--- a/src/game/GameController.h
+++ b/src/game/GameController.h
@@ -69,6 +69,8 @@ public:
void Install();
+ void AdjustGridSize(int direction);
+ void InvertAirSim();
void LoadRenderPreset(RenderPreset preset);
void SetZoomEnabled(bool zoomEnable);
void SetZoomPosition(ui::Point position);
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index 45addeb..af13797 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -1243,6 +1243,12 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
case 'f':
c->FrameStep();
break;
+ case 'g':
+ if(shift)
+ c->AdjustGridSize(-1);
+ else
+ c->AdjustGridSize(1);
+ break;
case 'd':
showDebug = !showDebug;
break;
@@ -1345,6 +1351,8 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
case 'i':
if(ctrl)
c->Install();
+ else
+ c->InvertAirSim();
break;
}