Shipwright/libultraship/libultraship/Text.cpp
M4xw d24c8453db git subrepo clone https://github.com/HarbourMasters/libultraship.git
subrepo:
  subdir:   "libultraship"
  merged:   "a484cda98"
upstream:
  origin:   "https://github.com/HarbourMasters/libultraship.git"
  branch:   "main"
  commit:   "a484cda98"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:52:44 +01:00

23 lines
506 B
C++

#include "Text.h"
void Ship::TextV0::ParseFileBinary(BinaryReader* reader, Resource* res)
{
Text* txt = (Text*)res;
ResourceFile::ParseFileBinary(reader, txt);
uint32_t msgCount = reader->ReadUInt32();
txt->messages.reserve(msgCount);
for (uint32_t i = 0; i < msgCount; i++)
{
MessageEntry entry;
entry.id = reader->ReadUInt16();
entry.textboxType = reader->ReadUByte();
entry.textboxYPos = reader->ReadUByte();
entry.msg = reader->ReadString();
txt->messages.push_back(entry);
}
}