mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 08:38:52 -05:00
d24c8453db
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: "???"
23 lines
603 B
C++
23 lines
603 B
C++
#include "Texture.h"
|
|
|
|
namespace Ship
|
|
{
|
|
void TextureV0::ParseFileBinary(BinaryReader* reader, Resource* res)
|
|
{
|
|
Texture* tex = (Texture*)res;
|
|
|
|
ResourceFile::ParseFileBinary(reader, tex);
|
|
|
|
tex->texType = (TextureType)reader->ReadUInt32();
|
|
tex->width = reader->ReadUInt32();
|
|
tex->height = reader->ReadUInt32();
|
|
|
|
uint32_t dataSize = reader->ReadUInt32();
|
|
|
|
tex->imageDataSize = dataSize;
|
|
tex->imageData = new uint8_t[dataSize];
|
|
|
|
for (uint32_t i = 0; i < dataSize; i++)
|
|
tex->imageData[i] = reader->ReadUByte();
|
|
}
|
|
} |