Get game to build again.

This commit is contained in:
King_DuckZ 2015-08-16 22:29:34 +02:00
parent b01fad0314
commit 78312526ac
10 changed files with 38 additions and 37 deletions

View file

@ -217,9 +217,11 @@ namespace dkh {
uint32_t data_length;
};
TylerMapSourceBase::TylerMapSourceBase (pos_type parStreamStartPos) :
m_stream_start(parStreamStartPos)
TylerMapSourceBase::TylerMapSourceBase (std::istream* parStream) :
m_stream(parStream),
m_stream_start(parStream->tellg())
{
DK_ASSERT(m_stream);
}
TylerMapSourceBase::~TylerMapSourceBase() {
@ -239,10 +241,12 @@ namespace dkh {
return m_map_type;
}
void TylerMapSourceBase::parseMapHeaders (std::istream& parSrc, uint32_t parDim, std::vector<uint32_t>& parMapDims, std::vector<uint16_t>& parTileDims) {
void TylerMapSourceBase::parseMapHeaders (uint32_t parDim, std::vector<uint32_t>& parMapDims, std::vector<uint16_t>& parTileDims) {
DK_ASSERT(m_stream);
//Read file header
implem::TylerMapHeader header;
implem::read_header(parSrc, header);
implem::read_header(*m_stream, header);
if (header.dimensions != parDim) {
throw InvalidMapDimensionsException();
@ -270,15 +274,15 @@ namespace dkh {
std::vector<uint32_t> map_dims;
std::vector<uint16_t> tile_dims;
const auto read_start = (header.dimensions_start > sizeof(header) ? header.dimensions_start - sizeof(header) : sizeof(header));
parSrc.seekg(read_start, std::ios_base::cur);
implem::read_dimensions(parSrc, parDim, map_dims, tile_dims);
m_stream->seekg(read_start, std::ios_base::cur);
implem::read_dimensions(*m_stream, parDim, map_dims, tile_dims);
parMapDims.swap(map_dims);
parTileDims.swap(tile_dims);
}
//Read vorbis comments
parSrc.seekg(header.comment_start + m_stream_start, std::ios_base::beg);
read_comments(parSrc, m_file_vendor, m_comments);
m_stream->seekg(header.comment_start + m_stream_start, std::ios_base::beg);
read_comments(*m_stream, m_file_vendor, m_comments);
}
void read_header (std::istream& parStream, TylerMapHeader& parHeader) {