summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-04-24 21:15:50 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-04-24 21:15:50 +0300
commit2704bdc68e51c39f5ea475ba092c2d21281ccd53 (patch)
tree29370fcc670d023c8a0123773deca6f9e685b6f9 /src/game.cpp
parent59de7a324cec6ffcb5015b616853d60e74a0c62d (diff)
downloadminetest-2704bdc68e51c39f5ea475ba092c2d21281ccd53.tar.gz
minetest-2704bdc68e51c39f5ea475ba092c2d21281ccd53.tar.bz2
minetest-2704bdc68e51c39f5ea475ba092c2d21281ccd53.zip
Optimized smooth lighting calculation code
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 7eb847e6c..9054f00cc 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1229,6 +1229,17 @@ void the_game(
s32 dx = input->getMousePos().X - displaycenter.X;
s32 dy = input->getMousePos().Y - displaycenter.Y;
//std::cout<<"window active, pos difference "<<dx<<","<<dy<<std::endl;
+
+ const float keyspeed = 500;
+ if(input->isKeyDown(irr::KEY_UP))
+ dy -= dtime * keyspeed;
+ if(input->isKeyDown(irr::KEY_DOWN))
+ dy += dtime * keyspeed;
+ if(input->isKeyDown(irr::KEY_LEFT))
+ dx -= dtime * keyspeed;
+ if(input->isKeyDown(irr::KEY_RIGHT))
+ dx += dtime * keyspeed;
+
camera_yaw -= dx*0.2;
camera_pitch += dy*0.2;
if(camera_pitch < -89.5) camera_pitch = -89.5;