Merge branch 'development' of https://github.com/GarageGames/Torque3D into PBR_ProbeArrayGLWIP

# Conflicts:
#	Engine/source/gfx/D3D11/gfxD3D11Device.cpp
#	Engine/source/lighting/lightManager.cpp
#	Templates/Full/game/levels/Empty Room.mis
#	Templates/Full/game/levels/Empty Terrain.mis
This commit is contained in:
AzaezelX 2019-05-01 23:18:31 -05:00
commit 97ec99f704
235 changed files with 7064 additions and 3090 deletions

View file

@ -598,6 +598,7 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
SDL_GetWindowSize( mWindowHandle, &width, &height );
mVideoMode.resolution.set( width, height );
getGFXTarget()->resetMode();
resizeEvent.trigger(getWindowId(), width, height);
break;
}

View file

@ -21,6 +21,7 @@
//-----------------------------------------------------------------------------
#include "windowManager/sdl/sdlWindowMgr.h"
#include "platformSDL/sdlInputManager.h"
#include "gfx/gfxDevice.h"
#include "core/util/journal/process.h"
#include "core/strings/unicode.h"
@ -269,6 +270,13 @@ void PlatformWindowManagerSDL::_process()
SDL_Event evt;
while( SDL_PollEvent(&evt) )
{
if (evt.type >= SDL_JOYAXISMOTION && evt.type <= SDL_CONTROLLERDEVICEREMAPPED)
{
SDLInputManager* mgr = static_cast<SDLInputManager*>(Input::getManager());
if (mgr)
mgr->processEvent(evt);
continue;
}
switch(evt.type)
{
case SDL_QUIT:
@ -356,15 +364,16 @@ void PlatformWindowManagerSDL::_process()
case(SDL_DROPCOMPLETE):
{
if (!Con::isFunction("onDropEnd"))
break;
Con::executef("onDropEnd");
if (Con::isFunction("onDropEnd"))
Con::executef("onDropEnd");
break;
}
default:
{
//Con::printf("Event: %d", evt.type);
#ifdef TORQUE_DEBUG
Con::warnf("Unhandled SDL input event: 0x%04x", evt.type);
#endif
}
}
}
@ -495,10 +504,12 @@ void InitWindowingSystem()
AFTER_MODULE_INIT(gfx)
{
#if !defined(TORQUE_DEDICATED)
int res = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS | SDL_INIT_NOPARACHUTE);
AssertFatal(res != -1, avar("SDL error:%s", SDL_GetError()));
// By default, SDL enables text input. We disable it on initialization, and
// we will enable it whenever the time is right.
SDL_StopTextInput();
#endif
}

View file

@ -33,7 +33,6 @@ extern InputModifiers convertModifierBits(const U32 in);
// Constructor/Destructor
//-----------------------------------------------------------------------------
WindowInputGenerator::WindowInputGenerator( PlatformWindow *window ) :
mNotifyPosition(true),
mWindow(window),
mInputController(NULL),
mLastCursorPos(0,0),
@ -135,6 +134,7 @@ void WindowInputGenerator::handleMouseMove( WindowId did, U32 modifier, S32 x, S
// Because of this we always have to generate and send off for processing
// relative events, even if the mouse is not locked.
// I'm considering removing this in the Canvas refactor, thoughts? [7/6/2007 justind]
// Now sends the absolute position event whenever an absolute position is received from the OS. [2/13/2019 mar]
// Generate a base Movement along and Axis event
InputEventInfo event;
@ -192,33 +192,23 @@ void WindowInputGenerator::handleMouseMove( WindowId did, U32 modifier, S32 x, S
}
// When the window gains focus, we send a cursor position event
if( mNotifyPosition )
{
mNotifyPosition = false;
// We use SI_MAKE to signify that the position is being set, not relatively moved.
event.action = SI_MAKE;
// We use SI_MAKE to signify that the position is being set, not relatively moved.
event.action = SI_MAKE;
// X Axis
event.objInst = SI_XAXIS;
event.fValue = (F32)x;
generateInputEvent(event);
// X Axis
event.objInst = SI_XAXIS;
event.fValue = (F32)x;
generateInputEvent(event);
// Y Axis
event.objInst = SI_YAXIS;
event.fValue = (F32)y;
generateInputEvent(event);
}
// Y Axis
event.objInst = SI_YAXIS;
event.fValue = (F32)y;
generateInputEvent(event);
mLastCursorPos = Point2I(x,y);
}
else
{
mLastCursorPos += Point2I(x,y);
mNotifyPosition = true;
}
}
void WindowInputGenerator::handleMouseButton( WindowId did, U32 modifiers, U32 action, U16 button )
@ -388,8 +378,6 @@ void WindowInputGenerator::handleAppEvent( WindowId did, S32 event )
}
else if(event == GainFocus)
{
// Set an update flag to notify the consumer of the absolute mouse position next move
mNotifyPosition = true;
mFocused = true;
}

View file

@ -37,8 +37,6 @@ class PlatformWindow;
class WindowInputGenerator
{
bool mNotifyPosition;
protected:
PlatformWindow *mWindow;