1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00

Obliterate hsBool

This commit is contained in:
2012-07-11 01:28:00 -04:00
parent 5f78b33db4
commit a709e17069
1041 changed files with 7889 additions and 8070 deletions

View File

@ -189,7 +189,7 @@ void plAvatarInputInterface::Shutdown( void )
{
}
void plAvatarInputInterface::CameraInThirdPerson(hsBool state)
void plAvatarInputInterface::CameraInThirdPerson(bool state)
{
if (state != f3rdPerson)
{
@ -393,17 +393,17 @@ void plAvatarInputInterface::EnableMouseMovement()
ISetBasicMode();
}
void plAvatarInputInterface::EnableJump(hsBool val)
void plAvatarInputInterface::EnableJump(bool val)
{
EnableControl(val, B_CONTROL_JUMP);
}
void plAvatarInputInterface::EnableForwardMovement(hsBool val)
void plAvatarInputInterface::EnableForwardMovement(bool val)
{
EnableControl(val, B_CONTROL_MOVE_FORWARD);
}
void plAvatarInputInterface::EnableControl(hsBool val, ControlEventCode code)
void plAvatarInputInterface::EnableControl(bool val, ControlEventCode code)
{
if (val)
IEnableControl(code);
@ -411,7 +411,7 @@ void plAvatarInputInterface::EnableControl(hsBool val, ControlEventCode code)
IDisableControl(code);
}
void plAvatarInputInterface::ForceAlwaysRun(hsBool val)
void plAvatarInputInterface::ForceAlwaysRun(bool val)
{
plCtrlCmd *pCmd = new plCtrlCmd( this );
pCmd->fControlCode = B_CONTROL_ALWAYS_RUN;
@ -424,7 +424,7 @@ void plAvatarInputInterface::ForceAlwaysRun(hsBool val)
//// IEval ///////////////////////////////////////////////////////////////////
// Gets called once per IUpdate(), just like normal IEval()s
hsBool plAvatarInputInterface::IEval( double secs, float del, uint32_t dirty )
bool plAvatarInputInterface::IEval( double secs, float del, uint32_t dirty )
{
fCursorTimeout += del;
if( fCursorTimeout > fCursorFadeDelay )
@ -442,7 +442,7 @@ hsBool plAvatarInputInterface::IEval( double secs, float del, uint32_t dirty )
//// IHandleCtrlCmd //////////////////////////////////////////////////////////
hsBool plAvatarInputInterface::IHandleCtrlCmd( plCtrlCmd *cmd )
bool plAvatarInputInterface::IHandleCtrlCmd( plCtrlCmd *cmd )
{
switch( cmd->fControlCode )
{
@ -498,7 +498,7 @@ plVirtualCam::Instance()->GetPipeline()->SetDrawableTypeMask(plVirtualCam::Insta
if( cmd->fControlActivated )
{
hsBool abort = false;
bool abort = false;
for (int i = 0; i < fMessageQueue->GetCount(); i++)
{
if ((*fMessageQueue)[i]->fControlCode == S_SET_WALK_MODE && !(*fMessageQueue)[i]->fControlActivated)
@ -523,7 +523,7 @@ plVirtualCam::Instance()->GetPipeline()->SetDrawableTypeMask(plVirtualCam::Insta
if( cmd->fControlActivated )
{
hsBool abort = false;
bool abort = false;
for (int i = 0; i < fMessageQueue->GetCount(); i++)
{
if ((*fMessageQueue)[i]->fControlCode == S_SET_WALK_BACK_MODE && !(*fMessageQueue)[i]->fControlActivated)
@ -548,7 +548,7 @@ plVirtualCam::Instance()->GetPipeline()->SetDrawableTypeMask(plVirtualCam::Insta
if( cmd->fControlActivated )
{
hsBool abort = false;
bool abort = false;
for (int i = 0; i < fMessageQueue->GetCount(); i++)
{
if ((*fMessageQueue)[i]->fControlCode == S_SET_WALK_BACK_MODE && !(*fMessageQueue)[i]->fControlActivated)
@ -602,7 +602,7 @@ plVirtualCam::Instance()->GetPipeline()->SetDrawableTypeMask(plVirtualCam::Insta
return false;
}
hsBool plAvatarInputInterface::CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box)
bool plAvatarInputInterface::CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box)
{
return ( pMsg->GetXPos() >= box.fX && pMsg->GetXPos() <= box.fY && pMsg->GetYPos() >= box.fZ && pMsg->GetYPos() <= box.fW );
}
@ -623,7 +623,7 @@ void plAvatarInputInterface::ClearMouseCursor()
IClearControlFlag(S_SET_CURSOR_RIGHT);
}
hsBool plAvatarInputInterface::MsgReceive( plMessage *msg )
bool plAvatarInputInterface::MsgReceive( plMessage *msg )
{
plCmdIfaceModMsg *pCMsg = plCmdIfaceModMsg::ConvertNoRef( msg );
if( pCMsg )
@ -684,7 +684,7 @@ void plAvatarInputInterface::MissedInputEvent( plInputEventMsg *pMsg )
}
}
hsBool plAvatarInputInterface::IsEnterChatModeBound()
bool plAvatarInputInterface::IsEnterChatModeBound()
{
int i;
for ( i=0; i< fControlMap->GetNumBindings(); i++ )
@ -704,7 +704,7 @@ hsBool plAvatarInputInterface::IsEnterChatModeBound()
//// InterpretInputEvent /////////////////////////////////////////////////////
hsBool plAvatarInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
bool plAvatarInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
{
if( fInputMap == nil )
return false;
@ -801,7 +801,7 @@ hsBool plAvatarInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
return true;
// can we disable this control?
hsBool disable = false;
bool disable = false;
// can we disable this control based on a button?
if (mouseMap->fMap[i]->fControlFlags & kControlFlagLeftButton && !(fInputMap->fButtonState & kLeftButtonDown))

View File

@ -83,7 +83,7 @@ class plAvatarInputMap
plAvatarInputMap();
virtual ~plAvatarInputMap();
virtual const char *GetName() = 0;
virtual hsBool IsBasic() { return false; }
virtual bool IsBasic() { return false; }
plMouseMap *fMouseMap;
uint32_t fButtonState;
@ -103,7 +103,7 @@ class plBasicControlMap : public plSuspendedMovementMap
public:
plBasicControlMap();
virtual const char *GetName() { return "Basic"; }
virtual hsBool IsBasic() { return true; }
virtual bool IsBasic() { return true; }
};
// The above, plus movement
@ -185,10 +185,10 @@ class plAvatarInputInterface : public plInputInterface
static plAvatarInputInterface *fInstance;
virtual hsBool IHandleCtrlCmd( plCtrlCmd *cmd );
virtual bool IHandleCtrlCmd( plCtrlCmd *cmd );
// Gets called once per IUpdate(), just like normal IEval()s
virtual hsBool IEval( double secs, float del, uint32_t dirty );
virtual bool IEval( double secs, float del, uint32_t dirty );
void IDeactivateCommand(plMouseInfo *info);
void IChangeInputMaps(plAvatarInputMap *newMap);
@ -199,10 +199,10 @@ class plAvatarInputInterface : public plInputInterface
void ISetPreLadderMap();
void ISetPostLadderMap();
hsBool IHasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
bool IHasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
void IClearControlFlag(int which) { fControlFlags.ClearBit( which ); }
hsBool CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box);
bool CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box);
void ClearMouseCursor();
void DisableMouseInput() { fMouseDisabled = true; }
void EnableMouseInput() { fMouseDisabled = false; }
@ -212,31 +212,31 @@ class plAvatarInputInterface : public plInputInterface
void RequestCursorToWorldPos(float xPos, float yPos, int ID);
hsBitVector fControlFlags;
hsBool fMouseDisabled;
bool fMouseDisabled;
plPipeline* fPipe;
int fCursorState;
int fCursorPriority;
hsBool f3rdPerson;
bool f3rdPerson;
public:
plAvatarInputInterface();
virtual ~plAvatarInputInterface();
void CameraInThirdPerson(hsBool state);
void CameraInThirdPerson(bool state);
// Always return true, since the cursor should be representing how we control the avatar
virtual hsBool HasInterestingCursorID( void ) const { return true; }
virtual bool HasInterestingCursorID( void ) const { return true; }
virtual uint32_t GetPriorityLevel( void ) const { return kAvatarInputPriority; }
virtual uint32_t GetCurrentCursorID( void ) const { return fCurrentCursor; }
virtual float GetCurrentCursorOpacity( void ) const { return fCursorOpacity; }
const char* GetInputMapName() { return fInputMap ? fInputMap->GetName() : ""; }
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg );
virtual bool InterpretInputEvent( plInputEventMsg *pMsg );
virtual void MissedInputEvent( plInputEventMsg *pMsg );
virtual hsBool MsgReceive( plMessage *msg );
virtual bool MsgReceive( plMessage *msg );
virtual void Init( plInputInterfaceMgr *manager );
virtual void Shutdown( void );
@ -247,18 +247,18 @@ class plAvatarInputInterface : public plInputInterface
// [dis/en]able mouse commands for avatar movement
void SuspendMouseMovement();
void EnableMouseMovement();
void EnableJump(hsBool val);
void EnableForwardMovement(hsBool val);
void EnableControl(hsBool val, ControlEventCode code);
void EnableJump(bool val);
void EnableForwardMovement(bool val);
void EnableControl(bool val, ControlEventCode code);
void ClearLadderMode();
void SetLadderMode();
void ForceAlwaysRun(hsBool val);
void ForceAlwaysRun(bool val);
void SetControlFlag(int f, hsBool val = true) { fControlFlags.SetBit(f, val); }
void SetControlFlag(int f, bool val = true) { fControlFlags.SetBit(f, val); }
void SetCursorFadeDelay( float delay ) { fCursorFadeDelay = delay; }
hsBool IsEnterChatModeBound();
bool IsEnterChatModeBound();
static plAvatarInputInterface *GetInstance( void ) { return fInstance; }
};

View File

@ -136,20 +136,20 @@ void plDebugInputInterface::RestoreDefaultKeyMappings( void )
//// IEval ///////////////////////////////////////////////////////////////////
hsBool plDebugInputInterface::IEval( double secs, float del, uint32_t dirty )
bool plDebugInputInterface::IEval( double secs, float del, uint32_t dirty )
{
return true;
}
//// MsgReceive //////////////////////////////////////////////////////////////
hsBool plDebugInputInterface::MsgReceive( plMessage *msg )
bool plDebugInputInterface::MsgReceive( plMessage *msg )
{
return plInputInterface::MsgReceive(msg);
}
//// cursorinbox /////////////////////////////////////////////////////
hsBool plDebugInputInterface::CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box)
bool plDebugInputInterface::CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box)
{
return ( pMsg->GetXPos() >= box.fX && pMsg->GetXPos() <= box.fY && pMsg->GetYPos() >= box.fZ && pMsg->GetYPos() <= box.fW );
}
@ -157,9 +157,9 @@ hsBool plDebugInputInterface::CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box)
//// InterpretInputEvent /////////////////////////////////////////////////////
hsBool plDebugInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
bool plDebugInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
{
hsBool handled = false;
bool handled = false;
plMouseEventMsg* pMouseMsg = plMouseEventMsg::ConvertNoRef(pMsg);
if (pMouseMsg)
@ -199,7 +199,7 @@ hsBool plDebugInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
if (fControlFlags.IsBitSet(fMouseMap.fMap[i]->fCode))
{
// can we disable this control?
hsBool disable = false;
bool disable = false;
// can we disable this control based on a button?
if (fMouseMap.fMap[i]->fControlFlags & kControlFlagLeftButton && !(fButtonState & kLeftButtonDown))

View File

@ -60,8 +60,8 @@ class plDebugInputInterface : public plInputInterface
{
protected:
virtual hsBool IEval( double secs, float del, uint32_t dirty );
hsBool CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box);
virtual bool IEval( double secs, float del, uint32_t dirty );
bool CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box);
plMouseMap fMouseMap;
uint32_t fButtonState;
@ -75,14 +75,14 @@ class plDebugInputInterface : public plInputInterface
virtual ~plDebugInputInterface();
// Always return false,
virtual hsBool HasInterestingCursorID( void ) const { return false; }
virtual bool HasInterestingCursorID( void ) const { return false; }
virtual uint32_t GetPriorityLevel( void ) const { return kDebugCmdPrioity; }
virtual void RestoreDefaultKeyMappings( void );
virtual uint32_t GetCurrentCursorID( void ) const { return 0; }
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg );
virtual bool InterpretInputEvent( plInputEventMsg *pMsg );
virtual hsBool MsgReceive( plMessage *msg );
virtual bool MsgReceive( plMessage *msg );
virtual void Init( plInputInterfaceMgr *manager );
virtual void Shutdown( void );

View File

@ -66,7 +66,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
plKeyboardDevice* plKeyboardDevice::fInstance = nil;
bool plKeyboardDevice::fKeyboardState[256];
hsBool plKeyboardDevice::fIgnoreCapsLock = false;
bool plKeyboardDevice::fIgnoreCapsLock = false;
plKeyboardDevice::plKeyboardDevice() :
fShiftKeyDown(false),
@ -153,7 +153,7 @@ void plKeyboardDevice::ReleaseAllKeys()
}
}
hsBool plKeyboardDevice::IsCapsLockKeyOn()
bool plKeyboardDevice::IsCapsLockKeyOn()
{
return fCapsLockLock;
}
@ -162,7 +162,7 @@ void plKeyboardDevice::Shutdown()
{
}
void plKeyboardDevice::HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDown, hsBool bKeyRepeat, wchar_t c)
void plKeyboardDevice::HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDown, bool bKeyRepeat, wchar_t c)
{
// update the internal keyboard state
unsigned int keyCode = (unsigned int)key;
@ -350,7 +350,7 @@ void plMouseDevice::SetCursorY(float y)
}
void plMouseDevice::HideCursor(hsBool override)
void plMouseDevice::HideCursor(bool override)
{
if( fInstance->fCursor != nil )
fInstance->fCursor->SetVisible( false );
@ -360,7 +360,7 @@ void plMouseDevice::HideCursor(hsBool override)
}
void plMouseDevice::ShowCursor(hsBool override)
void plMouseDevice::ShowCursor(bool override)
{
if( !plMouseDevice::bCursorHidden )
return;
@ -393,7 +393,7 @@ void plMouseDevice::SetCursorOpacity( float opacity )
fInstance->fCursor->SetOpacity( opacity );
}
hsBool plMouseDevice::MsgReceive(plMessage* msg)
bool plMouseDevice::MsgReceive(plMessage* msg)
{
plEvalMsg* pEMsg = plEvalMsg::ConvertNoRef(msg);
if (pEMsg)

View File

@ -74,10 +74,10 @@ public:
uint32_t GetFlags() { return fFlags; }
void SetFlags(uint32_t f) { fFlags = f; }
virtual void HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDown, hsBool bKeyRepeat, wchar_t c = nil) {;}
virtual void HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDown, bool bKeyRepeat, wchar_t c = nil) {;}
virtual void HandleMouseEvent(plOSMsg message, plMouseState state) {;}
virtual void HandleWindowActivate(bool bActive, hsWindowHndl hWnd) {;}
virtual hsBool MsgReceive(plMessage* msg) {return false;}
virtual bool MsgReceive(plMessage* msg) {return false;}
virtual void Shutdown() {;}
@ -87,15 +87,15 @@ class plKeyEventMsg;
class plKeyboardDevice : public plInputDevice
{
hsBool fAltKeyDown;
hsBool fShiftKeyDown;
hsBool fCtrlKeyDown;
hsBool fCapsLockKeyDown;
bool fAltKeyDown;
bool fShiftKeyDown;
bool fCtrlKeyDown;
bool fCapsLockKeyDown;
int fControlMode;
hsBool fCapsLockLock;
bool fCapsLockLock;
static bool fKeyboardState[256]; // virtual key code is the index, bool is whether it is down or not
static hsBool fIgnoreCapsLock; // set if we want it to ignore this key when translating characters (i.e. for chatting)
static bool fIgnoreCapsLock; // set if we want it to ignore this key when translating characters (i.e. for chatting)
static plKeyboardDevice* fInstance;
void InitKeyboardMaps();
@ -116,13 +116,13 @@ public:
void SetControlMode(int i) { fControlMode = i; }
const char* GetInputName() { return "keyboard"; }
void HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDown, hsBool bKeyRepeat, wchar_t c = nil);
void HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDown, bool bKeyRepeat, wchar_t c = nil);
virtual void HandleWindowActivate(bool bActive, hsWindowHndl hWnd);
virtual hsBool IsCapsLockKeyOn();
virtual bool IsCapsLockKeyOn();
virtual void Shutdown();
static hsBool IgnoreCapsLock() { return fIgnoreCapsLock; }
static void IgnoreCapsLock(hsBool ignore) { fIgnoreCapsLock = ignore; }
static bool IgnoreCapsLock() { return fIgnoreCapsLock; }
static void IgnoreCapsLock(bool ignore) { fIgnoreCapsLock = ignore; }
static plKeyboardDevice* GetInstance() { return fInstance; }
};
@ -162,7 +162,7 @@ public:
const char* GetInputName() { return "mouse"; }
void HandleWindowActivate(bool bActive, hsWindowHndl hWnd);
hsBool HasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
bool HasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
void SetControlFlag(int f)
{
fControlFlags.SetBit(f);
@ -176,14 +176,14 @@ public:
float GetCursorOpacity() { return fOpacity; }
void SetDisplayResolution(float Width, float Height);
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
static plMouseDevice* Instance() { return plMouseDevice::fInstance; }
static void SetMsgAlways(bool b) { plMouseDevice::bMsgAlways = b; }
static void ShowCursor(hsBool override = false);
static void ShowCursor(bool override = false);
static void NewCursor(char* cursor);
static void HideCursor(hsBool override = false);
static void HideCursor(bool override = false);
static bool GetHideCursor() { return plMouseDevice::bCursorHidden; }
static void SetCursorOpacity( float opacity = 1.f );
static bool GetInverted() { return plMouseDevice::bInverted; }

View File

@ -91,7 +91,7 @@ void plInputInterface::Write( hsStream* s, hsResMgr* mgr )
//// Helper Functions ////////////////////////////////////////////////////////
hsBool plInputInterface::IOwnsControlCode( ControlEventCode code )
bool plInputInterface::IOwnsControlCode( ControlEventCode code )
{
if( fControlMap->FindBinding( code ) != nil )
return true;
@ -102,7 +102,7 @@ hsBool plInputInterface::IOwnsControlCode( ControlEventCode code )
//// IVerifyShiftKey /////////////////////////////////////////////////////////
// special logic so the shift key can make everyone totally happy...
hsBool plInputInterface::IVerifyShiftKey( plKeyDef key, int index )
bool plInputInterface::IVerifyShiftKey( plKeyDef key, int index )
{
// if we are mapped to the actual shift key, return true
if (key == KEY_SHIFT)
@ -138,10 +138,10 @@ void plInputInterface::IDeactivateBinding(const plKeyBinding *binding)
// Processes the given key event as a key binding, if one exists. If not,
// returns false.
hsBool plInputInterface::ProcessKeyBindings( plInputEventMsg *msg )
bool plInputInterface::ProcessKeyBindings( plInputEventMsg *msg )
{
int i;
hsBool activate;
bool activate;
plKeyEventMsg *keyMsg = plKeyEventMsg::ConvertNoRef( msg );
if( keyMsg == nil )
@ -257,7 +257,7 @@ hsBool plInputInterface::ProcessKeyBindings( plInputEventMsg *msg )
activate = true;
}
hsBool wasActive = IHasKeyControlFlag(binding->GetCode());
bool wasActive = IHasKeyControlFlag(binding->GetCode());
// Set or clear our flags, since we do that even if we don't send a message
if ( !keyMsg->GetKeyChar() )
@ -305,7 +305,7 @@ hsBool plInputInterface::ProcessKeyBindings( plInputEventMsg *msg )
return true;
}
hsBool plInputInterface::IControlCodeEnabled(ControlEventCode code )
bool plInputInterface::IControlCodeEnabled(ControlEventCode code )
{
return (!fDisabledControls.IsBitSet(code));
}

View File

@ -106,14 +106,14 @@ class plInputInterface : public hsRefCnt
hsBitVector fKeyControlFlags;
hsBitVector fKeyControlsFrom2ndKeyFlags;
hsBitVector fDisabledControls;
hsBool fEnabled;
bool fEnabled;
void ISetMessageQueue( hsTArray<plCtrlCmd *> *queue ) { fMessageQueue = queue; }
plKeyMap *IGetControlMap( void ) const { return fControlMap; }
hsBool IOwnsControlCode( ControlEventCode code );
hsBool IVerifyShiftKey( plKeyDef key, int index );
bool IOwnsControlCode( ControlEventCode code );
bool IVerifyShiftKey( plKeyDef key, int index );
hsBool IHasKeyControlFlag(int f) const { return fKeyControlFlags.IsBitSet(f); }
bool IHasKeyControlFlag(int f) const { return fKeyControlFlags.IsBitSet(f); }
void ISetKeyControlFlag(int f) { fKeyControlFlags.SetBit(f); }
void IClearKeyControlFlag(int which) { fKeyControlFlags.ClearBit( which ); }
void IDisableControl(int which) { fDisabledControls.SetBit(which); }
@ -125,16 +125,16 @@ class plInputInterface : public hsRefCnt
// Gets called once per IUpdate(), just like normal IEval()s
virtual hsBool IEval( double secs, float del, uint32_t dirty ) { return false; }
virtual bool IEval( double secs, float del, uint32_t dirty ) { return false; }
// Override to handle special-cased control messages of your own (same as receiving them via a message, but if you process them, nobody else gets them). Return false if you don't handle it.
virtual hsBool IHandleCtrlCmd( plCtrlCmd *cmd ) { return false; }
virtual bool IHandleCtrlCmd( plCtrlCmd *cmd ) { return false; }
// Override to let the input interfaces control when a binding is truly active. If this function returns false,
// ProcessKeyBindings will ignore the keypress for the given control. This way, the interfaces can be selective
// about which bindings are active when. By default, always returns true, since there are very few and rare
// cases where you'd want to return false
virtual hsBool IControlCodeEnabled( ControlEventCode code );
virtual bool IControlCodeEnabled( ControlEventCode code );
// Some helpers for derived classes to avoid including the manager unnecessariliy
@ -178,7 +178,7 @@ class plInputInterface : public hsRefCnt
virtual uint32_t GetPriorityLevel( void ) const = 0;
// Returns true if the message was handled, false if not and we want to pass it on to others in the stack
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg ) = 0;
virtual bool InterpretInputEvent( plInputEventMsg *pMsg ) = 0;
// Returns the currently active mouse cursor for this layer, as defined in pnMessage/plCursorChangeMsg.h
virtual uint32_t GetCurrentCursorID( void ) const = 0;
@ -187,10 +187,10 @@ class plInputInterface : public hsRefCnt
virtual float GetCurrentCursorOpacity( void ) const { return 1.f; }
// Returns true if this layer is wanting to change the mouse, false if it isn't interested
virtual hsBool HasInterestingCursorID( void ) const = 0;
virtual bool HasInterestingCursorID( void ) const = 0;
// Gets called by the manager. If you want a message to come to you, set your manager as the destination
virtual hsBool MsgReceive( plMessage *msg ) { return false; }
virtual bool MsgReceive( plMessage *msg ) { return false; }
// Any initialization that requires a pointer to the manager needs to be done on Init()/Shutdown()
virtual void Init( plInputInterfaceMgr *manager ) { fManager = manager; RestoreDefaultKeyMappings(); }
@ -206,10 +206,10 @@ class plInputInterface : public hsRefCnt
virtual void MissedInputEvent( plInputEventMsg *pMsg ) {}
// Non-virtual, can't override--processes an inputEventMsg to see if we can handle it via a key binding (if so, InterpretInputEvent won't be called)
hsBool ProcessKeyBindings( plInputEventMsg *keyMsg );
bool ProcessKeyBindings( plInputEventMsg *keyMsg );
void SetEnabled( hsBool e ) { fEnabled = e; }
hsBool IsEnabled( void ) const { return fEnabled; }
void SetEnabled( bool e ) { fEnabled = e; }
bool IsEnabled( void ) const { return fEnabled; }
// clear all keys from map
virtual void ClearKeyMap();

View File

@ -295,7 +295,7 @@ void plInputInterfaceMgr::IUpdateCursor( int32_t newCursor )
//// IEval ///////////////////////////////////////////////////////////////////
// Inherited from plSingleModifier, gets called once per IUpdate() loop.
hsBool plInputInterfaceMgr::IEval( double secs, float del, uint32_t dirty )
bool plInputInterfaceMgr::IEval( double secs, float del, uint32_t dirty )
{
const char *inputEval = "Eval";
plProfile_BeginLap(Input, inputEval);
@ -363,7 +363,7 @@ hsBool plInputInterfaceMgr::IEval( double secs, float del, uint32_t dirty )
return true;
}
void plInputInterfaceMgr::ForceCursorHidden( hsBool requestedState )
void plInputInterfaceMgr::ForceCursorHidden( bool requestedState )
{
if ( requestedState )
{
@ -394,7 +394,7 @@ void plInputInterfaceMgr::ForceCursorHidden( hsBool requestedState )
}
hsBool plInputInterfaceMgr::ICheckCursor(plInputInterface *iFace)
bool plInputInterfaceMgr::ICheckCursor(plInputInterface *iFace)
{
if( iFace->IsEnabled() && iFace->HasInterestingCursorID() )
{
@ -412,7 +412,7 @@ hsBool plInputInterfaceMgr::ICheckCursor(plInputInterface *iFace)
//// MsgReceive //////////////////////////////////////////////////////////////
hsBool plInputInterfaceMgr::MsgReceive( plMessage *msg )
bool plInputInterfaceMgr::MsgReceive( plMessage *msg )
{
int i;
@ -429,7 +429,7 @@ hsBool plInputInterfaceMgr::MsgReceive( plMessage *msg )
{
const char *inputIEM = "InputEventMsg";
plProfile_BeginLap(Input, inputIEM);
hsBool handled = false;
bool handled = false;
uint32_t missedInputStartIdx = 0;
plInputInterface *oldCurrentFocus = fCurrentFocus;
@ -479,7 +479,7 @@ hsBool plInputInterfaceMgr::MsgReceive( plMessage *msg )
// because a key down may have changed some layer's interest in the cursor
if( !fForceCursorHidden )
{
hsBool cursorHandled = false;
bool cursorHandled = false;
if (fCurrentFocus)
cursorHandled = ICheckCursor(fCurrentFocus);

View File

@ -86,22 +86,22 @@ class plInputInterfaceMgr : public plSingleModifier
hsTArray<uint32_t> fDisabledKeys;
#endif
hsBool fClickEnabled;
bool fClickEnabled;
int32_t fCurrentCursor;
float fCursorOpacity;
hsBool fForceCursorHidden;
bool fForceCursorHidden;
int32_t fForceCursorHiddenCount;
plInputInterface *fCurrentFocus;
plDefaultKeyCatcher *fDefaultCatcher;
virtual hsBool IEval( double secs, float del, uint32_t dirty );
virtual bool IEval( double secs, float del, uint32_t dirty );
void IAddInterface( plInputInterface *iface );
void IRemoveInterface( plInputInterface *iface );
void IUpdateCursor( int32_t newCursor );
hsBool ICheckCursor(plInputInterface *iFace); // returns true if the iface changed cursor settings
bool ICheckCursor(plInputInterface *iFace); // returns true if the iface changed cursor settings
void IWriteConsoleCmdKeys( plKeyMap *keyMap, FILE *keyFile );
void IWriteNonConsoleCmdKeys( plKeyMap *keyMap, FILE *keyFile );
@ -119,7 +119,7 @@ class plInputInterfaceMgr : public plSingleModifier
CLASSNAME_REGISTER( plInputInterfaceMgr );
GETINTERFACE_ANY( plInputInterfaceMgr, plSingleModifier );
virtual hsBool MsgReceive( plMessage *msg );
virtual bool MsgReceive( plMessage *msg );
virtual void Read( hsStream* s, hsResMgr* mgr );
virtual void Write( hsStream* s, hsResMgr* mgr );
@ -134,9 +134,9 @@ class plInputInterfaceMgr : public plSingleModifier
void ReleaseCurrentFocus(plInputInterface *focus);
void SetDefaultKeyCatcher( plDefaultKeyCatcher *c ) { fDefaultCatcher = c; }
hsBool IsClickEnabled() { return fClickEnabled; }
bool IsClickEnabled() { return fClickEnabled; }
void ForceCursorHidden( hsBool requestedState );
void ForceCursorHidden( bool requestedState );
// Binding routers
void BindAction( const plKeyCombo &key, ControlEventCode code );
@ -168,11 +168,11 @@ class plCtrlCmd
void SetCmdString(const char* cs) { delete [] fCmd; fCmd=hsStrcpy(cs); }
ControlEventCode fControlCode;
hsBool fControlActivated;
bool fControlActivated;
hsPoint3 fPt;
float fPct;
hsBool fNetPropagateToPlayers;
bool fNetPropagateToPlayers;
void Read( hsStream* s, hsResMgr* mgr );
void Write( hsStream* s, hsResMgr* mgr );

View File

@ -60,7 +60,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plCmdIfaceModMsg.h"
#include "pnMessage/plPlayerPageMsg.h"
hsBool plInputManager::fUseDInput = false;
bool plInputManager::fUseDInput = false;
uint8_t plInputManager::bRecenterMouse = 0;
HWND plInputManager::fhWnd = nil;
#define NUM_ACTIONS 17
@ -94,7 +94,7 @@ public:
void Update();
void AddDevice(IDirectInputDevice8* device);
void ConfigureDevice();
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
// dinput callback functions
static int __stdcall EnumGamepadCallback(const DIDEVICEINSTANCE* device, void* pRef);
@ -154,7 +154,7 @@ plInputManager::~plInputManager()
}
//static
void plInputManager::SetRecenterMouse(hsBool b)
void plInputManager::SetRecenterMouse(bool b)
{
if (b)
bRecenterMouse++;
@ -188,7 +188,7 @@ void plInputManager::InitDInput(hsWindowInst hInst, hsWindowHndl hWnd)
}
}
hsBool plInputManager::MsgReceive(plMessage* msg)
bool plInputManager::MsgReceive(plMessage* msg)
{
for (int i=0; i<fInputDevices.Count(); i++)
if (fInputDevices[i]->MsgReceive(msg))
@ -244,7 +244,7 @@ void plInputManager::SetMouseScale( float s )
// Sometimes the keyboard driver "helps" us translating a key involved in a key
// combo. For example pressing shif-numpad8 will actually generate a KEY_UP event,
// the same as the up arrow. This function undoes that translation.
plKeyDef plInputManager::UntranslateKey(plKeyDef key, hsBool extended)
plKeyDef plInputManager::UntranslateKey(plKeyDef key, bool extended)
{
if (!extended)
{
@ -267,7 +267,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM
if( !fhWnd )
fhWnd = hWnd;
hsBool bExtended;
bool bExtended;
switch (message)
{
@ -275,7 +275,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM
case KEYDOWN:
{
bExtended = Lparam >> 24 & 1;
hsBool bRepeat = ((Lparam >> 29) & 0xf) != 0;
bool bRepeat = ((Lparam >> 29) & 0xf) != 0;
for (int i=0; i<fInputDevices.Count(); i++)
fInputDevices[i]->HandleKeyEvent( KEYDOWN, UntranslateKey((plKeyDef)Wparam, bExtended), true, bRepeat );
}
@ -301,7 +301,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM
UINT vkey = MapVirtualKey(scan, 1); //MAPVK_VSC_TO_VK
bExtended = Lparam >> 24 & 1;
hsBool bRepeat = ((Lparam >> 29) & 0xf) != 0;
bool bRepeat = ((Lparam >> 29) & 0xf) != 0;
bool down = !(Lparam >> 31);
for (int i=0; i<fInputDevices.Count(); i++)
@ -611,7 +611,7 @@ void plDInputMgr::ConfigureDevice()
}
hsBool plDInputMgr::MsgReceive(plMessage* msg)
bool plDInputMgr::MsgReceive(plMessage* msg)
{
plInputEventMsg* pMsg = plInputEventMsg::ConvertNoRef(msg);
if (pMsg && pMsg->fEvent == plInputEventMsg::kConfigure)

View File

@ -60,7 +60,7 @@ class plPipeline;
class plInputManager :public hsKeyedObject
{
private:
static hsBool fUseDInput;
static bool fUseDInput;
public:
plInputManager();
plInputManager( hsWindowHndl hWnd );
@ -73,13 +73,13 @@ public:
void AddInputDevice(plInputDevice* pDev);
void InitDInput(hsWindowInst hInst, hsWindowHndl hWnd);
static void UseDInput(hsBool b) { fUseDInput = b; }
static void UseDInput(bool b) { fUseDInput = b; }
void Update();
static plInputManager* GetInstance() { return fInstance; }
static plInputManager* fInstance;
virtual hsBool MsgReceive(plMessage* msg);
static hsBool RecenterMouse() { return bRecenterMouse > 0; }
static void SetRecenterMouse(hsBool b);
virtual bool MsgReceive(plMessage* msg);
static bool RecenterMouse() { return bRecenterMouse > 0; }
static void SetRecenterMouse(bool b);
static void RecenterCursor();
void CreateInterfaceMod(plPipeline* p);
@ -88,7 +88,7 @@ public:
float GetMouseScale( void ) const { return fMouseScale; }
void SetMouseScale( float s );
static plKeyDef UntranslateKey(plKeyDef key, hsBool extended);
static plKeyDef UntranslateKey(plKeyDef key, bool extended);
protected:

View File

@ -100,7 +100,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
plSceneInputInterface *plSceneInputInterface::fInstance = nil;
hsBool plSceneInputInterface::fShowLOS = false;
bool plSceneInputInterface::fShowLOS = false;
//// Constructor/Destructor //////////////////////////////////////////////////
@ -177,7 +177,7 @@ void plSceneInputInterface::ClearClickableMap()
//// IHalfFadeAvatar /////////////////////////////////////////////////////////
void plSceneInputInterface::IHalfFadeAvatar(hsBool out)
void plSceneInputInterface::IHalfFadeAvatar(bool out)
{
plIfaceFadeAvatarMsg* pMsg = new plIfaceFadeAvatarMsg();
pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
@ -204,7 +204,7 @@ void plSceneInputInterface::ResetClickableState()
}
//// IEval ///////////////////////////////////////////////////////////////////
hsBool plSceneInputInterface::IEval( double secs, float del, uint32_t dirty )
bool plSceneInputInterface::IEval( double secs, float del, uint32_t dirty )
{
// this needs to always go no matter what...
// ...unless we have cliclability disabled (as in the case of certain multistage behaviors)
@ -230,7 +230,7 @@ hsBool plSceneInputInterface::IEval( double secs, float del, uint32_t dirty )
plgDispatch::MsgSend( pMsg );
}
// then see if we have any
hsBool change = false;
bool change = false;
for (i=0; i < fClickableMap.Count(); i++)
{
if( fClickableMap[i]->val )
@ -251,14 +251,14 @@ hsBool plSceneInputInterface::IEval( double secs, float del, uint32_t dirty )
//// MsgReceive //////////////////////////////////////////////////////////////
hsBool plSceneInputInterface::MsgReceive( plMessage *msg )
bool plSceneInputInterface::MsgReceive( plMessage *msg )
{
plLOSHitMsg *pLOSMsg = plLOSHitMsg::ConvertNoRef( msg );
if( pLOSMsg )
{
if( pLOSMsg->fRequestID == ID_FIND_CLICKABLE )
{
hsBool clearCursor = false;
bool clearCursor = false;
if (!fClickability)
return true;
if( pLOSMsg->fObj )
@ -316,7 +316,7 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg )
return true;
// okay, are we a CCR?
hsBool amCCR = plNetClientMgr::GetInstance()->GetCCRLevel();
bool amCCR = plNetClientMgr::GetInstance()->GetCCRLevel();
// is this person a NPC or CCR?
int mbrIdx=plNetClientMgr::GetInstance()->TransportMgr().FindMember(pObj->GetKey());
@ -506,7 +506,7 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg )
plCursorChangeMsg *fakeReplyMsg = plCursorChangeMsg::ConvertNoRef( msg );
if( fakeReplyMsg != nil )
{
hsBool deniedCurrent = false;
bool deniedCurrent = false;
plKey key = fakeReplyMsg->GetSender();
for (int i = 0; i < fClickableMap.Count(); i++)
{
@ -975,7 +975,7 @@ void plSceneInputInterface::ISetLastClicked( plKey obj, hsPoint3 hitPoint )
//// InterpretInputEvent /////////////////////////////////////////////////////
hsBool plSceneInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
bool plSceneInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
{
plControlEventMsg* pControlEvent = plControlEventMsg::ConvertNoRef(pMsg);
if (pControlEvent)
@ -1076,7 +1076,7 @@ hsBool plSceneInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
//// ISendOfferNotification ////////////////////////////////////////////////////////
void plSceneInputInterface::IManageIgnoredAvatars(plKey& offeree, hsBool add)
void plSceneInputInterface::IManageIgnoredAvatars(plKey& offeree, bool add)
{
// tell everyone else to be able to / not to be able to select this avatar
plInputIfaceMgrMsg* pMsg = 0;
@ -1091,7 +1091,7 @@ void plSceneInputInterface::IManageIgnoredAvatars(plKey& offeree, hsBool add)
pMsg->Send();
}
void plSceneInputInterface::ISendOfferNotification(plKey& offeree, int ID, hsBool net)
void plSceneInputInterface::ISendOfferNotification(plKey& offeree, int ID, bool net)
{
int offereeID = -1;
if (offeree == plNetClientMgr::GetInstance()->GetLocalPlayerKey())
@ -1138,7 +1138,7 @@ void plSceneInputInterface::ISendOfferNotification(plKey& offeree, int ID, hsBoo
}
void plSceneInputInterface::ISendAvatarDisabledNotification(hsBool enabled)
void plSceneInputInterface::ISendAvatarDisabledNotification(bool enabled)
{
plInputIfaceMgrMsg* pMsg = 0;
if (enabled)
@ -1197,7 +1197,7 @@ void plSceneInputInterface::IRequestLOSCheck( float xPos, float yPos, int ID
//// IWorldPosMovedSinceLastLOSCheck /////////////////////////////////////////
hsBool plSceneInputInterface::IWorldPosMovedSinceLastLOSCheck( void )
bool plSceneInputInterface::IWorldPosMovedSinceLastLOSCheck( void )
{
if( fPipe == nil )
return false;

View File

@ -73,11 +73,11 @@ class plSceneInputInterface : public plInputInterface
uint32_t fCurrentCursor;
uint8_t fButtonState;
hsBool fClickability;
bool fClickability;
plKey fCurrentClickable, fLastClicked, fCurrentClickableLogicMod;
hsPoint3 fCurrentClickPoint;
hsBool fCurrClickIsAvatar, fLastClickIsAvatar,fFadedLocalAvatar;
hsBool fPendingLink;
bool fCurrClickIsAvatar, fLastClickIsAvatar,fFadedLocalAvatar;
bool fPendingLink;
int fBookMode; // are we in offer book mode?
plKey fBookKey; // key for the python file modifier for the book we are offering
@ -95,7 +95,7 @@ class plSceneInputInterface : public plInputInterface
val = false;
}
plKey key;
hsBool val;
bool val;
};
hsTArray<clickableTest *> fClickableMap;
@ -106,35 +106,35 @@ class plSceneInputInterface : public plInputInterface
hsPoint3 fLastStartPt, fLastEndPt;
plPipeline *fPipe;
virtual hsBool IEval( double secs, float del, uint32_t dirty );
virtual bool IEval( double secs, float del, uint32_t dirty );
void IRequestLOSCheck( float xPos, float yPos, int ID );
void ISetLastClicked( plKey obj, hsPoint3 hitPoint );
void IHalfFadeAvatar(hsBool out);
void IHalfFadeAvatar(bool out);
hsBool IWorldPosMovedSinceLastLOSCheck( void );
bool IWorldPosMovedSinceLastLOSCheck( void );
void ClearClickableMap();
void ISendOfferNotification(plKey& offeree, int ID, hsBool net);
void IManageIgnoredAvatars(plKey& offeree, hsBool add);
void ISendAvatarDisabledNotification(hsBool enabled);
void ISendOfferNotification(plKey& offeree, int ID, bool net);
void IManageIgnoredAvatars(plKey& offeree, bool add);
void ISendAvatarDisabledNotification(bool enabled);
void ILinkOffereeToAge();
public:
plSceneInputInterface();
virtual ~plSceneInputInterface();
static hsBool fShowLOS;
static bool fShowLOS;
// Always return true, since the cursor should be representing how we control the avatar
virtual hsBool HasInterestingCursorID( void ) const { return ( fCurrentCursor != kNullCursor ) ? true : false; }
virtual bool HasInterestingCursorID( void ) const { return ( fCurrentCursor != kNullCursor ) ? true : false; }
virtual uint32_t GetPriorityLevel( void ) const { return kSceneInteractionPriority; }
virtual uint32_t GetCurrentCursorID( void ) const {return fCurrentCursor;}
uint32_t SetCurrentCursorID(uint32_t id);
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg );
virtual bool InterpretInputEvent( plInputEventMsg *pMsg );
void RequestAvatarTurnToPointLOS();
virtual hsBool MsgReceive( plMessage *msg );
virtual bool MsgReceive( plMessage *msg );
virtual void Init( plInputInterfaceMgr *manager );
virtual void Shutdown( void );

View File

@ -97,21 +97,21 @@ void plTelescopeInputInterface::Init( plInputInterfaceMgr *manager )
//// IEval ///////////////////////////////////////////////////////////////////
hsBool plTelescopeInputInterface::IEval( double secs, float del, uint32_t dirty )
bool plTelescopeInputInterface::IEval( double secs, float del, uint32_t dirty )
{
return true;
}
//// MsgReceive //////////////////////////////////////////////////////////////
hsBool plTelescopeInputInterface::MsgReceive( plMessage *msg )
bool plTelescopeInputInterface::MsgReceive( plMessage *msg )
{
return false;
}
//// InterpretInputEvent /////////////////////////////////////////////////////
hsBool plTelescopeInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
bool plTelescopeInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
{
return false;
}

View File

@ -57,7 +57,7 @@ class plTelescopeInputInterface : public plInputInterface
{
protected:
virtual hsBool IEval( double secs, float del, uint32_t dirty );
virtual bool IEval( double secs, float del, uint32_t dirty );
public:
@ -66,9 +66,9 @@ class plTelescopeInputInterface : public plInputInterface
virtual void RestoreDefaultKeyMappings( void );
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg );
virtual bool InterpretInputEvent( plInputEventMsg *pMsg );
virtual hsBool MsgReceive( plMessage *msg );
virtual bool MsgReceive( plMessage *msg );
virtual void Init( plInputInterfaceMgr *manager );
virtual void Shutdown( void ) {;}
@ -83,7 +83,7 @@ class plTelescopeInputInterface : public plInputInterface
virtual float GetCurrentCursorOpacity( void ) const { return 1.f; }
// Returns true if this layer is wanting to change the mouse, false if it isn't interested
virtual hsBool HasInterestingCursorID( void ) const { return false; }
virtual bool HasInterestingCursorID( void ) const { return false; }
};