aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/cpp/Subconscious.cpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-02-12 19:31:45 +0100
committerNao Pross <naopross@thearcway.org>2018-02-12 19:31:45 +0100
commit43d0e11b4c9cd601f23cfe99a188ede598be418c (patch)
tree6a31fffae507997c0038177cbbccc984a468be04 /src/main/cpp/Subconscious.cpp
parentUpdate gitignore to ignore ctags (diff)
downloadSubconscious-old-43d0e11b4c9cd601f23cfe99a188ede598be418c.tar.gz
Subconscious-old-43d0e11b4c9cd601f23cfe99a188ede598be418c.zip
Fix zoom bug, add Scene.type member
Diffstat (limited to '')
-rw-r--r--src/main/cpp/Subconscious.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/cpp/Subconscious.cpp b/src/main/cpp/Subconscious.cpp
index b53a38b..a4f6128 100644
--- a/src/main/cpp/Subconscious.cpp
+++ b/src/main/cpp/Subconscious.cpp
@@ -55,7 +55,11 @@ void Subconscious::run()
//
// std::cout << std::fixed << std::setprecision(3)
// << event.mouseWheelScroll.delta << std::endl;
- _currentScene->zoom(event.mouseWheelScroll.delta/10.0);
+
+ if (_currentScene->type == Scene::Type::WORLD) {
+ static_cast<WorldScene*>(_currentScene)->zoom(event.mouseWheelScroll.delta/10.0);
+ }
+
break;
/*** Window Events ***/
@@ -66,6 +70,9 @@ void Subconscious::run()
case sf::Event::Resized:
_currentScene->resize(event.size);
break;
+
+ default:
+ break;
}
}