diff --git a/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h b/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h index 7f046db8..f9be1cbb 100644 --- a/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h +++ b/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; @@ -140,9 +140,9 @@ struct plMouseInfo fControlDescription = _desc; } ControlEventCode fCode; - uint32_t fControlFlags; + uint32_t fControlFlags; hsPoint4 fBox; - char* fControlDescription; + const char* fControlDescription; }; diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp index 35145eaa..e6af2ab9 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp +++ b/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) { @@ -259,8 +259,9 @@ 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 diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h index 3ebde4e4..d7c701a7 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h +++ b/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(); @@ -97,16 +97,19 @@ protected: bool fActive, fFirstActivated; float fMouseScale; - static uint8_t bRecenterMouse; - static HWND fhWnd; + static uint8_t bRecenterMouse; + 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 diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp index 25605709..d81487be 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp +++ b/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)) { @@ -1236,4 +1236,4 @@ uint32_t plSceneInputInterface::SetCurrentCursorID(uint32_t id) void plSceneInputInterface::RequestAvatarTurnToPointLOS() { IRequestLOSCheck( plMouseDevice::Instance()->GetCursorX(), plMouseDevice::Instance()->GetCursorY(), ID_FIND_WALKABLE_GROUND ); -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h index 77ae0488..02a0fd2f 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h +++ b/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) diff --git a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp index 3bcd21f0..03fbca95 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp +++ b/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);