QT buildfix attempt

This commit is contained in:
Henrik Rydgård 2017-01-21 14:48:12 +01:00
parent 9d5371a8ba
commit ec20cf7f88

View File

@ -465,7 +465,15 @@ void TextDrawer::DrawString(DrawBuffer &target, const char *str, float x, float
entry->bmWidth = entry->width = image.width();
entry->bmHeight = entry->height = image.height();
entry->lastUsedFrame = frameCount_;
entry->texture = thin3d_->CreateTexture(LINEAR2D, DataFormat::R4G4B4A4_UNORM_PACK16, entry->bmWidth, entry->bmHeight, 1, 0);
TextureDesc desc{};
desc.type = TextureType::LINEAR2D;
desc.format = Draw::DataFormat::R4G4B4A4_UNORM_PACK16;
desc.width = entry->bmWidth;
desc.height = entry->bmHeight;
desc.depth = 1;
desc.mipLevels = 1;
entry->texture = thin3d_->CreateTexture(desc);
uint16_t *bitmapData = new uint16_t[entry->bmWidth * entry->bmHeight];
for (int x = 0; x < entry->bmWidth; x++) {
@ -474,7 +482,6 @@ void TextDrawer::DrawString(DrawBuffer &target, const char *str, float x, float
}
}
entry->texture->SetImageData(0, 0, 0, entry->bmWidth, entry->bmHeight, 1, 0, entry->bmWidth * 2, (const uint8_t *)bitmapData);
entry->texture->Finalize();
delete [] bitmapData;