|
|
@@ -332,7 +332,7 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|
|
break;
|
|
|
|
|
|
case WM_MOUSEMOVE:
|
|
|
- {
|
|
|
+ {
|
|
|
int x = GET_X_LPARAM(lParam);
|
|
|
int y = GET_Y_LPARAM(lParam);
|
|
|
|
|
|
@@ -348,8 +348,8 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|
|
else if ((wParam & MK_RBUTTON) == MK_RBUTTON)
|
|
|
{
|
|
|
// Update the pitch and roll by adding the scaled deltas.
|
|
|
- __roll += -(float)(x - lx) * ACCELEROMETER_X_FACTOR;
|
|
|
- __pitch += (float)(y - ly) * ACCELEROMETER_Y_FACTOR;
|
|
|
+ __roll += (float)(x - lx) * ACCELEROMETER_X_FACTOR;
|
|
|
+ __pitch += -(float)(y - ly) * ACCELEROMETER_Y_FACTOR;
|
|
|
|
|
|
// Clamp the values to the valid range.
|
|
|
__roll = max(min(__roll, 90.0f), -90.0f);
|
|
|
@@ -359,7 +359,7 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|
|
lx = x;
|
|
|
ly = y;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
|