mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-29 07:21:54 -04:00
Touch controls (#2053)
* WIP touch controls * Action icons * Updates * Don't mutate freeCamera config; allow switching between touch and controller cam * Wow * Fix build & add Skip button * Fix build & add settings * RCSS cleanup * Dpad and fishing, might redo * Add menu mouse controls * More pointer & fix icons * Optimizations & introduce layout system * Update aurora * Implement touch controls layout editor * Cleanup & fixes * Allow disabling mouse/touch in menus * More fixes
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include "dusk/touch_camera.h"
|
||||
|
||||
namespace dusk::touch_camera {
|
||||
namespace {
|
||||
float s_yaw_dp = 0.0f;
|
||||
float s_pitch_dp = 0.0f;
|
||||
} // namespace
|
||||
|
||||
void add_delta(float yaw_dp, float pitch_dp) noexcept {
|
||||
s_yaw_dp += yaw_dp;
|
||||
s_pitch_dp += pitch_dp;
|
||||
}
|
||||
|
||||
bool consume_delta(float& yaw_dp, float& pitch_dp) noexcept {
|
||||
yaw_dp = s_yaw_dp;
|
||||
pitch_dp = s_pitch_dp;
|
||||
clear();
|
||||
return yaw_dp != 0.0f || pitch_dp != 0.0f;
|
||||
}
|
||||
|
||||
void clear() noexcept {
|
||||
s_yaw_dp = 0.0f;
|
||||
s_pitch_dp = 0.0f;
|
||||
}
|
||||
|
||||
} // namespace dusk::touch_camera
|
||||
Reference in New Issue
Block a user