bool cMapManager::DoWithMap(UInt32 a_ID, cMapCallback & a_Callback) { cCSLock Lock(m_CS); cMap * Map = GetMapData(a_ID); if (Map == nullptr) { return false; } else { a_Callback.Item(Map); return true; } }
// 월드좌표 wx, wy위치의 충돌값을 리턴한다. BYTE XMapLayerTile::GetCollision( float wx, float wy ) { XTilePack *pTilePack = m_pTilePack; // 좌표의 타일을 구함. int tw = pTilePack->GetwTile(); int th = pTilePack->GethTile(); int tx = (int)wx / tw; int ty = (int)wy / th; int idxTile = GetMapData( tx, ty ); // 타일의 로컬오프셋이 어딘지 계산 int xOfs = (int)wx % tw; int yOfs = (int)wy % th; BYTE coll = pTilePack->GetTileMask( idxTile, xOfs, yOfs ); return coll; }