mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-28 23:15:32 -04:00
ad53af5c78
* 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
27 lines
532 B
C++
27 lines
532 B
C++
#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
|