Merge pull request #1356 from Areloch/PVS_Cleanup_813

Convert un-modified function arguments to const references.
This commit is contained in:
Daniel Buckmaster 2015-07-20 22:55:22 +10:00
commit 4f2f1ca4e1
40 changed files with 59 additions and 59 deletions

View file

@ -259,7 +259,7 @@ void AIPlayer::setAimObject( GameBase *targetObject )
* @param targetObject The object to target * @param targetObject The object to target
* @param offset The offest from the target location to aim at * @param offset The offest from the target location to aim at
*/ */
void AIPlayer::setAimObject( GameBase *targetObject, Point3F offset ) void AIPlayer::setAimObject(GameBase *targetObject, const Point3F& offset)
{ {
mAimObject = targetObject; mAimObject = targetObject;
mTargetInLOS = false; mTargetInLOS = false;

View file

@ -161,7 +161,7 @@ public:
// Targeting and aiming sets/gets // Targeting and aiming sets/gets
void setAimObject( GameBase *targetObject ); void setAimObject( GameBase *targetObject );
void setAimObject( GameBase *targetObject, Point3F offset ); void setAimObject(GameBase *targetObject, const Point3F& offset);
GameBase* getAimObject() const { return mAimObject; } GameBase* getAimObject() const { return mAimObject; }
void setAimLocation( const Point3F &location ); void setAimLocation( const Point3F &location );
Point3F getAimLocation() const { return mAimLocation; } Point3F getAimLocation() const { return mAimLocation; }

View file

@ -393,7 +393,7 @@ void Camera::getEyeCameraTransform(IDisplayDevice *displayDevice, U32 eyeId, Mat
} }
} }
DisplayPose Camera::calcCameraDeltaPose(GameConnection *con, DisplayPose inPose) DisplayPose Camera::calcCameraDeltaPose(GameConnection *con, const DisplayPose& inPose)
{ {
// NOTE: this is intended to be similar to updateMove // NOTE: this is intended to be similar to updateMove
DisplayPose outPose; DisplayPose outPose;

View file

@ -237,7 +237,7 @@ class Camera: public ShapeBase
virtual void interpolateTick( F32 delta); virtual void interpolateTick( F32 delta);
virtual void getCameraTransform( F32* pos,MatrixF* mat ); virtual void getCameraTransform( F32* pos,MatrixF* mat );
virtual void getEyeCameraTransform( IDisplayDevice *display, U32 eyeId, MatrixF *outMat ); virtual void getEyeCameraTransform( IDisplayDevice *display, U32 eyeId, MatrixF *outMat );
virtual DisplayPose calcCameraDeltaPose(GameConnection *con, DisplayPose inPose); virtual DisplayPose calcCameraDeltaPose(GameConnection *con, const DisplayPose& inPose);
virtual void writePacketData( GameConnection* conn, BitStream* stream ); virtual void writePacketData( GameConnection* conn, BitStream* stream );
virtual void readPacketData( GameConnection* conn, BitStream* stream ); virtual void readPacketData( GameConnection* conn, BitStream* stream );

View file

@ -248,7 +248,7 @@ fxFoliageCulledList::fxFoliageCulledList(Box3F SearchBox, fxFoliageCulledList* I
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void fxFoliageCulledList::FindCandidates(Box3F SearchBox, fxFoliageCulledList* InVec) void fxFoliageCulledList::FindCandidates(const Box3F& SearchBox, fxFoliageCulledList* InVec)
{ {
// Search the Culled List. // Search the Culled List.
for (U32 i = 0; i < InVec->GetListCount(); i++) for (U32 i = 0; i < InVec->GetListCount(); i++)
@ -1028,7 +1028,7 @@ void fxFoliageReplicator::SetupBuffers()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Box3F fxFoliageReplicator::FetchQuadrant(Box3F Box, U32 Quadrant) Box3F fxFoliageReplicator::FetchQuadrant(const Box3F& Box, U32 Quadrant)
{ {
Box3F QuadrantBox; Box3F QuadrantBox;

View file

@ -86,7 +86,7 @@ public:
fxFoliageCulledList(Box3F SearchBox, fxFoliageCulledList* InVec); fxFoliageCulledList(Box3F SearchBox, fxFoliageCulledList* InVec);
~fxFoliageCulledList() {}; ~fxFoliageCulledList() {};
void FindCandidates(Box3F SearchBox, fxFoliageCulledList* InVec); void FindCandidates(const Box3F& SearchBox, fxFoliageCulledList* InVec);
U32 GetListCount(void) { return mCulledObjectSet.size(); }; U32 GetListCount(void) { return mCulledObjectSet.size(); };
fxFoliageItem* GetElement(U32 index) { return mCulledObjectSet[index]; }; fxFoliageItem* GetElement(U32 index) { return mCulledObjectSet[index]; };
@ -157,7 +157,7 @@ protected:
void SyncFoliageReplicators(void); void SyncFoliageReplicators(void);
Box3F FetchQuadrant(Box3F Box, U32 Quadrant); Box3F FetchQuadrant(const Box3F& Box, U32 Quadrant);
void ProcessQuadrant(fxFoliageQuadrantNode* pParentNode, fxFoliageCulledList* pCullList, U32 Quadrant); void ProcessQuadrant(fxFoliageQuadrantNode* pParentNode, fxFoliageCulledList* pCullList, U32 Quadrant);
void ProcessNodeChildren(fxFoliageQuadrantNode* pParentNode, fxFoliageCulledList* pCullList); void ProcessNodeChildren(fxFoliageQuadrantNode* pParentNode, fxFoliageCulledList* pCullList);

View file

@ -5586,7 +5586,7 @@ void Player::getMuzzleTransform(U32 imageSlot,MatrixF* mat)
*mat = nmat; *mat = nmat;
} }
DisplayPose Player::calcCameraDeltaPose(GameConnection *con, DisplayPose inPose) DisplayPose Player::calcCameraDeltaPose(GameConnection *con, const DisplayPose& inPose)
{ {
// NOTE: this is intended to be similar to updateMove // NOTE: this is intended to be similar to updateMove
DisplayPose outPose; DisplayPose outPose;

View file

@ -684,7 +684,7 @@ public:
void getEyeBaseTransform(MatrixF* mat, bool includeBank); void getEyeBaseTransform(MatrixF* mat, bool includeBank);
void getRenderEyeTransform(MatrixF* mat); void getRenderEyeTransform(MatrixF* mat);
void getRenderEyeBaseTransform(MatrixF* mat, bool includeBank); void getRenderEyeBaseTransform(MatrixF* mat, bool includeBank);
virtual DisplayPose calcCameraDeltaPose(GameConnection *con, DisplayPose inPose); virtual DisplayPose calcCameraDeltaPose(GameConnection *con, const DisplayPose& inPose);
void getCameraParameters(F32 *min, F32 *max, Point3F *offset, MatrixF *rot); void getCameraParameters(F32 *min, F32 *max, Point3F *offset, MatrixF *rot);
void getMuzzleTransform(U32 imageSlot,MatrixF* mat); void getMuzzleTransform(U32 imageSlot,MatrixF* mat);
void getRenderMuzzleTransform(U32 imageSlot,MatrixF* mat); void getRenderMuzzleTransform(U32 imageSlot,MatrixF* mat);

View file

@ -1191,13 +1191,13 @@ void ShapeBase::onDeleteNotify( SimObject *obj )
Parent::onDeleteNotify( obj ); Parent::onDeleteNotify( obj );
} }
void ShapeBase::onImpact(SceneObject* obj, VectorF vec) void ShapeBase::onImpact(SceneObject* obj, const VectorF& vec)
{ {
if (!isGhost()) if (!isGhost())
mDataBlock->onImpact_callback( this, obj, vec, vec.len() ); mDataBlock->onImpact_callback( this, obj, vec, vec.len() );
} }
void ShapeBase::onImpact(VectorF vec) void ShapeBase::onImpact(const VectorF& vec)
{ {
if (!isGhost()) if (!isGhost())
mDataBlock->onImpact_callback( this, NULL, vec, vec.len() ); mDataBlock->onImpact_callback( this, NULL, vec, vec.len() );
@ -1994,7 +1994,7 @@ void ShapeBase::getEyeCameraTransform(IDisplayDevice *displayDevice, U32 eyeId,
*outMat = temp; *outMat = temp;
} }
DisplayPose ShapeBase::calcCameraDeltaPose(GameConnection *con, DisplayPose inPose) DisplayPose ShapeBase::calcCameraDeltaPose(GameConnection *con, const DisplayPose& inPose)
{ {
// NOTE: this is intended to be similar to updateMove // NOTE: this is intended to be similar to updateMove
// WARNING: does not take into account any move values // WARNING: does not take into account any move values

View file

@ -1104,8 +1104,8 @@ protected:
virtual void shakeCamera( U32 imageSlot ); virtual void shakeCamera( U32 imageSlot );
virtual void updateDamageLevel(); virtual void updateDamageLevel();
virtual void updateDamageState(); virtual void updateDamageState();
virtual void onImpact(SceneObject* obj, VectorF vec); virtual void onImpact(SceneObject* obj, const VectorF& vec);
virtual void onImpact(VectorF vec); virtual void onImpact(const VectorF& vec);
/// @} /// @}
/// The inner prep render function that does the /// The inner prep render function that does the
@ -1588,7 +1588,7 @@ public:
virtual void getEyeCameraTransform( IDisplayDevice *display, U32 eyeId, MatrixF *outMat ); virtual void getEyeCameraTransform( IDisplayDevice *display, U32 eyeId, MatrixF *outMat );
/// Calculates a delta camera angle and view position based on inPose /// Calculates a delta camera angle and view position based on inPose
virtual DisplayPose calcCameraDeltaPose(GameConnection *con, DisplayPose inPose); virtual DisplayPose calcCameraDeltaPose(GameConnection *con, const DisplayPose& inPose);
/// Gets the index of a node inside a mounted image given the name /// Gets the index of a node inside a mounted image given the name
/// @param imageSlot Image slot /// @param imageSlot Image slot

View file

@ -76,7 +76,7 @@ Point3F BoxConvex::getVertex(S32 v)
return p; return p;
} }
inline bool isOnPlane(Point3F p,PlaneF& plane) inline bool isOnPlane(const Point3F& p,PlaneF& plane)
{ {
F32 dist = mDot(plane,p) + plane.d; F32 dist = mDot(plane,p) + plane.d;
return dist < 0.1 && dist > -0.1; return dist < 0.1 && dist > -0.1;

View file

@ -1091,7 +1091,7 @@ F32 GuiMeshRoadEditorCtrl::getNodeDepth()
return 0.0f; return 0.0f;
} }
void GuiMeshRoadEditorCtrl::setNodePosition( Point3F pos ) void GuiMeshRoadEditorCtrl::setNodePosition(const Point3F& pos)
{ {
if ( mSelRoad && mSelNode != -1 ) if ( mSelRoad && mSelNode != -1 )
{ {

View file

@ -100,7 +100,7 @@ class GuiMeshRoadEditorCtrl : public EditTSCtrl
void setNodeDepth( F32 depth ); void setNodeDepth( F32 depth );
Point3F getNodePosition(); Point3F getNodePosition();
void setNodePosition( Point3F pos ); void setNodePosition(const Point3F& pos);
VectorF getNodeNormal(); VectorF getNodeNormal();
void setNodeNormal( const VectorF &normal ); void setNodeNormal( const VectorF &normal );

View file

@ -1235,7 +1235,7 @@ F32 GuiRiverEditorCtrl::getNodeDepth()
return 0.0f; return 0.0f;
} }
void GuiRiverEditorCtrl::setNodePosition( Point3F pos ) void GuiRiverEditorCtrl::setNodePosition(const Point3F& pos)
{ {
if ( mSelRiver && mSelNode != -1 ) if ( mSelRiver && mSelNode != -1 )
{ {

View file

@ -110,7 +110,7 @@ class GuiRiverEditorCtrl : public EditTSCtrl
void setNodeDepth( F32 depth ); void setNodeDepth( F32 depth );
Point3F getNodePosition(); Point3F getNodePosition();
void setNodePosition( Point3F pos ); void setNodePosition(const Point3F& pos);
VectorF getNodeNormal(); VectorF getNodeNormal();
void setNodeNormal( const VectorF &normal ); void setNodeNormal( const VectorF &normal );

View file

@ -979,7 +979,7 @@ F32 GuiRoadEditorCtrl::getNodeWidth()
return 0.0f; return 0.0f;
} }
void GuiRoadEditorCtrl::setNodePosition( Point3F pos ) void GuiRoadEditorCtrl::setNodePosition(const Point3F& pos)
{ {
if ( mSelRoad && mSelNode != -1 ) if ( mSelRoad && mSelNode != -1 )
{ {

View file

@ -97,7 +97,7 @@ class GuiRoadEditorCtrl : public EditTSCtrl
void setNodeWidth( F32 width ); void setNodeWidth( F32 width );
Point3F getNodePosition(); Point3F getNodePosition();
void setNodePosition( Point3F pos ); void setNodePosition(const Point3F& pos);
void setTextureFile( StringTableEntry file ); void setTextureFile( StringTableEntry file );

View file

@ -735,14 +735,14 @@ void GFXDevice::setLight(U32 stage, GFXLightInfo* light)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Set Light Material // Set Light Material
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void GFXDevice::setLightMaterial(GFXLightMaterial mat) void GFXDevice::setLightMaterial(const GFXLightMaterial& mat)
{ {
mCurrentLightMaterial = mat; mCurrentLightMaterial = mat;
mLightMaterialDirty = true; mLightMaterialDirty = true;
mStateDirty = true; mStateDirty = true;
} }
void GFXDevice::setGlobalAmbientColor(ColorF color) void GFXDevice::setGlobalAmbientColor(const ColorF& color)
{ {
if(mGlobalAmbientColor != color) if(mGlobalAmbientColor != color)
{ {

View file

@ -901,8 +901,8 @@ public:
/// because of the state caching stuff. /// because of the state caching stuff.
/// @{ /// @{
void setLight(U32 stage, GFXLightInfo* light); void setLight(U32 stage, GFXLightInfo* light);
void setLightMaterial(GFXLightMaterial mat); void setLightMaterial(const GFXLightMaterial& mat);
void setGlobalAmbientColor(ColorF color); void setGlobalAmbientColor(const ColorF& color);
/// @} /// @}

View file

@ -91,7 +91,7 @@ class GuiContainer : public GuiControl
inline void setAnchorRight(bool val) { mSizingOptions.mAnchorRight = val; } inline void setAnchorRight(bool val) { mSizingOptions.mAnchorRight = val; }
ControlSizing getSizingOptions() const { return mSizingOptions; } ControlSizing getSizingOptions() const { return mSizingOptions; }
void setSizingOptions(ControlSizing val) { mSizingOptions = val; } void setSizingOptions(const ControlSizing& val) { mSizingOptions = val; }
/// @} /// @}

View file

@ -444,7 +444,7 @@ bool GuiSplitContainer::layoutControls( RectI &clientRect )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void GuiSplitContainer::solvePanelConstraints( Point2I newDragPos, GuiContainer * firstPanel, GuiContainer * secondPanel, RectI clientRect ) void GuiSplitContainer::solvePanelConstraints(Point2I newDragPos, GuiContainer * firstPanel, GuiContainer * secondPanel, const RectI& clientRect)
{ {
if( !firstPanel || !secondPanel ) if( !firstPanel || !secondPanel )
return; return;

View file

@ -84,7 +84,7 @@ public:
virtual inline Point2I getSplitPoint() { return mSplitPoint; }; virtual inline Point2I getSplitPoint() { return mSplitPoint; };
/// The Splitters entire Client Rectangle, this takes into account padding of this control /// The Splitters entire Client Rectangle, this takes into account padding of this control
virtual inline RectI getSplitRect() { return mSplitRect; }; virtual inline RectI getSplitRect() { return mSplitRect; };
virtual void solvePanelConstraints( Point2I newDragPos, GuiContainer * firstPanel, GuiContainer * secondPanel, RectI clientRect ); virtual void solvePanelConstraints(Point2I newDragPos, GuiContainer * firstPanel, GuiContainer * secondPanel, const RectI& clientRect);
virtual Point2I getMinExtent() const; virtual Point2I getMinExtent() const;
protected: protected:

View file

@ -548,7 +548,7 @@ void GuiTabBookCtrl::renderTabs( const Point2I &offset, const RectI &tabRect )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void GuiTabBookCtrl::renderTab( RectI tabRect, GuiTabPageCtrl *tab ) void GuiTabBookCtrl::renderTab(const RectI& tabRect, GuiTabPageCtrl *tab)
{ {
StringTableEntry text = tab->getText(); StringTableEntry text = tab->getText();
ColorI oldColor; ColorI oldColor;

View file

@ -158,7 +158,7 @@ class GuiTabBookCtrl : public GuiContainer
/// Tab rendering subroutine, renders one tab with specified options /// Tab rendering subroutine, renders one tab with specified options
/// @param tabRect the rectangle to render the tab into /// @param tabRect the rectangle to render the tab into
/// @param tab pointer to the tab page control for which to render the tab /// @param tab pointer to the tab page control for which to render the tab
void renderTab( RectI tabRect, GuiTabPageCtrl* tab ); void renderTab(const RectI& tabRect, GuiTabPageCtrl* tab);
/// @} /// @}

View file

@ -526,7 +526,7 @@ void GuiGradientCtrl::reInitSwatches( GuiGradientCtrl::PickMode )
} }
} }
void GuiGradientCtrl::addColorRange( Point2I pos, ColorF color ) void GuiGradientCtrl::addColorRange(Point2I pos, const ColorF& color)
{ {
if( pos.x + mSwatchFactor < mBlendRangeBox.point.x && if( pos.x + mSwatchFactor < mBlendRangeBox.point.x &&
pos.x + mSwatchFactor > mBlendRangeBox.extent.x ) pos.x + mSwatchFactor > mBlendRangeBox.extent.x )

View file

@ -148,7 +148,7 @@ public:
void inspectPreApply(); void inspectPreApply();
void inspectPostApply(); void inspectPostApply();
void reInitSwatches( GuiGradientCtrl::PickMode ); void reInitSwatches( GuiGradientCtrl::PickMode );
void addColorRange( Point2I pos, ColorF color ); void addColorRange(Point2I pos, const ColorF& color);
void removeColorRange( GuiGradientSwatchCtrl* swatch ); void removeColorRange( GuiGradientSwatchCtrl* swatch );
void sortColorRange(); void sortColorRange();

View file

@ -677,7 +677,7 @@ DefineEngineMethod( GuiListBoxCtrl, setItemColor, void, (S32 index, ColorF color
object->setItemColor( index, color ); object->setItemColor( index, color );
} }
void GuiListBoxCtrl::setItemColor( S32 index, ColorF color ) void GuiListBoxCtrl::setItemColor(S32 index, const ColorF& color)
{ {
if ((index >= mItems.size()) || index < 0) if ((index >= mItems.size()) || index < 0)
{ {
@ -1090,7 +1090,7 @@ void GuiListBoxCtrl::onRender( Point2I offset, const RectI &updateRect )
GFX->setClipRect( oldClipRect ); GFX->setClipRect( oldClipRect );
} }
void GuiListBoxCtrl::onRenderItem( RectI itemRect, LBItem *item ) void GuiListBoxCtrl::onRenderItem(const RectI& itemRect, LBItem *item)
{ {
if( item->isSelected ) if( item->isSelected )
GFX->getDrawUtil()->drawRectFill( itemRect, mProfile->mFillColorSEL ); GFX->getDrawUtil()->drawRectFill( itemRect, mProfile->mFillColorSEL );

View file

@ -107,7 +107,7 @@ public:
S32 insertItemWithColor( S32 index, StringTableEntry text, ColorF color = ColorF(-1, -1, -1), void *itemData = NULL); S32 insertItemWithColor( S32 index, StringTableEntry text, ColorF color = ColorF(-1, -1, -1), void *itemData = NULL);
S32 findItemText( StringTableEntry text, bool caseSensitive = false ); S32 findItemText( StringTableEntry text, bool caseSensitive = false );
void setItemColor(S32 index, ColorF color); void setItemColor(S32 index, const ColorF& color);
void clearItemColor(S32 index); void clearItemColor(S32 index);
void deleteItem( S32 index ); void deleteItem( S32 index );
@ -128,7 +128,7 @@ public:
// Rendering // Rendering
virtual void onRender( Point2I offset, const RectI &updateRect ); virtual void onRender( Point2I offset, const RectI &updateRect );
virtual void onRenderItem( RectI itemRect, LBItem *item ); virtual void onRenderItem(const RectI& itemRect, LBItem *item);
void drawBox( const Point2I &box, S32 size, ColorI &outlineColor, ColorI &boxColor ); void drawBox( const Point2I &box, S32 size, ColorI &outlineColor, ColorI &boxColor );
bool renderTooltip( const Point2I &hoverPos, const Point2I& cursorPos, const char* tipText ); bool renderTooltip( const Point2I &hoverPos, const Point2I& cursorPos, const char* tipText );
void addFilteredItem( String item ); void addFilteredItem( String item );

View file

@ -1624,7 +1624,7 @@ void GuiMenuBar::closeMenu()
} }
// Called when a menu item is highlighted by the mouse // Called when a menu item is highlighted by the mouse
void GuiMenuBar::highlightedMenuItem(S32 selectionIndex, RectI bounds, Point2I cellSize) void GuiMenuBar::highlightedMenuItem(S32 selectionIndex, const RectI& bounds, Point2I cellSize)
{ {
S32 selstore = selectionIndex; S32 selstore = selectionIndex;
@ -1778,7 +1778,7 @@ void GuiMenuBar::onAction()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Performs an action when a menu item that is a submenu is selected/highlighted // Performs an action when a menu item that is a submenu is selected/highlighted
void GuiMenuBar::onSubmenuAction(S32 selectionIndex, RectI bounds, Point2I cellSize) void GuiMenuBar::onSubmenuAction(S32 selectionIndex, const RectI& bounds, Point2I cellSize)
{ {
if(!mouseOverSubmenu) if(!mouseOverSubmenu)
return; return;

View file

@ -182,12 +182,12 @@ public:
static void addSubmenuItem(Menu *menu, MenuItem *submenu, MenuItem *newMenuItem ); static void addSubmenuItem(Menu *menu, MenuItem *submenu, MenuItem *newMenuItem );
static void removeSubmenuItem(MenuItem *menuItem, MenuItem *submenuItem); static void removeSubmenuItem(MenuItem *menuItem, MenuItem *submenuItem);
static void clearSubmenuItems(MenuItem *menuitem); static void clearSubmenuItems(MenuItem *menuitem);
void onSubmenuAction(S32 selectionIndex, RectI bounds, Point2I cellSize); void onSubmenuAction(S32 selectionIndex, const RectI& bounds, Point2I cellSize);
void closeSubmenu(); void closeSubmenu();
void checkSubmenuMouseMove(const GuiEvent &event); void checkSubmenuMouseMove(const GuiEvent &event);
MenuItem *findHitMenuItem(Point2I mousePoint); MenuItem *findHitMenuItem(Point2I mousePoint);
void highlightedMenuItem(S32 selectionIndex, RectI bounds, Point2I cellSize); // Called whenever a menu item is highlighted by the mouse void highlightedMenuItem(S32 selectionIndex, const RectI& bounds, Point2I cellSize); // Called whenever a menu item is highlighted by the mouse
// display/mouse functions // display/mouse functions

View file

@ -918,7 +918,7 @@ void DICreateUndoAction::initPersistFields()
Parent::initPersistFields(); Parent::initPersistFields();
} }
void DICreateUndoAction::addDecal( DecalInstance decal ) void DICreateUndoAction::addDecal(const DecalInstance& decal)
{ {
mDecalInstance = decal; mDecalInstance = decal;
mDatablockId = decal.mDataBlock->getId(); mDatablockId = decal.mDataBlock->getId();
@ -1006,7 +1006,7 @@ void DIDeleteUndoAction::initPersistFields()
Parent::initPersistFields(); Parent::initPersistFields();
} }
void DIDeleteUndoAction::deleteDecal( DecalInstance decal ) void DIDeleteUndoAction::deleteDecal(const DecalInstance& decal)
{ {
mDecalInstance = decal; mDecalInstance = decal;
mDatablockId = decal.mDataBlock->getId(); mDatablockId = decal.mDataBlock->getId();
@ -1094,7 +1094,7 @@ void DBDeleteUndoAction::initPersistFields()
Parent::initPersistFields(); Parent::initPersistFields();
} }
void DBDeleteUndoAction::deleteDecal( DecalInstance decal ) void DBDeleteUndoAction::deleteDecal(const DecalInstance& decal)
{ {
mDecalInstanceVec.increment(); mDecalInstanceVec.increment();
mDecalInstanceVec.last() = decal; mDecalInstanceVec.last() = decal;

View file

@ -129,7 +129,7 @@ public:
DICreateUndoAction( const UTF8* actionName = "Create Decal " ); DICreateUndoAction( const UTF8* actionName = "Create Decal " );
virtual ~DICreateUndoAction(); virtual ~DICreateUndoAction();
void addDecal( DecalInstance decal ); void addDecal(const DecalInstance& decal);
// UndoAction // UndoAction
virtual void undo(); virtual void undo();
@ -159,7 +159,7 @@ public:
virtual ~DIDeleteUndoAction(); virtual ~DIDeleteUndoAction();
/// ///
void deleteDecal( DecalInstance decal ); void deleteDecal(const DecalInstance& decal);
// UndoAction // UndoAction
virtual void undo(); virtual void undo();
@ -188,7 +188,7 @@ public:
DBDeleteUndoAction( const UTF8* actionName = "Delete Decal Datablock" ); DBDeleteUndoAction( const UTF8* actionName = "Delete Decal Datablock" );
virtual ~DBDeleteUndoAction(); virtual ~DBDeleteUndoAction();
void deleteDecal( DecalInstance decal ); void deleteDecal(const DecalInstance& decal);
// UndoAction // UndoAction
virtual void undo(); virtual void undo();

View file

@ -681,7 +681,7 @@ void NavMesh::updateConfig()
cfg.tileSize = mTileSize / cfg.cs; cfg.tileSize = mTileSize / cfg.cs;
} }
S32 NavMesh::getTile(Point3F pos) S32 NavMesh::getTile(const Point3F& pos)
{ {
if(mBuilding) if(mBuilding)
return -1; return -1;

View file

@ -118,7 +118,7 @@ public:
/// @} /// @}
/// Return the index of the tile included by this point. /// Return the index of the tile included by this point.
S32 getTile(Point3F pos); S32 getTile(const Point3F& pos);
/// Return the box of a given tile. /// Return the box of a given tile.
Box3F getTileBox(U32 id); Box3F getTileBox(U32 id);

View file

@ -28,11 +28,11 @@
#include "math/mBox.h" #include "math/mBox.h"
inline Point3F DTStoRC(F32 x, F32 y, F32 z) { return Point3F(x, z, -y); } inline Point3F DTStoRC(F32 x, F32 y, F32 z) { return Point3F(x, z, -y); }
inline Point3F DTStoRC(Point3F point) { return Point3F(point.x, point.z, -point.y); } inline Point3F DTStoRC(const Point3F& point){ return Point3F(point.x, point.z, -point.y); }
inline Point3F RCtoDTS(const F32* xyz) { return Point3F(xyz[0], -xyz[2], xyz[1]); } inline Point3F RCtoDTS(const F32* xyz) { return Point3F(xyz[0], -xyz[2], xyz[1]); }
inline Point3F RCtoDTS(F32 x, F32 y, F32 z) { return Point3F(x, -z, y); } inline Point3F RCtoDTS(F32 x, F32 y, F32 z) { return Point3F(x, -z, y); }
inline Point3F RCtoDTS(Point3F point) { return Point3F(point.x, -point.z, point.y); } inline Point3F RCtoDTS(const Point3F& point){ return Point3F(point.x, -point.z, point.y); }
inline Box3F DTStoRC(Box3F box) inline Box3F DTStoRC(const Box3F& box)
{ {
return Box3F(box.minExtents.x, box.minExtents.z, -box.maxExtents.y, return Box3F(box.minExtents.x, box.minExtents.z, -box.maxExtents.y,
box.maxExtents.x, box.maxExtents.z, -box.minExtents.y); box.maxExtents.x, box.maxExtents.z, -box.minExtents.y);

View file

@ -339,7 +339,7 @@ bool TerrainBlock::setFile( const FileName &terrFileName )
return true; return true;
} }
void TerrainBlock::setFile( Resource<TerrainFile> terr ) void TerrainBlock::setFile(const Resource<TerrainFile>& terr)
{ {
mFile = terr; mFile = terr;
mTerrFileName = terr.getPath(); mTerrFileName = terr.getPath();

View file

@ -413,7 +413,7 @@ public:
bool setFile( const FileName& terrFileName ); bool setFile( const FileName& terrFileName );
void setFile( Resource<TerrainFile> file ); void setFile(const Resource<TerrainFile>& file);
bool save(const char* filename); bool save(const char* filename);

View file

@ -38,7 +38,7 @@ bool triBoxOverlap(const Point3F &boxcenter, const Point3F &boxhalfsize, const P
/// Massage stuff into right format for triBoxOverlap test. This is really /// Massage stuff into right format for triBoxOverlap test. This is really
/// just a helper function - use the other version if you want to be fast! /// just a helper function - use the other version if you want to be fast!
inline bool triBoxOverlap(Box3F box, Point3F a, Point3F b, Point3F c) inline bool triBoxOverlap(Box3F box, const Point3F& a, const Point3F& b, const Point3F& c)
{ {
Point3F halfSize(box.len_x() / 2.f, box.len_y() / 2.f, box.len_z() / 2.f); Point3F halfSize(box.len_x() / 2.f, box.len_y() / 2.f, box.len_z() / 2.f);

View file

@ -125,8 +125,8 @@ bool intersect_triangle(Point3F orig, Point3F dir,
} }
//*** Taken from TSE, and based on the above //*** Taken from TSE, and based on the above
bool castRayTriangle(Point3F orig, Point3F dir, bool castRayTriangle(const Point3F& orig, const Point3F& dir,
Point3F vert0, Point3F vert1, Point3F vert2, const Point3F& vert0, const Point3F& vert1, const Point3F& vert2,
F32 &t, Point2F &bary) F32 &t, Point2F &bary)
{ {
Point3F tvec, qvec; Point3F tvec, qvec;

View file

@ -38,7 +38,7 @@ bool intersect_triangle(Point3F orig, Point3F dir,
F32& t, F32& u, F32& v); F32& t, F32& u, F32& v);
//*** Taken from TSE, but based on the above //*** Taken from TSE, but based on the above
bool castRayTriangle(Point3F orig, Point3F dir, Point3F vert0, Point3F vert1, Point3F vert2, F32 &t, Point2F &bary); bool castRayTriangle(const Point3F& orig, const Point3F& dir, const Point3F& vert0, const Point3F& vert1, const Point3F& vert2, F32 &t, Point2F &bary);
bool castRayTriangle(const Point3D &orig, const Point3D &dir, const Point3D &vert0, const Point3D &vert1, const Point3D &vert2); bool castRayTriangle(const Point3D &orig, const Point3D &dir, const Point3D &vert0, const Point3D &vert1, const Point3D &vert2);
#endif // _TRIRAYCHECK_H_ #endif // _TRIRAYCHECK_H_