BaseMapSource doesn't need to know T. Only fetch() will need that.
This commit is contained in:
parent
49f7d15379
commit
ab6ef6c338
14 changed files with 42 additions and 40 deletions
|
@ -92,12 +92,12 @@ namespace dkh {
|
|||
return m_tileSize;
|
||||
}
|
||||
|
||||
void AsciiMapSource::fetch (std::vector<MapTileType>& parOut, const coords& parFrom, const coords& parTo) {
|
||||
void AsciiMapSource::fetch_raw (char* parOut, const coords& parFrom, const coords& parTo, std::size_t parSize) {
|
||||
const std::size_t from = parFrom.x() + parFrom.y() * m_mapSize.x();
|
||||
const std::size_t to = parTo.x() + parTo.y() * m_mapSize.x() + 1;
|
||||
DK_ASSERT(to >= from);
|
||||
parOut.resize(to - from);
|
||||
std::copy(m_wholedata.begin() + from, m_wholedata.begin() + to, parOut.begin());
|
||||
DK_ASSERT(parSize / sizeof(MapTileType) == to - from);
|
||||
std::copy(m_wholedata.begin() + from, m_wholedata.begin() + to, parOut);
|
||||
}
|
||||
|
||||
dk::MapTypes AsciiMapSource::mapType() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue