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:
parent
ac18d0a11b
commit
8d1c7e802d
@ -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);
|
||||||
|
@ -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>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user