diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-24 21:15:50 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-24 21:15:50 +0300 |
commit | 2704bdc68e51c39f5ea475ba092c2d21281ccd53 (patch) | |
tree | 29370fcc670d023c8a0123773deca6f9e685b6f9 /src/game.cpp | |
parent | 59de7a324cec6ffcb5015b616853d60e74a0c62d (diff) | |
download | minetest-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.cpp | 11 |
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; |