Browse Source

Fixes for plInputManager and plResponderModifier.

Darryl Pogue 13 years ago
parent
commit
1f0547279c
  1. 6
      Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h
  2. 8
      Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp
  3. 11
      Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h
  4. 10
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp
  5. 4
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h
  6. 2
      Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp

6
Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h

@ -125,14 +125,14 @@ struct CommandConvert
struct plMouseInfo
{
plMouseInfo(ControlEventCode _code, uint32_t _flags, hsPoint4 _box, char* _desc)
plMouseInfo(ControlEventCode _code, uint32_t _flags, hsPoint4 _box, const char* _desc)
{
fCode = _code;
fControlFlags = _flags;
fBox = _box;
fControlDescription = _desc;
}
plMouseInfo(ControlEventCode _code, uint32_t _flags, float pt1, float pt2, float pt3, float pt4, char* _desc)
plMouseInfo(ControlEventCode _code, uint32_t _flags, float pt1, float pt2, float pt3, float pt4, const char* _desc)
{
fCode = _code;
fControlFlags = _flags;
@ -142,7 +142,7 @@ struct plMouseInfo
ControlEventCode fCode;
uint32_t fControlFlags;
hsPoint4 fBox;
char* fControlDescription;
const char* fControlDescription;
};

8
Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp

@ -117,7 +117,7 @@ typedef int (__stdcall * Pfunc1) (const DIDEVICEINSTANCE* device, void* pRef);
plInputManager* plInputManager::fInstance = nil;
plInputManager::plInputManager( HWND hWnd ) :
plInputManager::plInputManager( hsWindowHndl hWnd ) :
fDInputMgr(nil),
fInterfaceMgr(nil)
{
@ -178,7 +178,7 @@ void plInputManager::CreateInterfaceMod(plPipeline* p)
fInterfaceMgr->Init();
}
void plInputManager::InitDInput(HINSTANCE hInst, HWND hWnd)
void plInputManager::InitDInput(hsWindowInst hInst, hsWindowHndl hWnd)
{
if (fUseDInput)
{
@ -260,7 +260,8 @@ plKeyDef plInputManager::UntranslateKey(plKeyDef key, hsBool extended)
return key;
}
void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, HWND hWnd)
#if HS_BUILD_FOR_WIN32
void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, hsWindowHndl hWnd)
{
if( !fhWnd )
fhWnd = hWnd;
@ -431,6 +432,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM
}
}
#endif
//// Activate ////////////////////////////////////////////////////////////////
// Handles what happens when the app (window) activates/deactivates

11
Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h

@ -62,7 +62,7 @@ private:
static hsBool fUseDInput;
public:
plInputManager();
plInputManager( HWND hWnd );
plInputManager( hsWindowHndl hWnd );
~plInputManager();
CLASSNAME_REGISTER( plInputManager );
@ -70,7 +70,7 @@ public:
void AddInputDevice(plInputDevice* pDev);
void InitDInput(HINSTANCE hInst, HWND hWnd);
void InitDInput(hsWindowInst hInst, hsWindowHndl hWnd);
static void UseDInput(hsBool b) { fUseDInput = b; }
void Update();
@ -98,15 +98,18 @@ protected:
float fMouseScale;
static uint8_t bRecenterMouse;
static HWND fhWnd;
static hsWindowHndl fhWnd;
public:
#if HS_BUILD_FOR_WIN32
// event handlers
void HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, HWND hWnd);
#endif
};
#if HS_BUILD_FOR_WIN32
// {049DE53E-23A2-4d43-BF68-36AC1B57E357}
static const GUID PL_ACTION_GUID = { 0x49de53e, 0x23a2, 0x4d43, { 0xbf, 0x68, 0x36, 0xac, 0x1b, 0x57, 0xe3, 0x57 } };
#endif
#endif

10
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp

@ -109,7 +109,7 @@ plSceneInputInterface::plSceneInputInterface()
{
fPipe = nil;
fSpawnPoint = nil;
GuidClear(&fAgeInstanceGuid);
fAgeInstanceGuid.Clear();
fInstance = this;
SetEnabled( true ); // Always enabled
}
@ -790,7 +790,7 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg )
}
else if ( mgrMsg->GetCommand() == plInputIfaceMgrMsg::kSetShareAgeInstanceGuid )
{
fAgeInstanceGuid = mgrMsg->GetAgeInstanceGuid();
fAgeInstanceGuid = plUUID(mgrMsg->GetAgeInstanceGuid());
}
}
plVaultNotifyMsg* pVaultMsg = plVaultNotifyMsg::ConvertNoRef(msg);
@ -817,15 +817,15 @@ void plSceneInputInterface::ILinkOffereeToAge()
info.SetAgeFilename(fOfferedAgeFile);
info.SetAgeInstanceName(fOfferedAgeInstance);
bool isAgeInstanceGuidSet = !GuidIsNil(fAgeInstanceGuid);
bool isAgeInstanceGuidSet = fAgeInstanceGuid.IsSet();
plAgeLinkStruct link;
if (isAgeInstanceGuidSet) {
info.SetAgeInstanceGuid(&plUUID(fAgeInstanceGuid));
info.SetAgeInstanceGuid(&fAgeInstanceGuid);
link.GetAgeInfo()->CopyFrom(&info);
GuidClear(&fAgeInstanceGuid);
fAgeInstanceGuid.Clear();
}
else if (!VaultGetOwnedAgeLink(&info, &link)) {

4
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h

@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plInputInterface.h"
#include "hsGeometry3.h"
#include "pnKeyedObject/plKey.h"
#include "pnUtils/pnUtils.h"
#include "pnUUID/pnUUID.h"
//// Class Definition ////////////////////////////////////////////////////////
@ -86,7 +86,7 @@ class plSceneInputInterface : public plInputInterface
const char* fOfferedAgeFile;
const char* fOfferedAgeInstance;
const char* fSpawnPoint;
Uuid fAgeInstanceGuid;
plUUID fAgeInstanceGuid;
struct clickableTest
{
clickableTest(plKey k)

2
Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp

@ -788,7 +788,7 @@ void plResponderModifier::ILog(uint32_t color, const char* format, ...)
char buf[256];
va_list args;
va_start(args, format);
int numWritten = _vsnprintf(buf, sizeof(buf), format, args);
int numWritten = hsVsnprintf(buf, sizeof(buf), format, args);
hsAssert(numWritten > 0, "Buffer too small");
va_end(args);

Loading…
Cancel
Save