Browse Source

Obliterate hsBool

Adam Johnson 12 years ago
parent
commit
a709e17069
  1. 48
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 48
      Sources/Plasma/Apps/plClient/plClient.h
  3. 8
      Sources/Plasma/Apps/plClient/winmain.cpp
  4. 6
      Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp
  5. 8
      Sources/Plasma/Apps/plPageOptimizer/plPageOptimizer.cpp
  6. 4
      Sources/Plasma/Apps/plPythonPack/PythonInterface.cpp
  7. 4
      Sources/Plasma/Apps/plPythonPack/PythonInterface.h
  8. 2
      Sources/Plasma/Apps/plPythonPack/main.cpp
  9. 4
      Sources/Plasma/CoreLib/HeadSpin.h
  10. 48
      Sources/Plasma/CoreLib/hsBiExpander.h
  11. 34
      Sources/Plasma/CoreLib/hsBitVector.h
  12. 84
      Sources/Plasma/CoreLib/hsBounds.cpp
  13. 42
      Sources/Plasma/CoreLib/hsBounds.h
  14. 6
      Sources/Plasma/CoreLib/hsColorRGBA.h
  15. 20
      Sources/Plasma/CoreLib/hsExceptions.h
  16. 4
      Sources/Plasma/CoreLib/hsFastMath.cpp
  17. 16
      Sources/Plasma/CoreLib/hsGeometry3.h
  18. 4
      Sources/Plasma/CoreLib/hsHashTable.h
  19. 10
      Sources/Plasma/CoreLib/hsMatrix44.cpp
  20. 14
      Sources/Plasma/CoreLib/hsMatrix44.h
  21. 24
      Sources/Plasma/CoreLib/hsMemory.cpp
  22. 80
      Sources/Plasma/CoreLib/hsMemory.h
  23. 2
      Sources/Plasma/CoreLib/hsPoint2.h
  24. 18
      Sources/Plasma/CoreLib/hsSTLStream.cpp
  25. 36
      Sources/Plasma/CoreLib/hsSTLStream.h
  26. 95
      Sources/Plasma/CoreLib/hsStream.cpp
  27. 188
      Sources/Plasma/CoreLib/hsStream.h
  28. 16
      Sources/Plasma/CoreLib/hsStringTokenizer.cpp
  29. 28
      Sources/Plasma/CoreLib/hsStringTokenizer.h
  30. 66
      Sources/Plasma/CoreLib/hsTemplates.h
  31. 22
      Sources/Plasma/CoreLib/hsThread.h
  32. 2
      Sources/Plasma/CoreLib/hsThread_Mac.cpp
  33. 14
      Sources/Plasma/CoreLib/hsThread_Unix.cpp
  34. 8
      Sources/Plasma/CoreLib/hsThread_Win.cpp
  35. 6
      Sources/Plasma/CoreLib/hsWide.cpp
  36. 22
      Sources/Plasma/CoreLib/hsWide.h
  37. 5
      Sources/Plasma/CoreLib/pcSmallRect.h
  38. 2
      Sources/Plasma/CoreLib/plGeneric.cpp
  39. 4
      Sources/Plasma/CoreLib/plLoadMask.cpp
  40. 22
      Sources/Plasma/CoreLib/plLoadMask.h
  41. 2
      Sources/Plasma/CoreLib/plRefCnt.h
  42. 14
      Sources/Plasma/CoreLib/plViewTransform.cpp
  43. 52
      Sources/Plasma/CoreLib/plViewTransform.h
  44. 6
      Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp
  45. 20
      Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.h
  46. 2
      Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.h
  47. 2
      Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp
  48. 2
      Sources/Plasma/FeatureLib/pfAnimation/plBlower.h
  49. 6
      Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp
  50. 6
      Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.h
  51. 10
      Sources/Plasma/FeatureLib/pfAnimation/plLightModifier.h
  52. 14
      Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp
  53. 40
      Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.h
  54. 9
      Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp
  55. 20
      Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.h
  56. 8
      Sources/Plasma/FeatureLib/pfAnimation/plStereizer.cpp
  57. 16
      Sources/Plasma/FeatureLib/pfAnimation/plStereizer.h
  58. 8
      Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp
  59. 16
      Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.h
  60. 10
      Sources/Plasma/FeatureLib/pfAudio/plListener.cpp
  61. 14
      Sources/Plasma/FeatureLib/pfAudio/plListener.h
  62. 4
      Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp
  63. 6
      Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.h
  64. 2
      Sources/Plasma/FeatureLib/pfCamera/pfCameraProxy.cpp
  65. 2
      Sources/Plasma/FeatureLib/pfCamera/pfCameraProxy.h
  66. 48
      Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp
  67. 62
      Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.h
  68. 20
      Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp
  69. 34
      Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.h
  70. 2
      Sources/Plasma/FeatureLib/pfCamera/plInterestingModifier.cpp
  71. 4
      Sources/Plasma/FeatureLib/pfCamera/plInterestingModifier.h
  72. 32
      Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp
  73. 32
      Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.h
  74. 2
      Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp
  75. 2
      Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.h
  76. 12
      Sources/Plasma/FeatureLib/pfCharacter/plPlayerModifier.cpp
  77. 18
      Sources/Plasma/FeatureLib/pfCharacter/plPlayerModifier.h
  78. 2
      Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp
  79. 2
      Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.h
  80. 8
      Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.cpp
  81. 6
      Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.h
  82. 2
      Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp
  83. 2
      Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.h
  84. 2
      Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.cpp
  85. 2
      Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.h
  86. 4
      Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.cpp
  87. 8
      Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.h
  88. 2
      Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.cpp
  89. 2
      Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.h
  90. 2
      Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerInBoxConditionalObject.cpp
  91. 2
      Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerInBoxConditionalObject.h
  92. 2
      Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerIntersectPlaneConditionalObject.cpp
  93. 2
      Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerIntersectPlaneConditionalObject.h
  94. 4
      Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp
  95. 4
      Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.h
  96. 10
      Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp
  97. 22
      Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.h
  98. 2
      Sources/Plasma/FeatureLib/pfConditional/plObjectIntersectPlaneConditionalObject.cpp
  99. 2
      Sources/Plasma/FeatureLib/pfConditional/plObjectIntersectPlaneConditionalObject.h
  100. 2
      Sources/Plasma/FeatureLib/pfConditional/plPickedConditionalObject.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

48
Sources/Plasma/Apps/plClient/plClient.cpp

