0ad/source/tools/atlas/DatafileIO/Util.cpp
Ykkrosh aa118403bb Terrain: CalcFromPosition, to convert world-space to tile-space.
ScEd: Compilation fixes.
Atlas: Screen-space to world-space conversion when editing terrain.
Wireframe option. Minor wxWidgets 2.6.1 fixes. AoE3Ed.

This was SVN commit r2698.
2005-09-12 20:04:26 +00:00

26 lines
517 B
C++

#include "stdafx.h"
#include "Util.h"
#include "Stream/Stream.h"
using namespace DatafileIO;
utf16string DatafileIO::ReadUString(InputStream& stream)
{
uint32_t length;
stream.Read(&length, 4);
utf16string ret;
ret.resize(length);
stream.Read(&ret[0], length*2);
return ret;
}
void DatafileIO::WriteUString(OutputStream& stream, const utf16string& string)
{
uint32_t length = (uint32_t)string.length();
stream.Write(&length, 4);
stream.Write((utf16_t*)&string[0], length*2);
}