Ejemplo n.º 1
0
GridMapPtr TerrainInfo::Load(uint32 const& x, uint32 const& y)
{
    MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS);
    MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS);

    // quick check if GridMap already loaded
    GridMapPtr pMap = GetGridMap(x, y);
    if (!pMap)
        pMap = LoadMapAndVMap(x, y);

    return pMap;
}
Ejemplo n.º 2
0
GridMap * TerrainInfo::GetGrid( const float x, const float y )
{
    // half opt method
    int gx=(int)(32-x/SIZE_OF_GRIDS);                       //grid x
    int gy=(int)(32-y/SIZE_OF_GRIDS);                       //grid y
    
    //quick check if GridMap already loaded
    GridMap * pMap = m_GridMaps[gx][gy];
    if(!pMap)
         pMap = LoadMapAndVMap(gx, gy);

    return pMap;
}
Ejemplo n.º 3
0
GridMap * TerrainInfo::Load(const uint32 x, const uint32 y)
{
    MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS);
    MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS);

    //reference grid as a first step
    RefGrid(x, y);

    //quick check if GridMap already loaded
    GridMap * pMap = m_GridMaps[x][y];
    if(!pMap)
        pMap = LoadMapAndVMap(x, y);

    return pMap;
}
Ejemplo n.º 4
0
GridMap * TerrainInfo::GetGrid( const float x, const float y )
{
    // half opt method
    int gx=(int)(32-x/SIZE_OF_GRIDS);                       //grid x
    int gy=(int)(32-y/SIZE_OF_GRIDS);                       //grid y

    //quick check if GridMap already loaded
    GridMap * pMap = m_GridMaps[gx][gy];
    if(!pMap)
    {
	 // Make sure to reference the grid so it doesn't get cleaned up straight away.
	 RefGrid(gx, gy);
         pMap = LoadMapAndVMap(gx, gy);
    }

    return pMap;
}
Ejemplo n.º 5
0
GridMapPtr TerrainInfo::GetGrid(float const& x, float const& y)
{
    // half opt method
    int gx = (int)(32 - x / SIZE_OF_GRIDS);                 // grid x
    int gy = (int)(32 - y / SIZE_OF_GRIDS);                 // grid y

    if (gx >= MAX_NUMBER_OF_GRIDS || gy >= MAX_NUMBER_OF_GRIDS ||
        gx < 0 || gy < 0)
        return GridMapPtr();

    // quick check if GridMap already loaded
    GridMapPtr pMap = GetGridMap(gx,gy);
    if (!pMap)
        pMap = LoadMapAndVMap(gx, gy);

    return pMap;
}