From 905cff2a9456406f1be91ca311ab219980e9840c Mon Sep 17 00:00:00 2001 From: gus Date: Thu, 11 Apr 2013 18:02:12 +0100 Subject: [PATCH] anonymous namespace --- apps/openmw/mwmechanics/aitravel.cpp | 15 +++++++++------ apps/openmw/mwmechanics/pathfinding.cpp | 8 +++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwmechanics/aitravel.cpp b/apps/openmw/mwmechanics/aitravel.cpp index 65d43749b..13ae2a592 100644 --- a/apps/openmw/mwmechanics/aitravel.cpp +++ b/apps/openmw/mwmechanics/aitravel.cpp @@ -13,6 +13,15 @@ #include #include "boost/tuple/tuple.hpp" +namespace +{ + float sgn(float a) + { + if(a>0) return 1.; + else return -1.; + } +} + namespace MWMechanics { @@ -26,12 +35,6 @@ namespace MWMechanics return new AiTravel(*this); } - static float sgn(float a) - { - if(a>0) return 1.; - else return -1.; - } - bool AiTravel::execute (const MWWorld::Ptr& actor) { const ESM::Pathgrid *pathgrid = diff --git a/apps/openmw/mwmechanics/pathfinding.cpp b/apps/openmw/mwmechanics/pathfinding.cpp index 1d98674ef..7c22e5470 100644 --- a/apps/openmw/mwmechanics/pathfinding.cpp +++ b/apps/openmw/mwmechanics/pathfinding.cpp @@ -4,10 +4,9 @@ #include "boost/tuple/tuple.hpp" #include "OgreMath.h" -namespace MWMechanics +namespace { - - //helpers functions + //helpers functions float distanceZCorrected(ESM::Pathgrid::Point point,float x,float y,float z) { return sqrt((point.mX - x)*(point.mX - x)+(point.mY - y)*(point.mY - y)+0.1*(point.mZ - z)*(point.mZ - z)); @@ -89,7 +88,10 @@ namespace MWMechanics const PathGridGraph & mGraph; PointID mGoal; }; +} +namespace MWMechanics +{ PathGridGraph buildGraph(const ESM::Pathgrid* pathgrid,float xCell = 0,float yCell = 0) { PathGridGraph graph;