@ -169,7 +169,7 @@ static plAudioSystem* gAudio = nil;
extern ITaskbarList3* gTaskbarList;
#endif
hsBool plClient::fDelayMS = false;
bool plClient::fDelayMS = false;
plClient* plClient::fInstance=nil;
@ -255,7 +255,7 @@ plClient::~plClient()
#include "plGImage/plAVIWriter.h"
#include "pfCharacter/pfMarkerMgr.h"
hsBool plClient::Shutdown()
bool plClient::Shutdown()
{
plSynchEnabler ps(false); // disable dirty state tracking during shutdown
delete fProgressBar;
@ -482,7 +482,7 @@ void plClient::ISetGraphicsDefaults()
plDynamicCamMap::SetEnabled(plPipeline::fDefaultPipeParams.PlanarReflections ? true : false);
}
hsBool plClient::InitPipeline()
bool plClient::InitPipeline()
{
hsStatusMessage("InitPipeline client\n");
HWND hWnd = fWindowHndl;
@ -615,7 +615,7 @@ void plClient::IDispatchMsgReceiveCallback()
//============================================================================
hsBool plClient::MsgReceive(plMessage* msg)
bool plClient::MsgReceive(plMessage* msg)
{
if (plGenRefMsg * genRefMsg = plGenRefMsg::ConvertNoRef(msg)) {
// do nothing, we just use the client's key to ref vault image nodes.
@ -658,7 +658,7 @@ hsBool plClient::MsgReceive(plMessage* msg)
if (pRefMsg->GetContext() & plRefMsg::kOnCreate ||
pRefMsg->GetContext() & plRefMsg::kOnRequest)
{
hsBool found=false;
bool found=false;
plSceneNode *pNode = plSceneNode::ConvertNoRef(pRefMsg->GetRef());
int i;
for (i = 0; i < fRooms.Count(); i++)
@ -876,7 +876,7 @@ hsBool plClient::MsgReceive(plMessage* msg)
}
//============================================================================
hsBool plClient::IHandleMovieMsg(plMovieMsg* mov)
bool plClient::IHandleMovieMsg(plMovieMsg* mov)
{
if( !(mov->GetFileName() && *mov->GetFileName()) )
return true;
@ -1040,7 +1040,7 @@ void plClient::ILoadNextRoom()
fLoadRooms.pop_front();
bool alreadyLoaded = (IFindRoomByLoc(req->loc) != -1);
hsBool isLoading = IIsRoomLoading(req->loc);
bool isLoading = IIsRoomLoading(req->loc);
if (alreadyLoaded || isLoading)
{
delete req;
@ -1152,7 +1152,7 @@ void plClient::IRoomLoaded(plSceneNode* node, bool hold)
{
fCurrentNode = node;
// make sure we don't already have this room in the list:
hsBool bAppend = true;
bool bAppend = true;
for (int i = 0; i < fRooms.Count(); i++)
{
if (fRooms[i].fNode == fCurrentNode)
@ -1397,7 +1397,7 @@ void plClient::IStopProgress( void )
*
***/
extern hsBool gDataServerLocal;
extern bool gDataServerLocal;
#include "plQuality.h"
#include "plLoadMask.h"
@ -1470,7 +1470,7 @@ private:
#endif
//============================================================================
hsBool plClient::StartInit()
bool plClient::StartInit()
{
hsStatusMessage("Init client\n");
fFlags.SetBit( kFlagIniting );
@ -1669,7 +1669,7 @@ void plClient::ShutdownDLLs()
fLoadedDLLs.Reset();
}
hsBool plClient::MainLoop()
bool plClient::MainLoop()
{
#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
if (PythonInterface::UsePythonDebugger())
@ -1745,7 +1745,7 @@ plProfile_CreateTimer("ScreenElem", "Render", ScreenElem);
plProfile_CreateTimer("EndRender", "Render", EndRender);
hsBool plClient::IUpdate()
bool plClient::IUpdate()
{
plProfile_BeginTiming(UpdateTime);
@ -1839,7 +1839,7 @@ hsBool plClient::IUpdate()
return false;
}
hsBool plClient::IDrawProgress() {
bool plClient::IDrawProgress() {
// HACK: Don't draw while we're caching some room loads, otherwise the
// progress bar will jump around while we're calculating the size
if (fHoldLoadRequests)
@ -1871,7 +1871,7 @@ hsBool plClient::IDrawProgress() {
return false;
}
hsBool plClient::IDraw()
bool plClient::IDraw()
{
// If we're shutting down, don't attempt to draw. Doing so
// tends to cause a device reload each frame.
@ -1990,7 +1990,7 @@ void plClient::IKillMovies()
fMovies.Reset();
}
hsBool plClient::IPlayIntroBink(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume /* = 1.0 */)
bool plClient::IPlayIntroBink(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume /* = 1.0 */)
{
SetQuitIntro(false);
plBinkPlayer player;
@ -2022,7 +2022,7 @@ hsBool plClient::IPlayIntroBink(const char* movieName, float endDelay, float pos
return true;
}
hsBool done = false;
bool done = false;
if( !fPipeline->BeginRender() )
{
fPipeline->ClearRenderTarget();
@ -2039,7 +2039,7 @@ hsBool plClient::IPlayIntroBink(const char* movieName, float endDelay, float pos
return false;
}
hsBool plClient::IFlushRenderRequests()
bool plClient::IFlushRenderRequests()
{
// For those requesting ack's, we could go through and send them
// mail telling them their request was ill-timed. But hopefully,
@ -2109,7 +2109,7 @@ hsG3DDeviceModeRecord plClient::ILoadDevMode(const char* devModeFile)
HWND hWnd = fWindowHndl;
hsUNIXStream stream;
hsBool gottaCreate = false;
bool gottaCreate = false;
// If DevModeFind is specified, use the old method
// if ((GetGameFlags() & kDevModeFind))
@ -2175,7 +2175,7 @@ hsG3DDeviceModeRecord plClient::ILoadDevMode(const char* devModeFile)
return dmr;
}
void plClient::ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool VSync)
void plClient::ResetDisplayDevice(int Width, int Height, int ColorDepth, bool Windowed, int NumAASamples, int MaxAnisotropicSamples, bool VSync)
{
if(!fPipeline) return;
@ -2188,7 +2188,7 @@ void plClient::ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool
WindowActivate(true);
}
void plClient::ResizeDisplayDevice(int Width, int Height, hsBool Windowed)
void plClient::ResizeDisplayDevice(int Width, int Height, bool Windowed)
{
if (plMouseDevice::Instance())
@ -2231,7 +2231,7 @@ void plClient::ResizeDisplayDevice(int Width, int Height, hsBool Windowed)
SetWindowPos( fWindowHndl, insertAfter, 0, 0, OutsideWidth, OutsideHeight, flags );
}
void WriteBool(hsStream *stream, char *name, hsBool on )
void WriteBool(hsStream *stream, char *name, bool on )
{
char command[256];
sprintf(command, "%s %s\r\n", name, on ? "true" : "false");
@ -2256,7 +2256,7 @@ void WriteString(hsStream *stream, const char *name, const char *val)
void plClient::IDetectAudioVideoSettings()
{
// Setup default pipeline settings
hsBool devmode = true;
bool devmode = true;
hsG3DDeviceModeRecord dmr;
hsG3DDeviceSelector devSel;
devSel.Enumerate(fWindowHndl);
@ -2267,10 +2267,10 @@ void plClient::IDetectAudioVideoSettings()
hsG3DDeviceRecord *rec = (hsG3DDeviceRecord *)dmr.GetDevice();
const hsG3DDeviceMode *mode = dmr.GetMode();
hsBool pixelshaders = rec->GetCap(hsG3DDeviceSelector::kCapsPixelShader);
bool pixelshaders = rec->GetCap(hsG3DDeviceSelector::kCapsPixelShader);
int psMajor = 0, psMinor = 0;
rec->GetPixelShaderVersion(psMajor, psMinor);
hsBool refDevice = false;
bool refDevice = false;
if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DRefDev)
refDevice = true;

48
Sources/Plasma/Apps/plClient/plClient.h

@ -124,8 +124,8 @@ protected:
pfKI *fKIGUIGlue;
hsBool fDone;
hsBool fWindowActive;
bool fDone;
bool fWindowActive;
hsWindowHndl fWindowHndl;
@ -136,20 +136,20 @@ protected:
virtual hsG3DDeviceModeRecord ILoadDevMode(const char* devModeFile);
hsBool IUpdate();
hsBool IDraw();
hsBool IDrawProgress();
bool IUpdate();
bool IDraw();
bool IDrawProgress();
plVirtualCam1* fNewCamera;
static plClient* fInstance;
char * fpAuxInitDir;
static hsBool fDelayMS;
static bool fDelayMS;
int fClampCap;
int fQuality;
hsBool fQuitIntro;
bool fQuitIntro;
hsTArray<plBinkPlayer*> fMovies;
plMessagePumpProc fMessagePumpProc;
@ -184,14 +184,14 @@ protected:
void IHandleNetCommAuthMsg (plNetCommAuthMsg * msg);
bool IHandleAgeLoaded2Msg (plAgeLoaded2Msg * msg);
hsBool IFlushRenderRequests();
bool IFlushRenderRequests();
void IProcessPreRenderRequests();
void IProcessPostRenderRequests();
void IProcessRenderRequests(hsTArray<plRenderRequest*>& reqs);
void IAddRenderRequest(plRenderRequest* req);
hsBool IPlayIntroBink(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume = 1.0);
hsBool IHandleMovieMsg(plMovieMsg* mov);
bool IPlayIntroBink(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume = 1.0);
bool IHandleMovieMsg(plMovieMsg* mov);
void IKillMovies();
void IServiceMovies();
@ -225,9 +225,9 @@ public:
static plClient* GetInstance() { return fInstance; }
static void SetInstance(plClient* v) { fInstance=v; }
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
hsBool InitPipeline();
bool InitPipeline();
void InitInputs();
@ -236,12 +236,12 @@ public:
void InitAuxInits();
virtual hsBool StartInit();
virtual hsBool Shutdown();
virtual hsBool MainLoop();
virtual bool StartInit();
virtual bool Shutdown();
virtual bool MainLoop();
plClient& SetDone(hsBool done) { fDone = done; return *this; }
hsBool GetDone() { return fDone; }
plClient& SetDone(bool done) { fDone = done; return *this; }
bool GetDone() { return fDone; }
// Set this to true to queue any room load requests that come in. Set it to false to process them.
void SetHoldLoadRequests(bool hold);
@ -255,8 +255,8 @@ public:
kFlagGlobalDataLoaded,
};
hsBool HasFlag(int f) const { return fFlags.IsBitSet(f); }
void SetFlag(int f, hsBool on=true) { fFlags.SetBit(f, on); }
bool HasFlag(int f) const { return fFlags.IsBitSet(f); }
void SetFlag(int f, bool on=true) { fFlags.SetBit(f, on); }
virtual plClient& SetWindowHandle(hsWindowHndl hndl) { fWindowHndl=hndl; return *this; }
hsWindowHndl GetWindowHandle() { return fWindowHndl; }
@ -280,20 +280,20 @@ public:
void SetQuality(int q) { fQuality = q; }
int GetQuality() const { return fQuality; }
hsBool GetQuitIntro() const { return fQuitIntro; }
void SetQuitIntro(hsBool on) { fQuitIntro = on; }
bool GetQuitIntro() const { return fQuitIntro; }
void SetQuitIntro(bool on) { fQuitIntro = on; }
void SetClearColor( hsColorRGBA &color );
hsColorRGBA GetClearColor() const { return fClearColor; }
// The client window has focus (true) or lost it (false)
virtual void WindowActivate(bool active);
virtual hsBool WindowActive() const { return fWindowActive; }
virtual bool WindowActive() const { return fWindowActive; }
void FlashWindow();
void SetMessagePumpProc( plMessagePumpProc proc ) { fMessagePumpProc = proc; }
void ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool VSync = false);
void ResizeDisplayDevice(int Width, int Height, hsBool Windowed);
void ResetDisplayDevice(int Width, int Height, int ColorDepth, bool Windowed, int NumAASamples, int MaxAnisotropicSamples, bool VSync = false);
void ResizeDisplayDevice(int Width, int Height, bool Windowed);
void IDetectAudioVideoSettings();
void IWriteDefaultGraphicsSettings(const wchar_t* destFile);

8
Sources/Plasma/Apps/plClient/winmain.cpp

@ -92,10 +92,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
// Globals
//
hsBool gHasMouse = false;
bool gHasMouse = false;
ITaskbarList3* gTaskbarList = nil; // NT 6.1+ taskbar stuff
extern hsBool gDataServerLocal;
extern bool gDataServerLocal;
enum
{
@ -1047,7 +1047,7 @@ static void SaveUserPass (LoginDialogParam *pLoginParam, char *password)
{
stream->Write(sizeof(cryptKey), cryptKey);
stream->WriteSafeString(pLoginParam->username);
stream->Writebool(pLoginParam->remember);
stream->WriteBool(pLoginParam->remember);
if (pLoginParam->remember)
stream->Write(sizeof(pLoginParam->namePassHash), pLoginParam->namePassHash);
stream->Close();
@ -1092,7 +1092,7 @@ static void LoadUserPass (LoginDialogParam *pLoginParam)
delete temp;
}
pLoginParam->remember = stream->Readbool();
pLoginParam->remember = stream->ReadBool();
if (pLoginParam->remember)
{

6
Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp

@ -157,7 +157,7 @@ public:
plSoundBufferCollector(hsTArray<plKey>& keyArray)
: plKeyCollector(keyArray) {}
hsBool EatPage(plRegistryPageNode* page)
bool EatPage(plRegistryPageNode* page)
{
page->LoadKeys();
return page->IterateKeys(this, plSoundBuffer::Index());
@ -226,7 +226,7 @@ protected:
public:
plStatDumpIterator(const char* outputDir) : fOutputDir(outputDir) {}
hsBool EatKey(const plKey& key)
bool EatKey(const plKey& key)
{
plKeyImp* imp = (plKey)key;
@ -244,7 +244,7 @@ public:
return true;
}
hsBool EatPage(plRegistryPageNode* page)
bool EatPage(plRegistryPageNode* page)
{
const plPageInfo& info = page->GetPageInfo();

8
Sources/Plasma/Apps/plPageOptimizer/plPageOptimizer.cpp

@ -76,7 +76,7 @@ void plPageOptimizer::IFindLoc()
public:
plLocation fLoc;
virtual hsBool EatPage(plRegistryPageNode* keyNode)
virtual bool EatPage(plRegistryPageNode* keyNode)
{
fLoc = keyNode->GetPageInfo().GetLocation();
return true;
@ -95,7 +95,7 @@ void plPageOptimizer::Optimize()
// Get the location of the page we're optimizing
IFindLoc();
hsBool loaded = true;
bool loaded = true;
// Get the key for the scene node, we'll load it to force a load on all the objects
plKey snKey = plKeyFinder::Instance().FindSceneNodeKey(fLoc);
@ -111,7 +111,7 @@ void plPageOptimizer::Optimize()
public:
KeyVec& fKeys;
plVecKeyCollector(KeyVec& keys) : fKeys(keys) {}
virtual hsBool EatKey(const plKey& key) { fKeys.push_back(key); return true; }
virtual bool EatKey(const plKey& key) { fKeys.push_back(key); return true; }
};
plVecKeyCollector keyIt(fAllKeys);
fResMgr->IterateKeys(&keyIt);
@ -238,7 +238,7 @@ void plPageOptimizer::IRewritePage()
// some reason), put them at the end
for (int i = 0; i < fAllKeys.size(); i++)
{
hsBool found = (fLoadedKeys.find(fAllKeys[i]) != fLoadedKeys.end());
bool found = (fLoadedKeys.find(fAllKeys[i]) != fLoadedKeys.end());
if (!found)
IWriteKeyData(&oldPage, &newPage, fAllKeys[i]);
}

4
Sources/Plasma/Apps/plPythonPack/PythonInterface.cpp

@ -152,7 +152,7 @@ PyObject* PythonInterface::CompileString(const char *command, const char* filena
//
// PURPOSE : marshals an object into a char string
//
hsBool PythonInterface::DumpObject(PyObject* pyobj, char** pickle, int32_t* size)
bool PythonInterface::DumpObject(PyObject* pyobj, char** pickle, int32_t* size)
{
PyObject *s; // the python string object where the marsalled object wil go
// convert object to a marshalled string python object
@ -255,7 +255,7 @@ PyObject* PythonInterface::CreateModule(const char* module)
//
// PURPOSE : run a compiled python code in a specific module name
//
hsBool PythonInterface::RunPYC(PyObject* code, PyObject* module)
bool PythonInterface::RunPYC(PyObject* code, PyObject* module)
{
PyObject *d, *v;
// make sure that we're given a good module... or at least one with an address

4
Sources/Plasma/Apps/plPythonPack/PythonInterface.h

@ -52,9 +52,9 @@ namespace PythonInterface
void addPythonPath(std::string dir);
PyObject* CompileString(const char *command, const char* filename);
hsBool DumpObject(PyObject* pyobj, char** pickle, int32_t* size);
bool DumpObject(PyObject* pyobj, char** pickle, int32_t* size);
int getOutputAndReset(char** line=nil);
PyObject* CreateModule(const char* module);
hsBool RunPYC(PyObject* code, PyObject* module);
bool RunPYC(PyObject* code, PyObject* module);
PyObject* GetModuleItem(const char* item, PyObject* module);
}

2
Sources/Plasma/Apps/plPythonPack/main.cpp

@ -141,7 +141,7 @@ void WritePythonFile(std::string fileName, std::string path, hsStream *s)
// next we need to:
// - create instance of class
PyObject* getID = PythonInterface::GetModuleItem("glue_getBlockID",fModule);
hsBool foundID = false;
bool foundID = false;
if ( getID!=nil && PyCallable_Check(getID) )
{
PyObject* id = PyObject_CallFunction(getID,nil);

4
Sources/Plasma/CoreLib/HeadSpin.h

@ -139,10 +139,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
# define M_PI 3.14159265358979323846
#endif
#ifdef __cplusplus
typedef int hsBool;
#endif
#ifndef nil
# define nil (0)
#endif

48
Sources/Plasma/CoreLib/hsBiExpander.h

@ -53,7 +53,7 @@ template <class T> class hsExpander {
private:
int32_t fNumPost;
int32_t fNumPostAlloc;
T* fArray;
T* fArray;
int32_t fGrowBy; // default = 0, to double
int32_t fMinSize; // default = 1, min == 1
@ -72,23 +72,23 @@ public:
hsExpander<T>& operator=(const hsExpander<T>&orig) { return Copy(orig); }
hsExpander<T>& Copy(const hsExpander<T>& orig);
void SetCount(int cnt) { if( cnt >= fNumPostAlloc )IExpand(cnt); fNumPost = cnt; }
int32_t GetCount() const { return fNumPost; }
hsBool Empty() const { return GetCount() == 0; }
const T& Get(int32_t index) const;
int32_t Get(int32_t index, int32_t count, T data[]) const;
int32_t Find(const T&) const; // returns kMissingIndex if not found
void SetCount(int cnt) { if( cnt >= fNumPostAlloc )IExpand(cnt); fNumPost = cnt; }
int32_t GetCount() const { return fNumPost; }
bool Empty() const { return GetCount() == 0; }
const T& Get(int32_t index) const;
int32_t Get(int32_t index, int32_t count, T data[]) const;
int32_t Find(const T&) const; // returns kMissingIndex if not found
void SetArray(T* a, int32_t cnt);
T* GetArray() { return fArray; }
T& operator[]( int32_t index );
int32_t Append(const T&); // returns t's index
int32_t Append(const T&); // returns t's index
T* Append();
int32_t Push(const T& t) { return Append(t); }
int32_t Push(const T& t) { return Append(t); }
T* Push() { return Append(); }
T* Top() { return fNumPost ? fArray + fNumPost-1 : nil; }
int32_t Pop(T* t); // returns count of remaining
int32_t Pop();
int32_t Pop(T* t); // returns count of remaining
int32_t Pop();
void Reset(); // clears out everything
T& Head() { return fArray[0]; }
@ -97,7 +97,7 @@ public:
void First();
void Last();
void Plus() { ++fCurrent; }
hsBool More() { return (fCurrent < fNumPost); }
bool More() { return (fCurrent < fNumPost); }
};
template <class T>
@ -261,7 +261,7 @@ private:
int32_t fNumPost;
int32_t fNumPreAlloc;
int32_t fNumPostAlloc;
T* fArray;
T* fArray;
int32_t fGrowBy; // default = 0, to double
int32_t fMinSize; // default = 1, min == 1
@ -271,7 +271,7 @@ private:
hsBiExpander<T>& operator=(const hsBiExpander<T>&); // don't allow assignment
hsBiExpander(const hsBiExpander<T>&); // make it passed as ref or pointer
void IExpand(int newSize, hsBool towardEnd = true);
void IExpand(int newSize, bool towardEnd = true);
public:
enum { kMissingIndex = -1 };
@ -280,22 +280,22 @@ public:
int32_t GetFirst() const { return -fNumPre; }
int32_t GetCount() const { return fNumPre + fNumPost; }
hsBool Empty() const { return GetCount() == 0; }
const T& Get(int32_t index) const;
bool Empty() const { return GetCount() == 0; }
const T& Get(int32_t index) const;
int32_t Get(int32_t index, int32_t count, T data[]) const;
int32_t Find(const T&) const; // returns kMissingIndex if not found
void SetArray(T* a, int32_t cnt, int32_t numPre=0);
T** GetArray() { return fArray - fNumPre; }
T& operator[]( int32_t index );
T* Append(); // returns t's index
T* Push(); // returns t's index
void SetArray(T* a, int32_t cnt, int32_t numPre=0);
T** GetArray() { return fArray - fNumPre; }
T& operator[]( int32_t index );
T* Append(); // returns t's index
T* Push(); // returns t's index
int32_t Append(const T&); // returns t's index
int32_t Push(const T&); // returns t's index
int32_t Pop(T*t = nil) { return PopHead(t); } // returns count of remaining
int32_t PopHead(T*t = nil); // returns count of remaining
int32_t PopTail(T*t = nil); // returns count of remaining
void Reset(); // clears out everything
void Reset(); // clears out everything
T& Head() { return fArray[-fNumPre]; }
T& Tail() { return fArray[fNumPost-1]; }
@ -304,7 +304,7 @@ public:
void Last();
void Plus() { ++fCurrent; }
void Minus() { --fCurrent; }
hsBool More() { return (fCurrent < fNumPost)&&(fCurrent >= -fNumPre); }
bool More() { return (fCurrent < fNumPost)&&(fCurrent >= -fNumPre); }
};
template <class T>
@ -321,7 +321,7 @@ void hsBiExpander<T>::SetArray(T* a, int32_t cnt, int32_t numPre)
}
template <class T>
void hsBiExpander<T>::IExpand(int newSize, hsBool towardEnd)
void hsBiExpander<T>::IExpand(int newSize, bool towardEnd)
{
int32_t newPreAlloc = fNumPreAlloc;
int32_t newPostAlloc = fNumPostAlloc;

34
Sources/Plasma/CoreLib/hsBitVector.h

@ -69,21 +69,21 @@ public:
hsBitVector& Clear(); // everyone clear, but no dealloc
hsBitVector& Set(int upToBit=-1); // WARNING - see comments at function
int operator==(const hsBitVector& other) const; // unset (ie uninitialized) bits are clear,
int operator!=(const hsBitVector& other) const { return !(*this == other); }
bool operator==(const hsBitVector& other) const; // unset (ie uninitialized) bits are clear,
bool operator!=(const hsBitVector& other) const { return !(*this == other); }
hsBitVector& operator=(const hsBitVector& other); // will wind up identical
hsBool ClearBit(uint32_t which) { return SetBit(which, 0); } // returns previous state
hsBool SetBit(uint32_t which, hsBool on = true); // returns previous state
hsBool IsBitSet(uint32_t which) const; // returns current state
hsBool ToggleBit(uint32_t which); // returns previous state
bool ClearBit(uint32_t which) { return SetBit(which, 0); } // returns previous state
bool SetBit(uint32_t which, bool on = true); // returns previous state
bool IsBitSet(uint32_t which) const; // returns current state
bool ToggleBit(uint32_t which); // returns previous state
hsBitVector& RemoveBit(uint32_t which); // removes bit, sliding higher bits down to fill the gap.
friend inline int Overlap(const hsBitVector& lhs, const hsBitVector& rhs) { return lhs.Overlap(rhs); }
hsBool Overlap(const hsBitVector& other) const;
hsBool Empty() const;
bool Overlap(const hsBitVector& other) const;
bool Empty() const;
hsBool operator[](uint32_t which) const { return IsBitSet(which); }
bool operator[](uint32_t which) const { return IsBitSet(which); }
friend inline hsBitVector operator&(const hsBitVector& lhs, const hsBitVector& rhs); // See Overlap()
friend inline hsBitVector operator|(const hsBitVector& lhs, const hsBitVector& rhs);
@ -127,7 +127,7 @@ inline hsBitVector::hsBitVector(const hsBitVector& other)
fBitVectors = nil;
}
inline hsBool hsBitVector::Empty() const
inline bool hsBitVector::Empty() const
{
int i;
for( i = 0; i < fNumBitVectors; i++ )
@ -138,7 +138,7 @@ inline hsBool hsBitVector::Empty() const
return true;
}
inline hsBool hsBitVector::Overlap(const hsBitVector& other) const
inline bool hsBitVector::Overlap(const hsBitVector& other) const
{
if( fNumBitVectors > other.fNumBitVectors )
return other.Overlap(*this);
@ -174,7 +174,7 @@ inline hsBitVector& hsBitVector::operator=(const hsBitVector& other)
return *this;
}
inline int hsBitVector::operator==(const hsBitVector& other) const
inline bool hsBitVector::operator==(const hsBitVector& other) const
{
if( fNumBitVectors < other.fNumBitVectors )
return other.operator==(*this);
@ -315,7 +315,7 @@ inline hsBitVector& hsBitVector::Set(int upToBit)
return *this;
}
inline hsBool hsBitVector::IsBitSet(uint32_t which) const
inline bool hsBitVector::IsBitSet(uint32_t which) const
{
uint32_t major = which >> 5;
return
@ -323,13 +323,13 @@ inline hsBool hsBitVector::IsBitSet(uint32_t which) const
&& (0 != (fBitVectors[major] & 1 << (which & 0x1f)));
}
inline hsBool hsBitVector::SetBit(uint32_t which, hsBool on)
inline bool hsBitVector::SetBit(uint32_t which, bool on)
{
uint32_t major = which >> 5;
uint32_t minor = 1 << (which & 0x1f);
if( major >= fNumBitVectors )
IGrow(major+1);
hsBool ret = 0 != (fBitVectors[major] & minor);
bool ret = 0 != (fBitVectors[major] & minor);
if( ret != on )
{
if( on )
@ -341,13 +341,13 @@ inline hsBool hsBitVector::SetBit(uint32_t which, hsBool on)
return ret;
}
inline hsBool hsBitVector::ToggleBit(uint32_t which)
inline bool hsBitVector::ToggleBit(uint32_t which)
{
uint32_t major = which >> 5;
uint32_t minor = 1 << (which & 0x1f);
if( major >= fNumBitVectors )
IGrow(major);
hsBool ret = 0 != (fBitVectors[major] & minor);
bool ret = 0 != (fBitVectors[major] & minor);
if( ret )
fBitVectors[major] &= ~minor;
else

84
Sources/Plasma/CoreLib/hsBounds.cpp

@ -249,7 +249,7 @@ int32_t hsBounds3::TestBound(const hsBounds3& other) const
return retVal;
}
hsBool hsBounds3::IsInside(const hsPoint3* pos) const
bool hsBounds3::IsInside(const hsPoint3* pos) const
{
hsAssert(fType != kBoundsUninitialized, "Invalid bounds type for hsBounds3::IsInside() ");
if(fType == kBoundsEmpty)
@ -471,7 +471,7 @@ float hsBounds3::ClosestPointToInfiniteLine(const hsPoint3* p, const hsVector3*
return t;
}
hsBool hsBounds3::ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const
bool hsBounds3::ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const
{
// Look for axis intervals p is within
int nSect = 0;
@ -532,7 +532,7 @@ void hsBoundsOriented::TestPlane(const hsVector3 &n, hsPoint2 &depth) const
//
// Return true if inside all the planes
//
hsBool hsBoundsOriented::IsInside(const hsPoint3* pos) const
bool hsBoundsOriented::IsInside(const hsPoint3* pos) const
{
hsAssert(fType == kBoundsNormal, "Invalid bounds type for hsBounds3::IsInside() ");
if(fType == kBoundsEmpty)
@ -629,7 +629,7 @@ void hsBoundsOriented::Read(hsStream *stream)
{
hsBounds::Read(stream);
fCenter.Read(stream);
fCenterValid = (hsBool)stream->ReadLE32();
fCenterValid = (bool)stream->ReadLE32();
fNumPlanes = stream->ReadLE32();
if (fPlanes)
delete [] fPlanes;
@ -1009,7 +1009,7 @@ void hsBounds3Ext::Translate(const hsVector3 &v)
}
}
hsBool hsBounds3Ext::IsInside(const hsPoint3 *p) const
bool hsBounds3Ext::IsInside(const hsPoint3 *p) const
{
if( fExtFlags & kAxisAligned )
return hsBounds3::IsInside(p);
@ -1192,9 +1192,9 @@ int32_t hsBounds3Ext::TestPoints(int n, const hsPoint3 *pList, const hsVector3 &
for( i = 0; i < 3; i++ )
{
float diff = fAxes[i].InnerProduct(ptVel);
hsBool someLow = false;
hsBool someHi = false;
hsBool someIn = false;
bool someLow = false;
bool someHi = false;
bool someIn = false;
int j;
for( j = 0; j < n; j++ )
{
@ -1230,8 +1230,8 @@ int32_t hsBounds3Ext::TestPoints(int n, const hsPoint3 *pList, const hsVector3 &
int32_t hsBounds3Ext::TestPoints(int n, const hsPoint3 *pList) const
{
hsBool someIn = false;
hsBool someOut = false;
bool someIn = false;
bool someOut = false;
int i;
for( i = 0; i < n; i++ )
{
@ -1247,7 +1247,7 @@ int32_t hsBounds3Ext::TestPoints(int n, const hsPoint3 *pList) const
return 1;
}
hsBool hsBounds3Ext::ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const
bool hsBounds3Ext::ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const
{
if( fExtFlags & kAxisAligned )
return hsBounds3::ClosestPoint(p, inner, outer);
@ -1282,7 +1282,7 @@ hsBool hsBounds3Ext::ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3&
return nSect == 3;
}
hsBool hsBounds3Ext::ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel) const
bool hsBounds3Ext::ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel) const
{
if( fExtFlags & kAxisAligned )
{
@ -1356,7 +1356,7 @@ hsBool hsBounds3Ext::ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel)
}
static hsBool ISectInterval(const hsPoint2& other, const hsPoint2& mine)
static bool ISectInterval(const hsPoint2& other, const hsPoint2& mine)
{
if( other.fY - mine.fX <= 0 )
return false;
@ -1366,7 +1366,7 @@ static hsBool ISectInterval(const hsPoint2& other, const hsPoint2& mine)
return true;
}
static hsBool ITestDepth(const hsPoint2& other, const hsPoint2& mine,
static bool ITestDepth(const hsPoint2& other, const hsPoint2& mine,
const hsVector3& inAx,
hsVector3 &outAx, float& depth)
{
@ -1475,7 +1475,7 @@ void hsBounds3Ext::Unalign()
fAxes[2].Set(0, 0, span);
}
hsBool hsBounds3Ext::ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const
bool hsBounds3Ext::ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const
{
if( fExtFlags & kAxisAligned )
{
@ -1640,7 +1640,7 @@ hsBool hsBounds3Ext::ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel,
return true;
}
hsBool hsBounds3Ext::ISectABB(const hsBounds3Ext &other, const hsVector3 &myVel) const
bool hsBounds3Ext::ISectABB(const hsBounds3Ext &other, const hsVector3 &myVel) const
{
hsPoint3 effMaxs = fMaxs;
hsPoint3 effMins = fMins;
@ -1662,7 +1662,7 @@ hsBool hsBounds3Ext::ISectABB(const hsBounds3Ext &other, const hsVector3 &myVel)
return true;
}
hsBool hsBounds3Ext::ISectBS(const hsBounds3Ext &other, const hsVector3 &myVel) const
bool hsBounds3Ext::ISectBS(const hsBounds3Ext &other, const hsVector3 &myVel) const
{
if( !(fExtFlags & kSphereSet) )
IMakeSphere();
@ -1691,7 +1691,7 @@ hsBool hsBounds3Ext::ISectBS(const hsBounds3Ext &other, const hsVector3 &myVel)
}
#if 0 // Commenting out this which will be made redundant and/or obsolete by Havok integration
hsBool hsBounds3Ext::ISectTriABB(hsBounds3Tri &tri, const hsVector3 &myVel) const
bool hsBounds3Ext::ISectTriABB(hsBounds3Tri &tri, const hsVector3 &myVel) const
{
int i;
for( i = 0; i < 3; i++ )
@ -1719,13 +1719,13 @@ hsBool hsBounds3Ext::ISectTriABB(hsBounds3Tri &tri, const hsVector3 &myVel) cons
return true;
}
hsBool hsBounds3Ext::TriBSHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsHitInfoExt* hit) const
bool hsBounds3Ext::TriBSHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsHitInfoExt* hit) const
{
hsPoint3 myPt = GetCenter();
myPt += myVel;
hsPoint3 closePt;
hsBool onTri = tri.ClosestTriPoint(&myPt, &closePt);
bool onTri = tri.ClosestTriPoint(&myPt, &closePt);
hsVector3 repel;
repel.Set(&myPt, &closePt);
@ -1761,7 +1761,7 @@ hsBool hsBounds3Ext::TriBSHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsH
}
#if 0 // TOCENTER
hsBool hsBounds3Ext::TriBBHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsHitInfoExt* hit) const
bool hsBounds3Ext::TriBBHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsHitInfoExt* hit) const
{
// Find our closest point (after movement)
hsPoint3 myPt = fCorner;
@ -1789,7 +1789,7 @@ hsBool hsBounds3Ext::TriBBHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsH
// Find closest point on tri to our closest corner
hsPoint3 closePt;
hsBool onTri = tri.ClosestTriPoint(&myPt, &closePt);
bool onTri = tri.ClosestTriPoint(&myPt, &closePt);
// Repel vector is from closest corner to closest point on tri
hsVector3 repel;
@ -1816,13 +1816,13 @@ hsBool hsBounds3Ext::TriBBHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsH
}
#else // TOCENTER
hsBool hsBounds3Ext::TriBBHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsHitInfoExt* hit) const
bool hsBounds3Ext::TriBBHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsHitInfoExt* hit) const
{
hsPoint3 myPt = GetCenter();
myPt += myVel;
hsPoint3 closePt;
hsBool onTri = tri.ClosestTriPoint(&myPt, &closePt);
bool onTri = tri.ClosestTriPoint(&myPt, &closePt);
hsVector3 repel;
repel.Set(&myPt, &closePt);
@ -1855,7 +1855,7 @@ hsBool hsBounds3Ext::TriBBHitInfo(hsBounds3Tri& tri, const hsVector3& myVel, hsH
#endif // TOCENTER
hsBool hsBounds3Ext::ISectTriBB(hsBounds3Tri &tri, const hsVector3 &myVel) const
bool hsBounds3Ext::ISectTriBB(hsBounds3Tri &tri, const hsVector3 &myVel) const
{
hsPoint2 faceDepth;
// first test box against the triangle plane
@ -1904,7 +1904,7 @@ hsBool hsBounds3Ext::ISectTriBB(hsBounds3Tri &tri, const hsVector3 &myVel) const
return true;
}
hsBool hsBounds3Ext::ISectTriBB(hsBounds3Tri &tri, const hsVector3 &myVel, hsHitInfoExt *hit) const
bool hsBounds3Ext::ISectTriBB(hsBounds3Tri &tri, const hsVector3 &myVel, hsHitInfoExt *hit) const
{
hsPoint2 faceDepth;
// first test box against the triangle plane
@ -1972,7 +1972,7 @@ hsBool hsBounds3Ext::ISectTriBB(hsBounds3Tri &tri, const hsVector3 &myVel, hsHit
return hit->fDepth > hsBounds::kRealSmall;
}
hsBool hsBounds3Ext::ISectTriBS(hsBounds3Tri &tri, const hsVector3 &myVel) const
bool hsBounds3Ext::ISectTriBS(hsBounds3Tri &tri, const hsVector3 &myVel) const
{
if( !(fExtFlags & kSphereSet) )
IMakeSphere();
@ -2047,7 +2047,7 @@ hsBool hsBounds3Ext::ISectTriBS(hsBounds3Tri &tri, const hsVector3 &myVel) const
return true;
}
hsBool hsBounds3Ext::ISectTriBS(hsBounds3Tri &tri, const hsVector3 &myVel, hsHitInfoExt *hit) const
bool hsBounds3Ext::ISectTriBS(hsBounds3Tri &tri, const hsVector3 &myVel, hsHitInfoExt *hit) const
{
if( !(fExtFlags & kSphereSet) )
IMakeSphere();
@ -2142,7 +2142,7 @@ hsBool hsBounds3Ext::ISectTriBS(hsBounds3Tri &tri, const hsVector3 &myVel, hsHit
#endif // Commenting out this which will be made redundant and/or obsolete by Havok integration
hsBool hsBounds3Ext::ISectBSBS(const hsBounds3Ext& other, const hsVector3& myVel, hsHitInfoExt *hit) const
bool hsBounds3Ext::ISectBSBS(const hsBounds3Ext& other, const hsVector3& myVel, hsHitInfoExt *hit) const
{
if(!(fExtFlags & kSphereSet) )
IMakeSphere();
@ -2177,7 +2177,7 @@ hsBool hsBounds3Ext::ISectBSBS(const hsBounds3Ext& other, const hsVector3& myVel
return true;
}
hsBool hsBounds3Ext::ISectBSBox(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const
bool hsBounds3Ext::ISectBSBox(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const
{
hit->fDelPos = -myVel;
if( other.ISectBoxBS(*this, hit->fDelPos, hit) )
@ -2194,7 +2194,7 @@ hsBool hsBounds3Ext::ISectBSBox(const hsBounds3Ext &other, const hsVector3 &myVe
return false;
}
hsBool hsBounds3Ext::ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const
bool hsBounds3Ext::ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const
{
if(!(fExtFlags & kSphereSet) )
IMakeSphere();
@ -2202,13 +2202,13 @@ hsBool hsBounds3Ext::ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVe
hsVector3 minAxis;
float minDepth;
hsBool haveAxis = false;
bool haveAxis = false;
hsVector3 tstAxis;
float tstDepth;
int i;
for( i = 0; i < 3; i++ )
{
hsBool tryAxis;
bool tryAxis;
if( other.fExtFlags & kAxisAligned )
{
// first try the other box axes
@ -2346,7 +2346,7 @@ hsBool hsBounds3Ext::ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVe
return true;
}
hsBool hsBounds3Ext::ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel) const
bool hsBounds3Ext::ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel) const
{
if( !(fExtFlags & kSphereSet) )
IMakeSphere();
@ -2423,7 +2423,7 @@ hsBool hsBounds3Ext::ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVe
return true;
}
hsBool hsBounds3Ext::ISectLine(const hsPoint3* from, const hsPoint3* at) const
bool hsBounds3Ext::ISectLine(const hsPoint3* from, const hsPoint3* at) const
{
if( !(fExtFlags & kSphereSet) )
IMakeSphere();
@ -2475,7 +2475,7 @@ hsBool hsBounds3Ext::ISectLine(const hsPoint3* from, const hsPoint3* at) const
return true;
}
hsBool hsBounds3Ext::ISectCone(const hsPoint3* from, const hsPoint3* at, float radius) const
bool hsBounds3Ext::ISectCone(const hsPoint3* from, const hsPoint3* at, float radius) const
{
if( !(fExtFlags & kSphereSet) )
IMakeSphere();
@ -2553,7 +2553,7 @@ hsBool hsBounds3Ext::ISectCone(const hsPoint3* from, const hsPoint3* at, float r
}
hsBool hsBounds3Ext::ISectRayBS(const hsPoint3& from, const hsPoint3& to, hsPoint3& at) const
bool hsBounds3Ext::ISectRayBS(const hsPoint3& from, const hsPoint3& to, hsPoint3& at) const
{
hsVector3 c2f(&from,&GetCenter());
hsVector3 f2t(&to,&from);
@ -2660,7 +2660,7 @@ void hsBounds3Tri::TestPlane(const hsVector3 &n, hsPoint2 &depth) const
depth.fX = d1;
}
}
hsBool hsBounds3Tri::ClosestTriPoint(const hsPoint3 *p, hsPoint3 *out, const hsVector3 *ax) const
bool hsBounds3Tri::ClosestTriPoint(const hsPoint3 *p, hsPoint3 *out, const hsVector3 *ax) const
{
// project point onto tri plane
hsPoint3 pPln;
@ -2702,7 +2702,7 @@ hsBool hsBounds3Tri::ClosestTriPoint(const hsPoint3 *p, hsPoint3 *out, const hsV
for( i = 0; i < 3; i++ )
{
float tst = fPerpAxes[i].InnerProduct(pPln);
hsBool in = false;
bool in = false;
if( fOnIsMax & (1 << i) )
{
if( tst <= fPerpDists[i].fY )
@ -2781,7 +2781,7 @@ hsBool hsBounds3Tri::ClosestTriPoint(const hsPoint3 *p, hsPoint3 *out, const hsV
hsAssert( vDis - dis > -hsBounds::kRealSmall, "Bad closest point");
vDis = hsVector3(&pPln, fVerts+2).MagnitudeSquared();
hsAssert( vDis - dis > -hsBounds::kRealSmall, "Bad closest point");
hsBool dork = false;
bool dork = false;
if( dork )
{
float zn[3];
@ -2977,7 +2977,7 @@ hsBounds3Tri::~hsBounds3Tri()
// Finds closest intersection vertex or triangle/center-line intersection
hsBool hsBounds3Tri::ISectCone(const hsPoint3& from, const hsPoint3& to, float cosThetaSq, hsBool ignoreFacing, hsPoint3& at, hsBool& backSide) const
bool hsBounds3Tri::ISectCone(const hsPoint3& from, const hsPoint3& to, float cosThetaSq, bool ignoreFacing, hsPoint3& at, bool& backSide) const
{
float d0 = from.InnerProduct(fNormal);
float d1 = at.InnerProduct(fNormal);
@ -2996,7 +2996,7 @@ hsBool hsBounds3Tri::ISectCone(const hsPoint3& from, const hsPoint3& to, float c
float minDistSq = 0;
int32_t minVert = 0;
hsBool sect = false;
bool sect = false;
for (int32_t i=0; i<3; i++)
{
hsPoint3 onLine;

42
Sources/Plasma/CoreLib/hsBounds.h

@ -81,7 +81,7 @@ public:
//
virtual void Reset(const hsBounds3*) = 0;
virtual hsBool IsInside(const hsPoint3* pos) const =0; // Only valid for kBounds Normal
virtual bool IsInside(const hsPoint3* pos) const =0; // Only valid for kBounds Normal
virtual void Read(hsStream*);
virtual void Write(hsStream*);
@ -132,10 +132,10 @@ public:
const hsPoint3& GetMaxs() const;
float GetMaxDim() const; // Computes the answer
const hsPoint3& GetCenter() const; // Computes the answer if not already there
virtual hsBool IsInside(const hsPoint3* pos) const; // ok for full/empty
virtual bool IsInside(const hsPoint3* pos) const; // ok for full/empty
virtual void TestPlane(const hsVector3 &n, hsPoint2 &depth) const;
virtual void TestPlane(const hsPlane3 *p, hsPoint2 &depth) const;
virtual hsBool ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const;
virtual bool ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const;
// Test according to my axes only, doesn't check other's axes
// neg, pos, zero == disjoint, I contain other, overlap
@ -195,10 +195,10 @@ inline float hsBounds3::GetMaxDim() const
class hsBoundsOriented : public hsBounds
{
private:
hsBool fCenterValid;
bool fCenterValid;
hsPoint3 fCenter;
hsPlane3 *fPlanes;
uint32_t fNumPlanes;
uint32_t fNumPlanes;
public:
hsBoundsOriented() : fPlanes(nil),fNumPlanes(0),fCenterValid(false) {}
virtual ~hsBoundsOriented() { if (fPlanes) delete [] fPlanes; }
@ -223,7 +223,7 @@ public:
//
// Only valid for kBounds Normal
//
virtual hsBool IsInside(const hsPoint3* pos) const;
virtual bool IsInside(const hsPoint3* pos) const;
virtual void TestPlane(const hsVector3 &n, hsPoint2 &depth) const; // Complain and refuse
virtual void Write(hsStream *stream);
@ -247,7 +247,7 @@ protected:
mutable hsPoint2 fDists[3];
mutable float fRadius;
hsBool IAxisIsZero(uint32_t i) const { return (fExtFlags & (1 << (20+i))) != 0; };
bool IAxisIsZero(uint32_t i) const { return (fExtFlags & (1 << (20+i))) != 0; };
void IMakeSphere() const;
void IMakeDists() const;
void IMakeMinsMaxs();
@ -280,9 +280,9 @@ public:
virtual void GetAxes(hsVector3 *fAxis0, hsVector3 *fAxis1, hsVector3 *fAxis2) const;
virtual hsPoint3 *GetCorner(hsPoint3 *c) const { *c = (fExtFlags & kAxisAligned ? fMins : fCorner); return c; }
virtual void GetCorners(hsPoint3 *b) const;
virtual hsBool ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const;
virtual bool ClosestPoint(const hsPoint3& p, hsPoint3& inner, hsPoint3& outer) const;
virtual hsBool IsInside(const hsPoint3* pos) const; // ok for full/empty
virtual bool IsInside(const hsPoint3* pos) const; // ok for full/empty
virtual void TestPlane(const hsVector3 &n, hsPoint2 &depth) const;
virtual int32_t TestPoints(int n, const hsPoint3 *pList) const; // pos,neg,zero == allout, allin, cut
@ -294,21 +294,21 @@ public:
virtual void TestPlane(const hsVector3 &n, const hsVector3 &myVel, hsPoint2 &depth) const;
virtual void TestPlane(const hsPlane3 *p, const hsVector3 &myVel, hsPoint2 &depth) const;
virtual int32_t TestPoints(int n, const hsPoint3 *pList, const hsVector3 &ptVel) const; // pos,neg,zero == allout, allin, cut
virtual hsBool ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual hsBool ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual hsBool ISectABB(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual hsBool ISectBS(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual bool ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual bool ISectBB(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual bool ISectABB(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual bool ISectBS(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual int32_t IClosestISect(const hsBounds3Ext& other, const hsVector3& myVel,
float* tClose, float* tImpact) const;
virtual hsBool ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual hsBool ISectBSBox(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual hsBool ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual hsBool ISectBSBS(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual hsBool ISectLine(const hsPoint3* from, const hsPoint3* to) const;
virtual hsBool ISectCone(const hsPoint3* from, const hsPoint3* to, float radius) const;
virtual hsBool ISectRayBS(const hsPoint3& from, const hsPoint3& to, hsPoint3& at) const;
virtual bool ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual bool ISectBSBox(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual bool ISectBoxBS(const hsBounds3Ext &other, const hsVector3 &myVel) const;
virtual bool ISectBSBS(const hsBounds3Ext &other, const hsVector3 &myVel, hsHitInfoExt *hit) const;
virtual bool ISectLine(const hsPoint3* from, const hsPoint3* to) const;
virtual bool ISectCone(const hsPoint3* from, const hsPoint3* to, float radius) const;
virtual bool ISectRayBS(const hsPoint3& from, const hsPoint3& to, hsPoint3& at) const;
virtual void Read(hsStream *s);
virtual void Write(hsStream *s);

6
Sources/Plasma/CoreLib/hsColorRGBA.h

@ -52,8 +52,8 @@ struct hsColorRGBA {
hsColorRGBA& Set(float red, float grn, float blu, float alp) { r = red; g = grn; b = blu; a = alp; return *this; }
hsBool operator==(const hsColorRGBA&c) const { return (r==c.r)&&(g==c.g)&&(b==c.b)&&(a==c.a); }
hsBool operator!=(const hsColorRGBA&c) const { return !(c == *this); }
bool operator==(const hsColorRGBA&c) const { return (r==c.r)&&(g==c.g)&&(b==c.b)&&(a==c.a); }
bool operator!=(const hsColorRGBA&c) const { return !(c == *this); }
friend inline hsColorRGBA operator+(const hsColorRGBA& s, const hsColorRGBA& t);
hsColorRGBA& operator+=(const hsColorRGBA& s);
@ -179,7 +179,7 @@ public:
};
hsColorRGBA fShade;
hsColorRGBA fColor;
hsBool fFlags;
unsigned int fFlags;
};

20
Sources/Plasma/CoreLib/hsExceptions.h

@ -111,7 +111,7 @@ inline void hsThrowIfNilParam(const void* p)
}
}
inline void hsThrowIfBadParam(hsBool trueIfBadParam)
inline void hsThrowIfBadParam(bool trueIfBadParam)
{
if (trueIfBadParam)
{
@ -129,7 +129,7 @@ inline void hsThrowIfOSErr(long osErr)
}
}
inline void hsThrowIfTrue(hsBool condition)
inline void hsThrowIfTrue(bool condition)
{
if (condition)
{
@ -138,7 +138,7 @@ inline void hsThrowIfTrue(hsBool condition)
}
}
inline void hsThrowIfFalse(hsBool condition)
inline void hsThrowIfFalse(bool condition)
{
if (condition == false)
{
@ -147,7 +147,7 @@ inline void hsThrowIfFalse(hsBool condition)
}
}
inline void hsThrowIfTrue(hsBool condition, const char message[])
inline void hsThrowIfTrue(bool condition, const char message[])
{
if (condition)
{
@ -156,7 +156,7 @@ inline void hsThrowIfTrue(hsBool condition, const char message[])
}
}
inline void hsThrowIfFalse(hsBool condition, const char message[])
inline void hsThrowIfFalse(bool condition, const char message[])
{
if (condition == false)
{
@ -176,7 +176,7 @@ inline void hsThrowIfNilParam(const void* p)
hsAssert(p!=nil,"hsThrowIfNilParam");
}
inline void hsThrowIfBadParam(hsBool trueIfBadParam)
inline void hsThrowIfBadParam(bool trueIfBadParam)
{
hsAssert(!trueIfBadParam,"hsThrowIfBadParam");
}
@ -186,22 +186,22 @@ inline void hsThrowIfOSErr(long osErr)
hsAssert(osErr==0,"hsThrowIfOSErr");
}
inline void hsThrowIfTrue(hsBool condition)
inline void hsThrowIfTrue(bool condition)
{
hsAssert(!condition,"hsThrowIfTrue");
}
inline void hsThrowIfFalse(hsBool condition)
inline void hsThrowIfFalse(bool condition)
{
hsAssert(condition,"hsThrowIfFalse");
}
inline void hsThrowIfTrue(hsBool condition, const char message[])
inline void hsThrowIfTrue(bool condition, const char message[])
{
hsAssert(!condition,message);
}
inline void hsThrowIfFalse(hsBool condition, const char message[])
inline void hsThrowIfFalse(bool condition, const char message[])
{
hsAssert(condition,message);
}

4
Sources/Plasma/CoreLib/hsFastMath.cpp

@ -604,10 +604,10 @@ float hsFastMath::IATan2OverTwoPi(float y, float x)
if( (x == 0)&&(y == 0) )
return 0;
hsBool xNeg, yNeg;
bool xNeg, yNeg;
if((yNeg = (y < 0)))y = -y;
if((xNeg = (x < 0)))x = -x;
hsBool yBigger = y >= x;
bool yBigger = y >= x;
float div = yBigger ? x / y : y / x;
float fInd = div * tabMax;

16
Sources/Plasma/CoreLib/hsGeometry3.h

@ -104,7 +104,7 @@ public:
float Magnitude() const;
float MagnitudeSquared() const { return (fX * fX + fY * fY + fZ * fZ); }
hsBool IsEmpty() const { return fX == 0 && fY == 0 && fZ == 0; }
bool IsEmpty() const { return fX == 0 && fY == 0 && fZ == 0; }
float operator[](int i) const;
float& operator[](int i);
@ -166,11 +166,11 @@ struct hsPoint3 : public hsScalarTriple {
friend inline hsPoint3 operator*(const float& s, const hsPoint3& t);
friend inline hsPoint3 operator*(const hsPoint3& t, const float& s);
friend inline hsPoint3 operator/(const hsPoint3& t, const float& s);
hsBool operator==(const hsPoint3& ss) const
bool operator==(const hsPoint3& ss) const
{
return (ss.fX == fX && ss.fY == fY && ss.fZ == fZ);
}
hsBool operator!=(const hsPoint3& ss) const { return !(*this == ss); }
bool operator!=(const hsPoint3& ss) const { return !(*this == ss); }
hsPoint3 &operator+=(const hsScalarTriple &s) { fX += s.fX; fY += s.fY; fZ += s.fZ; return *this; }
hsPoint3 &operator*=(const float s) { fX *= s; fY *= s; fZ *= s; return *this; }
};
@ -226,17 +226,11 @@ struct hsVector3 : public hsScalarTriple {
friend inline hsVector3 operator/(const hsVector3& t, const float& s);
friend inline float operator*(const hsVector3& t, const hsVector3& s);
friend hsVector3 operator%(const hsVector3& t, const hsVector3& s);
#if 0 // Havok reeks
friend hsBool32 operator==(const hsVector3& s, const hsVector3& t)
{
return (s.fX == t.fX && s.fY == t.fY && s.fZ == t.fZ);
}
#else // Havok reeks
hsBool operator==(const hsVector3& ss) const
bool operator==(const hsVector3& ss) const
{
return (ss.fX == fX && ss.fY == fY && ss.fZ == fZ);
}
#endif // Havok reeks
hsVector3 &operator+=(const hsScalarTriple &s) { fX += s.fX; fY += s.fY; fZ += s.fZ; return *this; }
hsVector3 &operator-=(const hsScalarTriple &s) { fX -= s.fX; fY -= s.fY; fZ -= s.fZ; return *this; }
hsVector3 &operator*=(const float s) { fX *= s; fY *= s; fZ *= s; return *this; }

4
Sources/Plasma/CoreLib/hsHashTable.h

@ -62,8 +62,8 @@ public:
hsHashTableIterator<T>& operator--() { fIndex++; return *this; }
const hsHashTableIterator<T>& operator--(int) { hsHashTableIterator<T> temp(*this); ++(*this); return temp; }
hsBool operator==(const hsHashTableIterator<T>& other) const { return fList==other.fList && fIndex==other.fIndex; }
hsBool operator!=(const hsHashTableIterator<T>& other) const { return !(*this == other); }
bool operator==(const hsHashTableIterator<T>& other) const { return fList==other.fList && fIndex==other.fIndex; }
bool operator!=(const hsHashTableIterator<T>& other) const { return !(*this == other); }
private:
hsTArray<T>* fList;

10
Sources/Plasma/CoreLib/hsMatrix44.cpp

@ -212,7 +212,7 @@ hsVector3 hsMatrix44::operator*(const hsVector3& p) const
return rVal;
}
int hsMatrix44::operator==(const hsMatrix44& ss) const
bool hsMatrix44::operator==(const hsMatrix44& ss) const
{
if( ss.fFlags & fFlags & hsMatrix44::kIsIdent )
{
@ -807,9 +807,9 @@ hsPoint3* hsMatrix44::MapPoints(long count, hsPoint3 points[]) const
return points;
}
hsBool hsMatrix44::IsIdentity(void)
bool hsMatrix44::IsIdentity(void)
{
hsBool retVal = true;
bool retVal = true;
int i, j;
for( i = 0; i < 4; i++ )
{
@ -866,7 +866,7 @@ hsBool hsMatrix44::IsIdentity(void)
return retVal;
}
hsBool hsMatrix44::GetParity() const
bool hsMatrix44::GetParity() const
{
if( fFlags & kIsIdent )
return false;
@ -896,7 +896,7 @@ void hsMatrix44::Read(hsStream *stream)
void hsMatrix44::Write(hsStream *stream)
{
hsBool ident = IsIdentity();
bool ident = IsIdentity();
stream->WriteBool(!ident);
if (!ident)
{

14
Sources/Plasma/CoreLib/hsMatrix44.h

@ -61,7 +61,7 @@ struct hsMatrix44 {
kView
};
float fMap[4][4];
uint32_t fFlags;
uint32_t fFlags;
hsMatrix44() : fFlags(0) {}
hsMatrix44(const hsScalarTriple &translate, const hsQuat &rotate);
@ -79,7 +79,7 @@ struct hsMatrix44 {
hsMatrix44& Scale(const hsVector3 *);
hsMatrix44& Rotate(int axis, float radians);
hsMatrix44& Reset(hsBool asIdent=true)
hsMatrix44& Reset(bool asIdent=true)
{
fMap[0][0] = 1.0f; fMap[0][1] = 0.0f; fMap[0][2] = 0.0f; fMap[0][3] = 0.0f;
fMap[1][0] = 0.0f; fMap[1][1] = 1.0f; fMap[1][2] = 0.0f; fMap[1][3] = 0.0f;
@ -104,7 +104,7 @@ struct hsMatrix44 {
hsMatrix44& MakeCameraUpPreserving(const hsPoint3* from, const hsPoint3* at,
const hsVector3* up);
hsBool GetParity() const;
bool GetParity() const;
float GetDeterminant() const;
hsMatrix44* GetInverse(hsMatrix44* inverse) const;
hsMatrix44* GetTranspose(hsMatrix44* inverse) const;
@ -145,11 +145,11 @@ struct hsMatrix44 {
hsPoint3* MapPoints(long count, hsPoint3 points[]) const;
hsBool IsIdentity(void);
void NotIdentity() { fFlags &= ~kIsIdent; }
bool IsIdentity(void);
void NotIdentity() { fFlags &= ~kIsIdent; }
hsBool operator==(const hsMatrix44& ss) const;
hsBool operator!=(const hsMatrix44& ss) const { return !(ss == *this); }
bool operator==(const hsMatrix44& ss) const;
bool operator!=(const hsMatrix44& ss) const { return !(ss == *this); }
void Read(hsStream *stream);
void Write(hsStream *stream);

24
Sources/Plasma/CoreLib/hsMemory.cpp

@ -54,7 +54,7 @@ void HSMemory::BlockMove(const void* src, void* dst, uint32_t length)
memmove(dst, src, length);
}
hsBool HSMemory::EqualBlocks(const void* block1, const void* block2, uint32_t length)
bool HSMemory::EqualBlocks(const void* block1, const void* block2, uint32_t length)
{
const uint8_t* byte1 = (uint8_t*)block1;
const uint8_t* byte2 = (uint8_t*)block2;
@ -247,13 +247,13 @@ struct hsAppenderHead {
void* GetBottom() const { return fBottom; }
void* GetStop() const { return fStop; }
void* GetFirst() const { return fFirst; }
void* GetLast(uint32_t elemSize) const { return (char*)fStop - elemSize; }
uint32_t GetSize() const { return (char*)fStop - (char*)fFirst; }
void* GetFirst() const { return fFirst; }
void* GetLast(uint32_t elemSize) const { return (char*)fStop - elemSize; }
uint32_t GetSize() const { return (char*)fStop - (char*)fFirst; }
hsBool CanPrepend() const { return fFirst != this->GetTop(); }
bool CanPrepend() const { return fFirst != this->GetTop(); }
int PrependSize() const { return (char*)fFirst - (char*)this->GetTop(); }
hsBool CanAppend() const { return fStop != this->GetBottom(); }
bool CanAppend() const { return fStop != this->GetBottom(); }
int AppendSize() const { return (char*)this->GetBottom() - (char*)fStop; }
void* Prepend(uint32_t elemSize)
@ -271,7 +271,7 @@ struct hsAppenderHead {
hsAssert((char*)fStop <= (char*)fBottom, "bad elemSize");
return data;
}
hsBool PopHead(uint32_t elemSize, void* data)
bool PopHead(uint32_t elemSize, void* data)
{
hsAssert(fFirst != fStop, "Empty");
if( data )
@ -279,7 +279,7 @@ struct hsAppenderHead {
fFirst = (char*)fFirst + elemSize;
return fFirst == fStop;
}
hsBool PopTail(uint32_t elemSize, void* data)
bool PopTail(uint32_t elemSize, void* data)
{
hsAssert(fFirst != fStop, "Empty");
fStop = (char*)fStop - elemSize;
@ -388,7 +388,7 @@ void* hsAppender::PeekHead() const
return nil;
}
hsBool hsAppender::PopHead(void* data)
bool hsAppender::PopHead(void* data)
{
if (fCount == 0)
return false;
@ -500,7 +500,7 @@ void* hsAppender::PeekTail() const
return nil;
}
hsBool hsAppender::PopTail(void* data)
bool hsAppender::PopTail(void* data)
{
if (fCount == 0)
return false;
@ -570,7 +570,7 @@ void* hsAppenderIterator::Next()
return item;
}
hsBool hsAppenderIterator::Next(void* data)
bool hsAppenderIterator::Next(void* data)
{
void* addr = this->Next();
if (addr)
@ -613,7 +613,7 @@ void* hsAppenderIterator::Prev()
return item;
}
hsBool hsAppenderIterator::Prev(void* data)
bool hsAppenderIterator::Prev(void* data)
{
void* addr = this->Prev();
if (addr)

80
Sources/Plasma/CoreLib/hsMemory.h

@ -51,13 +51,13 @@ public:
static void Clear(void *m, uint32_t byteLen);
static void ClearMemory(void *m, uint32_t byteLen) { HSMemory::Clear(m, byteLen); }
static hsBool EqualBlocks(const void* block1, const void* block2, uint32_t length);
static bool EqualBlocks(const void* block1, const void* block2, uint32_t length);
static void* New(uint32_t size);
static void Delete(void* block);
static void* Copy(uint32_t length, const void* source);
static void* New(uint32_t size);
static void Delete(void* block);
static void* Copy(uint32_t length, const void* source);
static void* SoftNew(uint32_t size); // returns nil if can't allocate
static void* SoftNew(uint32_t size); // returns nil if can't allocate
};
///////////////////////////////////////////////////////////////////////////////////////////
@ -127,21 +127,21 @@ public:
uint32_t ElemSize() const { return fElemSize; }
uint32_t Count() const { return fCount; }
hsBool IsEmpty() const { return fCount == 0; }
void Reset();
bool IsEmpty() const { return fCount == 0; }
void Reset();
uint32_t CopyInto(void* data = nil) const; // return size of data array in bytes
void* PushHead();
void PushHead(const void* data);
void* PushTail();
void PushTail(const void* data);
void PushTail(int count, const void* data); // data[] = count * fElemSize
void* PeekHead() const;
void* PeekTail() const;
hsBool PopHead(void* data = nil);
int PopHead(int count, void* data = nil); // data[] = count * fElemSize
hsBool PopTail(void* data = nil);
void* PushHead();
void PushHead(const void* data);
void* PushTail();
void PushTail(const void* data);
void PushTail(int count, const void* data); // data[] = count * fElemSize
void* PeekHead() const;
void* PeekTail() const;
bool PopHead(void* data = nil);
int PopHead(int count, void* data = nil); // data[] = count * fElemSize
bool PopTail(void* data = nil);
// Alternate interfaces
@ -149,13 +149,13 @@ public:
void* Append() { return this->PushTail(); }
void* Push() { return this->PushHead(); }
void Push(const void* data) { this->PushHead(data); }
hsBool Pop(void* data = nil) { return this->PopHead(data); }
void Push(const void* data) { this->PushHead(data); }
bool Pop(void* data = nil) { return this->PopHead(data); }
void* Enqueue() { return this->PushTail(); };
void Enqueue(const void* data) { this->PushTail(data); }
void Enqueue(int count, const void* data) { this->PushTail(count, data); }
hsBool Dequeue(void* data = nil) { return this->PopHead(data); }
void Enqueue(const void* data) { this->PushTail(data); }
void Enqueue(int count, const void* data) { this->PushTail(count, data); }
bool Dequeue(void* data = nil) { return this->PopHead(data); }
int Dequeue(int count, void* data = nil) { return this->PopHead(count, data); }
};
@ -169,10 +169,10 @@ public:
void ResetToHead(const hsAppender* list = nil);
void ResetToTail(const hsAppender* list = nil);
void* Next();
hsBool Next(void* data);
bool Next(void* data);
int Next(int count, void* data);
void* Prev();
hsBool Prev(void* data);
bool Prev(void* data);
// Obsolete interface
@ -190,37 +190,37 @@ public:
const hsAppender* GetAppender() const { return this; }
uint32_t Count() const { return hsAppender::Count(); }
hsBool IsEmpty() const { return hsAppender::IsEmpty(); }
void Reset() { hsAppender::Reset(); }
bool IsEmpty() const { return hsAppender::IsEmpty(); }
void Reset() { hsAppender::Reset(); }
uint32_t CopyInto(T copy[]) const { return hsAppender::CopyInto(copy); }
T* PushHead() { return (T*)hsAppender::PushHead(); }
void PushHead(const T& item) { *this->PushHead() = item; }
void PushHead(const T& item) { *this->PushHead() = item; }
T* PushTail() { return (T*)hsAppender::PushTail(); }
void PushTail(const T& item) { *this->PushTail() = item; };
void PushTail(int count, const T item[]) { this->hsAppender::PushTail(count, item); };
void PushTail(const T& item) { *this->PushTail() = item; };
void PushTail(int count, const T item[]) { this->hsAppender::PushTail(count, item); };
T* PeekHead() const { return (T*)hsAppender::PeekHead(); }
T* PeekTail() const { return (T*)hsAppender::PeekTail(); }
hsBool PopHead(T* item = nil) { return hsAppender::PopHead(item); }
bool PopHead(T* item = nil) { return hsAppender::PopHead(item); }
int PopHead(int count, T item[] = nil) { return hsAppender::PopHead(count, item); }
hsBool PopTail(T* item = nil) { return hsAppender::PopTail(item); }
bool PopTail(T* item = nil) { return hsAppender::PopTail(item); }
// Alternate intefaces
T* Prepend() { return this->PushHead(); }
T* Append() { return this->PushTail(); }
void PrependItem(const T& item) { this->PushHead(item); }
void AppendItem(const T& item) { this->PushTail(item); }
void PrependItem(const T& item) { this->PushHead(item); }
void AppendItem(const T& item) { this->PushTail(item); }
T* Push() { return this->PushHead(); }
void Push(const T& item) { this->PushHead(item); }
hsBool Pop(T* item = nil) { return this->PopHead(item); }
void Push(const T& item) { this->PushHead(item); }
bool Pop(T* item = nil) { return this->PopHead(item); }
T* Enqueue() { return this->PushTail(); };
void Enqueue(const T& item) { this->PushTail(item); }
void Enqueue(int count, const T item[]) { this->PushTail(count, item); }
hsBool Dequeue(T* item = nil) { return this->PopHead(item); }
void Enqueue(const T& item) { this->PushTail(item); }
void Enqueue(int count, const T item[]) { this->PushTail(count, item); }
bool Dequeue(T* item = nil) { return this->PopHead(item); }
int Dequeue(int count, T item[] = nil) { return this->PopHead(count, item); }
};
@ -234,9 +234,9 @@ public:
void ResetToTail() { hsAppenderIterator::ResetToTail(nil); }
void ResetToTail(const hsTAppender<T>* list) { hsAppenderIterator::ResetToTail(list->GetAppender()); }
T* Next() { return (T*)hsAppenderIterator::Next(); }
hsBool Next(T* item) { return hsAppenderIterator::Next(item); }
int Next(T* item) { return hsAppenderIterator::Next(item); }
T* Prev() { return (T*)hsAppenderIterator::Prev(); }
hsBool Prev(T* item) { return hsAppenderIterator::Prev(item); }
bool Prev(T* item) { return hsAppenderIterator::Prev(item); }
// Obsolete interfaces

2
Sources/Plasma/CoreLib/hsPoint2.h

@ -112,7 +112,7 @@ struct hsPoint2 {
}
hsPoint2* Grid(float period);
hsBool CloseEnough(const hsPoint2* p, float tolerance) const;
bool CloseEnough(const hsPoint2* p, float tolerance) const;
float MagnitudeSquared() const { return fX * fX + fY * fY; }
float Magnitude() const { return Magnitude(fX, fY); }

18
Sources/Plasma/CoreLib/hsSTLStream.cpp

@ -54,7 +54,7 @@ hsVectorStream::~hsVectorStream()
{
}
hsBool hsVectorStream::AtEnd()
bool hsVectorStream::AtEnd()
{
return (fBytesRead >= fEnd);
}
@ -174,7 +174,7 @@ hsNamedPipeStream::~hsNamedPipeStream()
fOverlap.hEvent = INVALID_HANDLE_VALUE;
}
hsBool hsNamedPipeStream::WaitForClientConnect()
bool hsNamedPipeStream::WaitForClientConnect()
{
// Look for a client connect (this should return zero since it's overlapped)
BOOL ret = ConnectNamedPipe(fPipe, &fOverlap);
@ -201,17 +201,17 @@ hsBool hsNamedPipeStream::WaitForClientConnect()
return false;
}
hsBool hsNamedPipeStream::Open(const char *name, const char *mode)
bool hsNamedPipeStream::Open(const char *name, const char *mode)
{
wchar_t* wName = hsStringToWString(name);
wchar_t* wMode = hsStringToWString(mode);
hsBool ret = Open(wName, wMode);
bool ret = Open(wName, wMode);
delete [] wName;
delete [] wMode;
return ret;
}
hsBool hsNamedPipeStream::Open(const wchar_t *name, const wchar_t *mode)
bool hsNamedPipeStream::Open(const wchar_t *name, const wchar_t *mode)
{
if (wcschr(mode, L'w'))
{
@ -249,7 +249,7 @@ hsBool hsNamedPipeStream::Open(const wchar_t *name, const wchar_t *mode)
return false;
}
hsBool hsNamedPipeStream::Close()
bool hsNamedPipeStream::Close()
{
if (fPipe == INVALID_HANDLE_VALUE)
return false;
@ -270,7 +270,7 @@ hsBool hsNamedPipeStream::Close()
return true;
}
hsBool hsNamedPipeStream::ICheckOverlappedResult(BOOL result, uint32_t &numTransferred)
bool hsNamedPipeStream::ICheckOverlappedResult(BOOL result, uint32_t &numTransferred)
{
// Read/Write succeeded, return now
if (result)
@ -294,7 +294,7 @@ hsBool hsNamedPipeStream::ICheckOverlappedResult(BOOL result, uint32_t &numTrans
return false;
}
hsBool hsNamedPipeStream::IRead(uint32_t byteCount, void *buffer, uint32_t &numRead)
bool hsNamedPipeStream::IRead(uint32_t byteCount, void *buffer, uint32_t &numRead)
{
numRead = 0;
@ -312,7 +312,7 @@ hsBool hsNamedPipeStream::IRead(uint32_t byteCount, void *buffer, uint32_t &numR
return false;
}
hsBool hsNamedPipeStream::IWrite(uint32_t byteCount, const void *buffer, uint32_t &numWritten)
bool hsNamedPipeStream::IWrite(uint32_t byteCount, const void *buffer, uint32_t &numWritten)
{
numWritten = 0;

36
Sources/Plasma/CoreLib/hsSTLStream.h

@ -57,17 +57,17 @@ public:
hsVectorStream(uint32_t chunkSize);
virtual ~hsVectorStream();
virtual hsBool Open(const char *, const char *) { hsAssert(0, "hsVectorStream::Open Not Implemented"); return false; }
virtual hsBool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsVectorStream::Open Not Implemented"); return false; }
virtual hsBool Close() { hsAssert(0, "hsVectorStream::Close Not Implemented"); return false; }
virtual bool Open(const char *, const char *) { hsAssert(0, "hsVectorStream::Open Not Implemented"); return false; }
virtual bool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsVectorStream::Open Not Implemented"); return false; }
virtual bool Close() { hsAssert(0, "hsVectorStream::Close Not Implemented"); return false; }
virtual hsBool AtEnd();
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void * buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual void Truncate();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual void Truncate();
virtual uint32_t GetEOF();
virtual void CopyToMem(void* mem);
@ -92,13 +92,13 @@ class hsNamedPipeStream : public hsStream
protected:
HANDLE fPipe;
OVERLAPPED fOverlap;
hsBool fReadMode; // True for read, false for write
bool fReadMode; // True for read, false for write
uint8_t fFlags;
uint32_t fTimeout;
hsBool ICheckOverlappedResult(BOOL result, uint32_t &numTransferred);
hsBool IRead(uint32_t byteCount, void *buffer, uint32_t &numRead);
hsBool IWrite(uint32_t byteCount, const void *buffer, uint32_t &numWritten);
bool ICheckOverlappedResult(BOOL result, uint32_t &numTransferred);
bool IRead(uint32_t byteCount, void *buffer, uint32_t &numRead);
bool IWrite(uint32_t byteCount, const void *buffer, uint32_t &numWritten);
public:
enum { kThrowOnError = 1 }; // Throws if a read or write operation fails
@ -110,20 +110,20 @@ public:
// The format is "\\.\pipe\pipeName". The '.' can be replaced with a
// computer name to do it over the network. 'pipeName' is whatever you
// want.
virtual hsBool Open(const char *name, const char *mode);
virtual hsBool Open(const wchar_t *name, const wchar_t *mode);
virtual hsBool Close();
virtual bool Open(const char *name, const char *mode);
virtual bool Open(const wchar_t *name, const wchar_t *mode);
virtual bool Close();
virtual uint32_t Read(uint32_t byteCount, void *buffer);
virtual uint32_t Write(uint32_t byteCount, const void *buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
// - For the server (writer) only -
// After calling open, signal your client to start reading and call this function.
// If a client connects, this will return true and you can start writing. If it
// returns false, close the pipe, it ain't happening.
hsBool WaitForClientConnect();
bool WaitForClientConnect();
};
#endif // HS_BUILD_FOR_WIN32

95
Sources/Plasma/CoreLib/hsStream.cpp

@ -277,7 +277,7 @@ char *hsStream::ReadSafeString()
#ifndef REMOVE_ME_SOON
// Backward compat hack - remove in a week or so (from 6/30/03)
hsBool oldFormat = !(numChars & 0xf000);
bool oldFormat = !(numChars & 0xf000);
if (oldFormat)
ReadLE16();
#endif
@ -354,7 +354,7 @@ plString hsStream::ReadSafeWString_TEMP()
return result;
}
hsBool hsStream::Read4Bytes(void *pv) // Virtual, faster version in sub classes
bool hsStream::Read4Bytes(void *pv) // Virtual, faster version in sub classes
{
int knt = this->Read(sizeof(uint32_t), pv);
if (knt != 4)
@ -362,7 +362,7 @@ hsBool hsStream::Read4Bytes(void *pv) // Virtual, faster version in sub classe
return true;
}
hsBool hsStream::Read12Bytes(void *buffer) // Reads 12 bytes, return true if success
bool hsStream::Read12Bytes(void *buffer) // Reads 12 bytes, return true if success
{
int knt = this->Read(12,buffer);
if (knt != 12)
@ -370,7 +370,7 @@ hsBool hsStream::Read12Bytes(void *buffer) // Reads 12 bytes, return true if su
return true;
}
hsBool hsStream::Read8Bytes(void *buffer) // Reads 12 bytes, return true if success
bool hsStream::Read8Bytes(void *buffer) // Reads 12 bytes, return true if success
{
int knt = this->Read(8,buffer);
if (knt !=8)
@ -378,27 +378,21 @@ hsBool hsStream::Read8Bytes(void *buffer) // Reads 12 bytes, return true if su
return true;
}
hsBool hsStream::ReadBool() // Virtual, faster version in sub classes
bool hsStream::ReadBOOL()
{
return this->ReadByte();
uint32_t val;
this->Read(sizeof(uint32_t), &val);
return val != 0;
}
bool hsStream::Readbool() // Virtual, faster version in sub classes
bool hsStream::ReadBool() // Virtual, faster version in sub classes
{
return this->ReadByte() ? true : false;
return (this->ReadByte() != 0);
}
void hsStream::ReadBool(int count, hsBool values[])
void hsStream::ReadBool(int count, bool values[])
{
this->Read(count, values);
if (sizeof(hsBool) > 1)
{ const uint8_t* src = (uint8_t*)values;
// go backwards so we don't overwrite ourselves
for (int i = count - 1; i >= 0; --i)
values[i] = src[i];
}
}
uint8_t hsStream::ReadByte()
@ -409,18 +403,18 @@ uint8_t hsStream::ReadByte()
return value;
}
hsBool hsStream::AtEnd()
bool hsStream::AtEnd()
{
hsAssert(0,"No hsStream::AtEnd() implemented for this stream class");
return false;
}
hsBool hsStream::IsTokenSeparator(char c)
bool hsStream::IsTokenSeparator(char c)
{
return (isspace(c) || c==',' || c=='=');
}
hsBool hsStream::GetToken(char *s, uint32_t maxLen, const char beginComment, const char endComment)
bool hsStream::GetToken(char *s, uint32_t maxLen, const char beginComment, const char endComment)
{
char c;
char endCom;
@ -470,7 +464,7 @@ hsBool hsStream::GetToken(char *s, uint32_t maxLen, const char beginComment, con
return true;
}
hsBool hsStream::ReadLn(char *s, uint32_t maxLen, const char beginComment, const char endComment)
bool hsStream::ReadLn(char *s, uint32_t maxLen, const char beginComment, const char endComment)
{
char c;
char endCom;
@ -598,32 +592,21 @@ float hsStream::ReadBEFloat()
}
void hsStream::WriteBool(hsBool value)
void hsStream::WriteBOOL(bool value)
{
uint8_t dst = (value != 0);
this->Write(sizeof(uint8_t), &dst);
uint32_t dst = value != 0;
this->Write(sizeof(uint32_t), &dst);
}
void hsStream::Writebool(bool value)
void hsStream::WriteBool(bool value)
{
uint8_t dst = (value != 0);
uint8_t dst = value != 0;
this->Write(sizeof(uint8_t), &dst);
}
void hsStream::WriteBool(int count, const hsBool values[])
void hsStream::WriteBool(int count, const bool values[])
{
if (sizeof(hsBool) > 1)
{ hsTempArray<uint8_t> storage(count);
uint8_t* dst = (uint8_t*)values;
for (int i = 0; i < count; i++)
dst[i] = (values[i] != 0);
this->Write(count, dst);
}
else
this->Write(count, values);
this->Write(count, values);
}
void hsStream::WriteByte(uint8_t value)
@ -711,19 +694,19 @@ uint32_t hsStream::ReadLEAtom(uint32_t* sizePtr)
#define kFileStream_Uninitialized ~0
hsBool hsFileStream::Open(const char *name, const char *mode)
bool hsFileStream::Open(const char *name, const char *mode)
{
hsAssert(0, "hsFileStream::Open NotImplemented");
return false;
}
hsBool hsFileStream::Open(const wchar_t *name, const wchar_t *mode)
bool hsFileStream::Open(const wchar_t *name, const wchar_t *mode)
{
hsAssert(0, "hsFileStream::Open NotImplemented");
return false;
}
hsBool hsFileStream::Close ()
bool hsFileStream::Close ()
{
hsAssert(0, "hsFileStream::Close NotImplemented");
return false;
@ -793,7 +776,7 @@ uint32_t hsFileStream::Write(uint32_t bytes, const void* buffer)
}
hsBool hsFileStream::AtEnd()
bool hsFileStream::AtEnd()
{
#if HS_BUILD_FOR_WIN32
uint32_t bytes;
@ -838,21 +821,21 @@ hsUNIXStream::~hsUNIXStream()
// Don't Close here, because Sub classes Don't always want that behaviour!
}
hsBool hsUNIXStream::Open(const char *name, const char *mode)
bool hsUNIXStream::Open(const char *name, const char *mode)
{
fPosition = 0;
fRef = hsFopen(name, mode);
return (fRef) ? true : false;
}
hsBool hsUNIXStream::Open(const wchar_t *name, const wchar_t *mode)
bool hsUNIXStream::Open(const wchar_t *name, const wchar_t *mode)
{
fPosition = 0;
fRef = hsWFopen(name, mode);
return (fRef) ? true : false;
}
hsBool hsUNIXStream::Close()
bool hsUNIXStream::Close()
{
int rtn = true;
if (fRef)
@ -885,11 +868,11 @@ uint32_t hsUNIXStream::Read(uint32_t bytes, void* buffer)
return numItems;
}
hsBool hsUNIXStream::AtEnd()
bool hsUNIXStream::AtEnd()
{
if (!fRef)
return 1;
hsBool rVal;
bool rVal;
int x = getc(fRef);
rVal = feof(fRef) != 0;
ungetc(x, fRef);
@ -993,7 +976,7 @@ void plReadOnlySubStream::IFixPosition( void )
fPosition = fBase->GetPosition() - fOffset;
}
hsBool plReadOnlySubStream::AtEnd()
bool plReadOnlySubStream::AtEnd()
{
if( fPosition >= fLength )
return true;
@ -1074,7 +1057,7 @@ void hsRAMStream::Reset()
fIter.ResetToHead(&fAppender);
}
hsBool hsRAMStream::AtEnd()
bool hsRAMStream::AtEnd()
{
return (fBytesRead >= fAppender.Count() * fAppender.ElemSize());
}
@ -1163,7 +1146,7 @@ void hsNullStream::Truncate()
/////////////////////////////////////////////////////////////////////////////////
hsBool hsReadOnlyStream::AtEnd()
bool hsReadOnlyStream::AtEnd()
{
return fData >= fStop;
}
@ -1337,7 +1320,7 @@ void hsQueueStream::FastFwd()
fReadCursor = fWriteCursor;
}
hsBool hsQueueStream::AtEnd()
bool hsQueueStream::AtEnd()
{
return fReadCursor == fWriteCursor;
}
@ -1393,7 +1376,7 @@ hsBufferedStream::~hsBufferedStream()
#endif // LOG_BUFFERED
}
hsBool hsBufferedStream::Open(const char* name, const char* mode)
bool hsBufferedStream::Open(const char* name, const char* mode)
{
hsAssert(!fRef, "hsBufferedStream:Open Stream already opened");
fRef = hsFopen(name, mode);
@ -1413,13 +1396,13 @@ hsBool hsBufferedStream::Open(const char* name, const char* mode)
return true;
}
hsBool hsBufferedStream::Open(const wchar_t *name, const wchar_t *mode)
bool hsBufferedStream::Open(const wchar_t *name, const wchar_t *mode)
{
hsAssert(0, "hsFileStream::Open NotImplemented for wchar_t");
return false;
}
hsBool hsBufferedStream::Close()
bool hsBufferedStream::Close()
{
int rtn = true;
if (fRef)
@ -1556,7 +1539,7 @@ uint32_t hsBufferedStream::Write(uint32_t bytes, const void* buffer)
return amtWritten;
}
hsBool hsBufferedStream::AtEnd()
bool hsBufferedStream::AtEnd()
{
if (fWriteBufferUsed)
{

188
Sources/Plasma/CoreLib/hsStream.h

@ -85,24 +85,24 @@ protected:
uint32_t fBytesRead;
uint32_t fPosition;
hsBool IsTokenSeparator(char c);
bool IsTokenSeparator(char c);
public:
hsStream() : fBytesRead(0), fPosition(0) {}
virtual ~hsStream();
virtual hsBool Open(const char *, const char * = "rb")=0;
virtual hsBool Open(const wchar_t *, const wchar_t * = L"rb")=0;
virtual hsBool Close()=0;
virtual hsBool AtEnd();
virtual bool Open(const char *, const char * = "rb")=0;
virtual bool Open(const wchar_t *, const wchar_t * = L"rb")=0;
virtual bool Close()=0;
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void * buffer) = 0;
virtual uint32_t Write(uint32_t byteCount, const void* buffer) = 0;
virtual void Skip(uint32_t deltaByteCount) = 0;
virtual void Rewind() = 0;
virtual void FastFwd();
virtual void Skip(uint32_t deltaByteCount) = 0;
virtual void Rewind() = 0;
virtual void FastFwd();
virtual uint32_t GetPosition() const;
virtual void SetPosition(uint32_t position);
virtual void Truncate();
virtual void Flush() {}
virtual void SetPosition(uint32_t position);
virtual void Truncate();
virtual void Flush() {}
#ifdef STREAM_LOGGER
// Logging Reads & Skips
@ -121,14 +121,14 @@ public:
// Optimization for small Reads
virtual uint8_t ReadByte();
virtual hsBool Read4Bytes(void *buffer); // Reads 4 bytes, return true if success
virtual hsBool Read8Bytes(void *buffer); // Reads 8 bytes, return true if success
virtual hsBool Read12Bytes(void *buffer); // Reads 12 bytes, return true if success
virtual bool Read4Bytes(void *buffer); // Reads 4 bytes, return true if success
virtual bool Read8Bytes(void *buffer); // Reads 8 bytes, return true if success
virtual bool Read12Bytes(void *buffer); // Reads 12 bytes, return true if success
virtual uint32_t GetEOF();
uint32_t GetSizeLeft();
virtual void CopyToMem(void* mem);
virtual hsBool IsCompressed() { return false; }
virtual bool IsCompressed() { return false; }
uint32_t WriteString(const char cstring[]);
uint32_t WriteString(const plString & string) { return WriteString(_TEMP_CONVERT_TO_CONST_CHAR(string)); }
@ -150,21 +150,23 @@ public:
plString ReadSafeString_TEMP();
plString ReadSafeWString_TEMP();
hsBool GetToken(char *s, uint32_t maxLen=uint32_t(-1), const char beginComment=kComment, const char endComment=kEolnCode);
hsBool ReadLn(char* s, uint32_t maxLen=uint32_t(-1), const char beginComment=kComment, const char endComment=kEolnCode);
bool GetToken(char *s, uint32_t maxLen=uint32_t(-1), const char beginComment=kComment, const char endComment=kEolnCode);
bool ReadLn(char* s, uint32_t maxLen=uint32_t(-1), const char beginComment=kComment, const char endComment=kEolnCode);
bool Readbool();
hsBool ReadBool();
void ReadBool(int count, hsBool values[]);
// Reads a 4-byte BOOLean
bool ReadBOOL();
// Reads a 1-byte boolean
bool ReadBool();
void ReadBool(int count, bool values[]);
uint16_t ReadLE16();
void ReadLE16(int count, uint16_t values[]);
uint32_t ReadLE32();
void ReadLE32(int count, uint32_t values[]);
uint32_t ReadBE32();
void Writebool(bool value);
void WriteBool(hsBool value);
void WriteBool(int count, const hsBool values[]);
void WriteBOOL(bool value);
void WriteBool(bool value);
void WriteBool(int count, const bool values[]);
void WriteByte(uint8_t value);
void WriteLE16(uint16_t value);
void WriteLE16(int count, const uint16_t values[]);
@ -302,18 +304,18 @@ class hsFileStream: public hsStream
uint32_t fRef;
public:
hsFileStream();
virtual ~hsFileStream();
virtual hsBool Open(const char *name, const char *mode = "rb");
virtual hsBool Open(const wchar_t *name, const wchar_t *mode = L"rb");
virtual hsBool Close();
hsFileStream();
virtual ~hsFileStream();
virtual bool Open(const char *name, const char *mode = "rb");
virtual bool Open(const wchar_t *name, const wchar_t *mode = L"rb");
virtual bool Close();
virtual hsBool AtEnd();
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void* buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual uint32_t GetFileRef();
virtual void SetFileRef(uint32_t refNum);
@ -327,19 +329,19 @@ class hsUNIXStream: public hsStream
public:
hsUNIXStream(): fRef(0), fBuff(nil) {}
~hsUNIXStream();
virtual hsBool Open(const char* name, const char* mode = "rb");
virtual hsBool Open(const wchar_t *name, const wchar_t *mode = L"rb");
virtual hsBool Close();
virtual bool Open(const char* name, const char* mode = "rb");
virtual bool Open(const wchar_t *name, const wchar_t *mode = L"rb");
virtual bool Close();
virtual hsBool AtEnd();
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void* buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void SetPosition(uint32_t position);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual void Truncate();
virtual void Flush();
virtual void SetPosition(uint32_t position);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual void Truncate();
virtual void Flush();
FILE* GetFILE() { return fRef; }
void SetFILE(FILE* file) { fRef = file; }
@ -362,17 +364,17 @@ public:
plReadOnlySubStream(): fBase( nil ), fOffset( 0 ), fLength( 0 ) {}
~plReadOnlySubStream();
virtual hsBool Open(const char *, const char *) { hsAssert(0, "plReadOnlySubStream::Open NotImplemented"); return false; }
virtual hsBool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "plReadOnlySubStream::Open NotImplemented"); return false; }
void Open( hsStream *base, uint32_t offset, uint32_t length );
virtual hsBool Close() { fBase = nil; fOffset = 0; fLength = 0; return true; }
virtual hsBool AtEnd();
virtual bool Open(const char *, const char *) { hsAssert(0, "plReadOnlySubStream::Open NotImplemented"); return false; }
virtual bool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "plReadOnlySubStream::Open NotImplemented"); return false; }
void Open( hsStream *base, uint32_t offset, uint32_t length );
virtual bool Close() { fBase = nil; fOffset = 0; fLength = 0; return true; }
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void* buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual void Truncate();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual void Truncate();
virtual uint32_t GetEOF();
};
@ -385,17 +387,17 @@ public:
hsRAMStream(uint32_t chunkSize);
virtual ~hsRAMStream();
virtual hsBool Open(const char *, const char *) { hsAssert(0, "hsRAMStream::Open NotImplemented"); return false; }
virtual hsBool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsRAMStream::Open NotImplemented"); return false; }
virtual hsBool Close() { hsAssert(0, "hsRAMStream::Close NotImplemented"); return false; }
virtual bool Open(const char *, const char *) { hsAssert(0, "hsRAMStream::Open NotImplemented"); return false; }
virtual bool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsRAMStream::Open NotImplemented"); return false; }
virtual bool Close() { hsAssert(0, "hsRAMStream::Close NotImplemented"); return false; }
virtual hsBool AtEnd();
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void * buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual uint32_t GetEOF();
virtual void CopyToMem(void* mem);
@ -406,18 +408,18 @@ public:
class hsNullStream : public hsStream {
public:
virtual hsBool Open(const char *, const char *) { return true; }
virtual hsBool Open(const wchar_t *, const wchar_t *) { return true; }
virtual hsBool Close() { return true; }
virtual bool Open(const char *, const char *) { return true; }
virtual bool Open(const wchar_t *, const wchar_t *) { return true; }
virtual bool Close() { return true; }
virtual uint32_t Read(uint32_t byteCount, void * buffer); // throw's exception
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
uint32_t GetBytesWritten() const { return fBytesRead; }
void Reset( ) { fBytesRead = 0; }
uint32_t GetBytesWritten() const { return fBytesRead; }
void Reset( ) { fBytesRead = 0; }
};
// read only mem stream
@ -430,19 +432,19 @@ public:
hsReadOnlyStream(int size, const void* data) { Init(size, data); }
hsReadOnlyStream() {}
virtual void Init(int size, const void* data) { fStart=((char*)data); fData=((char*)data); fStop=((char*)data + size); }
virtual hsBool Open(const char *, const char *) { hsAssert(0, "hsReadOnlyStream::Open NotImplemented"); return false; }
virtual hsBool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsReadOnlyStream::Open NotImplemented"); return false; }
virtual hsBool Close() { hsAssert(0, "hsReadOnlyStream::Close NotImplemented"); return false; }
virtual hsBool AtEnd();
virtual void Init(int size, const void* data) { fStart=((char*)data); fData=((char*)data); fStop=((char*)data + size); }
virtual bool Open(const char *, const char *) { hsAssert(0, "hsReadOnlyStream::Open NotImplemented"); return false; }
virtual bool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsReadOnlyStream::Open NotImplemented"); return false; }
virtual bool Close() { hsAssert(0, "hsReadOnlyStream::Close NotImplemented"); return false; }
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void * buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer); // throws exception
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual uint32_t GetBytesRead() const { return fBytesRead; }
virtual uint32_t GetEOF() { return (uint32_t)(fStop-fStart); }
virtual void CopyToMem(void* mem);
virtual void CopyToMem(void* mem);
};
// write only mem stream
@ -451,9 +453,9 @@ public:
hsWriteOnlyStream(int size, const void* data) : hsReadOnlyStream(size, data) {}
hsWriteOnlyStream() {}
virtual hsBool Open(const char *, const char *) { hsAssert(0, "hsWriteOnlyStream::Open NotImplemented"); return false; }
virtual hsBool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsWriteOnlyStream::Open NotImplemented"); return false; }
virtual hsBool Close() { hsAssert(0, "hsWriteOnlyStream::Close NotImplemented"); return false; }
virtual bool Open(const char *, const char *) { hsAssert(0, "hsWriteOnlyStream::Open NotImplemented"); return false; }
virtual bool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsWriteOnlyStream::Open NotImplemented"); return false; }
virtual bool Close() { hsAssert(0, "hsWriteOnlyStream::Close NotImplemented"); return false; }
virtual uint32_t Read(uint32_t byteCount, void * buffer); // throws exception
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual uint32_t GetBytesRead() const { return 0; }
@ -472,16 +474,16 @@ public:
hsQueueStream(int32_t size);
~hsQueueStream();
virtual hsBool Open(const char *, const char *) { hsAssert(0, "hsQueueStream::Open NotImplemented"); return false; }
virtual hsBool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsQueueStream::Open NotImplemented"); return false; }
virtual hsBool Close() { hsAssert(0, "hsQueueStream::Close NotImplemented"); return false; }
virtual bool Open(const char *, const char *) { hsAssert(0, "hsQueueStream::Open NotImplemented"); return false; }
virtual bool Open(const wchar_t *, const wchar_t *) { hsAssert(0, "hsQueueStream::Open NotImplemented"); return false; }
virtual bool Close() { hsAssert(0, "hsQueueStream::Close NotImplemented"); return false; }
virtual uint32_t Read(uint32_t byteCount, void * buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual hsBool AtEnd();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void FastFwd();
virtual bool AtEnd();
uint32_t GetSize() { return fSize; }
const char* GetQueue() { return fQueue; }
@ -501,7 +503,7 @@ class hsBufferedStream : public hsStream
// a partial block at the end of the file.
uint32_t fBufferLen;
hsBool fWriteBufferUsed;
bool fWriteBufferUsed;
#ifdef HS_DEBUGGING
// For doing statistics on how efficient we are
@ -515,16 +517,16 @@ public:
hsBufferedStream();
virtual ~hsBufferedStream();
virtual hsBool Open(const char* name, const char* mode = "rb");
virtual hsBool Open(const wchar_t* name, const wchar_t* mode = L"rb");
virtual hsBool Close();
virtual bool Open(const char* name, const char* mode = "rb");
virtual bool Open(const wchar_t* name, const wchar_t* mode = L"rb");
virtual bool Close();
virtual hsBool AtEnd();
virtual bool AtEnd();
virtual uint32_t Read(uint32_t byteCount, void* buffer);
virtual uint32_t Write(uint32_t byteCount, const void* buffer);
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual void Skip(uint32_t deltaByteCount);
virtual void Rewind();
virtual void Truncate();
virtual uint32_t GetEOF();
FILE* GetFileRef();

16
Sources/Plasma/CoreLib/hsStringTokenizer.cpp

@ -61,12 +61,12 @@ hsStringTokenizer::~hsStringTokenizer()
delete[] fSeps;
}
hsBool hsStringTokenizer::HasMoreTokens()
bool hsStringTokenizer::HasMoreTokens()
{
return (*fTok != 0);
}
inline hsBool hsStringTokenizer::IsSep(char c)
inline bool hsStringTokenizer::IsSep(char c)
{
if (!fQAsTok || !fInQuote)
{
@ -111,7 +111,7 @@ char *hsStringTokenizer::next()
}
// Slightly more loop-friendly version of next
hsBool hsStringTokenizer::Next( char *token, uint32_t maxTokLen )
bool hsStringTokenizer::Next( char *token, uint32_t maxTokLen )
{
char *t = next();
if( t == nil )
@ -161,7 +161,7 @@ void hsStringTokenizer::Reset(const char *string, const char *seps)
// next();
}
void hsStringTokenizer::ParseQuotes(hsBool qAsTok)
void hsStringTokenizer::ParseQuotes(bool qAsTok)
{
fQAsTok = qAsTok;
}
@ -185,12 +185,12 @@ hsWStringTokenizer::~hsWStringTokenizer()
delete[] fSeps;
}
hsBool hsWStringTokenizer::HasMoreTokens()
bool hsWStringTokenizer::HasMoreTokens()
{
return (*fTok != L'\0');
}
inline hsBool hsWStringTokenizer::IsSep(wchar_t c)
inline bool hsWStringTokenizer::IsSep(wchar_t c)
{
if (!fQAsTok || !fInQuote)
{
@ -235,7 +235,7 @@ wchar_t *hsWStringTokenizer::next()
}
// Slightly more loop-friendly version of next
hsBool hsWStringTokenizer::Next( wchar_t *token, uint32_t maxTokLen )
bool hsWStringTokenizer::Next( wchar_t *token, uint32_t maxTokLen )
{
wchar_t *t = next();
if( t == nil )
@ -303,7 +303,7 @@ void hsWStringTokenizer::Reset(const wchar_t *string, const wchar_t *seps)
// next();
}
void hsWStringTokenizer::ParseQuotes(hsBool qAsTok)
void hsWStringTokenizer::ParseQuotes(bool qAsTok)
{
fQAsTok = qAsTok;
}

28
Sources/Plasma/CoreLib/hsStringTokenizer.h

@ -59,17 +59,17 @@ private:
char fLastRep;
int32_t fNumSeps;
hsBool fQAsTok;
hsBool fInQuote;
hsBool fCheckAlphaNum;
bool fQAsTok;
bool fInQuote;
bool fCheckAlphaNum;
public:
hsStringTokenizer(const char *string=nil, const char *seps=nil);
~hsStringTokenizer();
char *next();
hsBool Next( char *token, uint32_t maxTokLen );
hsBool HasMoreTokens();
bool Next( char *token, uint32_t maxTokLen );
bool HasMoreTokens();
void Reset(const char *string, const char *seps);
void ParseQuotes(hsBool qAsTok);
void ParseQuotes(bool qAsTok);
char *GetRestOfString( void ) const { return fTok; }
@ -78,7 +78,7 @@ public:
void RestoreLastTerminator( void );
private:
hsBool IsSep(char c);
bool IsSep(char c);
};
class hsWStringTokenizer
@ -90,17 +90,17 @@ private:
wchar_t fLastRep;
int32_t fNumSeps;
hsBool fQAsTok;
hsBool fInQuote;
hsBool fCheckAlphaNum;
bool fQAsTok;
bool fInQuote;
bool fCheckAlphaNum;
public:
hsWStringTokenizer(const wchar_t *string=nil, const wchar_t *seps=nil);
~hsWStringTokenizer();
wchar_t *next();
hsBool Next( wchar_t *token, uint32_t maxTokLen );
hsBool HasMoreTokens();
bool Next( wchar_t *token, uint32_t maxTokLen );
bool HasMoreTokens();
void Reset(const wchar_t *string, const wchar_t *seps);
void ParseQuotes(hsBool qAsTok);
void ParseQuotes(bool qAsTok);
wchar_t *GetRestOfString( void ) const { return fTok; }
@ -109,7 +109,7 @@ public:
void RestoreLastTerminator( void );
private:
hsBool IsSep(wchar_t c);
bool IsSep(wchar_t c);
};
#endif // _hsStringTokenizer_Included_

66
Sources/Plasma/CoreLib/hsTemplates.h

@ -224,7 +224,7 @@ public:
template <class T> class hsDynamicArray {
private:
int32_t fCount;
int32_t fCount;
T* fArray;
hsDynamicArray<T>& operator=(const hsDynamicArray<T>&); // don't allow assignment
@ -235,28 +235,28 @@ public:
virtual ~hsDynamicArray();
int32_t GetCount() const { return fCount; }
hsBool IsEmpty() const { return fCount == 0; }
const T& Get(int32_t index) const;
bool IsEmpty() const { return fCount == 0; }
const T& Get(int32_t index) const;
int32_t Get(int32_t index, int32_t count, T data[]) const;
int32_t Find(const T&) const; // returns kMissingIndex if not found
void SetCount(int32_t count);
T& operator[]( int32_t index );
void SetCount(int32_t count);
T& operator[]( int32_t index );
int32_t Append(const T&);
int32_t InsertAtIndex(uint32_t index, const T& obj);
int32_t Push(const T&);
int32_t Pop(T*);
void Remove(int32_t);
void Reset(); // clears out everything
void Remove(int32_t);
void Reset(); // clears out everything
T* AcquireArray() { return fArray; }
T* DetachArray() { T* t = fArray; fCount = 0; fArray = nil; return t; }
void ReleaseArray(T*) {}
hsDynamicArray<T>* Copy(hsDynamicArray<T>* dst = nil) const;
T* AcquireArray() { return fArray; }
T* DetachArray() { T* t = fArray; fCount = 0; fArray = nil; return t; }
void ReleaseArray(T*) {}
hsDynamicArray<T>* Copy(hsDynamicArray<T>* dst = nil) const;
T* ForEach(bool (*proc)(T&));
T* ForEach(bool (*proc)(T&, void* p1), void* p1);
T* ForEach(bool (*proc)(T&, void* p1, void* p2), void* p1, void* p2);
T* ForEach(int32_t (*proc)(T&));
T* ForEach(int32_t (*proc)(T&, void* p1), void* p1);
T* ForEach(int32_t (*proc)(T&, void* p1, void* p2), void* p1, void* p2);
};
// Use this for block of memory allocated with HSMemory::New()
@ -475,7 +475,7 @@ hsDynamicArray<T>* hsDynamicArray<T>::Copy(hsDynamicArray<T>* dst) const
return dst;
}
template <class T> T* hsDynamicArray<T>::ForEach(bool (*proc)(T&))
template <class T> T* hsDynamicArray<T>::ForEach(int32_t (*proc)(T&))
{
for (int i = 0; i < fCount; i++)
if (proc(fArray[i]))
@ -483,7 +483,7 @@ template <class T> T* hsDynamicArray<T>::ForEach(bool (*proc)(T&))
return nil;
}
template <class T> T* hsDynamicArray<T>::ForEach(bool (*proc)(T&, void* p1), void * p1)
template <class T> T* hsDynamicArray<T>::ForEach(int32_t (*proc)(T&, void* p1), void * p1)
{
for (int i = 0; i < fCount; i++)
if (proc(fArray[i], p1))
@ -491,7 +491,7 @@ template <class T> T* hsDynamicArray<T>::ForEach(bool (*proc)(T&, void* p1), voi
return nil;
}
template <class T> T* hsDynamicArray<T>::ForEach(bool (*proc)(T&, void* p1, void* p2), void *p1, void *p2)
template <class T> T* hsDynamicArray<T>::ForEach(int32_t (*proc)(T&, void* p1, void* p2), void *p1, void *p2)
{
for (int i = 0; i < fCount; i++)
if (proc(fArray[i], p1, p2))
@ -614,7 +614,7 @@ public:
hsTArray_ValidateIndex(index + count - 1);
this->DecCount(index, count);
}
hsBool RemoveItem(const T& item);
bool RemoveItem(const T& item);
T* Push()
{
@ -638,9 +638,9 @@ public:
kMissingIndex = -1
};
int Find(const T& item) const; // returns kMissingIndex if not found
inline T* ForEach(hsBool (*proc)(T&));
inline T* ForEach(hsBool (*proc)(T&, void* p1), void* p1);
inline T* ForEach(hsBool (*proc)(T&, void* p1, void* p2), void* p1, void* p2);
inline T* ForEach(int32_t (*proc)(T&));
inline T* ForEach(int32_t (*proc)(T&, void* p1), void* p1);
inline T* ForEach(int32_t (*proc)(T&, void* p1, void* p2), void* p1, void* p2);
T* DetachArray()
{
@ -813,7 +813,7 @@ template <class T> int hsTArray<T>::Find(const T& item) const
return kMissingIndex;
}
template <class T> hsBool hsTArray<T>::RemoveItem(const T& item)
template <class T> bool hsTArray<T>::RemoveItem(const T& item)
{
for (int i = 0; i < fUseCount; i++)
if (fArray[i] == item)
@ -870,7 +870,7 @@ template <class T> void hsTArray<T>::DecCount(int index, int count)
}
}
template <class T> T* hsTArray<T>::ForEach(hsBool (*proc)(T&))
template <class T> T* hsTArray<T>::ForEach(int32_t (*proc)(T&))
{
for (int i = 0; i < fUseCount; i++)
if (proc(fArray[i]))
@ -878,7 +878,7 @@ template <class T> T* hsTArray<T>::ForEach(hsBool (*proc)(T&))
return nil;
}
template <class T> T* hsTArray<T>::ForEach(hsBool (*proc)(T&, void* p1), void* p1)
template <class T> T* hsTArray<T>::ForEach(int32_t (*proc)(T&, void* p1), void* p1)
{
for (int i = 0; i < fUseCount; i++)
if (proc(fArray[i], p1))
@ -886,7 +886,7 @@ template <class T> T* hsTArray<T>::ForEach(hsBool (*proc)(T&, void* p1), void* p
return nil;
}
template <class T> T* hsTArray<T>::ForEach(hsBool (*proc)(T&, void* p1, void* p2), void* p1, void* p2)
template <class T> T* hsTArray<T>::ForEach(int32_t (*proc)(T&, void* p1, void* p2), void* p1, void* p2)
{
for (int i = 0; i < fUseCount; i++)
if (proc(fArray[i], p1, p2))
@ -1011,7 +1011,7 @@ public:
hsLargeArray_ValidateIndex(index + count - 1);
this->DecCount(index, count);
}
hsBool RemoveItem(const T& item);
bool RemoveItem(const T& item);
T* Push()
{
@ -1035,9 +1035,9 @@ public:
kMissingIndex = -1
};
int Find(const T& item) const; // returns kMissingIndex if not found
inline T* ForEach(hsBool (*proc)(T&));
inline T* ForEach(hsBool (*proc)(T&, void* p1), void* p1);
inline T* ForEach(hsBool (*proc)(T&, void* p1, void* p2), void* p1, void* p2);
inline T* ForEach(int32_t (*proc)(T&));
inline T* ForEach(int32_t (*proc)(T&, void* p1), void* p1);
inline T* ForEach(int32_t (*proc)(T&, void* p1, void* p2), void* p1, void* p2);
T* DetachArray()
{
@ -1182,7 +1182,7 @@ template <class T> int hsLargeArray<T>::Find(const T& item) const
return kMissingIndex;
}
template <class T> hsBool hsLargeArray<T>::RemoveItem(const T& item)
template <class T> bool hsLargeArray<T>::RemoveItem(const T& item)
{
for (int i = 0; i < fUseCount; i++)
if (fArray[i] == item)
@ -1239,7 +1239,7 @@ template <class T> void hsLargeArray<T>::DecCount(int index, int count)
}
}
template <class T> T* hsLargeArray<T>::ForEach(hsBool (*proc)(T&))
template <class T> T* hsLargeArray<T>::ForEach(int32_t (*proc)(T&))
{
for (int i = 0; i < fUseCount; i++)
if (proc(fArray[i]))
@ -1247,7 +1247,7 @@ template <class T> T* hsLargeArray<T>::ForEach(hsBool (*proc)(T&))
return nil;
}
template <class T> T* hsLargeArray<T>::ForEach(hsBool (*proc)(T&, void* p1), void* p1)
template <class T> T* hsLargeArray<T>::ForEach(int32_t (*proc)(T&, void* p1), void* p1)
{
for (int i = 0; i < fUseCount; i++)
if (proc(fArray[i], p1))
@ -1255,7 +1255,7 @@ template <class T> T* hsLargeArray<T>::ForEach(hsBool (*proc)(T&, void* p1), voi
return nil;
}
template <class T> T* hsLargeArray<T>::ForEach(hsBool (*proc)(T&, void* p1, void* p2), void* p1, void* p2)
template <class T> T* hsLargeArray<T>::ForEach(int32_t (*proc)(T&, void* p1, void* p2), void* p1, void* p2)
{
for (int i = 0; i < fUseCount; i++)
if (proc(fArray[i], p1, p2))

22
Sources/Plasma/CoreLib/hsThread.h

@ -68,20 +68,20 @@ public:
typedef pthread_t ThreadId;
#endif
private:
hsBool fQuit;
uint32_t fStackSize;
bool fQuit;
uint32_t fStackSize;
#if HS_BUILD_FOR_WIN32
ThreadId fThreadId;
HANDLE fThreadH;
HANDLE fQuitSemaH;
#elif HS_BUILD_FOR_UNIX
ThreadId fPThread;
hsBool fIsValid;
bool fIsValid;
pthread_mutex_t fMutex;
#endif
protected:
hsBool GetQuit() const { return hsBool(fQuit); }
void SetQuit(hsBool value) { fQuit = value; }
bool GetQuit() const { return fQuit; }
void SetQuit(bool value) { fQuit = value; }
public:
hsThread(uint32_t stackSize = 0);
virtual ~hsThread(); // calls Stop()
@ -121,7 +121,7 @@ public:
#endif
void Lock();
hsBool TryLock();
bool TryLock();
void Unlock();
};
@ -165,8 +165,8 @@ public:
HANDLE GetHandle() const { return fSemaH; }
#endif
hsBool TryWait();
hsBool Wait(hsMilliseconds timeToWait = kPosInfinity32);
bool TryWait();
bool Wait(hsMilliseconds timeToWait = kPosInfinity32);
void Signal();
};
@ -177,7 +177,7 @@ class hsEvent
#ifndef PSEUDO_EVENT
pthread_mutex_t fMutex;
pthread_cond_t fCond;
hsBool fTriggered;
bool fTriggered;
#else
enum { kRead, kWrite };
int fFds[2];
@ -195,8 +195,8 @@ public:
HANDLE GetHandle() const { return fEvent; }
#endif
hsBool Wait(hsMilliseconds timeToWait = kPosInfinity32);
void Signal();
bool Wait(hsMilliseconds timeToWait = kPosInfinity32);
void Signal();
};
//////////////////////////////////////////////////////////////////////////////

2
Sources/Plasma/CoreLib/hsThread_Mac.cpp

@ -153,7 +153,7 @@ hsSemaphore::~hsSemaphore()
hsThrowIfOSErr(status);
}
hsBool hsSemaphore::Wait(hsMilliseconds timeToWait)
bool hsSemaphore::Wait(hsMilliseconds timeToWait)
{
Duration duration;

14
Sources/Plasma/CoreLib/hsThread_Unix.cpp

@ -253,7 +253,7 @@ void hsMutex::Lock()
#endif
}
hsBool hsMutex::TryLock()
bool hsMutex::TryLock()
{
int status = ::pthread_mutex_trylock(&fPMutex);
hsThrowIfOSErr(status);
@ -316,7 +316,7 @@ hsSemaphore::~hsSemaphore()
#endif
}
hsBool hsSemaphore::TryWait()
bool hsSemaphore::TryWait()
{
#ifdef USE_SEMA
int status = ::sem_trywait(fPSema);
@ -328,7 +328,7 @@ hsBool hsSemaphore::TryWait()
#endif
}
hsBool hsSemaphore::Wait(hsMilliseconds timeToWait)
bool hsSemaphore::Wait(hsMilliseconds timeToWait)
{
#ifdef USE_SEMA // SHOULDN'T THIS USE timeToWait??!?!? -rje
// shouldn't this use sem_timedwait? -dpogue (2012-03-04)
@ -337,7 +337,7 @@ hsBool hsSemaphore::Wait(hsMilliseconds timeToWait)
hsThrowIfOSErr(status);
return true;
#else
hsBool retVal = true;
bool retVal = true;
int status = ::pthread_mutex_lock(&fPMutex);
hsThrowIfOSErr(status);
@ -430,9 +430,9 @@ hsEvent::~hsEvent()
hsThrowIfOSErr(status);
}
hsBool hsEvent::Wait(hsMilliseconds timeToWait)
bool hsEvent::Wait(hsMilliseconds timeToWait)
{
hsBool retVal = true;
bool retVal = true;
int status = ::pthread_mutex_lock(&fMutex);
hsAssert(status == 0, "hsEvent Mutex Lock");
hsThrowIfOSErr(status);
@ -530,7 +530,7 @@ hsEvent::~hsEvent()
close( fFds[kWrite] );
}
hsBool hsEvent::Wait( hsMilliseconds timeToWait )
bool hsEvent::Wait( hsMilliseconds timeToWait )
{
hsTempMutexLock lock( fWaitLock );

8
Sources/Plasma/CoreLib/hsThread_Win.cpp

@ -142,7 +142,7 @@ void hsMutex::Lock()
hsAssert(state != WAIT_TIMEOUT,"hsMutex::Lock -> Infinite Timeout expired?");
}
hsBool hsMutex::TryLock()
bool hsMutex::TryLock()
{
DWORD state = ::WaitForSingleObject(fMutexH, 0);
hsAssert(state != WAIT_ABANDONED,"hsMutex::TryLock -> Abandoned Mutex");
@ -170,14 +170,14 @@ hsSemaphore::~hsSemaphore()
::CloseHandle(fSemaH);
}
hsBool hsSemaphore::TryWait()
bool hsSemaphore::TryWait()
{
DWORD result = ::WaitForSingleObject(fSemaH, 0);
hsAssert(result != WAIT_ABANDONED, "hsSemaphore -> Abandoned Semaphore");
return result == WAIT_OBJECT_0;
}
hsBool hsSemaphore::Wait(hsMilliseconds timeToWait)
bool hsSemaphore::Wait(hsMilliseconds timeToWait)
{
if (timeToWait == kPosInfinity32)
timeToWait = INFINITE;
@ -211,7 +211,7 @@ hsEvent::~hsEvent()
::CloseHandle(fEvent);
}
hsBool hsEvent::Wait(hsMilliseconds timeToWait)
bool hsEvent::Wait(hsMilliseconds timeToWait)
{
if (timeToWait == kPosInfinity32)
timeToWait = INFINITE;

6
Sources/Plasma/CoreLib/hsWide.cpp

@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
/////////////////////////////////////////////////////////////////////////
inline hsBool OverflowAdd(uint32_t* sum, uint32_t a, uint32_t b)
inline bool OverflowAdd(uint32_t* sum, uint32_t a, uint32_t b)
{
*sum = a + b;
@ -55,7 +55,7 @@ inline hsBool OverflowAdd(uint32_t* sum, uint32_t a, uint32_t b)
wide = (high << 32) + (middle << 16) + low
*/
inline hsBool SetWide3(hsWide* target, int32_t high, uint32_t middle, uint32_t low)
inline bool SetWide3(hsWide* target, int32_t high, uint32_t middle, uint32_t low)
{
hsAssert(high >= 0, "high is neg");
@ -308,7 +308,7 @@ int32_t hsWide::CubeRoot() const
uint32_t valueL = fLo;
uint32_t currH, currL;
uint32_t guessH, guessL;
hsBool neg = false;
bool neg = false;
if (WIDE_ISNEG(valueH, valueL))
{ neg = true;

22
Sources/Plasma/CoreLib/hsWide.h

@ -51,18 +51,18 @@ struct hsWide {
hsWide* Set(int32_t lo) { fLo = lo; if (lo < 0) fHi = -1L; else fHi = 0; return this; }
hsWide* Set(int32_t hi, uint32_t lo) { fHi = hi; fLo = lo; return this; }
inline hsBool IsNeg() const { return fHi < 0; }
inline hsBool IsPos() const { return fHi > 0 || (fHi == 0 && fLo != 0); }
inline hsBool IsZero() const { return fHi == 0 && fLo == 0; }
inline hsBool IsWide() const;
inline bool IsNeg() const { return fHi < 0; }
inline bool IsPos() const { return fHi > 0 || (fHi == 0 && fLo != 0); }
inline bool IsZero() const { return fHi == 0 && fLo == 0; }
inline bool IsWide() const;
hsBool operator==(const hsWide& b) const { return fHi == b.fHi && fLo == b.fLo; }
hsBool operator<(const hsWide& b) const { return fHi < b.fHi || (fHi == b.fHi && fLo < b.fLo); }
hsBool operator>( const hsWide& b) const { return fHi > b.fHi || (fHi == b.fHi && fLo > b.fLo); }
hsBool operator!=( const hsWide& b) const { return !( *this == b); }
hsBool operator<=(const hsWide& b) const { return !(*this > b); }
hsBool operator>=(const hsWide& b) const { return !(*this < b); }
bool operator==(const hsWide& b) const { return fHi == b.fHi && fLo == b.fLo; }
bool operator<(const hsWide& b) const { return fHi < b.fHi || (fHi == b.fHi && fLo < b.fLo); }
bool operator>( const hsWide& b) const { return fHi > b.fHi || (fHi == b.fHi && fLo > b.fLo); }
bool operator!=( const hsWide& b) const { return !( *this == b); }
bool operator<=(const hsWide& b) const { return !(*this > b); }
bool operator>=(const hsWide& b) const { return !(*this < b); }
inline hsWide* Negate();
inline hsWide* Add(int32_t scaler);
@ -182,7 +182,7 @@ inline int32_t hsWide::AsLong() const
return (int32_t)fLo;
}
inline hsBool hsWide::IsWide() const
inline bool hsWide::IsWide() const
{
return (fHi > 0 || (fHi == 0 && (int32_t)fLo < 0)) || (fHi < -1L || (fHi == -1L && (int32_t)fLo >= 0));
}

5
Sources/Plasma/CoreLib/pcSmallRect.h

@ -73,7 +73,10 @@ class pcSmallRect
void Read( hsStream *s );
void Write( hsStream *s );
hsBool Contains( int16_t x, int16_t y ) { if( x >= fX && x <= fX + fWidth && y >= fY && y <= fY + fHeight ) return true; return false; }
bool Contains( int16_t x, int16_t y ) const
{
return (x >= fX) && (x <= fX + fWidth) && (y >= fY) && (y <= fY + fHeight);
}
};

2
Sources/Plasma/CoreLib/plGeneric.cpp

@ -177,7 +177,7 @@ int plGeneric::Read(hsStream* stream)
break; // nothing to read
case kBool:
fBoolVal = (stream->ReadBool() != 0);
fBoolVal = stream->ReadBool();
break;
case kInt:

4
Sources/Plasma/CoreLib/plLoadMask.cpp

@ -144,13 +144,13 @@ uint32_t plLoadMask::ValidateMasks(int num, plLoadMask masks[])
return retVal;
}
hsBool plLoadMask::ComputeRepMasks(
bool plLoadMask::ComputeRepMasks(
int num,
const int quals[],
const int caps[],
plLoadMask masks[])
{
hsBool retVal = false; // Okay till proven otherwise.
bool retVal = false; // Okay till proven otherwise.
int i;
for( i = 0; i < num; i++ )

22
Sources/Plasma/CoreLib/plLoadMask.h

@ -74,21 +74,21 @@ public:
plLoadMask(uint8_t qLo, uint8_t qHi) { fQuality[0] = qLo; fQuality[1] = qHi; }
~plLoadMask() {}
hsBool DontLoad() const { return !(fQuality[fGlobalCapability] & fGlobalQuality); }
bool DontLoad() const { return !(fQuality[fGlobalCapability] & fGlobalQuality); }
hsBool NeverLoads() const { return !(fQuality[0] && fQuality[1]); }
bool NeverLoads() const { return !(fQuality[0] && fQuality[1]); }
hsBool IsUsed() const { return (fQuality[0] != uint8_t(-1)) || (fQuality[1] != uint8_t(-1)); }
bool IsUsed() const { return (fQuality[0] != uint8_t(-1)) || (fQuality[1] != uint8_t(-1)); }
hsBool MatchesQuality(int q) const { return (IBitToMask(q) & (fQuality[0] | fQuality[1])) != 0; }
hsBool MatchesCapability(int c) const { return fQuality[c] != 0; }
hsBool MatchesQualityAndCapability(int q, int c) const { return IBitToMask(q) & fQuality[c]; }
bool MatchesQuality(int q) const { return (IBitToMask(q) & (fQuality[0] | fQuality[1])) != 0; }
bool MatchesCapability(int c) const { return fQuality[c] != 0; }
bool MatchesQualityAndCapability(int q, int c) const { return IBitToMask(q) & fQuality[c]; }
hsBool MatchesCurrentQuality() const { return MatchesQuality(fGlobalQuality); }
hsBool MatchesCurrentCapability() const { return MatchesCapability(fGlobalCapability); }
hsBool MatchesCurrent() const { return !DontLoad(); }
bool MatchesCurrentQuality() const { return MatchesQuality(fGlobalQuality); }
bool MatchesCurrentCapability() const { return MatchesCapability(fGlobalCapability); }
bool MatchesCurrent() const { return !DontLoad(); }
uint8_t GetQualityMask(int cap) const { return fQuality[cap]; }
uint8_t GetQualityMask(int cap) const { return fQuality[cap]; }
plLoadMask& SetMask(uint8_t lo, uint8_t hi) { fQuality[0] = lo; fQuality[1] = hi; return *this; }
plLoadMask& SetNever() { return SetMask(0,0); }
@ -127,7 +127,7 @@ public:
// the output with ValidateMasks. The return value is a bitmask of which
// items in the list had problems, so return of zero means A-OK.
//
static hsBool ComputeRepMasks(int num, const int quals[], const int caps[], plLoadMask masks[]);
static bool ComputeRepMasks(int num, const int quals[], const int caps[], plLoadMask masks[]);
static uint32_t ValidateReps(int num, const int quals[], const int caps[]);
static uint32_t ValidateMasks(int num, plLoadMask masks[]);
};

2
Sources/Plasma/CoreLib/plRefCnt.h

@ -51,7 +51,7 @@ class plRefCnt
public:
plRefCnt() : fRefCnt(1){}
~plRefCnt(){}
hsBool TimeToDelete() { return (fRefCnt == 1); }
bool TimeToDelete() { return (fRefCnt == 1); }
void Incr() { fRefCnt++; }
void Decr() { fRefCnt--; }
};

14
Sources/Plasma/CoreLib/plViewTransform.cpp

@ -114,7 +114,7 @@ void plViewTransform::ISetCameraToNDC() const
ISetFlag(kCameraToNDCSet);
}
void plViewTransform::SetViewPort(const hsPoint2& mins, const hsPoint2& maxs, hsBool relative)
void plViewTransform::SetViewPort(const hsPoint2& mins, const hsPoint2& maxs, bool relative)
{
fViewPortX.Set(mins.fX, maxs.fX, 1.f / (maxs.fX - mins.fX));
fViewPortY.Set(mins.fY, maxs.fY, 1.f / (maxs.fY - mins.fY));
@ -221,7 +221,7 @@ hsScalarTriple plViewTransform::NDCToMap(const hsScalarTriple& ndcP) const
return map;
}
hsBool plViewTransform::SetProjection(const hsBounds3& bnd)
bool plViewTransform::SetProjection(const hsBounds3& bnd)
{
hsPoint3 maxs;
hsPoint3 mins;
@ -233,14 +233,14 @@ hsBool plViewTransform::SetProjection(const hsBounds3& bnd)
return false;
}
hsBool plViewTransform::SetProjectionWorld(const hsBounds3& wBnd)
bool plViewTransform::SetProjectionWorld(const hsBounds3& wBnd)
{
hsBounds3Ext cBnd = wBnd;
cBnd.Transform(&GetWorldToCamera());
return SetProjection(cBnd);
}
hsBool plViewTransform::IGetMaxMinsFromBnd(const hsBounds3& bnd, hsPoint3& mins, hsPoint3& maxs) const
bool plViewTransform::IGetMaxMinsFromBnd(const hsBounds3& bnd, hsPoint3& mins, hsPoint3& maxs) const
{
if( bnd.GetMaxs().fZ <= kMinHither )
return false;
@ -259,12 +259,12 @@ hsBool plViewTransform::IGetMaxMinsFromBnd(const hsBounds3& bnd, hsPoint3& mins,
return true;
}
hsBool plViewTransform::Intersect(const plViewTransform& view)
bool plViewTransform::Intersect(const plViewTransform& view)
{
hsPoint3 mins;
hsPoint3 maxs;
hsBool retVal = true;
bool retVal = true;
int i;
for( i = 0; i < 3; i++ )
{
@ -282,7 +282,7 @@ hsBool plViewTransform::Intersect(const plViewTransform& view)
return retVal;
}
hsBool plViewTransform::Union(const plViewTransform& view)
bool plViewTransform::Union(const plViewTransform& view)
{
hsPoint3 mins;
hsPoint3 maxs;

52
Sources/Plasma/CoreLib/plViewTransform.h

@ -95,9 +95,9 @@ public:
void Reset(); // resets to default state
// Queries
hsBool GetOrthogonal() const { return IHasFlag(kOrthogonal); }
hsBool GetPerspective() const { return !GetOrthogonal(); }
hsBool GetViewPortRelative() const { return IHasFlag(kViewPortRelative); }
bool GetOrthogonal() const { return IHasFlag(kOrthogonal); }
bool GetPerspective() const { return !GetOrthogonal(); }
bool GetViewPortRelative() const { return IHasFlag(kViewPortRelative); }
// Next, all our matrices.
const hsMatrix44& GetCameraToWorld() const { return fCameraToWorld; }
@ -110,8 +110,8 @@ public:
hsVector3 GetUp() const { return *((hsVector3*)&GetWorldToCamera().fMap[1]); }
hsVector3 GetAcross() const { return *((hsVector3*)&GetWorldToCamera().fMap[0]); }
uint16_t GetScreenWidth() const { return fWidth; }
uint16_t GetScreenHeight() const { return fHeight; }
uint16_t GetScreenWidth() const { return fWidth; }
uint16_t GetScreenHeight() const { return fHeight; }
void GetViewPort(hsPoint2& mins, hsPoint2& maxs) const;
void GetViewPort(int& loX, int& loY, int& hiX, int& hiY) const;
@ -130,14 +130,14 @@ public:
hsPoint3 GetMapMax() const { return fMapMax; }
void GetMapping(hsPoint3& mapMin, hsPoint3& mapMax) const { mapMin = fMapMin; mapMax = fMapMax; }
float GetFovX() const;
float GetFovY() const;
float GetFovXDeg() const { return hsRadiansToDegrees(GetFovX()); }
float GetFovYDeg() const { return hsRadiansToDegrees(GetFovY()); }
float GetOrthoWidth() const { return fMax.fX - fMin.fX; }
float GetOrthoHeight() const { return fMax.fY - fMin.fY; }
float GetHither() const { return fMin.fZ; }
float GetYon() const { return fMax.fZ; }
float GetFovX() const;
float GetFovY() const;
float GetFovXDeg() const { return hsRadiansToDegrees(GetFovX()); }
float GetFovYDeg() const { return hsRadiansToDegrees(GetFovY()); }
float GetOrthoWidth() const { return fMax.fX - fMin.fX; }
float GetOrthoHeight() const { return fMax.fY - fMin.fY; }
float GetHither() const { return fMin.fZ; }
float GetYon() const { return fMax.fZ; }
void GetDepth(float& hither, float& yon) const { hither = GetHither(); yon = GetYon(); }
// Setup.
@ -145,8 +145,8 @@ public:
void SetCameraTransform(const hsMatrix44& w2c, const hsMatrix44& c2w) { fWorldToCamera = w2c; fCameraToWorld = c2w; ISetFlag(kWorldToNDCSet, false); }
// Next, what kind of projection.
void SetOrthogonal(hsBool on) { ISetFlag(kOrthogonal, on); InvalidateTransforms(); }
void SetPerspective(hsBool on) { SetOrthogonal(!on); }
void SetOrthogonal(bool on) { ISetFlag(kOrthogonal, on); InvalidateTransforms(); }
void SetPerspective(bool on) { SetOrthogonal(!on); }
// Next, setting the scree/window/rendertarget size
void SetWidth(uint16_t w) { fWidth = w; }
@ -156,8 +156,8 @@ public:
// Next, setting the viewport. You only need to do this if you want to use the screen functions above.
// If you're passing in and getting out normalized device coordinates, skip this. If you don't set viewport,
// Defaults to 0,0,width,height (i.e. the whole screen).
void SetViewPort(const hsPoint2& mins, const hsPoint2& maxs, hsBool relative=true);
void SetViewPort(float loX, float loY, float hiX, float hiY, hsBool relative=true) { SetViewPort(hsPoint2().Set(loX, loY), hsPoint2().Set(hiX, hiY), relative); }
void SetViewPort(const hsPoint2& mins, const hsPoint2& maxs, bool relative=true);
void SetViewPort(float loX, float loY, float hiX, float hiY, bool relative=true) { SetViewPort(hsPoint2().Set(loX, loY), hsPoint2().Set(hiX, hiY), relative); }
void SetViewPort(uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) { SetViewPort(float(left), float(top), float(right), float(bottom), false); }
void SetMapping(const hsPoint3& mins, const hsPoint3& maxs) { SetMapMin(mins); SetMapMax(maxs); }
@ -203,8 +203,8 @@ public:
// Note this doesn't swivel the camera around to see the box, it offsets the projection.
// Return false if there isn't a projection that will capture any of the bnd. This
// can be from the bnd being behind the camera.
hsBool SetProjection(const hsBounds3& cBnd);
hsBool SetProjectionWorld(const hsBounds3& wBnd);
bool SetProjection(const hsBounds3& cBnd);
bool SetProjectionWorld(const hsBounds3& wBnd);
// This lets you create insane projection matrices. Note that it won't change the answer on anything like
// GetFov().
@ -216,8 +216,8 @@ public:
// of what the two views will see. The boolean is performed in axis aligned camera space, which lines
// up nicely with screen space. Note that this only makes sense for two ViewTransforms with identical
// CameraToWorld's (which isn't checked).
hsBool Intersect(const plViewTransform& view);
hsBool Union(const plViewTransform& view);
bool Intersect(const plViewTransform& view);
bool Union(const plViewTransform& view);
// Convenience to move from one space to another.
// Screen means pixels - Default is mapping NDC -> [0..1]. Z value of pixel is NDC Z.
@ -322,20 +322,20 @@ protected:
static const float kMinHither;
void ISetCameraToNDC() const;
hsBool ICameraToNDCSet() const { return IHasFlag(kCameraToNDCSet); }
bool ICameraToNDCSet() const { return IHasFlag(kCameraToNDCSet); }
const hsMatrix44& ICheckCameraToNDC() const { if( !ICameraToNDCSet() ) ISetCameraToNDC(); return fCameraToNDC; }
void ISetWorldToNDC() const { fWorldToNDC = GetCameraToNDC() * fWorldToCamera; ISetFlag(kWorldToNDCSet); }
hsBool IWorldToNDCSet() const { return IHasFlag(kWorldToNDCSet); }
bool IWorldToNDCSet() const { return IHasFlag(kWorldToNDCSet); }
const hsMatrix44& ICheckWorldToNDC() const { if( !IWorldToNDCSet() ) ISetWorldToNDC(); return fWorldToNDC; }
hsBool IGetMaxMinsFromBnd(const hsBounds3& bnd, hsPoint3& mins, hsPoint3& maxs) const;
bool IGetMaxMinsFromBnd(const hsBounds3& bnd, hsPoint3& mins, hsPoint3& maxs) const;
void InvalidateTransforms() { ISetFlag(kCameraToNDCSet|kWorldToNDCSet, false); }
// Flags - generic
hsBool IHasFlag(uint32_t f) const { return 0 != (fFlags & f); }
void ISetFlag(uint32_t f, hsBool on=true) const { if(on) fFlags |= f; else fFlags &= ~f; }
bool IHasFlag(uint32_t f) const { return 0 != (fFlags & f); }
void ISetFlag(uint32_t f, bool on=true) const { if(on) fFlags |= f; else fFlags &= ~f; }
};

6
Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp

@ -523,7 +523,7 @@ void pfBoid::ISetupToken(pfProximityDatabase &pd)
fProximityToken = pd.MakeToken(this);
}
hsBool pfBoid::IInBoidNeighborhood(const pfVehicle &other, const float minDistance, const float maxDistance, const float cosMaxAngle)
bool pfBoid::IInBoidNeighborhood(const pfVehicle &other, const float minDistance, const float maxDistance, const float cosMaxAngle)
{
if (&other == this) // abort if we're looking at ourselves
return false;
@ -929,7 +929,7 @@ void pfObjectFlocker::SetNumBoids(uint8_t val)
fNumBoids = val;
}
hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
bool pfObjectFlocker::MsgReceive(plMessage* msg)
{
plInitialAgeStateLoadedMsg* loadMsg = plInitialAgeStateLoadedMsg::ConvertNoRef(msg);
if (loadMsg)
@ -979,7 +979,7 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
return plSingleModifier::MsgReceive(msg);
}
hsBool pfObjectFlocker::IEval(double secs, float del, uint32_t dirty)
bool pfObjectFlocker::IEval(double secs, float del, uint32_t dirty)
{
fFlock.Update(fTarget, del);

20
Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.h

@ -255,7 +255,7 @@ private:
hsPoint3 fCurPos;
hsVector3 fForward;
float fSpeed; // in meters/sec
hsBool fHasLastPos; // does the last position make sense?
bool fHasLastPos; // does the last position make sense?
public:
pfBoidGoal();
~pfBoidGoal() {}
@ -301,7 +301,7 @@ private:
void ISetupToken(pfProximityDatabase &pd);
// Are we in the neighborhood of another boid?
hsBool IInBoidNeighborhood(const pfVehicle &other, const float minDistance, const float maxDistance, const float cosMaxAngle);
bool IInBoidNeighborhood(const pfVehicle &other, const float minDistance, const float maxDistance, const float cosMaxAngle);
// Wander steering
hsVector3 ISteerForWander(float timeDelta);
// Seek the target point
@ -403,7 +403,7 @@ public:
GETINTERFACE_ANY( pfObjectFlocker, plSingleModifier );
virtual void SetTarget(plSceneObject* so);
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
@ -433,10 +433,10 @@ public:
float MinSpeed() const {return fFlock.MinSpeed();}
void SetMinSpeed(float minSpeed) {fFlock.SetMinSpeed(minSpeed);}
hsBool RandomizeAnimStart() const {return fRandomizeAnimationStart;}
void SetRandomizeAnimStart(hsBool val) {fRandomizeAnimationStart = val;}
hsBool UseTargetRotation() const {return fUseTargetRotation;}
void SetUseTargetRotation(hsBool val) {fUseTargetRotation = val;}
bool RandomizeAnimStart() const {return fRandomizeAnimationStart;}
void SetRandomizeAnimStart(bool val) {fRandomizeAnimationStart = val;}
bool UseTargetRotation() const {return fUseTargetRotation;}
void SetUseTargetRotation(bool val) {fUseTargetRotation = val;}
protected:
const static int fFileVersion; // so we don't have to update the global version number when we change
@ -445,10 +445,10 @@ protected:
int fNumBoids;
plKey fBoidKey;
hsBool fUseTargetRotation;
hsBool fRandomizeAnimationStart;
bool fUseTargetRotation;
bool fRandomizeAnimationStart;
virtual hsBool IEval(double secs, float del, uint32_t dirty);
virtual bool IEval(double secs, float del, uint32_t dirty);
};
#endif

2
Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.h

@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class plAnimDebugList
{
public:
hsBool fEnabled;
bool fEnabled;
hsTArray<plKey> fSOKeys;
hsTArray<plKey> fMaterialKeys;

2
Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp

@ -145,7 +145,7 @@ void plBlower::IBlow(double secs, float delSecs)
fCurrDel = del;
}
hsBool plBlower::IEval(double secs, float delSecs, uint32_t dirty)
bool plBlower::IEval(double secs, float delSecs, uint32_t dirty)
{
const float kMaxDelSecs = 0.1f;
if( delSecs > kMaxDelSecs )

2
Sources/Plasma/FeatureLib/pfAnimation/plBlower.h

@ -86,7 +86,7 @@ protected:
void ISetTargetTransform();
void IBlow(double secs, float delSecs);
virtual hsBool IEval(double secs, float del, uint32_t dirty);
virtual bool IEval(double secs, float del, uint32_t dirty);
public:
~plBlower();
plBlower();

6
Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp

@ -64,7 +64,7 @@ plFollowMod::~plFollowMod()
#include "plProfile.h"
plProfile_CreateTimer("FollowMod", "RenderSetup", FollowMod);
hsBool plFollowMod::MsgReceive(plMessage* msg)
bool plFollowMod::MsgReceive(plMessage* msg)
{
plRenderMsg* rend = plRenderMsg::ConvertNoRef(msg);
if( rend )
@ -110,7 +110,7 @@ hsBool plFollowMod::MsgReceive(plMessage* msg)
return plSingleModifier::MsgReceive(msg);
}
hsBool plFollowMod::ICheckLeader()
bool plFollowMod::ICheckLeader()
{
switch( fLeaderType )
{
@ -218,7 +218,7 @@ void plFollowMod::IMoveTarget()
GetTarget()->SetTransform(l2w, w2l);
}
hsBool plFollowMod::IEval(double secs, float del, uint32_t dirty)
bool plFollowMod::IEval(double secs, float del, uint32_t dirty)
{
if( ICheckLeader() )
IMoveTarget();

6
Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.h

@ -84,10 +84,10 @@ protected:
hsMatrix44 fLeaderL2W;
hsMatrix44 fLeaderW2L;
hsBool ICheckLeader();
bool ICheckLeader();
void IMoveTarget();
virtual hsBool IEval(double secs, float del, uint32_t dirty);
virtual bool IEval(double secs, float del, uint32_t dirty);
public:
plFollowMod();
@ -96,7 +96,7 @@ public:
CLASSNAME_REGISTER( plFollowMod );
GETINTERFACE_ANY( plFollowMod, plSingleModifier );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);

10
Sources/Plasma/FeatureLib/pfAnimation/plLightModifier.h

@ -79,7 +79,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool HasAnima() const { return fColorCtl || fAmbientCtl || fSpecularCtl; }
virtual bool HasAnima() const { return fColorCtl || fAmbientCtl || fSpecularCtl; }
// Export only
void SetColorCtl(plController* ctl) { fColorCtl = ctl; }
@ -115,7 +115,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool HasAnima() const { return plLightModifier::HasAnima() || fAttenCtl; }
virtual bool HasAnima() const { return plLightModifier::HasAnima() || fAttenCtl; }
// Export Only
void SetAttenCtl(plController* ctl) { fAttenCtl = ctl; }
@ -128,7 +128,7 @@ class plSpotModifier : public plOmniModifier
{
protected:
plSpotLightInfo* fSpot;
plSpotLightInfo* fSpot;
plController* fInnerCtl;
plController* fOuterCtl;
@ -149,7 +149,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool HasAnima() const { return plOmniModifier::HasAnima() || fInnerCtl || fOuterCtl; }
virtual bool HasAnima() const { return plOmniModifier::HasAnima() || fInnerCtl || fOuterCtl; }
// Export Only
void SetInnerCtl(plController* ctl) { fInnerCtl = ctl; }
@ -184,7 +184,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool HasAnima() const { return plLightModifier::HasAnima() || fWidthCtl || fHeightCtl || fDepthCtl; }
virtual bool HasAnima() const { return plLightModifier::HasAnima() || fWidthCtl || fHeightCtl || fDepthCtl; }
// Export Only
void SetWidthCtl(plController* ctl) { fWidthCtl = ctl; }

14
Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp

@ -107,7 +107,7 @@ void plLineFollowMod::SetOffsetFeet(float f)
}
}
void plLineFollowMod::SetForceToLine(hsBool on)
void plLineFollowMod::SetForceToLine(bool on)
{
if( on )
fFollowFlags |= kForceToLine;
@ -218,7 +218,7 @@ void plLineFollowMod::Write(hsStream* stream, hsResMgr* mgr)
#include "plProfile.h"
plProfile_CreateTimer("LineFollow", "RenderSetup", LineFollow);
hsBool plLineFollowMod::MsgReceive(plMessage* msg)
bool plLineFollowMod::MsgReceive(plMessage* msg)
{
plGenRefMsg* refMsg = plGenRefMsg::ConvertNoRef(msg);
if( refMsg )
@ -337,7 +337,7 @@ void plLineFollowMod::IRegister()
}
}
hsBool plLineFollowMod::IEval(double secs, float del, uint32_t dirty)
bool plLineFollowMod::IEval(double secs, float del, uint32_t dirty)
{
if( !fPath )
return false;
@ -361,7 +361,7 @@ hsBool plLineFollowMod::IEval(double secs, float del, uint32_t dirty)
return true;
}
hsBool plLineFollowMod::IOffsetTargetTransform(hsMatrix44& tgtXfm)
bool plLineFollowMod::IOffsetTargetTransform(hsMatrix44& tgtXfm)
{
hsPoint3 tgtPos = tgtXfm.GetTranslate();
@ -407,7 +407,7 @@ hsBool plLineFollowMod::IOffsetTargetTransform(hsMatrix44& tgtXfm)
return true;
}
hsBool plLineFollowMod::IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm)
bool plLineFollowMod::IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm)
{
float t = fPath->GetExtremePoint(searchPos);
if( fFollowFlags & kFullMatrix )
@ -453,7 +453,7 @@ void plLineFollowMod::ICheckForPop(const hsPoint3& oldPos, const hsPoint3& newPo
fFollowFlags &= ~kSearchPosPop;
}
hsBool plLineFollowMod::IGetSearchPos()
bool plLineFollowMod::IGetSearchPos()
{
hsPoint3 oldPos = fSearchPos;
if( kFollowObject == fFollowMode )
@ -642,7 +642,7 @@ plRailCameraMod::~plRailCameraMod()
{
}
hsBool plRailCameraMod::IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm)
bool plRailCameraMod::IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm)
{
if (fPath->GetFarthest())
{

40
Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.h

@ -97,14 +97,14 @@ protected:
float fOffsetClamp;
float fSpeedClamp;
virtual hsBool IEval(double secs, float del, uint32_t dirty);
virtual bool IEval(double secs, float del, uint32_t dirty);
virtual hsBool IGetSearchPos();
virtual bool IGetSearchPos();
virtual void ISetTargetTransform(int iTarg, const hsMatrix44& tgtXfm);
virtual void ISetPathTransform();
virtual hsBool IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm);
virtual hsBool IOffsetTargetTransform(hsMatrix44& tgtXfm);
virtual bool IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm);
virtual bool IOffsetTargetTransform(hsMatrix44& tgtXfm);
virtual hsMatrix44 ISpeedClamp(plCoordinateInterface* ci, const hsMatrix44& unclTgtXfm);
hsMatrix44 IInterpMatrices(const hsMatrix44& m0, const hsMatrix44& m1, float parm);
void ICheckForPop(const hsPoint3& oldPos, const hsPoint3& newPos);
@ -132,28 +132,28 @@ public:
void SetFollowMode(FollowMode f);
FollowMode GetFollowMode() const { return fFollowMode; }
hsBool HasOffsetFeet() const { return 0 != (fFollowFlags & kOffsetFeet); }
hsBool HasOffsetDegrees() const { return 0 != (fFollowFlags & kOffsetAng); }
hsBool HasOffset() const { return 0 != (fFollowFlags & kOffset); }
hsBool HasOffsetClamp() const { return 0 != (fFollowFlags & kOffsetClamp); }
hsBool HasSpeedClamp() const { return 0 != (fFollowFlags & kSpeedClamp); }
bool HasOffsetFeet() const { return 0 != (fFollowFlags & kOffsetFeet); }
bool HasOffsetDegrees() const { return 0 != (fFollowFlags & kOffsetAng); }
bool HasOffset() const { return 0 != (fFollowFlags & kOffset); }
bool HasOffsetClamp() const { return 0 != (fFollowFlags & kOffsetClamp); }
bool HasSpeedClamp() const { return 0 != (fFollowFlags & kSpeedClamp); }
void SetOffsetFeet(float f);
float GetOffsetFeet() const { return fOffset; }
float GetOffsetFeet() const { return fOffset; }
void SetOffsetDegrees(float f);
float GetOffsetDegrees() const { return hsRadiansToDegrees(fOffset); }
float GetOffsetDegrees() const { return hsRadiansToDegrees(fOffset); }
void SetOffsetClamp(float f);
float GetOffsetClamp() const { return fOffsetClamp; }
float GetOffsetClamp() const { return fOffsetClamp; }
void SetForceToLine(hsBool on);
hsBool GetForceToLine() const { return 0 != (fFollowFlags & kForceToLine); }
void SetForceToLine(bool on);
bool GetForceToLine() const { return 0 != (fFollowFlags & kForceToLine); }
void SetSpeedClamp(float feetPerSec);
float GetSpeedClamp() const { return fSpeedClamp; }
float GetSpeedClamp() const { return fSpeedClamp; }
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
virtual void AddTarget(plSceneObject* so);
virtual void RemoveTarget(plSceneObject* so);
@ -180,12 +180,12 @@ public:
protected:
virtual void ISetTargetTransform(int iTarg, const hsMatrix44& tgtXfm) {fDesiredMatrix = tgtXfm;}
virtual hsBool IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm);
virtual bool IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm);
hsMatrix44 fDesiredMatrix;
float fCurrentTime;
float fTargetTime;
float fCurrentTime;
float fTargetTime;
hsPoint3 fGoal;
hsBool fFarthest;
bool fFarthest;
};
#endif // plLineFollowMod_inc

9
Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp

@ -141,7 +141,7 @@ float plRandomCommandMod::IGetDelay(float len) const
return delay;
}
hsBool plRandomCommandMod::ISelectNext(int ncmds)
bool plRandomCommandMod::ISelectNext(int ncmds)
{
if( fMode & kSequential )
{
@ -200,11 +200,6 @@ void plRandomCommandMod::IStop()
fState |= kStopped;
}
hsBool plRandomCommandMod::IStopped() const
{
return 0 != (fState & kStopped);
}
void plRandomCommandMod::IPlayNextIfMaster()
{
if( !fTarget )
@ -219,7 +214,7 @@ void plRandomCommandMod::IPlayNextIfMaster()
IPlayNext();
}
hsBool plRandomCommandMod::MsgReceive(plMessage* msg)
bool plRandomCommandMod::MsgReceive(plMessage* msg)
{
// plAnimCmdMsg - interpret start/stop appropriately.
// could overinterpret set loop points to limit range of

20
Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.h

@ -78,7 +78,7 @@ protected:
void IStart();
virtual void IStop();
hsBool IStopped() const;
bool IStopped() const { return hsCheckBits(fState, kStopped); }
void IRetry(float secs);
virtual void IPlayNextIfMaster();
@ -87,14 +87,14 @@ protected:
float IGetDelay(float len) const;
int IExcludeSelections(int ncmds);
hsBool ISelectNext(int nAnim); // return false if we should stop, else set fCurrent to next index
bool ISelectNext(int nAnim); // return false if we should stop, else set fCurrent to next index
// Once fCurrent is set to the next animation index to play,
// IPlayNext() does whatever it takes to actually play it.
virtual void IPlayNext() = 0;
// We only act in response to messages.
virtual hsBool IEval(double secs, float del, uint32_t dirty) { return false; }
virtual bool IEval(double secs, float del, uint32_t dirty) { return false; }
public:
plRandomCommandMod();
@ -103,23 +103,23 @@ public:
CLASSNAME_REGISTER( plRandomCommandMod );
GETINTERFACE_ANY( plRandomCommandMod, plSingleModifier );
virtual hsBool MsgReceive(plMessage* pMsg);
virtual bool MsgReceive(plMessage* pMsg);
virtual void Read(hsStream* s, hsResMgr* mgr);
virtual void Write(hsStream* s, hsResMgr* mgr);
// Export only
void SetMode(uint8_t m) { fMode = m; }
uint8_t GetMode() const { return fMode; }
uint8_t GetMode() const { return fMode; }
void SetState(uint8_t s) { fState = s; }
uint8_t GetState() const { return fState; }
uint8_t GetState() const { return fState; }
void SetMinDelay(float f) { fMinDelay = f; }
float GetMinDelay() const { return fMinDelay; }
void SetMinDelay(float f) { fMinDelay = f; }
float GetMinDelay() const { return fMinDelay; }
void SetMaxDelay(float f) { fMaxDelay = f; }
float GetMaxDelay() const { return fMaxDelay; }
void SetMaxDelay(float f) { fMaxDelay = f; }
float GetMaxDelay() const { return fMaxDelay; }
};

8
Sources/Plasma/FeatureLib/pfAnimation/plStereizer.cpp

@ -107,7 +107,7 @@ void plStereizer::Write(hsStream* stream, hsResMgr* mgr)
fInitPos.Write(stream);
}
hsBool plStereizer::MsgReceive(plMessage* msg)
bool plStereizer::MsgReceive(plMessage* msg)
{
plListenerMsg* listenMsg = plListenerMsg::ConvertNoRef(msg);
if( listenMsg )
@ -119,12 +119,12 @@ hsBool plStereizer::MsgReceive(plMessage* msg)
return plSingleModifier::MsgReceive(msg);
}
hsBool plStereizer::IEval(double secs, float del, uint32_t dirty)
bool plStereizer::IEval(double secs, float del, uint32_t dirty)
{
return false;
}
hsBool plStereizer::Stereize()
bool plStereizer::Stereize()
{
plSceneObject* targ = GetTarget();
if( !targ )
@ -286,7 +286,7 @@ plCoordinateInterface* plStereizer::IGetParent() const
// Or in simpler terms, I want to do it one way, Brice wants to do
// it another, and since either would work for this, we're waiting
// for a tie breaker case that gives one way or the other an advantage.
hsBool plStereizer::CheckForMaster()
bool plStereizer::CheckForMaster()
{
ISetHasMaster(false);
plSceneObject* targ = GetTarget();

16
Sources/Plasma/FeatureLib/pfAnimation/plStereizer.h

@ -82,7 +82,7 @@ protected:
hsVector3 fListDirection;
hsVector3 fListUp;
virtual hsBool IEval(double secs, float del, uint32_t dirty);
virtual bool IEval(double secs, float del, uint32_t dirty);
hsPoint3 IGetLocalizedPos(const hsVector3& posToList, float distToList) const;
hsPoint3 IGetAmbientPos() const;
@ -92,7 +92,7 @@ protected:
plCoordinateInterface* IGetParent() const;
void ISetHasMaster(hsBool on) { if(on)SetFlag(kHasMaster); else ClearFlag(kHasMaster); }
void ISetHasMaster(bool on) { if(on)SetFlag(kHasMaster); else ClearFlag(kHasMaster); }
public:
plStereizer();
@ -104,9 +104,9 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
hsBool Stereize();
bool Stereize();
void SetFromListenerMsg(const plListenerMsg* listMsg);
void SetAmbientDist(float d) { fAmbientDist = d; }
@ -124,8 +124,8 @@ public:
void SetSepAngle(float rads);
float GetSepAngle() const;
void SetAsLeftChannel(hsBool on) { if(on)SetFlag(kLeftChannel); else ClearFlag(kLeftChannel); }
hsBool IsLeftChannel() const { return HasFlag(kLeftChannel); }
void SetAsLeftChannel(bool on) { if(on)SetFlag(kLeftChannel); else ClearFlag(kLeftChannel); }
bool IsLeftChannel() const { return HasFlag(kLeftChannel); }
void SetParentInitPos(const hsPoint3& pos) { fInitPos = pos; }
const hsPoint3& GetParentInitPos() const { return fInitPos; }
@ -133,8 +133,8 @@ public:
void SetWorldInitPos(const hsPoint3& pos);
hsPoint3 GetWorldInitPos() const;
hsBool CheckForMaster();
hsBool HasMaster() const { return HasFlag(kHasMaster); }
bool CheckForMaster();
bool HasMaster() const { return HasFlag(kHasMaster); }
};
#endif // plStereizer_inc

8
Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp

@ -129,12 +129,12 @@ void plViewFaceModifier::SetTarget(plSceneObject* so)
plgDispatch::Dispatch()->RegisterForExactType(plArmatureUpdateMsg::Index(), GetKey());
}
hsBool plViewFaceModifier::IEval(double secs, float del, uint32_t dirty)
bool plViewFaceModifier::IEval(double secs, float del, uint32_t dirty)
{
return false;
}
hsBool plViewFaceModifier::IFacePoint(plPipeline* pipe, const hsPoint3& at)
bool plViewFaceModifier::IFacePoint(plPipeline* pipe, const hsPoint3& at)
{
#if 1 // BOUNDSTEST
extern int mfCurrentTest;
@ -272,7 +272,7 @@ hsBool plViewFaceModifier::IFacePoint(plPipeline* pipe, const hsPoint3& at)
#include "plProfile.h"
plProfile_CreateTimer("ViewFacing", "RenderSetup", ViewFace);
hsBool plViewFaceModifier::MsgReceive(plMessage* msg)
bool plViewFaceModifier::MsgReceive(plMessage* msg)
{
plRenderMsg* rend = plRenderMsg::ConvertNoRef(msg);
@ -438,7 +438,7 @@ plViewFaceModifier::FollowMode plViewFaceModifier::GetFollowMode() const
}
void plViewFaceModifier::SetOffset(const hsVector3& off, hsBool local)
void plViewFaceModifier::SetOffset(const hsVector3& off, bool local)
{
fOffset = off;
if( local )

16
Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.h

@ -83,8 +83,8 @@ protected:
hsBounds3Ext fMaxBounds;
virtual hsBool IFacePoint(plPipeline* pipe, const hsPoint3& at);
virtual hsBool IEval(double secs, float del, uint32_t dirty);
virtual bool IFacePoint(plPipeline* pipe, const hsPoint3& at);
virtual bool IEval(double secs, float del, uint32_t dirty);
enum RefType
{
@ -106,7 +106,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
// ViewFace specific
void SetScale(const hsVector3& s) { fScale = s; }
@ -116,7 +116,7 @@ public:
void SetMaxBounds(const hsBounds3Ext& bnd);
const hsBounds3Ext& GetMaxBounds() const { return fMaxBounds; }
hsBool HaveMaxBounds() const { return HasFlag(kMaxBounds); }
bool HaveMaxBounds() const { return HasFlag(kMaxBounds); }
enum FollowMode
{
@ -129,12 +129,12 @@ public:
FollowMode GetFollowMode() const;
plSceneObject* GetFollowObject() const { return fFaceObj; }
void SetOffsetActive(hsBool on) { if(on) SetFlag(kOffset); else ClearFlag(kOffset); }
hsBool GetOffsetActive() const { return HasFlag(kOffset); }
void SetOffsetActive(bool on) { if(on) SetFlag(kOffset); else ClearFlag(kOffset); }
bool GetOffsetActive() const { return HasFlag(kOffset); }
void SetOffset(const hsVector3& off, hsBool local=true);
void SetOffset(const hsVector3& off, bool local=true);
const hsVector3& GetOffset() const { return fOffset; }
hsBool GetOffsetLocal() const { return HasFlag(kOffsetLocal); }
bool GetOffsetLocal() const { return HasFlag(kOffsetLocal); }
};
#endif // plViewFaceModifier_inc

10
Sources/Plasma/FeatureLib/pfAudio/plListener.cpp

@ -59,9 +59,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvatar/plArmatureMod.h"
#include "plAvatar/plAvCallbackAction.h"
hsBool plListener::fPrintDbgInfo = false;
bool plListener::fPrintDbgInfo = false;
hsBool plListener::IEval(double secs, float del, uint32_t dirty)
bool plListener::IEval(double secs, float del, uint32_t dirty)
{
// if (!plgAudioSys::Active())
// return true;
@ -204,7 +204,7 @@ hsBool plListener::IEval(double secs, float del, uint32_t dirty)
return true;
}
void plListener::ISetRef( const plKey &ref, hsBool binding, int type )
void plListener::ISetRef( const plKey &ref, bool binding, int type )
{
if( binding )
hsgResMgr::ResMgr()->AddViaNotify( ref, new plGenRefMsg( GetKey(), plGenRefMsg::kOnReplace, -1, type ), plRefFlags::kPassiveRef );
@ -243,12 +243,12 @@ void plListener::ICheckAudio( void ) const
plgAudioSys::SetMuted( true );
}
hsBool plListener::MsgReceive(plMessage* msg)
bool plListener::MsgReceive(plMessage* msg)
{
plSetListenerMsg *setMsg = plSetListenerMsg::ConvertNoRef( msg );
if( setMsg != nil )
{
hsBool useVCam;
bool useVCam;
if( setMsg->GetType() & plSetListenerMsg::kVCam )
{

14
Sources/Plasma/FeatureLib/pfAudio/plListener.h

@ -58,9 +58,9 @@ public:
CLASSNAME_REGISTER( plListener );
GETINTERFACE_ANY( plListener, plSingleModifier );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
static void ShowDebugInfo( hsBool s ) { fPrintDbgInfo = s; }
static void ShowDebugInfo( bool s ) { fPrintDbgInfo = s; }
// Get info for which object these things are attached to - camera or refObject
uint8_t GetAttachedPosType() { return (uint8_t)fPosRatio; }
@ -83,13 +83,13 @@ protected:
plVirtualCam1* fVCam;
float fPosRatio, fFacingRatio, fVelRatio; // 0 is vCam, 1 is refObject
hsBool fInitMe;
float fPosRatio, fFacingRatio, fVelRatio; // 0 is vCam, 1 is refObject
bool fInitMe;
static hsBool fPrintDbgInfo;
static bool fPrintDbgInfo;
virtual hsBool IEval(double secs, float del, uint32_t dirty);
void ISetRef( const plKey &ref, hsBool binding, int type );
virtual bool IEval(double secs, float del, uint32_t dirty);
void ISetRef( const plKey &ref, bool binding, int type );
void ICheckAudio( void ) const;
void IEnsureVCamValid( void );

4
Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp

@ -317,7 +317,7 @@ void plRandomSoundMod::Write(hsStream *s, hsResMgr *mgr)
}
}
void plRandomSoundMod::ForceSoundLoadState( hsBool loaded )
void plRandomSoundMod::ForceSoundLoadState( bool loaded )
{
uint16_t i, j;
@ -370,7 +370,7 @@ void plRandomSoundMod::ForceSoundLoadState( hsBool loaded )
}
// Overload this to handle volume changes
hsBool plRandomSoundMod::MsgReceive(plMessage* msg)
bool plRandomSoundMod::MsgReceive(plMessage* msg)
{
plAnimCmdMsg* anim = plAnimCmdMsg::ConvertNoRef(msg);
if( anim )

6
Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.h

@ -72,7 +72,7 @@ protected:
plRandomSoundModGroup *fGroups;
std::vector<uint16_t> fActiveList; // list of sounds we're allowed to choose
int fOldPriority; // old sound priority
hsBool fFirstTimePlay;
bool fFirstTimePlay;
virtual void IPlayNext();
virtual void IPlayNextIfMaster();
@ -93,8 +93,8 @@ public:
void SetCurrentGroup(uint16_t group);
void ForceSoundLoadState( hsBool loaded );
hsBool MsgReceive(plMessage* msg);
void ForceSoundLoadState( bool loaded );
bool MsgReceive(plMessage* msg);
float GetVolume();
// EXPORT ONLY

2
Sources/Plasma/FeatureLib/pfCamera/pfCameraProxy.cpp

@ -57,7 +57,7 @@ plCameraProxy::~plCameraProxy()
{
}
hsBool plCameraProxy::Init(plVirtualCam1* aud)
bool plCameraProxy::Init(plVirtualCam1* aud)
{
plProxyGen::Init(aud);

2
Sources/Plasma/FeatureLib/pfCamera/pfCameraProxy.h

@ -60,7 +60,7 @@ public:
plCameraProxy();
virtual ~plCameraProxy();
hsBool Init(plVirtualCam1* aud);
bool Init(plVirtualCam1* aud);
plSceneNode* node;
};

48
Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp

@ -72,7 +72,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvatar/plAvBrainHuman.h"
#include "plNetClient/plNetClientMgr.h"
hsBool plCameraBrain1_FirstPerson::fDontFade = false;
bool plCameraBrain1_FirstPerson::fDontFade = false;
float plCameraBrain1::fFallAccel = 20.0f;
float plCameraBrain1::fFallDecel = 5.0f;
float plCameraBrain1::fFallVelocity = 50.0f;
@ -153,7 +153,7 @@ void plCameraBrain1::AddTarget()
}
// called when we are pushed on top of the camera stack (or re-activated by another popping off directly above)
void plCameraBrain1::Push(hsBool recenter)
void plCameraBrain1::Push(bool recenter)
{
if (fFlags.IsBitSet(kRailComponent))
{
@ -203,7 +203,7 @@ void plCameraBrain1::SetZoomParams(float max, float min, float rate)
// periodic update - forced means we are forcing an update at a non-normal time to "prime" the camera
// into position before it renders the first time (hence the fake 10 second frame delta)
void plCameraBrain1::Update(hsBool forced)
void plCameraBrain1::Update(bool forced)
{
double secs = hsTimer::GetDelSysSeconds();
if (forced)
@ -259,7 +259,7 @@ void plCameraBrain1::IAnimateFOV(double time)
// move the camera's origin point (not where it is looking) toward where it is going
void plCameraBrain1::IMoveTowardGoal(double elapsedTime)
{
hsBool current = plVirtualCam1::Instance()->IsCurrentCamera(GetCamera());
bool current = plVirtualCam1::Instance()->IsCurrentCamera(GetCamera());
if (fFlags.IsBitSet(kCutPos) || fFlags.IsBitSet(kNonPhys) || !current)
{
@ -334,7 +334,7 @@ void plCameraBrain1::SetMovementFlag(int f)
void plCameraBrain1::IPointTowardGoal(double elapsedTime)
{
hsBool current = plVirtualCam1::Instance()->IsCurrentCamera(GetCamera());
bool current = plVirtualCam1::Instance()->IsCurrentCamera(GetCamera());
if (fFlags.IsBitSet(kCutPOA) || fFlags.IsBitSet(kNonPhys) || !current)
{
@ -452,7 +452,7 @@ float plCameraBrain1::IClampVelocity(hsVector3* vel, float maxSpeed, double elap
return distMoved;
}
hsBool plCameraBrain1::IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal)
bool plCameraBrain1::IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal)
{
if (decelSpeed == 0)
// no deceleration
@ -535,7 +535,7 @@ void plCameraBrain1::Write(hsStream* stream, hsResMgr* mgr)
stream->WriteLEFloat(fZoomMin);
stream->WriteLEFloat(fZoomMax);
}
hsBool plCameraBrain1::MsgReceive(plMessage* msg)
bool plCameraBrain1::MsgReceive(plMessage* msg)
{
plCameraMsg* pCamMsg = plCameraMsg::ConvertNoRef(msg);
if (pCamMsg)
@ -743,7 +743,7 @@ plCameraBrain1_Drive::~plCameraBrain1_Drive()
}
void plCameraBrain1_Drive::Push(hsBool recenter)
void plCameraBrain1_Drive::Push(bool recenter)
{
plCameraBrain1::Push(recenter);
plInputManager::SetRecenterMouse(true);
@ -757,7 +757,7 @@ void plCameraBrain1_Drive::Pop()
//
// Update Method
//
void plCameraBrain1_Drive::Update(hsBool forced)
void plCameraBrain1_Drive::Update(bool forced)
{
hsVector3 neg_up = -1 * fUp;
fTargetMatrix.Make(&fGoal, &fPOAGoal, &neg_up);
@ -882,7 +882,7 @@ void plCameraBrain1_Drive::Update(hsBool forced)
fCamera->SetTargetPOA(fPOAGoal);
}
hsBool plCameraBrain1_Drive::MsgReceive(plMessage* msg)
bool plCameraBrain1_Drive::MsgReceive(plMessage* msg)
{
plMouseEventMsg* pMouseMsg = plMouseEventMsg::ConvertNoRef(msg);
if( pMouseMsg )
@ -992,7 +992,7 @@ void plCameraBrain1_Avatar::Pop()
plCameraBrain1::Pop();
}
void plCameraBrain1_Avatar::Push(hsBool recenter)
void plCameraBrain1_Avatar::Push(bool recenter)
{
bObscured = false;
fFallTimer = 0.0f;
@ -1003,7 +1003,7 @@ void plCameraBrain1_Avatar::Push(hsBool recenter)
//
// Update Method
//
void plCameraBrain1_Avatar::Update(hsBool forced)
void plCameraBrain1_Avatar::Update(bool forced)
{
if (!GetSubject())
return;
@ -1139,7 +1139,7 @@ void plCameraBrain1_Avatar::IHandleObstacle()
// swing around the 'obstacle'
}
void plCameraBrain1_Avatar::ISendFadeMsg(hsBool fade)
void plCameraBrain1_Avatar::ISendFadeMsg(bool fade)
{
if (plVirtualCam1::IsCurrentCamera(GetCamera()))
{
@ -1158,7 +1158,7 @@ void plCameraBrain1_Avatar::ISendFadeMsg(hsBool fade)
}
}
hsBool plCameraBrain1_Avatar::MsgReceive(plMessage* msg)
bool plCameraBrain1_Avatar::MsgReceive(plMessage* msg)
{
plLOSHitMsg *pLOSMsg = plLOSHitMsg::ConvertNoRef( msg );
if( pLOSMsg )
@ -1295,7 +1295,7 @@ plCameraBrain1_FirstPerson::~plCameraBrain1_FirstPerson()
{
}
hsBool plCameraBrain1_FirstPerson::MsgReceive(plMessage* msg)
bool plCameraBrain1_FirstPerson::MsgReceive(plMessage* msg)
{
plGenRefMsg* pRefMsg = plGenRefMsg::ConvertNoRef(msg);
@ -1429,7 +1429,7 @@ void plCameraBrain1_FirstPerson::CalculatePosition()
}
void plCameraBrain1_FirstPerson::Push(hsBool recenter)
void plCameraBrain1_FirstPerson::Push(bool recenter)
{
if (!GetSubject())
return;
@ -1490,7 +1490,7 @@ void plCameraBrain1_Fixed::Write(hsStream* stream, hsResMgr* mgr)
mgr->WriteKey(stream, fTargetPoint);
}
void plCameraBrain1_Fixed::Update(hsBool forced)
void plCameraBrain1_Fixed::Update(bool forced)
{
double secs = hsTimer::GetDelSysSeconds();
if (forced)
@ -1563,7 +1563,7 @@ void plCameraBrain1_Fixed::CalculatePosition()
{
}
hsBool plCameraBrain1_Fixed::MsgReceive(plMessage* msg)
bool plCameraBrain1_Fixed::MsgReceive(plMessage* msg)
{
plGenRefMsg* pRefMsg = plGenRefMsg::ConvertNoRef(msg);
if (pRefMsg)
@ -1611,7 +1611,7 @@ plCameraBrain1_Circle::~plCameraBrain1_Circle()
//
//
//
void plCameraBrain1_Circle::Update(hsBool forced)
void plCameraBrain1_Circle::Update(bool forced)
{
double secs = hsTimer::GetDelSysSeconds();
if (forced)
@ -1651,7 +1651,7 @@ void plCameraBrain1_Circle::Update(hsBool forced)
//
// keep us on the circle
//
hsPoint3 plCameraBrain1_Circle::MoveTowardsFromGoal(const hsPoint3* fromGoal, double secs, hsBool warp)
hsPoint3 plCameraBrain1_Circle::MoveTowardsFromGoal(const hsPoint3* fromGoal, double secs, bool warp)
{
if (fCurRad != fGoalRad)
@ -1659,7 +1659,7 @@ hsPoint3 plCameraBrain1_Circle::MoveTowardsFromGoal(const hsPoint3* fromGoal, do
float dist = hsABS(fGoalRad-fCurRad);
hsAssert(dist>=0 && dist<=kTwoPI, "illegal radian diff");
hsBool mustWrap = (dist > M_PI); // go opposite direction for shortcut and wrap
bool mustWrap = (dist > M_PI); // go opposite direction for shortcut and wrap
// compute speed
float speed;
@ -1676,7 +1676,7 @@ hsPoint3 plCameraBrain1_Circle::MoveTowardsFromGoal(const hsPoint3* fromGoal, do
if (mustWrap)
{
fCurRad-=speed;
hsBool didWrap=false;
bool didWrap=false;
while(fCurRad<0)
{
didWrap=true;
@ -1697,7 +1697,7 @@ hsPoint3 plCameraBrain1_Circle::MoveTowardsFromGoal(const hsPoint3* fromGoal, do
if (mustWrap)
{
fCurRad+=speed;
hsBool didWrap=false;
bool didWrap=false;
while(fCurRad>kTwoPI)
{
didWrap=true;
@ -1791,7 +1791,7 @@ void plCameraBrain1_Circle::Read(hsStream* stream, hsResMgr* mgr)
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey());
}
hsBool plCameraBrain1_Circle::MsgReceive(plMessage* msg)
bool plCameraBrain1_Circle::MsgReceive(plMessage* msg)
{
plGenRefMsg* pRefMsg = plGenRefMsg::ConvertNoRef(msg);
if (pRefMsg)

62
Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.h

@ -103,8 +103,8 @@ public:
const plCameraModifier1* GetCamera() { return fCamera; }
virtual void Update(hsBool forced = false);
virtual hsBool MsgReceive(plMessage* msg);
virtual void Update(bool forced = false);
virtual bool MsgReceive(plMessage* msg);
virtual plSceneObject* GetSubject();
virtual void SetSubject(plSceneObject* sub);
@ -116,15 +116,15 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool GetFaded() { return false; }
virtual hsBool SetFaded(hsBool b) { return false; }
virtual bool GetFaded() { return false; }
virtual bool SetFaded(bool b) { return false; }
hsBool HasMovementFlag(int f) { return fMoveFlags.IsBitSet(f); }
bool HasMovementFlag(int f) { return fMoveFlags.IsBitSet(f); }
void SetMovementFlag(int f);
void ClearMovementFlag(int which) { fMoveFlags.ClearBit( which ); }
void SetFlags(int i) { fFlags.SetBit(i); }
void ClearFlags(int which) { fFlags.ClearBit( which ); }
hsBool HasFlag(int f) { return fFlags.IsBitSet(f); }
bool HasFlag(int f) { return fFlags.IsBitSet(f); }
void SetGoal(hsPoint3 pt) { fGoal = pt; }
void SetPOAGoal(hsPoint3 pt) { fPOAGoal = pt; }
@ -141,7 +141,7 @@ public:
hsPoint3 GetGoal() { return fGoal; }
hsPoint3 GetPOAGoal() { return fPOAGoal; }
virtual void Push(hsBool recenter = true);
virtual void Push(bool recenter = true);
virtual void Pop();
float GetVelocity() { return fVelocity; }
@ -182,7 +182,7 @@ protected:
double elapsedTime);
float IClampVelocity(hsVector3* vel, float maxSpeed, double elapsedTime);
hsBool IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal);
bool IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal);
plCameraModifier1* fCamera;
plKey fSubjectKey;
@ -225,11 +225,11 @@ class plCameraBrain1_Drive : public plCameraBrain1
protected:
hsPoint3 fDesiredPosition;
hsPoint3 fFacingTarget;
hsBool bUseDesiredFacing;
bool bUseDesiredFacing;
float deltaX;
float deltaY;
hsBool bDisregardY; // these are here to prevent
hsBool bDisregardX; // the camera from jumping when the mouse cursor recenters / wraps around.
bool bDisregardY; // these are here to prevent
bool bDisregardX; // the camera from jumping when the mouse cursor recenters / wraps around.
hsVector3 fUp;
public:
@ -243,9 +243,9 @@ public:
CLASSNAME_REGISTER( plCameraBrain1_Drive );
GETINTERFACE_ANY( plCameraBrain1_Drive, plCameraBrain1 );
virtual void Update(hsBool forced = false);
virtual hsBool MsgReceive(plMessage* msg);
virtual void Push(hsBool recenter = true);
virtual void Update(bool forced = false);
virtual bool MsgReceive(plMessage* msg);
virtual void Push(bool recenter = true);
virtual void Pop();
static float fAcceleration;
@ -267,8 +267,8 @@ public:
GETINTERFACE_ANY( plCameraBrain1_Avatar, plCameraBrain1 );
virtual void Update(hsBool forced = false);
virtual hsBool MsgReceive(plMessage* msg);
virtual void Update(bool forced = false);
virtual bool MsgReceive(plMessage* msg);
virtual void CalculatePosition();
hsVector3 GetOffset() { return fOffset; }
@ -277,21 +277,21 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool GetFaded() { return fFaded; }
virtual hsBool SetFaded(hsBool b) { fFaded = b; return true; }
virtual bool GetFaded() { return fFaded; }
virtual bool SetFaded(bool b) { fFaded = b; return true; }
virtual void Pop();
virtual void Push(hsBool recenter = true);
virtual void Push(bool recenter = true);
protected:
void ISendFadeMsg(hsBool fade);
void ISendFadeMsg(bool fade);
void IHandleObstacle();
hsPoint3 fHitPoint;
hsVector3 fOffset;
hsVector3 fHitNormal;
hsBool bObscured;
hsBool fFaded;
bool bObscured;
bool fFaded;
plSceneObject* fObstacle;
};
@ -307,12 +307,12 @@ public:
GETINTERFACE_ANY( plCameraBrain1_FirstPerson, plCameraBrain1_Avatar );
virtual void CalculatePosition();
virtual void Push(hsBool recenter = true);
virtual void Push(bool recenter = true);
virtual void Pop();
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
// for console hack
static hsBool fDontFade;
static bool fDontFade;
protected:
plSceneObject* fPosNode;
@ -333,9 +333,9 @@ public:
void SetTargetPoint(plCameraModifier1* pt) { fTargetPoint = pt; }
virtual void Update(hsBool forced = false);
virtual void Update(bool forced = false);
void CalculatePosition();
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
@ -382,9 +382,9 @@ public:
virtual void Read(hsStream *stream, hsResMgr* mgr);
virtual void Write(hsStream *stream, hsResMgr* mgr);
virtual hsPoint3 MoveTowardsFromGoal(const hsPoint3* fromGoal, double secs, hsBool warp = false);
virtual void Update(hsBool forced = false);
virtual hsBool MsgReceive(plMessage* msg);
virtual hsPoint3 MoveTowardsFromGoal(const hsPoint3* fromGoal, double secs, bool warp = false);
virtual void Update(bool forced = false);
virtual bool MsgReceive(plMessage* msg);
uint32_t GetCircleFlags() { return fCircleFlags; }
hsPoint3* GetCenter() { return &fCenter; } // use GetCenterPoint
@ -396,7 +396,7 @@ public:
void SetCircleFlags(uint32_t f) { fCircleFlags|=f; }
void SetCenter(hsPoint3* ctr) { fCenter = *ctr; } // Circle lies in the plane z = ctr->z
void SetRadius(float radius) { fRadius = radius; }
void SetFarCircleCam(hsBool farType) { if (farType) fCircleFlags |= kFarthest; else fCircleFlags &= ~kFarthest; }
void SetFarCircleCam(bool farType) { if (farType) fCircleFlags |= kFarthest; else fCircleFlags &= ~kFarthest; }
void SetCenterObjectKey(plKey k);
void SetPOAObject(plSceneObject* pObj) { fPOAObj = pObj; }

20
Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp

@ -137,34 +137,34 @@ plSceneObject* plCameraModifier1::GetSubject()
return fSubObj;
}
void plCameraModifier1::SetFOVw(float f, hsBool fUpdateVCam)
void plCameraModifier1::SetFOVw(float f, bool fUpdateVCam)
{
fFOVw = f;
if (plVirtualCam1::Instance() && fUpdateVCam)
plVirtualCam1::SetFOV(fFOVw, fFOVh, this);
}
void plCameraModifier1::SetFOVh(float f, hsBool fUpdateVCam)
void plCameraModifier1::SetFOVh(float f, bool fUpdateVCam)
{
fFOVh = f;
if (plVirtualCam1::Instance() && fUpdateVCam)
plVirtualCam1::SetFOV(fFOVw, fFOVh, this);
}
hsBool plCameraModifier1::SetFaded(hsBool b)
bool plCameraModifier1::SetFaded(bool b)
{
if (GetBrain())
return GetBrain()->SetFaded(b);
return false;
}
hsBool plCameraModifier1::GetFaded()
bool plCameraModifier1::GetFaded()
{
if (GetBrain())
return GetBrain()->GetFaded();
return false;
}
hsBool plCameraModifier1::MsgReceive(plMessage* msg)
bool plCameraModifier1::MsgReceive(plMessage* msg)
{
if (GetBrain())
GetBrain()->MsgReceive(msg);
@ -257,7 +257,7 @@ void plCameraModifier1::Update()
GetBrain()->AddTarget(); // update the brain's target
}
hsBool moveInSub = !(GetBrain()->HasFlag(plCameraBrain1::kIgnoreSubworldMovement));
bool moveInSub = !(GetBrain()->HasFlag(plCameraBrain1::kIgnoreSubworldMovement));
if (moveInSub && GetBrain()->GetSubject())
{
@ -330,9 +330,9 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr)
{
plKey key = mgr->ReadKey(stream);
hsBool cutpos = stream->ReadBool();
hsBool cutpoa = stream->ReadBool();
hsBool ignore = stream->ReadBool();
bool cutpos = stream->ReadBool();
bool cutpoa = stream->ReadBool();
bool ignore = stream->ReadBool();
float v = stream->ReadLEScalar();
float a = stream->ReadLEScalar();
float d = stream->ReadLEScalar();
@ -424,7 +424,7 @@ void plCameraModifier1::Write(hsStream* stream, hsResMgr* mgr)
stream->WriteBool(fResetAnimOnPop);
}
void plCameraModifier1::Push(hsBool recenter)
void plCameraModifier1::Push(bool recenter)
{
if (fAnimated)
{

34
Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.h

@ -72,9 +72,9 @@ struct CamTrans
}
plKey fTransTo;
hsBool fCutPos;
hsBool fCutPOA;
hsBool fIgnore;
bool fCutPos;
bool fCutPOA;
bool fIgnore;
float fAccel;
float fDecel;
float fVelocity;
@ -96,7 +96,7 @@ class plCameraModifier1 : public plSingleModifier
protected:
void Output();
virtual hsBool IEval(double secs, float del, uint32_t dirty) { return true; }
virtual bool IEval(double secs, float del, uint32_t dirty) { return true; }
public:
@ -106,7 +106,7 @@ public:
CLASSNAME_REGISTER( plCameraModifier1 );
GETINTERFACE_ANY( plCameraModifier1, plSingleModifier );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
void Initialize();
virtual void Update();
@ -130,10 +130,10 @@ public:
void SetSubworldPOA(hsPoint3 pos) { fLastSubPOA = pos; }
float GetFOVw() { return fFOVw; }
float GetFOVh() { return fFOVh; }
void SetFOVw(float f, hsBool fUpdateVCam = true);
void SetFOVh(float f, hsBool fUpdateVCam = true);
hsBool GetInSubworld() { return fInSubLastUpdate; }
void InSubworld(hsBool b) { fInSubLastUpdate = b; }
void SetFOVw(float f, bool fUpdateVCam = true);
void SetFOVh(float f, bool fUpdateVCam = true);
bool GetInSubworld() { return fInSubLastUpdate; }
void InSubworld(bool b) { fInSubLastUpdate = b; }
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
void AddTrans(CamTrans* t) { fTrans.Append(t); }
@ -142,14 +142,14 @@ public:
void SetSubject(plSceneObject* pObj);
plSceneObject* GetSubject();
virtual void Push(hsBool recenter = true);
virtual void Push(bool recenter = true);
virtual void Pop();
virtual hsBool GetFaded();
virtual hsBool SetFaded(hsBool b);
virtual bool GetFaded();
virtual bool SetFaded(bool b);
hsBool IsAnimated() { return fAnimated; }
void SetAnimCommands(hsBool a, hsBool b, hsBool c) { fStartAnimOnPush = a; fStopAnimOnPop = b; fResetAnimOnPop = c; }
bool IsAnimated() { return fAnimated; }
void SetAnimCommands(bool a, bool b, bool c) { fStartAnimOnPush = a; fStopAnimOnPop = b; fResetAnimOnPop = c; }
private:
hsPoint3 fFrom;
@ -161,11 +161,11 @@ private:
float fFOVh;
hsTArray<plMessage*> fMessageQueue;
hsTArray<plCameraMsg*> fFOVInstructions;
hsBool fAnimated, fStartAnimOnPush, fStopAnimOnPop, fResetAnimOnPop;
bool fAnimated, fStartAnimOnPush, fStopAnimOnPop, fResetAnimOnPop;
hsPoint3 fLastSubPos;
hsPoint3 fLastSubPOA;
hsBool fInSubLastUpdate;
hsBool fUpdateBrainTarget; // sometimes our target isn't loaded yet, so wait to update the brain til later
bool fInSubLastUpdate;
bool fUpdateBrainTarget; // sometimes our target isn't loaded yet, so wait to update the brain til later
};

2
Sources/Plasma/FeatureLib/pfCamera/plInterestingModifier.cpp

@ -56,7 +56,7 @@ float plInterestingModifier::fInterestRadius = 100.0f;
float plInterestingModifier::fInterestWeight = 1.0f;
hsBool plInterestingModifier::IEval(double secs, float del, uint32_t dirty)
bool plInterestingModifier::IEval(double secs, float del, uint32_t dirty)
{
for (int i=0; i < GetNumTargets(); i++)
{

4
Sources/Plasma/FeatureLib/pfCamera/plInterestingModifier.h

@ -67,13 +67,13 @@ protected:
static float fInterestRadius;
static float fInterestWeight;
virtual hsBool IEval(double secs, float del, uint32_t dirty);
virtual bool IEval(double secs, float del, uint32_t dirty);
public:
plInterestingModifier(){ fType = kTypeInteresting;}
virtual ~plInterestingModifier(){;}
virtual hsBool MsgReceive(plMessage* msg) {return false;}
virtual bool MsgReceive(plMessage* msg) {return false;}
CLASSNAME_REGISTER( plInterestingModifier );
GETINTERFACE_ANY( plInterestingModifier, plSingleModifier );

32
Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp

@ -90,9 +90,9 @@ float plVirtualCam1::fFOVw = 45.0f;
float plVirtualCam1::fFOVh = 33.75f;
float plVirtualCam1::fHither = 0.3f;
float plVirtualCam1::fYon = 500.0f;
hsBool plVirtualCam1::printFOV = false;
hsBool plVirtualCam1::fUseAccelOverride = 1;
hsBool plVirtualCam1::freeze = 0;
bool plVirtualCam1::printFOV = false;
bool plVirtualCam1::fUseAccelOverride = 1;
bool plVirtualCam1::freeze = 0;
//float plVirtualCam1::fAccel = 5.0f;
//float plVirtualCam1::fDecel = 5.0f;
//float plVirtualCam1::fVel = 10.0f;
@ -101,9 +101,9 @@ float plVirtualCam1::fDecel = 50.0f;
float plVirtualCam1::fVel = 100.0f;
float plVirtualCam1::fPanResponseTime = 3.0f;
float plVirtualCam1::fFallTimerDelay = 0.25f;
hsBool plVirtualCam1::alwaysCutForColin = false;
hsBool plVirtualCam1::WalkPan3rdPerson = false;
hsBool plVirtualCam1::StayInFirstPersonForever = false;
bool plVirtualCam1::alwaysCutForColin = false;
bool plVirtualCam1::WalkPan3rdPerson = false;
bool plVirtualCam1::StayInFirstPersonForever = false;
float plVirtualCam1::fAspectRatio = fFOVw / fFOVh;
// #define STATUS_LOG
@ -121,7 +121,7 @@ void plVirtualCam1::AddMsgToLog(const char* msg)
#endif
}
hsBool plVirtualCam1::IsCurrentCamera(const plCameraModifier1* mod)
bool plVirtualCam1::IsCurrentCamera(const plCameraModifier1* mod)
{
if (plVirtualCam1::Instance())
{
@ -392,7 +392,7 @@ void plVirtualCam1::SetPipeline(plPipeline* p)
SetRender(false);
}
void plVirtualCam1::Reset(hsBool bRender)
void plVirtualCam1::Reset(bool bRender)
{
if (fPythonOverride)
fPythonOverride = nil;
@ -455,7 +455,7 @@ plCameraModifier1* plVirtualCam1::GetCurrentCamera()
return nil;
}
hsBool plVirtualCam1::Is1stPersonCamera()
bool plVirtualCam1::Is1stPersonCamera()
{
if (GetCurrentStackCamera() == fDriveCamera)
return false;
@ -508,7 +508,7 @@ void plVirtualCam1::SetCutNextTrans()
#endif
}
void plVirtualCam1::SetRender(hsBool render)
void plVirtualCam1::SetRender(bool render)
{
fFlags.SetBit(kRender,render);
if (render)
@ -532,7 +532,7 @@ void plVirtualCam1::SetRender(hsBool render)
}
// hack, hack, hack
hsBool plVirtualCam1::RestoreFromName(const plString& name)
bool plVirtualCam1::RestoreFromName(const plString& name)
{
for(plSOVec::iterator it = fCamerasLoaded.begin(); it != fCamerasLoaded.end(); ++it)
{
@ -777,7 +777,7 @@ void plVirtualCam1::IUpdate()
for (plCameraVec::iterator i = fCameraStack.begin(); i != fCameraStack.end(); ++i)
{
hsBool update = true;
bool update = true;
for (plCameraVec::iterator j = (i+1); j != fCameraStack.end(); ++j)
{
if (*i != *j)
@ -954,7 +954,7 @@ void plVirtualCam1::FirstPersonOverride()
}
}
hsBool plVirtualCam1::MsgReceive(plMessage* msg)
bool plVirtualCam1::MsgReceive(plMessage* msg)
{
plPlayerPageMsg* pPMsg = plPlayerPageMsg::ConvertNoRef(msg);
if (pPMsg)
@ -1356,7 +1356,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
if (pCam->GetTriggerer() && pCam->GetTriggerer() != plNetClientApp::GetInstance()->GetLocalPlayerKey())
return true;
{
hsBool bDef = pCam->Cmd(plCameraMsg::kSetAsPrimary);
bool bDef = pCam->Cmd(plCameraMsg::kSetAsPrimary);
plKey pCamKey = pCam->GetNewCam();
if (pCamKey)
{
@ -1504,7 +1504,7 @@ void plVirtualCam1::AddCameraToStack(plCameraModifier1* pCam)
hsgResMgr::ResMgr()->AddViaNotify(pCam->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefCamera), plRefFlags::kPassiveRef);
}
void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
void plVirtualCam1::PushCamera(plCameraModifier1* pCam, bool bDefault)
{
// pushing the same camera, folks?
if (pCam == GetCurrentStackCamera())
@ -1696,7 +1696,7 @@ void plVirtualCam1::PopCamera(plCameraModifier1* pCam)
}
// are we mouse-looking?
hsBool mLook = false;
bool mLook = false;
if (pCam->GetBrain() && pCam->GetBrain()->HasMovementFlag(S_SET_FREELOOK))
mLook = true;

32
Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.h

@ -121,7 +121,7 @@ public:
void SetPipeline(plPipeline* p);
void Init();
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
static void SetFOV(float w, float h);
static void SetFOV(float w, float h, plCameraModifier1* pCam);
static void SetDepth(float h, float y);
@ -133,14 +133,14 @@ public:
static void SetAspectRatio(float aspect) { fAspectRatio = aspect; }
static float GetAspectRatio() { return fAspectRatio; }
hsBool InTransition() { return fTransPos != POS_TRANS_OFF; }
bool InTransition() { return fTransPos != POS_TRANS_OFF; }
plCameraModifier1* GetCurrentCamera();
plCameraModifier1* GetCurrentStackCamera();
plCameraModifier1* GetTransitionCamera(){return fTransitionCamera;}
hsBool Is1stPersonCamera();
bool Is1stPersonCamera();
hsBool HasMovementFlag(int f) { return fMoveFlags.IsBitSet(f); }
void SetMovementFlag(int f, hsBool on = true) { fMoveFlags.SetBit(f, on);}
bool HasMovementFlag(int f) { return fMoveFlags.IsBitSet(f); }
void SetMovementFlag(int f, bool on = true) { fMoveFlags.SetBit(f, on);}
hsPoint3 GetCameraPos() { return fOutputPos; }
hsPoint3 GetCameraPOA() { return fOutputPOA; }
@ -155,34 +155,34 @@ public:
void RebuildStack(const plKey& key);
void SetFlags(int flag) { fFlags.SetBit(flag); }
hsBool HasFlags(int flag) { return fFlags.IsBitSet(flag); }
bool HasFlags(int flag) { return fFlags.IsBitSet(flag); }
void ClearFlags(int flag) { fFlags.ClearBit(flag); }
// console command stuff
static void Next();
static void Prev();
static void Deactivate();
void CameraRegions(hsBool b) { fFlags.SetBit(kRegionIgnore,b); }
void LogFOV(hsBool b) { printFOV = b; }
void CameraRegions(bool b) { fFlags.SetBit(kRegionIgnore,b); }
void LogFOV(bool b) { printFOV = b; }
void Drive();
void PushThirdPerson();
static void AddMsgToLog(const char* msg);
static hsBool IsCurrentCamera(const plCameraModifier1* mod);
static bool IsCurrentCamera(const plCameraModifier1* mod);
void ClearStack();
void AddCameraLoaded(plSceneObject* pCam) { fCamerasLoaded.push_back(pCam); }
hsBool RestoreFromName(const plString& name);
bool RestoreFromName(const plString& name);
void StartUnPan();
// these are for console access
static hsBool fUseAccelOverride, freeze, alwaysCutForColin, WalkPan3rdPerson,StayInFirstPersonForever;
static bool fUseAccelOverride, freeze, alwaysCutForColin, WalkPan3rdPerson,StayInFirstPersonForever;
static float fDecel, fAccel, fVel;
static float fFallTimerDelay;
private:
void Reset(hsBool bRender);
void PushCamera(plCameraModifier1* pCam, hsBool bDefault = false);
void Reset(bool bRender);
void PushCamera(plCameraModifier1* pCam, bool bDefault = false);
void PopCamera(plCameraModifier1* pCam);
void AddCameraToStack(plCameraModifier1* pCam);
void PopAll();
@ -190,7 +190,7 @@ private:
void StartTransition(CamTrans* transition);
void RunTransition();
void FinishTransition();
void SetRender(hsBool render);
void SetRender(bool render);
void IHandleCameraStatusLog(plCameraModifier1* pMod, int action);
void ICreatePlate();
void FreezeOutput(int frames) { fFreezeCounter = frames; } // I hate this and I hate myself for doing it
@ -242,10 +242,10 @@ private:
static float fFOVh, fFOVw;
static float fHither, fYon;
static plVirtualCam1* fInstance;
static hsBool printFOV;
static bool printFOV;
static float fPanResponseTime;
static float fAspectRatio;
hsBool fForceCutOnce;
bool fForceCutOnce;
};

2
Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp

@ -280,7 +280,7 @@ bool pfMarkerMgr::AreLocalMarkersShowing()
return fShowingLocalMarkers;
}
hsBool pfMarkerMgr::MsgReceive(plMessage* msg)
bool pfMarkerMgr::MsgReceive(plMessage* msg)
{
plEvalMsg* evalMsg = plEvalMsg::ConvertNoRef(msg);
if (evalMsg)

2
Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.h

@ -89,7 +89,7 @@ public:
static pfMarkerMgr* Instance();
static void Shutdown();
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void AddMarker(double x, double y, double z, uint32_t id, bool justCreated);
void RemoveMarker(uint32_t id);

12
Sources/Plasma/FeatureLib/pfCharacter/plPlayerModifier.cpp

@ -186,7 +186,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// plgAudioSys::SetMuted( false );
//}
//
//hsBool plPlayerModifier::MsgReceive(plMessage* msg)
//bool plPlayerModifier::MsgReceive(plMessage* msg)
//{
// plControlEventMsg* pCommandMsg = plControlEventMsg::ConvertNoRef(msg);
// if (pCommandMsg)
@ -228,9 +228,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// return plSingleModifier::MsgReceive(msg);
//}
//
//hsBool plPlayerModifier::HandleControlInput(plControlEventMsg* pMsg)
//bool plPlayerModifier::HandleControlInput(plControlEventMsg* pMsg)
//{
// hsBool ret=false;
// bool ret=false;
//
// if (pMsg->ControlActivated() && (pMsg->GetControlCode() == B_CONTROL_ROTATE_RIGHT || pMsg->GetControlCode() == B_CONTROL_ROTATE_LEFT || pMsg->GetControlCode() == A_CONTROL_TURN))
// {
@ -256,7 +256,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// return ret;
//}
//
//void plPlayerModifier::SetMoving(hsBool b)
//void plPlayerModifier::SetMoving(bool b)
//{
// if (b != bMoving)
// {
@ -277,7 +277,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//hsPoint3 forceRight(-200,0,0);
//hsPoint3 forceUp(0,0,15);
//
//hsBool plPlayerModifier::IEval(double secs, float del, uint32_t dirty)
//bool plPlayerModifier::IEval(double secs, float del, uint32_t dirty)
//{
// // setup for local player if necessary
// if (HasFlag(kNeedsLocalSetup))
@ -610,7 +610,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// return distMoved;
//}
//
//hsBool32 plPlayerModifier::IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal)
//bool32 plPlayerModifier::IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal)
//{
// if (decelSpeed == 0)
// // no deceleration

18
Sources/Plasma/FeatureLib/pfCharacter/plPlayerModifier.h

@ -100,9 +100,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// double elapsedTime);
//
// float IClampVelocity(hsVector3* vel, float maxSpeed, double elapsedTime);
// hsBool32 IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal);
// bool32 IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal);
//
// hsBool HasMovementFlag(int f) const { return fMoveFlags.IsBitSet(f); }
// bool HasMovementFlag(int f) const { return fMoveFlags.IsBitSet(f); }
// void SetMovementFlag(int f) { fMoveFlags.SetBit(f); }
// void ClearMovementFlag(int which) { fMoveFlags.ClearBit( which ); }
//
@ -111,7 +111,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
// void WarpToSpawnPoint() { SetFlag( kWantsToSpawn ); }
//
// hsBool bMoving;
// bool bMoving;
//
// void IApplyForce(plSimulationInterface::plSimpleForce type, const Havok::Vector3 &vec);
// void IDoLocalSetup(plSceneObject*);
@ -124,17 +124,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// CLASSNAME_REGISTER( plPlayerModifier );
// GETINTERFACE_ANY( plPlayerModifier, plSingleModifier );
//
// virtual hsBool MsgReceive(plMessage* msg);
// virtual bool MsgReceive(plMessage* msg);
// virtual void AddTarget(plSceneObject* so);
// virtual void RemoveTarget(plSceneObject* so);
//
// hsBool HandleControlInput(plControlEventMsg* pMsg);
// virtual hsBool IEval(double secs, float del, uint32_t dirty);
// bool HandleControlInput(plControlEventMsg* pMsg);
// virtual bool IEval(double secs, float del, uint32_t dirty);
//
// void SetMoving(hsBool b);
// hsBool IsMoving() { return bMoving; }
// void SetMoving(bool b);
// bool IsMoving() { return bMoving; }
//
// hsBool HasFlag(int f) const { return fFlags.IsBitSet(f); }
// bool HasFlag(int f) const { return fFlags.IsBitSet(f); }
// void SetFlag(int f) { fFlags.SetBit(f); }
// void ClearFlag(int which) { fFlags.ClearBit( which ); }
//

2
Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp

@ -58,7 +58,7 @@ plANDConditionalObject::~plANDConditionalObject()
delete (fChildren[i]);
}
hsBool plANDConditionalObject::MsgReceive(plMessage* msg)
bool plANDConditionalObject::MsgReceive(plMessage* msg)
{
plCondRefMsg* pCondMsg = plCondRefMsg::ConvertNoRef(msg);
if (pCondMsg)

2
Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.h

@ -62,7 +62,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void Evaluate();
void Reset();

8
Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.cpp

@ -52,7 +52,7 @@ plActivatorConditionalObject::plActivatorConditionalObject()
SetFlag(kLocalElement); // since it relies on user input
}
hsBool plActivatorConditionalObject::MsgReceive(plMessage* msg)
bool plActivatorConditionalObject::MsgReceive(plMessage* msg)
{
plActivatorMsg* pDetectorMsg = plActivatorMsg::ConvertNoRef(msg);
if (pDetectorMsg)
@ -130,7 +130,7 @@ hsBool plActivatorConditionalObject::MsgReceive(plMessage* msg)
fLogicMod->GetNotify()->AddCollisionEvent(true, pDetectorMsg->fHitterObj, pDetectorMsg->fHiteeObj);
}
SetSatisfied(true);
//hsBool netRequest = msg->HasBCastFlag(plMessage::kNetNonLocal);
//bool netRequest = msg->HasBCastFlag(plMessage::kNetNonLocal);
//fLogicMod->RequestTrigger(netRequest);
fLogicMod->RequestTrigger(false);
}
@ -166,7 +166,7 @@ void plActivatorConditionalObject::SetActivatorKey(plKey k)
// plActivatorActivatorConditional
//
hsBool plActivatorActivatorConditionalObject::MsgReceive(plMessage* msg)
bool plActivatorActivatorConditionalObject::MsgReceive(plMessage* msg)
{
plNotifyMsg* pDetectorMsg = plNotifyMsg::ConvertNoRef(msg);
if (pDetectorMsg)
@ -190,7 +190,7 @@ hsBool plActivatorActivatorConditionalObject::MsgReceive(plMessage* msg)
}
hsBool plVolActivatorConditionalObject::MsgReceive(plMessage* msg)
bool plVolActivatorConditionalObject::MsgReceive(plMessage* msg)
{
plActivatorMsg* pDetectorMsg = plActivatorMsg::ConvertNoRef(msg);
if (pDetectorMsg)

6
Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.h

@ -62,7 +62,7 @@ public:
CLASSNAME_REGISTER( plActivatorConditionalObject );
GETINTERFACE_ANY( plActivatorConditionalObject, plConditionalObject );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
void Evaluate(){;}
void SetActivatorKey(plKey k);
@ -83,7 +83,7 @@ public:
CLASSNAME_REGISTER( plActivatorActivatorConditionalObject );
GETINTERFACE_ANY( plActivatorActivatorConditionalObject, plActivatorConditionalObject );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
};
@ -98,7 +98,7 @@ public:
CLASSNAME_REGISTER( plVolActivatorConditionalObject );
GETINTERFACE_ANY( plVolActivatorConditionalObject, plActivatorConditionalObject );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
};

2
Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp

@ -54,7 +54,7 @@ fAction(kEventEnd)
{
}
hsBool plAnimationEventConditionalObject::MsgReceive(plMessage* msg)
bool plAnimationEventConditionalObject::MsgReceive(plMessage* msg)
{
plEventCallbackMsg* pMsg = plEventCallbackMsg::ConvertNoRef(msg);
if (pMsg)

2
Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.h

@ -66,7 +66,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void Evaluate(){;}
void Reset() { SetSatisfied(false); }

2
Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.cpp

@ -50,7 +50,7 @@ plControlEventConditionalObject::plControlEventConditionalObject()
}
hsBool plControlEventConditionalObject::MsgReceive(plMessage* msg)
bool plControlEventConditionalObject::MsgReceive(plMessage* msg)
{
plControlEventMsg* pControlMsg = plControlEventMsg::ConvertNoRef(msg);
if( pControlMsg )

2
Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.h

@ -64,7 +64,7 @@ public:
virtual void Write(hsStream* stream, hsResMgr* mgr);
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void Evaluate(){;}
void Reset() { SetSatisfied(false); }

4
Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.cpp

@ -58,7 +58,7 @@ fDirectional(false)
SetSatisfied(true);
}
hsBool plFacingConditionalObject::MsgReceive(plMessage* msg)
bool plFacingConditionalObject::MsgReceive(plMessage* msg)
{
return plConditionalObject::MsgReceive(msg);
}
@ -78,7 +78,7 @@ void plFacingConditionalObject::Read(hsStream* stream, hsResMgr* mgr)
fDirectional = stream->ReadBool();
}
hsBool plFacingConditionalObject::Verify(plMessage* msg)
bool plFacingConditionalObject::Verify(plMessage* msg)
{
plActivatorMsg* pActivateMsg = plActivatorMsg::ConvertNoRef(msg);
if (pActivateMsg && pActivateMsg->fHitterObj)

8
Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.h

@ -51,7 +51,7 @@ class plFacingConditionalObject : public plConditionalObject
{
protected:
float fTolerance;
hsBool fDirectional;
bool fDirectional;
public:
@ -61,12 +61,12 @@ public:
CLASSNAME_REGISTER( plFacingConditionalObject );
GETINTERFACE_ANY( plFacingConditionalObject, plConditionalObject );
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void SetTolerance(float d) { fTolerance = d; }
void SetDirectional(hsBool d) { fDirectional = d; }
void SetDirectional(bool d) { fDirectional = d; }
virtual hsBool Verify(plMessage* msg);
virtual bool Verify(plMessage* msg);
void Evaluate(){;}
void Reset() { SetSatisfied(true); }

2
Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.cpp

@ -50,7 +50,7 @@ plKeyPressConditionalObject::plKeyPressConditionalObject()
SetFlag(kLocalElement); // since it relies on user input
}
hsBool plKeyPressConditionalObject::MsgReceive(plMessage* msg)
bool plKeyPressConditionalObject::MsgReceive(plMessage* msg)
{
plKeyEventMsg* pKeyMsg = plKeyEventMsg::ConvertNoRef(msg);
if( pKeyMsg )

2
Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.h

@ -64,7 +64,7 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void Evaluate(){;}
void Reset() { SetSatisfied(false); }

2
Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerInBoxConditionalObject.cpp

@ -50,7 +50,7 @@ plLocalPlayerInBoxConditionalObject::plLocalPlayerInBoxConditionalObject()
SetFlag(kLocalElement); // since it relies on the local player
}
hsBool plLocalPlayerInBoxConditionalObject::MsgReceive(plMessage* msg)
bool plLocalPlayerInBoxConditionalObject::MsgReceive(plMessage* msg)
{
/*

2
Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerInBoxConditionalObject.h

@ -61,7 +61,7 @@ public:
CLASSNAME_REGISTER( plLocalPlayerInBoxConditionalObject );
GETINTERFACE_ANY( plLocalPlayerInBoxConditionalObject, plConditionalObject );
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void SetBox(plKey pKey) { fBox = pKey; }

2
Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerIntersectPlaneConditionalObject.cpp

@ -49,7 +49,7 @@ plLocalPlayerIntersectPlaneConditionalObject::plLocalPlayerIntersectPlaneConditi
SetFlag(kLocalElement); // since it relies on the local player
}
hsBool plLocalPlayerIntersectPlaneConditionalObject::MsgReceive(plMessage* msg)
bool plLocalPlayerIntersectPlaneConditionalObject::MsgReceive(plMessage* msg)
{
/*

2
Sources/Plasma/FeatureLib/pfConditional/plLocalPlayerIntersectPlaneConditionalObject.h

@ -61,7 +61,7 @@ public:
CLASSNAME_REGISTER( plLocalPlayerIntersectPlaneConditionalObject );
GETINTERFACE_ANY( plLocalPlayerIntersectPlaneConditionalObject, plConditionalObject );
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void SetTarget(plKey pKey) { fTarget = pKey; }
void SetPlane(plKey pKey) { fPlane = pKey; }

4
Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp

@ -58,7 +58,7 @@ plORConditionalObject::~plORConditionalObject()
fChildren.SetCountAndZero(0);
}
hsBool plORConditionalObject::MsgReceive(plMessage* msg)
bool plORConditionalObject::MsgReceive(plMessage* msg)
{
plCondRefMsg* pCondMsg = plCondRefMsg::ConvertNoRef(msg);
if (pCondMsg)
@ -81,7 +81,7 @@ void plORConditionalObject::SetLogicMod(plLogicModBase* pMod)
}
}
hsBool plORConditionalObject::Satisfied()
bool plORConditionalObject::Satisfied()
{
for (int i = 0; i < fChildren.Count(); i++)
{

4
Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.h

@ -62,9 +62,9 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
virtual hsBool Satisfied();
virtual bool Satisfied();
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
void Evaluate(){;}
void Reset();

10
Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp

@ -58,7 +58,7 @@ fCurrentTrigger(nil)
SetSatisfied(true);
}
hsBool plObjectInBoxConditionalObject::MsgReceive(plMessage* msg)
bool plObjectInBoxConditionalObject::MsgReceive(plMessage* msg)
{
plActivatorMsg* pActivateMsg = plActivatorMsg::ConvertNoRef(msg);
if (pActivateMsg)
@ -92,7 +92,7 @@ hsBool plObjectInBoxConditionalObject::MsgReceive(plMessage* msg)
return plConditionalObject::MsgReceive(msg);
}
hsBool plObjectInBoxConditionalObject::Verify(plMessage* msg)
bool plObjectInBoxConditionalObject::Verify(plMessage* msg)
{
plActivatorMsg* pActivateMsg = plActivatorMsg::ConvertNoRef(msg);
if (pActivateMsg)
@ -135,7 +135,7 @@ fIgnoreExtraEnters(true)
}
hsBool plVolumeSensorConditionalObject::MsgReceive(plMessage* msg)
bool plVolumeSensorConditionalObject::MsgReceive(plMessage* msg)
{
plActivatorMsg* pActivateMsg = plActivatorMsg::ConvertNoRef(msg);
if (pActivateMsg)
@ -256,7 +256,7 @@ hsBool plVolumeSensorConditionalObject::MsgReceive(plMessage* msg)
return plConditionalObject::MsgReceive(msg);
}
hsBool plVolumeSensorConditionalObject::Satisfied()
bool plVolumeSensorConditionalObject::Satisfied()
{
if (fType == kTypeExit && fFirst && !fTriggered)
{
@ -295,7 +295,7 @@ void plVolumeSensorConditionalObject::Write(hsStream* stream, hsResMgr* mgr)
}
#include "pnMessage/plPlayerPageMsg.h"
#include "plgDispatch.h"
hsBool plVolumeSensorConditionalObjectNoArbitration::MsgReceive(plMessage* msg)
bool plVolumeSensorConditionalObjectNoArbitration::MsgReceive(plMessage* msg)
{
plActivatorMsg* pActivateMsg = plActivatorMsg::ConvertNoRef(msg);
if (pActivateMsg)

22
Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.h

@ -63,12 +63,12 @@ public:
CLASSNAME_REGISTER( plObjectInBoxConditionalObject );
GETINTERFACE_ANY( plObjectInBoxConditionalObject, plConditionalObject );
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void Evaluate(){;}
void Reset() { SetSatisfied(false); }
virtual hsBool Satisfied() { return true; }
virtual hsBool Verify(plMessage* msg);
virtual bool Satisfied() { return true; }
virtual bool Verify(plMessage* msg);
};
@ -80,9 +80,9 @@ protected:
hsTArray<plKey> fInside;
int fTrigNum;
int fType;
hsBool fFirst;
hsBool fTriggered;
hsBool fIgnoreExtraEnters;
bool fFirst;
bool fTriggered;
bool fIgnoreExtraEnters;
public:
static bool makeBriceHappyVar;
@ -99,17 +99,17 @@ public:
CLASSNAME_REGISTER( plVolumeSensorConditionalObject );
GETINTERFACE_ANY( plVolumeSensorConditionalObject, plConditionalObject );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
void Evaluate(){;}
void Reset() { SetSatisfied(false); }
virtual hsBool Satisfied();
virtual bool Satisfied();
void SetType(int i) { fType = i; }
void SetTrigNum(int i) { fTrigNum = i; }
void SetFirst(hsBool b) { fFirst = b; }
void SetFirst(bool b) { fFirst = b; }
void IgnoreExtraEnters(hsBool ignore = true) {fIgnoreExtraEnters = ignore;}
void IgnoreExtraEnters(bool ignore = true) {fIgnoreExtraEnters = ignore;}
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
@ -122,7 +122,7 @@ public:
~plVolumeSensorConditionalObjectNoArbitration (){;}
CLASSNAME_REGISTER( plVolumeSensorConditionalObjectNoArbitration );
GETINTERFACE_ANY( plVolumeSensorConditionalObjectNoArbitration, plConditionalObject );
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
virtual void Read(hsStream* stream, hsResMgr* mgr);
protected:
plKey fHittee;

2
Sources/Plasma/FeatureLib/pfConditional/plObjectIntersectPlaneConditionalObject.cpp

@ -49,7 +49,7 @@ plObjectIntersectPlaneConditionalObject::plObjectIntersectPlaneConditionalObject
}
hsBool plObjectIntersectPlaneConditionalObject::MsgReceive(plMessage* msg)
bool plObjectIntersectPlaneConditionalObject::MsgReceive(plMessage* msg)
{
/*

2
Sources/Plasma/FeatureLib/pfConditional/plObjectIntersectPlaneConditionalObject.h

@ -61,7 +61,7 @@ public:
CLASSNAME_REGISTER( plObjectIntersectPlaneConditionalObject );
GETINTERFACE_ANY( plObjectIntersectPlaneConditionalObject, plConditionalObject );
hsBool MsgReceive(plMessage* msg);
bool MsgReceive(plMessage* msg);
void SetTarget(plKey pKey) { fTarget = pKey; }
void SetPlane(plKey pKey) { fPlane = pKey; }

2
Sources/Plasma/FeatureLib/pfConditional/plPickedConditionalObject.cpp

@ -51,7 +51,7 @@ plPickedConditionalObject::plPickedConditionalObject()
SetFlag(kLocalElement); // since it relies on user input
}
hsBool plPickedConditionalObject::MsgReceive(plMessage* msg)
bool plPickedConditionalObject::MsgReceive(plMessage* msg)
{
plActivatorMsg* pDetectorMsg = plActivatorMsg::ConvertNoRef(msg);
if (pDetectorMsg && pDetectorMsg->TriggerType() == plActivatorMsg::kPickedTrigger )

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save