Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/GameClient/Mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ class Mouse : public SubsystemInterface
virtual void setPosition( Int x, Int y ); ///< set the mouse position
virtual void setCursor( MouseCursor cursor ) = 0; ///< set mouse cursor

void initCapture(); ///< called once to unlock the mouse capture functionality
void setCursorCaptureMode(CursorCaptureMode mode); ///< set the rules for the mouse capture
void refreshCursorCapture(); ///< refresh the mouse capture
Bool isCursorCaptured(); ///< true if the mouse is captured in the game window
Expand Down Expand Up @@ -348,7 +349,6 @@ class Mouse : public SubsystemInterface

protected:

void initCapture();
Bool canCapture() const; ///< true if the mouse can be captured
void unblockCapture(CursorCaptureBlockReason reason); // unset a reason to block mouse capture
void blockCapture(CursorCaptureBlockReason reason); // set a reason to block mouse capture
Expand Down
7 changes: 4 additions & 3 deletions Generals/Code/GameEngine/Source/GameClient/GameClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,15 @@ void GameClient::init( void )
TheRayEffects->setName("TheRayEffects");
}

TheMouse->init(); //finish initializing the mouse.

// set the limits of the mouse now that we've created the display and such
if( TheMouse )
{
// finish initializing the mouse.
TheMouse->init();
TheMouse->initCapture();
TheMouse->setPosition( 0, 0 );
TheMouse->setMouseLimits();
TheMouse->setName("TheMouse");
TheMouse->setName("TheMouse");
}

// create the video player
Expand Down
5 changes: 1 addition & 4 deletions Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ Mouse::Mouse( void )
m_tooltipBackColor.blue = 0;
m_tooltipBackColor.alpha = 255;

m_cursorCaptureMode = CursorCaptureMode_Default;
m_cursorCaptureMode = 0;

m_captureBlockReasonBits = (1 << CursorCaptureBlockReason_NoInit);
DEBUG_LOG(("Mouse::Mouse: m_blockCaptureReason=CursorCaptureBlockReason_NoInit"));
Expand Down Expand Up @@ -582,9 +582,6 @@ void Mouse::init( void )

// allocate a new display string
m_cursorTextDisplayString = TheDisplayStringManager->newDisplayString();

initCapture();

}

//-------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/GameClient/Mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ class Mouse : public SubsystemInterface
virtual void setPosition( Int x, Int y ); ///< set the mouse position
virtual void setCursor( MouseCursor cursor ) = 0; ///< set mouse cursor

void initCapture(); ///< called once to unlock the mouse capture functionality
void setCursorCaptureMode(CursorCaptureMode mode); ///< set the rules for the mouse capture
void refreshCursorCapture(); ///< refresh the mouse capture
Bool isCursorCaptured(); ///< true if the mouse is captured in the game window
Expand Down Expand Up @@ -349,7 +350,6 @@ class Mouse : public SubsystemInterface

protected:

void initCapture();
Bool canCapture() const; ///< true if the mouse can be captured
void unblockCapture(CursorCaptureBlockReason reason); // unset a reason to block mouse capture
void blockCapture(CursorCaptureBlockReason reason); // set a reason to block mouse capture
Expand Down
7 changes: 4 additions & 3 deletions GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,15 @@ void GameClient::init( void )
TheRayEffects->setName("TheRayEffects");
}

TheMouse->init(); //finish initializing the mouse.

// set the limits of the mouse now that we've created the display and such
if( TheMouse )
{
// finish initializing the mouse.
TheMouse->init();
TheMouse->initCapture();
TheMouse->setPosition( 0, 0 );
TheMouse->setMouseLimits();
TheMouse->setName("TheMouse");
TheMouse->setName("TheMouse");
}

// create the video player
Expand Down
5 changes: 1 addition & 4 deletions GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ Mouse::Mouse( void )
m_tooltipBackColor.blue = 0;
m_tooltipBackColor.alpha = 255;

m_cursorCaptureMode = CursorCaptureMode_Default;
m_cursorCaptureMode = 0;

m_captureBlockReasonBits = (1 << CursorCaptureBlockReason_NoInit);
DEBUG_LOG(("Mouse::Mouse: m_blockCaptureReason=CursorCaptureBlockReason_NoInit"));
Expand Down Expand Up @@ -582,9 +582,6 @@ void Mouse::init( void )

// allocate a new display string
m_cursorTextDisplayString = TheDisplayStringManager->newDisplayString();

initCapture();

}

//-------------------------------------------------------------------------------------------------
Expand Down
Loading