aboutsummaryrefslogtreecommitdiff
path: root/src/common/Collision/Management
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-07-05 17:48:08 +0200
committerOvahlord <dreadkiller@gmx.de>2024-07-06 15:36:06 +0200
commit5acd3085501fb7ad4ad76ccec4f727e20869cacd (patch)
treed0da6c8d5d6efedb98741d73646ce469ea594552 /src/common/Collision/Management
parentf82fcdc1769307f8b82cebefdcf2030cea1b9e7d (diff)
Core/Vmaps: Minor cleanup in MapTree - use unique_ptr to manage file handles
(cherry picked from commit 5dbb6b043f8e66a3b163e4275dc8ec8ce22ce096)
Diffstat (limited to 'src/common/Collision/Management')
-rw-r--r--src/common/Collision/Management/VMapManager2.cpp8
-rw-r--r--src/common/Collision/Management/VMapManager2.h4
2 files changed, 1 insertions, 11 deletions
diff --git a/src/common/Collision/Management/VMapManager2.cpp b/src/common/Collision/Management/VMapManager2.cpp
index 82fcd47f3d2..02d618836ec 100644
--- a/src/common/Collision/Management/VMapManager2.cpp
+++ b/src/common/Collision/Management/VMapManager2.cpp
@@ -23,8 +23,6 @@
#include "VMapDefinitions.h"
#include "WorldModel.h"
#include <G3D/Vector3.h>
-#include <iomanip>
-#include <sstream>
#include <string>
using G3D::Vector3;
@@ -103,11 +101,7 @@ namespace VMAP
// move to MapTree too?
std::string VMapManager2::getMapFileName(unsigned int mapId)
{
- std::stringstream fname;
- fname.width(4);
- fname << std::setfill('0') << mapId << std::string(MAP_FILENAME_EXTENSION2);
-
- return fname.str();
+ return Trinity::StringFormat("{:04}.vmtree", mapId);
}
LoadResult VMapManager2::loadMap(char const* basePath, unsigned int mapId, int x, int y)
diff --git a/src/common/Collision/Management/VMapManager2.h b/src/common/Collision/Management/VMapManager2.h
index b621fc72d02..5abe003056c 100644
--- a/src/common/Collision/Management/VMapManager2.h
+++ b/src/common/Collision/Management/VMapManager2.h
@@ -27,10 +27,6 @@
//===========================================================
-#define MAP_FILENAME_EXTENSION2 ".vmtree"
-
-#define FILENAMEBUFFER_SIZE 500
-
/**
This is the main Class to manage loading and unloading of maps, line of sight, height calculation and so on.
For each map or map tile to load it reads a directory file that contains the ModelContainer files used by this map or map tile.