mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 17:16:20 +00:00
Trash DirectInput
--HG-- branch : game-device
This commit is contained in:
parent
f281622d47
commit
496f7f268c
10 changed files with 0 additions and 322 deletions
|
@ -866,10 +866,6 @@ public:
|
|||
/// x and y must be between 0.0 and 1.0
|
||||
virtual void setMousePos(float x, float y) = 0;
|
||||
|
||||
/** Get the delay in ms for mouse double clicks.
|
||||
*/
|
||||
virtual uint getDoubleClickDelay(bool hardwareMouse) = 0;
|
||||
|
||||
/** If true, capture the mouse to force it to stay under the window.
|
||||
* NB : this has no effects if a low level mouse is used
|
||||
*/
|
||||
|
|
|
@ -35,9 +35,6 @@
|
|||
|
||||
namespace NLMISC
|
||||
{
|
||||
struct IMouseDevice;
|
||||
struct IKeyboardDevice;
|
||||
struct IInputDeviceManager;
|
||||
class CLog;
|
||||
}
|
||||
|
||||
|
|
|
@ -1637,20 +1637,6 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
|
|||
// Setup the event emitter, and try to retrieve a direct input interface
|
||||
_EventEmitter.addEmitter(we, true /*must delete*/); // the main emitter
|
||||
|
||||
// Try to get direct input
|
||||
try
|
||||
{
|
||||
NLMISC::CDIEventEmitter *diee = NLMISC::CDIEventEmitter::create(GetModuleHandle(NULL), _HWnd, we);
|
||||
if (diee)
|
||||
{
|
||||
_EventEmitter.addEmitter(diee, true);
|
||||
}
|
||||
}
|
||||
catch(const EDirectInput &e)
|
||||
{
|
||||
nlinfo(e.what());
|
||||
}
|
||||
|
||||
// Init some variables
|
||||
_ForceDXTCCompression = false;
|
||||
_AnisotropicFilter = 0;
|
||||
|
@ -2010,13 +1996,6 @@ bool CDriverD3D::swapBuffers()
|
|||
// todo hulud volatile
|
||||
//_DeviceInterface->SetStreamSource(0, _VolatileVertexBufferRAM[1]->VertexBuffer, 0, 12);
|
||||
|
||||
// Is direct input running ?
|
||||
if (_EventEmitter.getNumEmitters() > 1)
|
||||
{
|
||||
// flush direct input messages if any
|
||||
NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1))->poll();
|
||||
}
|
||||
|
||||
// End now
|
||||
if (!endScene())
|
||||
{
|
||||
|
|
|
@ -1033,11 +1033,6 @@ public:
|
|||
// Change default scale for all cursors
|
||||
virtual void setCursorScale(float scale);
|
||||
|
||||
virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive);
|
||||
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
||||
virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager();
|
||||
virtual uint getDoubleClickDelay(bool hardwareMouse);
|
||||
|
||||
// Lights
|
||||
virtual uint getMaxLight () const;
|
||||
virtual void setLight (uint8 num, const CLight& light);
|
||||
|
|
|
@ -463,121 +463,6 @@ bool CDriverD3D::isSystemCursorCaptured()
|
|||
return GetCapture() == _HWnd;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
NLMISC::IMouseDevice* CDriverD3D::enableLowLevelMouse(bool enable, bool exclusive)
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_enableLowLevelMouse);
|
||||
|
||||
NLMISC::IMouseDevice *res = NULL;
|
||||
|
||||
NLMISC::CDIEventEmitter *diee = NULL;
|
||||
|
||||
if (_EventEmitter.getNumEmitters() > 1)
|
||||
diee = NLMISC::safe_cast<CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
|
||||
if (enable)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (diee)
|
||||
res = diee->getMouseDevice(exclusive);
|
||||
}
|
||||
catch (const EDirectInput &)
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (diee)
|
||||
diee->releaseMouse();
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
NLMISC::IKeyboardDevice* CDriverD3D::enableLowLevelKeyboard(bool enable)
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_enableLowLevelKeyboard);
|
||||
|
||||
NLMISC::IKeyboardDevice *res = NULL;
|
||||
|
||||
NLMISC::CDIEventEmitter *diee = NULL;
|
||||
|
||||
if (_EventEmitter.getNumEmitters() > 1)
|
||||
diee = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
|
||||
if (enable)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (diee)
|
||||
res = diee->getKeyboardDevice();
|
||||
}
|
||||
catch (const EDirectInput &)
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (diee)
|
||||
diee->releaseKeyboard();
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
NLMISC::IInputDeviceManager* CDriverD3D::getLowLevelInputDeviceManager()
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_getLowLevelInputDeviceManager);
|
||||
|
||||
NLMISC::IInputDeviceManager *res = NULL;
|
||||
|
||||
if (_EventEmitter.getNumEmitters() > 1)
|
||||
res = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
uint CDriverD3D::getDoubleClickDelay(bool hardwareMouse)
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_getDoubleClickDelay);
|
||||
|
||||
uint res = 250;
|
||||
|
||||
NLMISC::IMouseDevice *md = NULL;
|
||||
|
||||
if (_EventEmitter.getNumEmitters() >= 2)
|
||||
{
|
||||
NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast<CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
if (diee->isMouseCreated())
|
||||
{
|
||||
try
|
||||
{
|
||||
md = diee->getMouseDevice(hardwareMouse);
|
||||
}
|
||||
catch (const EDirectInput &)
|
||||
{
|
||||
// could not get device ..
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (md)
|
||||
{
|
||||
res = md->getDoubleClickDelay();
|
||||
}
|
||||
else
|
||||
{
|
||||
// try to read the good value from windows
|
||||
res = ::GetDoubleClickTime();
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CDriverD3D::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY)
|
||||
{
|
||||
return convertBitmapToIcon(bitmap, cursor, iconWidth, iconHeight, iconDepth, col, hotSpotX, hotSpotY, true);
|
||||
|
|
|
@ -934,14 +934,6 @@ bool CDriverGL::swapBuffers()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
if (_EventEmitter.getNumEmitters() > 1) // is direct input running ?
|
||||
{
|
||||
// flush direct input messages if any
|
||||
NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1))->poll();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!_WndActive)
|
||||
{
|
||||
if (_AGPVertexArrayRange) _AGPVertexArrayRange->updateLostBuffers();
|
||||
|
|
|
@ -527,14 +527,6 @@ public:
|
|||
// Change default scale for all cursors
|
||||
virtual void setCursorScale(float scale);
|
||||
|
||||
virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive);
|
||||
|
||||
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
||||
|
||||
virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager();
|
||||
|
||||
virtual uint getDoubleClickDelay(bool hardwareMouse);
|
||||
|
||||
virtual void getWindowSize (uint32 &width, uint32 &height);
|
||||
|
||||
virtual void getWindowPos (sint32 &x, sint32 &y);
|
||||
|
|
|
@ -664,149 +664,6 @@ bool CDriverGL::isSystemCursorCaptured()
|
|||
#endif
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive)
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_enableLowLevelMouse);
|
||||
|
||||
NLMISC::IMouseDevice *res = NULL;
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
|
||||
NLMISC::CDIEventEmitter *diee = NULL;
|
||||
|
||||
if (_EventEmitter.getNumEmitters() > 1)
|
||||
diee = NLMISC::safe_cast<CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
|
||||
if (enable)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (diee)
|
||||
res = diee->getMouseDevice(exclusive);
|
||||
}
|
||||
catch (const EDirectInput &)
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (diee)
|
||||
diee->releaseMouse();
|
||||
}
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
#elif defined (NL_OS_UNIX)
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable)
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard);
|
||||
|
||||
NLMISC::IKeyboardDevice *res = NULL;
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
|
||||
NLMISC::CDIEventEmitter *diee = NULL;
|
||||
|
||||
if (_EventEmitter.getNumEmitters() > 1)
|
||||
diee = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
|
||||
if (enable)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (diee)
|
||||
res = diee->getKeyboardDevice();
|
||||
}
|
||||
catch (const EDirectInput &)
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (diee)
|
||||
diee->releaseKeyboard();
|
||||
}
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
#elif defined (NL_OS_UNIX)
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager()
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager);
|
||||
|
||||
NLMISC::IInputDeviceManager *res = NULL;
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
|
||||
if (_EventEmitter.getNumEmitters() > 1)
|
||||
res = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
#elif defined (NL_OS_UNIX)
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
uint CDriverGL::getDoubleClickDelay(bool hardwareMouse)
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_getDoubleClickDelay);
|
||||
|
||||
uint res = 250;
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
|
||||
NLMISC::IMouseDevice *md = NULL;
|
||||
|
||||
if (_EventEmitter.getNumEmitters() >= 2)
|
||||
{
|
||||
NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast<CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
||||
if (diee->isMouseCreated())
|
||||
{
|
||||
try
|
||||
{
|
||||
md = diee->getMouseDevice(hardwareMouse);
|
||||
}
|
||||
catch (const EDirectInput &)
|
||||
{
|
||||
// could not get device ..
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (md)
|
||||
{
|
||||
res = md->getDoubleClickDelay();
|
||||
}
|
||||
else
|
||||
{
|
||||
// try to read the good value from windows
|
||||
res = ::GetDoubleClickTime();
|
||||
}
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
// TODO: Missing Mac Implementation for getDoubleClickDelay
|
||||
#elif defined (NL_OS_UNIX)
|
||||
|
||||
// TODO for Linux
|
||||
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight)
|
||||
{
|
||||
#ifdef NL_OS_WINDOWS
|
||||
|
|
|
@ -938,20 +938,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
// setup the event emitter, and try to retrieve a direct input interface
|
||||
_EventEmitter.addEmitter(we, true /*must delete*/); // the main emitter
|
||||
|
||||
/// try to get direct input
|
||||
try
|
||||
{
|
||||
NLMISC::CDIEventEmitter *diee = NLMISC::CDIEventEmitter::create(GetModuleHandle(NULL), _win, we);
|
||||
if (diee)
|
||||
{
|
||||
_EventEmitter.addEmitter(diee, true);
|
||||
}
|
||||
}
|
||||
catch(const EDirectInput &e)
|
||||
{
|
||||
nlinfo(e.what());
|
||||
}
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
|
||||
if (wnd == EmptyWindow)
|
||||
|
|
|
@ -165,7 +165,6 @@ using namespace std;
|
|||
// EXTERN //
|
||||
////////////
|
||||
extern UDriver *Driver;
|
||||
extern IMouseDevice *MouseDevice;
|
||||
extern UScene *Scene;
|
||||
extern UScene *SceneRoot;
|
||||
extern ULandscape *Landscape;
|
||||
|
|
Loading…
Reference in a new issue