mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
DS: Fix can't move camera
This commit is contained in:
parent
f4ada2aa51
commit
88d43a8420
@ -90,23 +90,23 @@ static void HandleButtons(int mods) {
|
|||||||
static void ProcessTouchInput(int mods) {
|
static void ProcessTouchInput(int mods) {
|
||||||
touchPosition pos;
|
touchPosition pos;
|
||||||
touchRead(&pos);
|
touchRead(&pos);
|
||||||
touchActive = mods & KEY_TOUCH;
|
|
||||||
|
|
||||||
if (touchActive) {
|
|
||||||
Pointer_SetPosition(0, pos.px, pos.py);
|
|
||||||
}
|
|
||||||
// Set starting position for camera movement
|
// Set starting position for camera movement
|
||||||
if (mods & KEY_TOUCH) {
|
if (!touchActive && (mods & KEY_TOUCH)) {
|
||||||
touchBegX = pos.px;
|
touchBegX = pos.px;
|
||||||
touchBegY = pos.py;
|
touchBegY = pos.py;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
touchActive = mods & KEY_TOUCH;
|
||||||
|
if (touchActive) {
|
||||||
|
Pointer_SetPosition(0, pos.px, pos.py);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window_ProcessEvents(double delta) {
|
void Window_ProcessEvents(double delta) {
|
||||||
scanKeys();
|
scanKeys();
|
||||||
|
|
||||||
int keys = keysDown() | keysHeld();
|
int keys = keysDown() | keysHeld();
|
||||||
Platform_Log1("KEYS: %h", &keys);
|
|
||||||
HandleButtons(keys);
|
HandleButtons(keys);
|
||||||
|
|
||||||
Input_SetNonRepeatable(CCMOUSE_L, keys & KEY_TOUCH);
|
Input_SetNonRepeatable(CCMOUSE_L, keys & KEY_TOUCH);
|
||||||
@ -123,9 +123,6 @@ void Window_UpdateRawMouse(void) {
|
|||||||
touchPosition touch;
|
touchPosition touch;
|
||||||
touchRead(&touch);
|
touchRead(&touch);
|
||||||
|
|
||||||
int DX = touch.px - touchBegX;
|
|
||||||
int DY = touch.py - touchBegY;
|
|
||||||
Platform_Log2("DELTA: %i, %i", &DX, &DY);
|
|
||||||
Event_RaiseRawMove(&PointerEvents.RawMoved,
|
Event_RaiseRawMove(&PointerEvents.RawMoved,
|
||||||
touch.px - touchBegX, touch.py - touchBegY);
|
touch.px - touchBegX, touch.py - touchBegY);
|
||||||
touchBegX = touch.px;
|
touchBegX = touch.px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user