- FileData cleanup and uncoupling from FString.

Work is still needed to allow this to use the lump cache directly because some decisions in the past made this data padded by a zero byte.
This commit is contained in:
Christoph Oelckers 2023-08-19 22:59:11 +02:00
commit a0d679b84b
24 changed files with 69 additions and 90 deletions

View file

@ -178,7 +178,7 @@ void FDMDModel::LoadGeometry()
{
static int axis[3] = { VX, VY, VZ };
FileData lumpdata = fileSystem.ReadFile(mLumpNum);
const char *buffer = (const char *)lumpdata.GetMem();
auto buffer = lumpdata.GetString();
texCoords = new FTexCoord[info.numTexCoords];
memcpy(texCoords, buffer + info.offsetTexCoords, info.numTexCoords * sizeof(FTexCoord));
@ -502,7 +502,7 @@ void FMD2Model::LoadGeometry()
static int axis[3] = { VX, VY, VZ };
uint8_t *md2_frames;
FileData lumpdata = fileSystem.ReadFile(mLumpNum);
const char *buffer = (const char *)lumpdata.GetMem();
auto buffer = lumpdata.GetString();
texCoords = new FTexCoord[info.numTexCoords];
memcpy(texCoords, (uint8_t*)buffer + info.offsetTexCoords, info.numTexCoords * sizeof(FTexCoord));