summaryrefslogtreecommitdiffstats
path: root/sdl/pyramid.c
diff options
context:
space:
mode:
Diffstat (limited to 'sdl/pyramid.c')
-rw-r--r--sdl/pyramid.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sdl/pyramid.c b/sdl/pyramid.c
index b3e1b2e..a3303b8 100644
--- a/sdl/pyramid.c
+++ b/sdl/pyramid.c
@@ -70,6 +70,8 @@ static void keys(SDL_keysym *keysym, const unsigned int *keys_held, const int fl
case SDLK_DOWN: glframe_move_forward(&p.camera, -0.5f); break;
case SDLK_LEFT: glframe_rotate_local_y(&p.camera, 0.1f); break;
case SDLK_RIGHT: glframe_rotate_local_y(&p.camera, -0.1f); break;
+ case SDLK_n: glframe_rotate_local_x(&p.camera, 0.1f); break;
+ case SDLK_m: glframe_rotate_local_x(&p.camera, -0.1f); break;
default: break;
}
}
@@ -92,6 +94,11 @@ static void keys(SDL_keysym *keysym, const unsigned int *keys_held, const int fl
glframe_rotate_local_y(&p.camera, 0.02f);
if (keys_held[SDLK_RIGHT])
glframe_rotate_local_y(&p.camera, -0.02f);
+
+ if (keys_held[SDLK_n])
+ glframe_rotate_local_x(&p.camera, 0.02f);
+ if (keys_held[SDLK_m])
+ glframe_rotate_local_x(&p.camera, -0.02f);
}
p.xrot = (GLfloat) ((const int) p.xrot % 360);
@@ -133,7 +140,8 @@ static void process_events(void)
/* below code has to be placed here, check for keys that are being constantly held */
if (keys_held[SDLK_w] || keys_held[SDLK_s] || keys_held[SDLK_a] || keys_held[SDLK_d] ||
- keys_held[SDLK_UP] || keys_held[SDLK_DOWN] || keys_held[SDLK_LEFT] || keys_held[SDLK_RIGHT])
+ keys_held[SDLK_UP] || keys_held[SDLK_DOWN] || keys_held[SDLK_LEFT] || keys_held[SDLK_RIGHT] ||
+ keys_held[SDLK_n] || keys_held[SDLK_m])
{
flag = !flag;
keys(NULL, keys_held, flag);