Merge remote-tracking branch 'svn/trunk' into git_master

This commit is contained in:
Diederick Niehorster 2014-10-12 14:39:53 +08:00
commit 9e3fad3576
2 changed files with 12 additions and 7 deletions

View File

@ -247,11 +247,12 @@ void FGAPIENTRY glutJoystickFunc( FGCBJoystick callback, int pollInterval )
SET_CALLBACK( Joystick ); SET_CALLBACK( Joystick );
fgStructure.CurrentWindow->State.JoystickPollRate = pollInterval; fgStructure.CurrentWindow->State.JoystickPollRate = pollInterval;
fgStructure.CurrentWindow->State.JoystickLastPoll = /* set last poll time such that joystick will be polled asap */
fgElapsedTime() - fgStructure.CurrentWindow->State.JoystickPollRate; fgStructure.CurrentWindow->State.JoystickLastPoll = fgElapsedTime();
if (fgStructure.CurrentWindow->State.JoystickLastPoll < pollInterval)
if( fgStructure.CurrentWindow->State.JoystickLastPoll < 0 )
fgStructure.CurrentWindow->State.JoystickLastPoll = 0; fgStructure.CurrentWindow->State.JoystickLastPoll = 0;
else
fgStructure.CurrentWindow->State.JoystickLastPoll -= pollInterval;
} }

View File

@ -752,7 +752,9 @@ SFG_Window* fghWindowUnderCursor(SFG_Window *window)
/* Get mouse position at time of message */ /* Get mouse position at time of message */
DWORD mouse_pos_dw = GetMessagePos(); DWORD mouse_pos_dw = GetMessagePos();
POINT mouse_pos = {GET_X_LPARAM(mouse_pos_dw), GET_Y_LPARAM(mouse_pos_dw)}; POINT mouse_pos;
mouse_pos.x = GET_X_LPARAM(mouse_pos_dw);
mouse_pos.y = GET_Y_LPARAM(mouse_pos_dw);
ScreenToClient( window->Window.Handle, &mouse_pos ); ScreenToClient( window->Window.Handle, &mouse_pos );
hwnd = ChildWindowFromPoint(window->Window.Handle, mouse_pos); hwnd = ChildWindowFromPoint(window->Window.Handle, mouse_pos);
@ -947,7 +949,9 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
/* For child window, we should return relative to upper-left /* For child window, we should return relative to upper-left
* of parent's client area. * of parent's client area.
*/ */
POINT topleft = {windowRect.left,windowRect.top}; POINT topleft;
topleft.x = windowRect.left;
topleft.y = windowRect.top;
ScreenToClient(window->Parent->Window.Handle,&topleft); ScreenToClient(window->Parent->Window.Handle,&topleft);
windowRect.left = topleft.x; windowRect.left = topleft.x;
@ -1763,4 +1767,4 @@ void fgPlatformVisibilityWork(SFG_Window* window)
} }
ShowWindow( win->Window.Handle, cmdShow ); ShowWindow( win->Window.Handle, cmdShow );
} }