fixed texture loading

This commit is contained in:
Asuro
2025-02-17 18:25:39 +01:00
parent f93c40f3b6
commit fb5851020f
14 changed files with 30 additions and 16 deletions

View File

@@ -37,7 +37,8 @@ namespace Game
long fileSize = ftell(file);
fseek(file, 0, SEEK_SET);
const bgfx::Memory* mem = bgfx::alloc(fileSize + 1);
void* rawMem = AllocateScratch(fileSize + 1);
const bgfx::Memory* mem = bgfx::makeRef(rawMem, fileSize + 1);
fread(mem->data, 1, fileSize, file);
if (appendZero)
{
@@ -126,7 +127,9 @@ namespace Game
*_orientation = imageContainer.m_orientation;
}
const bgfx::Memory* mem = bgfx::makeRef(imageContainer.m_data, imageContainer.m_size);
const bgfx::Memory* mem =
bgfx::makeRef(data->data + imageContainer.m_offset, data->size - imageContainer.m_offset);
// const bgfx::Memory* mem = bgfx::makeRef(imageContainer.m_data, imageContainer.m_size);
if (NULL != _info)
{