mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
- Fixed mouse boundary to game window for multi-monitor setup in full screen mode (vanilla bug) (by Buggler)
- Freed 'Ctrl+y' hotkey in tactical & laptop screen for other uses (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6407 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -50,7 +50,8 @@ extern BOOLEAN gfApplicationActive;
|
||||
BOOLEAN gfKeyState[256]; // TRUE = Pressed, FALSE = Not Pressed
|
||||
BOOLEAN fCursorWasClipped = FALSE;
|
||||
RECT gCursorClipRect;
|
||||
|
||||
extern BOOLEAN gfMouseLockedOnBorder;
|
||||
extern int iWindowedMode;
|
||||
|
||||
|
||||
// The gsKeyTranslationTables basically translates scan codes to our own key value table. Please note that the table is 2 bytes
|
||||
@@ -1590,10 +1591,23 @@ void RestrictMouseCursor(SGPRect *pRectangle)
|
||||
fCursorWasClipped = TRUE;
|
||||
}
|
||||
|
||||
void FreeMouseCursor(void)
|
||||
void FreeMouseCursor( BOOLEAN fLockForTacticalWindowedMode )
|
||||
{
|
||||
ClipCursor(NULL);
|
||||
fCursorWasClipped = FALSE;
|
||||
|
||||
// Buggler: Need to relock for fullscreen mode as ClipCursor release mouse boundary to full desktop resolution on multi-monitor setup &&
|
||||
// for windowed mode, lockscreen only when player activates feature in tactical screen due to mouse restriction applies to desktop too!
|
||||
if ( !iWindowedMode || ( iWindowedMode && gfMouseLockedOnBorder && fLockForTacticalWindowedMode ) )
|
||||
{
|
||||
SGPRect LJDRect;
|
||||
|
||||
LJDRect.iLeft = 0;
|
||||
LJDRect.iTop = 0;
|
||||
LJDRect.iRight = SCREEN_WIDTH;
|
||||
LJDRect.iBottom = SCREEN_HEIGHT;
|
||||
RestrictMouseCursor( &LJDRect );
|
||||
}
|
||||
}
|
||||
|
||||
void RestoreCursorClipRect( void )
|
||||
|
||||
@@ -105,7 +105,7 @@ extern BOOLEAN DequeueSpecificEvent(InputAtom *Event, UINT32 uiMaskFlags );
|
||||
|
||||
extern void RestrictMouseToXYXY(UINT16 usX1, UINT16 usY1, UINT16 usX2, UINT16 usY2);
|
||||
extern void RestrictMouseCursor(SGPRect *pRectangle);
|
||||
extern void FreeMouseCursor(void);
|
||||
extern void FreeMouseCursor( BOOLEAN fLockForTacticalWindowedMode );
|
||||
extern BOOLEAN IsCursorRestricted( void );
|
||||
extern void GetRestrictedClipCursor( SGPRect *pRectangle );
|
||||
extern void RestoreCursorClipRect( void );
|
||||
|
||||
@@ -567,7 +567,7 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
|
||||
SuspendVideoManager();
|
||||
}
|
||||
gfApplicationActive=FALSE;
|
||||
FreeMouseCursor();
|
||||
FreeMouseCursor( FALSE );
|
||||
#endif
|
||||
// Set a flag to restore surfaces once a WM_ACTIVEATEAPP is received
|
||||
fRestore = TRUE;
|
||||
|
||||
@@ -715,7 +715,7 @@ void ShutdownVideoManager(void)
|
||||
}
|
||||
|
||||
// ATE: Release mouse cursor!
|
||||
FreeMouseCursor( );
|
||||
FreeMouseCursor( FALSE );
|
||||
|
||||
UnRegisterDebugTopic(TOPIC_VIDEO, "Video");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user