Skip to content

Commit

Permalink
Added keyboard-input code for panorama and tilt renderers
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa-Chan committed Apr 1, 2012
1 parent 9666912 commit 517fc38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 25 additions & 1 deletion Engine/src/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,18 @@ void Rend_DrawPanorama()

void Rend_PanaMouseInteract()
{
int32_t tt = *view_X;

if (KeyDown(SDLK_LEFT))
{
int32_t speed = GetgVarInt(SLOT_KBD_ROTATE_SPEED) / 10;
*view_X -= (pana_ReversePana == false ? speed: -speed);
}
else if (KeyDown(SDLK_RIGHT))
{
int32_t speed = GetgVarInt(SLOT_KBD_ROTATE_SPEED) / 10;
*view_X += (pana_ReversePana == false ? speed: -speed);
}

if (Rend_MouseInGamescr())
{
if (MouseX() > GAMESCREEN_X + GAMESCREEN_W - GAMESCREEN_P)
Expand All @@ -618,6 +629,8 @@ void Rend_PanaMouseInteract()
}
}

int32_t tt = *view_X;

if (tt < pana_Zero)
{
if (*view_X >= pana_Zero)
Expand Down Expand Up @@ -993,6 +1006,17 @@ void Rend_DrawTilt()

void Rend_tilt_MouseInteract()
{
if (KeyDown(SDLK_UP))
{
int32_t speed = GetgVarInt(SLOT_KBD_ROTATE_SPEED) / 10;
*view_X -= (pana_ReversePana == false ? speed: -speed);
}
else if (KeyDown(SDLK_DOWN))
{
int32_t speed = GetgVarInt(SLOT_KBD_ROTATE_SPEED) / 10;
*view_X += (pana_ReversePana == false ? speed: -speed);
}

if (Rend_MouseInGamescr())
{
if (MouseY() > GAMESCREEN_Y + GAMESCREEN_H - GAMESCREEN_P)
Expand Down
2 changes: 0 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ action_clear_system_message :reverse it
* Other little things...
* Add more code for pana and tilt renderers
* Add fast code for distort effect based on scale-parameter. What code is used we may choose in config.h
* Add code for input controls for navigation by keyboard
* Add panorama controls by Keyboard

--------------TODO if needed (not used)-----------------

Expand Down

0 comments on commit 517fc38

Please sign in to comment.