mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11910] Implement loading for MMap Generator
This commit is contained in:
parent
d3606fb4ee
commit
df3a5f2808
8 changed files with 48 additions and 1 deletions
|
|
@ -25,6 +25,7 @@
|
||||||
#include "DBCStores.h"
|
#include "DBCStores.h"
|
||||||
#include "GridMap.h"
|
#include "GridMap.h"
|
||||||
#include "VMapFactory.h"
|
#include "VMapFactory.h"
|
||||||
|
#include "MoveMap.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "Policies/SingletonImp.h"
|
#include "Policies/SingletonImp.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
|
@ -645,6 +646,7 @@ TerrainInfo::~TerrainInfo()
|
||||||
delete m_GridMaps[i][k];
|
delete m_GridMaps[i][k];
|
||||||
|
|
||||||
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_mapId);
|
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_mapId);
|
||||||
|
MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(m_mapId);
|
||||||
}
|
}
|
||||||
|
|
||||||
GridMap * TerrainInfo::Load(const uint32 x, const uint32 y)
|
GridMap * TerrainInfo::Load(const uint32 x, const uint32 y)
|
||||||
|
|
@ -705,6 +707,9 @@ void TerrainInfo::CleanUpGrids(const uint32 diff)
|
||||||
|
|
||||||
//unload VMAPS...
|
//unload VMAPS...
|
||||||
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_mapId, x, y);
|
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_mapId, x, y);
|
||||||
|
|
||||||
|
//unload mmap...
|
||||||
|
MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(m_mapId, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1088,6 +1093,9 @@ GridMap * TerrainInfo::LoadMapAndVMap( const uint32 x, const uint32 y )
|
||||||
DEBUG_LOG("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x,y,x,y);
|
DEBUG_LOG("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x,y,x,y);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// load navmesh
|
||||||
|
MMAP::MMapFactory::createOrGetMMapManager()->loadMap(m_mapId, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
#include "DBCEnums.h"
|
#include "DBCEnums.h"
|
||||||
#include "MapPersistentStateMgr.h"
|
#include "MapPersistentStateMgr.h"
|
||||||
#include "VMapFactory.h"
|
#include "VMapFactory.h"
|
||||||
|
#include "MoveMap.h"
|
||||||
#include "BattleGroundMgr.h"
|
#include "BattleGroundMgr.h"
|
||||||
|
|
||||||
Map::~Map()
|
Map::~Map()
|
||||||
|
|
@ -53,6 +54,9 @@ Map::~Map()
|
||||||
i_data = NULL;
|
i_data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// unload instance specific navigation data
|
||||||
|
MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(m_TerrainData->GetMapId(), GetInstanceId());
|
||||||
|
|
||||||
//release reference count
|
//release reference count
|
||||||
if(m_TerrainData->Release())
|
if(m_TerrainData->Release())
|
||||||
sTerrainMgr.UnloadTerrain(m_TerrainData->GetMapId());
|
sTerrainMgr.UnloadTerrain(m_TerrainData->GetMapId());
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,11 @@ namespace VMAP
|
||||||
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm);
|
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm);
|
||||||
bool isTiled() const { return iIsTiled; }
|
bool isTiled() const { return iIsTiled; }
|
||||||
uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
|
uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
|
||||||
|
|
||||||
|
#ifdef MMAP_GENERATOR
|
||||||
|
public:
|
||||||
|
void getModelInstances(ModelInstance* &models, uint32 &count);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AreaInfo
|
struct AreaInfo
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,11 @@ namespace VMAP
|
||||||
G3D::Matrix3 iInvRot;
|
G3D::Matrix3 iInvRot;
|
||||||
float iInvScale;
|
float iInvScale;
|
||||||
WorldModel *iModel;
|
WorldModel *iModel;
|
||||||
|
|
||||||
|
#ifdef MMAP_GENERATOR
|
||||||
|
public:
|
||||||
|
WorldModel* const getWorldModel();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
} // namespace VMAP
|
} // namespace VMAP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,12 @@ namespace VMAP
|
||||||
#include "Errors.h"
|
#include "Errors.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#define ERROR_LOG(...) sLog.outError(__VA_ARGS__);
|
#define ERROR_LOG(...) sLog.outError(__VA_ARGS__);
|
||||||
|
#elif defined MMAP_GENERATOR
|
||||||
|
#include <assert.h>
|
||||||
|
#define MANGOS_ASSERT(x) assert(x)
|
||||||
|
#define DEBUG_LOG(...) 0
|
||||||
|
#define DETAIL_LOG(...) 0
|
||||||
|
#define ERROR_LOG(...) do{ printf("ERROR:"); printf(__VA_ARGS__); printf("\n"); } while(0)
|
||||||
#else
|
#else
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#define MANGOS_ASSERT(x) assert(x)
|
#define MANGOS_ASSERT(x) assert(x)
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,11 @@ namespace VMAP
|
||||||
return getMapFileName(pMapId);
|
return getMapFileName(pMapId);
|
||||||
}
|
}
|
||||||
virtual bool existsMap(const char* pBasePath, unsigned int pMapId, int x, int y);
|
virtual bool existsMap(const char* pBasePath, unsigned int pMapId, int x, int y);
|
||||||
|
|
||||||
|
#ifdef MMAP_GENERATOR
|
||||||
|
public:
|
||||||
|
void getInstanceMapTree(InstanceTreeMap &instanceMapTree);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,10 @@ namespace VMAP
|
||||||
uint32 iType; //!< liquid type
|
uint32 iType; //!< liquid type
|
||||||
float *iHeight; //!< (tilesX + 1)*(tilesY + 1) height values
|
float *iHeight; //!< (tilesX + 1)*(tilesY + 1) height values
|
||||||
uint8 *iFlags; //!< info if liquid tile is used
|
uint8 *iFlags; //!< info if liquid tile is used
|
||||||
|
#ifdef MMAP_GENERATOR
|
||||||
|
public:
|
||||||
|
void getPosInfo(uint32 &tilesX, uint32 &tilesY, Vector3 &corner) const;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! holding additional info for WMO group files */
|
/*! holding additional info for WMO group files */
|
||||||
|
|
@ -98,6 +102,11 @@ namespace VMAP
|
||||||
std::vector<MeshTriangle> triangles;
|
std::vector<MeshTriangle> triangles;
|
||||||
BIH meshTree;
|
BIH meshTree;
|
||||||
WmoLiquid *iLiquid;
|
WmoLiquid *iLiquid;
|
||||||
|
|
||||||
|
#ifdef MMAP_GENERATOR
|
||||||
|
public:
|
||||||
|
void getMeshData(std::vector<Vector3> &vertices, std::vector<MeshTriangle> &triangles, WmoLiquid* &liquid);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
/*! Holds a model (converted M2 or WMO) in its original coordinate space */
|
/*! Holds a model (converted M2 or WMO) in its original coordinate space */
|
||||||
class WorldModel
|
class WorldModel
|
||||||
|
|
@ -117,6 +126,11 @@ namespace VMAP
|
||||||
uint32 RootWMOID;
|
uint32 RootWMOID;
|
||||||
std::vector<GroupModel> groupModels;
|
std::vector<GroupModel> groupModels;
|
||||||
BIH groupTree;
|
BIH groupTree;
|
||||||
|
|
||||||
|
#ifdef MMAP_GENERATOR
|
||||||
|
public:
|
||||||
|
void getGroupModels(std::vector<GroupModel> &groupModels);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
} // namespace VMAP
|
} // namespace VMAP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11909"
|
#define REVISION_NR "11910"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue