1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 10:22:52 +01:00

Add RWGame::hasFocus(), fix mouse warping

This commit is contained in:
Daniel Evans 2015-05-01 00:43:02 +01:00
parent ac18d0a11b
commit 8d1c7e802d
2 changed files with 3 additions and 1 deletions

View File

@ -101,6 +101,8 @@ public:
void startScript(const std::string& name); void startScript(const std::string& name);
bool hasFocus() const { return inFocus; }
private: private:
void tick(float dt); void tick(float dt);
void render(float alpha, float dt); void render(float alpha, float dt);

View File

@ -99,7 +99,7 @@ void IngameState::tick(float dt)
autolookTimer = std::max(autolookTimer - dt, 0.f); autolookTimer = std::max(autolookTimer - dt, 0.f);
auto player = getPlayer(); auto player = getPlayer();
if( player && player->isInputEnabled() ) if( player && player->isInputEnabled() && game->hasFocus() )
{ {
float qpi = glm::half_pi<float>(); float qpi = glm::half_pi<float>();