Fix for faster models exporting

This commit is contained in:
Wojtek Figat
2022-03-14 20:32:38 +01:00
parent 6da3dff5de
commit b780e33a5b
3 changed files with 7 additions and 8 deletions

View File

@@ -75,8 +75,8 @@ ExportAssetResult AssetExporters::ExportModel(ExportAssetContext& context)
for (uint32 i = 0; i < vertices; i++) for (uint32 i = 0; i < vertices; i++)
{ {
auto v = vb1[i].TexCoord; auto v = vb1[i].TexCoord.ToVector2();
output->WriteText(StringAnsi::Format("vt {0} {1}\n", Float16Compressor::Decompress(v.X), Float16Compressor::Decompress(v.Y))); output->WriteText(StringAnsi::Format("vt {0} {1}\n", v.X, v.Y));
} }
output->WriteChar('\n'); output->WriteChar('\n');
@@ -180,8 +180,8 @@ ExportAssetResult AssetExporters::ExportSkinnedModel(ExportAssetContext& context
for (uint32 i = 0; i < vertices; i++) for (uint32 i = 0; i < vertices; i++)
{ {
auto v = vb0[i].TexCoord; auto v = vb0[i].TexCoord.ToVector2();
output->WriteText(StringAnsi::Format("vt {0} {1}\n", Float16Compressor::Decompress(v.X), Float16Compressor::Decompress(v.Y))); output->WriteText(StringAnsi::Format("vt {0} {1}\n", v.X, v.Y));
} }
output->WriteChar('\n'); output->WriteChar('\n');

View File

@@ -519,14 +519,12 @@ void ReadStream::ReadJson(ISerializable* obj)
void WriteStream::WriteText(const StringView& text) void WriteStream::WriteText(const StringView& text)
{ {
for (int32 i = 0; i < text.Length(); i++) WriteBytes(text.Get(), sizeof(Char) * text.Length());
WriteChar(text[i]);
} }
void WriteStream::WriteText(const StringAnsiView& text) void WriteStream::WriteText(const StringAnsiView& text)
{ {
for (int32 i = 0; i < text.Length(); i++) WriteBytes(text.Get(), sizeof(char) * text.Length());
WriteChar(text[i]);
} }
void WriteStream::WriteString(const StringView& data) void WriteStream::WriteString(const StringView& data)

View File

@@ -18,6 +18,7 @@
#define FMT_USE_WINDOWS_H 0 #define FMT_USE_WINDOWS_H 0
//#define FMT_USE_STRING_VIEW 1 //#define FMT_USE_STRING_VIEW 1
#define FMT_USE_STRING 0 #define FMT_USE_STRING 0
#define FMT_USE_LONG_DOUBLE 0
#define FMT_USE_ITERATOR 0 #define FMT_USE_ITERATOR 0
#define FMT_USE_LOCALE_GROUPING 0 #define FMT_USE_LOCALE_GROUPING 0
#define FMT_EXCEPTIONS 0 #define FMT_EXCEPTIONS 0