diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/shared/vmap/CoordModelMapping.h | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/shared/vmap/CoordModelMapping.h')
-rw-r--r-- | src/shared/vmap/CoordModelMapping.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/shared/vmap/CoordModelMapping.h b/src/shared/vmap/CoordModelMapping.h index 7684bf1b373..8600620cc99 100644 --- a/src/shared/vmap/CoordModelMapping.h +++ b/src/shared/vmap/CoordModelMapping.h @@ -17,43 +17,32 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef _COORDMODELMAPPING_H_ #define _COORDMODELMAPPING_H_ - #include <cstdio> #include <G3D/Table.h> #include <G3D/Array.h> - /** This Class is a helper Class to convert the raw vector data into BSP-Trees. We read the directory file of the raw data output and build logical groups. Models with a lot of vectors are not merged into a resulting model, but separated into an additional file. */ - namespace VMAP { - #define MIN_VERTICES_FOR_OWN_CONTAINER_FILE 65000 - // if we are in an instance #define MIN_INST_VERTICES_FOR_OWN_CONTAINER_FILE 40000 - //===================================================== class NameCollection { public: G3D::Array<std::string> iMainFiles; G3D::Array<std::string> iSingeFiles; - void appendToMain(const std::string& pStr) { iMainFiles.append(pStr); } void appendToSingle(const std::string& pStr) { iSingeFiles.append(pStr); } - size_t size() { return (iMainFiles.size() + iSingeFiles.size()); } }; - //===================================================== - class CMappingEntry { private: @@ -61,7 +50,6 @@ namespace VMAP int yPos; unsigned int iMapId; G3D::Array<std::string> iFilenames; - public: CMappingEntry() { }; CMappingEntry(unsigned int pMapId, const int pXPos, const int pYPos) @@ -70,17 +58,12 @@ namespace VMAP xPos = pXPos; yPos = pYPos; }; ~CMappingEntry() {}; - void addFilename(char *pName); const std::string getKeyString() const; inline const G3D::Array<std::string>& getFilenames() const { return(iFilenames); } - static const std::string getKeyString(unsigned int pMapId, int pXPos, int pYPos); - }; - //===================================================== - class CoordModelMapping { private: @@ -89,12 +72,10 @@ namespace VMAP G3D::Array<unsigned int> iMapIds; G3D::Array<unsigned int> iWorldAreaGroups; bool (*iFilterMethod)(char *pName); - inline void addCMappingEntry(CMappingEntry* pCMappingEntry) { iMapObjectFiles.set(pCMappingEntry->getKeyString(), pCMappingEntry); } - inline CMappingEntry* getCMappingEntry(const std::string& pKey) { if(iMapObjectFiles.containsKey(pKey)) @@ -102,19 +83,14 @@ namespace VMAP else return 0; } - public: CoordModelMapping() { iFilterMethod = NULL; } virtual ~CoordModelMapping(); - bool readCoordinateMapping(const std::string& pDirectoryFileName); - const NameCollection getFilenamesForCoordinate(unsigned int pMapId, int xPos, int yPos); - static unsigned int getMapIdFromFilename(const std::string& pName) { size_t spos; - spos = pName.find_last_of('/'); std::string basename = pName.substr(0, spos); spos = basename.find_last_of('/'); @@ -122,11 +98,9 @@ namespace VMAP unsigned int mapId = atoi(groupname.c_str()); return(mapId); } - const G3D::Array<unsigned int>& getMaps() const { return iMapIds; } bool isAlreadyProcessedSingleFile(const std::string& pName) const { return iProcesseSingleFiles.containsKey(pName); } void addAlreadyProcessedSingleFile(const std::string& pName) { iProcesseSingleFiles.set(pName,pName); } - inline void addWorldAreaMap(unsigned int pMapId) { if(!iWorldAreaGroups.contains(pMapId)) @@ -136,7 +110,6 @@ namespace VMAP } inline bool isWorldAreaMap(unsigned int pMapId) { return(iWorldAreaGroups.contains(pMapId)); } void setModelNameFilterMethod(bool (*pFilterMethod)(char *pName)) { iFilterMethod = pFilterMethod; } - }; } #endif /*_COORDMODELMAPPING_H_*/ |