@@ -317,7 +317,7 @@ void BtPhysTest::TickGame(float seconds) | |||||
} | } | ||||
if (m_controller->WasKeyReleased(KEY_QUIT)) | |||||
if (m_controller->WasKeyReleasedThisFrame(KEY_QUIT)) | |||||
Ticker::Shutdown(); | Ticker::Shutdown(); | ||||
m_loop_value += seconds; | m_loop_value += seconds; | ||||
@@ -508,7 +508,7 @@ void BtPhysTest::TickGame(float seconds) | |||||
- (m_controller->IsKeyPressed(KEY_MOVE_DOWN) ? 1.f : 0.f); | - (m_controller->IsKeyPressed(KEY_MOVE_DOWN) ? 1.f : 0.f); | ||||
vec3 CharMove = movement * seconds * vec3(4.f, 10.f, 4.f); | vec3 CharMove = movement * seconds * vec3(4.f, 10.f, 4.f); | ||||
if (m_controller->WasKeyReleased(KEY_MOVE_JUMP)) | |||||
if (m_controller->WasKeyReleasedThisFrame(KEY_MOVE_JUMP)) | |||||
Character->Jump(); | Character->Jump(); | ||||
Character->SetMovementForFrame(CharMove); | Character->SetMovementForFrame(CharMove); | ||||
@@ -247,11 +247,11 @@ public: | |||||
} | } | ||||
#if NO_NACL_EM_INPUT | #if NO_NACL_EM_INPUT | ||||
bool KeyReleased(MVKeyboardList index) { return (HAS_KBOARD && m_controller->WasKeyReleased(index)); } | |||||
bool KeyPressed(MVKeyboardList index) { return (HAS_KBOARD && m_controller->WasKeyPressed(index)); } | |||||
bool KeyReleased(MVKeyboardList index) { return (HAS_KBOARD && m_controller->WasKeyReleasedThisFrame(index)); } | |||||
bool KeyPressed(MVKeyboardList index) { return (HAS_KBOARD && m_controller->WasKeyPressedThisFrame(index)); } | |||||
bool KeyDown(MVKeyboardList index) { return (HAS_KBOARD && m_controller->IsKeyPressed(index)); } | bool KeyDown(MVKeyboardList index) { return (HAS_KBOARD && m_controller->IsKeyPressed(index)); } | ||||
bool KeyReleased(MVMouseKeyList index) { return (HAS_MOUSE && m_controller->WasKeyReleased(index)); } | |||||
bool KeyPressed(MVMouseKeyList index) { return (HAS_MOUSE && m_controller->WasKeyPressed(index)); } | |||||
bool KeyReleased(MVMouseKeyList index) { return (HAS_MOUSE && m_controller->WasKeyReleasedThisFrame(index)); } | |||||
bool KeyPressed(MVMouseKeyList index) { return (HAS_MOUSE && m_controller->WasKeyPressedThisFrame(index)); } | |||||
bool KeyDown(MVMouseKeyList index) { return (HAS_MOUSE && m_controller->IsKeyPressed(index)); } | bool KeyDown(MVMouseKeyList index) { return (HAS_MOUSE && m_controller->IsKeyPressed(index)); } | ||||
float AxisValue(MVMouseAxisList index) { return (HAS_MOUSE) ? (m_controller->GetAxisValue(index)) : (0.f); } | float AxisValue(MVMouseAxisList index) { return (HAS_MOUSE) ? (m_controller->GetAxisValue(index)) : (0.f); } | ||||
#endif //NO_NACL_EM_INPUT | #endif //NO_NACL_EM_INPUT | ||||
@@ -107,7 +107,7 @@ public: | |||||
/* Handle keyboard */ | /* Handle keyboard */ | ||||
if (m_keyboard) | if (m_keyboard) | ||||
{ | { | ||||
if (m_controller->WasKeyPressed(KEY_MANUAL_ROTATION)) | |||||
if (m_controller->WasKeyPressedThisFrame(KEY_MANUAL_ROTATION)) | |||||
m_autorot = !m_autorot; | m_autorot = !m_autorot; | ||||
} | } | ||||
@@ -78,7 +78,7 @@ public: | |||||
{ | { | ||||
//Shutdown logic | //Shutdown logic | ||||
if (m_controller->WasKeyReleased(KEY_ESC)) | |||||
if (m_controller->WasKeyReleasedThisFrame(KEY_ESC)) | |||||
Ticker::Shutdown(); | Ticker::Shutdown(); | ||||
} | } | ||||
@@ -169,16 +169,16 @@ public: | |||||
{ | { | ||||
//Shutdown logic | //Shutdown logic | ||||
if (m_controller->WasKeyReleased(KEY_POP)) | |||||
if (m_controller->WasKeyReleasedThisFrame(KEY_POP)) | |||||
voronoi_points.Pop(); | voronoi_points.Pop(); | ||||
else if (m_controller->WasKeyReleased(KEY_PUSH)) | |||||
else if (m_controller->WasKeyReleasedThisFrame(KEY_PUSH)) | |||||
voronoi_points.Push(vec3(rand<float>(512.f), rand<float>(512.f), .0f), | voronoi_points.Push(vec3(rand<float>(512.f), rand<float>(512.f), .0f), | ||||
vec2(64.f + rand<float>(64.f), 64.f + rand<float>(64.f))); | vec2(64.f + rand<float>(64.f), 64.f + rand<float>(64.f))); | ||||
else if (m_controller->WasKeyReleased(KEY_F1)) | |||||
else if (m_controller->WasKeyReleasedThisFrame(KEY_F1)) | |||||
m_cur_fbo = SrcVoronoiFbo; | m_cur_fbo = SrcVoronoiFbo; | ||||
else if (m_controller->WasKeyReleased(KEY_F2)) | |||||
else if (m_controller->WasKeyReleasedThisFrame(KEY_F2)) | |||||
m_cur_fbo = VoronoiFbo; | m_cur_fbo = VoronoiFbo; | ||||
else if (m_controller->WasKeyReleased(KEY_F3)) | |||||
else if (m_controller->WasKeyReleasedThisFrame(KEY_F3)) | |||||
{ | { | ||||
voronoi_points.Empty(); | voronoi_points.Empty(); | ||||
if (mode == 0) | if (mode == 0) | ||||
@@ -320,13 +320,13 @@ bool Controller::IsKeyReleased(int index) const | |||||
{ | { | ||||
return GetKey(index).IsReleased(); | return GetKey(index).IsReleased(); | ||||
} | } | ||||
bool Controller::WasKeyPressed(int index) const | |||||
bool Controller::WasKeyPressedThisFrame(int index) const | |||||
{ | { | ||||
return GetKey(index).WasKeyPressed(); | |||||
return GetKey(index).WasPressedThisFrame(); | |||||
} | } | ||||
bool Controller::WasKeyReleased(int index) const | |||||
bool Controller::WasKeyReleasedThisFrame(int index) const | |||||
{ | { | ||||
return GetKey(index).WasKeyReleased(); | |||||
return GetKey(index).WasReleasedThisFrame(); | |||||
} | } | ||||
//Axis methods: should not go directly to binding ----------------------------- | //Axis methods: should not go directly to binding ----------------------------- | ||||
@@ -30,9 +30,9 @@ protected: | |||||
/** Indicates wheither the key is currently up */ | /** Indicates wheither the key is currently up */ | ||||
bool IsReleased() const { return !m_current; } | bool IsReleased() const { return !m_current; } | ||||
/** Indicates wheither the key has just been pressed */ | /** Indicates wheither the key has just been pressed */ | ||||
bool WasKeyPressed() const { return m_current && !m_previous; } | |||||
bool WasPressedThisFrame() const { return m_current && !m_previous; } | |||||
/** Indicates wheither the key has just been released */ | /** Indicates wheither the key has just been released */ | ||||
bool WasKeyReleased() const { return !m_current && m_previous; } | |||||
bool WasReleasedThisFrame() const { return !m_current && m_previous; } | |||||
public: | public: | ||||
//Binding methods --------------------------------------------------------- | //Binding methods --------------------------------------------------------- | ||||
@@ -360,9 +360,9 @@ public: | |||||
/** Indicates wheither the key is currently up */ | /** Indicates wheither the key is currently up */ | ||||
bool IsKeyReleased(int index) const; | bool IsKeyReleased(int index) const; | ||||
/** Indicates wheither the key has just been pressed */ | /** Indicates wheither the key has just been pressed */ | ||||
bool WasKeyPressed(int index) const; | |||||
bool WasKeyPressedThisFrame(int index) const; | |||||
/** Indicates wheither the key has just been released */ | /** Indicates wheither the key has just been released */ | ||||
bool WasKeyReleased(int index) const; | |||||
bool WasKeyReleasedThisFrame(int index) const; | |||||
/** Axis methods: should not go directly to binding */ | /** Axis methods: should not go directly to binding */ | ||||
/** Gets the current absolute value of this axis */ | /** Gets the current absolute value of this axis */ | ||||