|
|
@@ -40,7 +40,6 @@
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
#include "../Engine/Engine.h"
|
|
|
-#include "../Graphics/Renderer.h"
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@@ -147,7 +146,7 @@ MouseMode EmscriptenInput::invalidatedRequestedMouseMode_ = MM_INVALID;
|
|
|
EmscriptenInput::EmscriptenInput(Input* inputInst) :
|
|
|
inputInst_(inputInst)
|
|
|
{
|
|
|
- void* vInputInst = (void*)inputInst;
|
|
|
+ auto* vInputInst = (void*)inputInst;
|
|
|
|
|
|
// Handle pointer lock
|
|
|
emscripten_set_pointerlockchange_callback(NULL, vInputInst, false, EmscriptenInput::HandlePointerLockChange);
|
|
|
@@ -201,7 +200,7 @@ bool EmscriptenInput::IsVisible()
|
|
|
|
|
|
EM_BOOL EmscriptenInput::HandlePointerLockChange(int eventType, const EmscriptenPointerlockChangeEvent* keyEvent, void* userData)
|
|
|
{
|
|
|
- Input* const inputInst = (Input*)userData;
|
|
|
+ auto* const inputInst = (Input*)userData;
|
|
|
|
|
|
bool invalid = false;
|
|
|
const bool suppress = suppressMouseModeEvent_;
|
|
|
@@ -257,7 +256,7 @@ EM_BOOL EmscriptenInput::HandlePointerLockChange(int eventType, const Emscripten
|
|
|
|
|
|
EM_BOOL EmscriptenInput::HandleFocusChange(int eventType, const EmscriptenFocusEvent* keyEvent, void* userData)
|
|
|
{
|
|
|
- Input* const inputInst = (Input*)userData;
|
|
|
+ auto* const inputInst = (Input*)userData;
|
|
|
|
|
|
inputInst->SuppressNextMouseMove();
|
|
|
|
|
|
@@ -272,7 +271,7 @@ EM_BOOL EmscriptenInput::HandleFocusChange(int eventType, const EmscriptenFocusE
|
|
|
EM_BOOL EmscriptenInput::HandleMouseJump(int eventType, const EmscriptenMouseEvent * mouseEvent, void* userData)
|
|
|
{
|
|
|
// Suppress mouse jump on pointer-lock change
|
|
|
- Input* const inputInst = (Input*)userData;
|
|
|
+ auto* const inputInst = (Input*)userData;
|
|
|
bool suppress = false;
|
|
|
if (eventType == EMSCRIPTEN_EVENT_MOUSEDOWN && inputInst->emscriptenEnteredPointerLock_)
|
|
|
{
|
|
|
@@ -292,7 +291,7 @@ EM_BOOL EmscriptenInput::HandleMouseJump(int eventType, const EmscriptenMouseEve
|
|
|
|
|
|
int EmscriptenInput::HandleSDLEvents(void* userData, SDL_Event* event)
|
|
|
{
|
|
|
- Input* const inputInst = (Input*)userData;
|
|
|
+ auto* const inputInst = (Input*)userData;
|
|
|
|
|
|
inputInst->HandleSDLEvent(event);
|
|
|
|
|
|
@@ -305,14 +304,14 @@ int EmscriptenInput::HandleSDLEvents(void* userData, SDL_Event* event)
|
|
|
// On Windows repaint while the window is actively being resized.
|
|
|
int Win32_ResizingEventWatcher(void* data, SDL_Event* event)
|
|
|
{
|
|
|
- if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_RESIZED)
|
|
|
+ if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_RESIZED)
|
|
|
{
|
|
|
SDL_Window* win = SDL_GetWindowFromID(event->window.windowID);
|
|
|
if (win == (SDL_Window*)data)
|
|
|
{
|
|
|
- if (Context* ctx = (Context*)SDL_GetWindowData(win, "URHO3D_CONTEXT"))
|
|
|
+ if (auto* ctx = (Context*)SDL_GetWindowData(win, "URHO3D_CONTEXT"))
|
|
|
{
|
|
|
- if (auto graphics = ctx->GetSubsystem<Graphics>())
|
|
|
+ if (auto* graphics = ctx->GetSubsystem<Graphics>())
|
|
|
{
|
|
|
if (graphics->IsInitialized())
|
|
|
{
|