From 2704bdc68e51c39f5ea475ba092c2d21281ccd53 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 24 Apr 2011 21:15:50 +0300 Subject: Optimized smooth lighting calculation code --- src/game.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/game.cpp') 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 "<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; -- cgit v1.2.3