@@ -240,28 +240,6 @@ void Gui::LoadTextureFromRawImage(const std::string& name, const std::string& pa
240
240
initData->Type = static_cast <uint32_t >(RESOURCE_TYPE_GUI_TEXTURE);
241
241
initData->ResourceVersion = 0 ;
242
242
auto guiTexture = std::static_pointer_cast<GuiTexture>(Context::GetInstance ()->GetResourceManager ()->LoadResource (path, false , initData));
243
- // const auto res = Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFile(path, initData);
244
-
245
- // if (!res) {
246
- // SPDLOG_ERROR("Failed to load resource");
247
- // return;
248
- // }
249
- // if (!res->Buffer || res->Buffer->empty()) {
250
- // SPDLOG_ERROR("Buffer is null or empty");
251
- // return;
252
- // }
253
-
254
- // GuiTexture asset;
255
- // asset.Width = 0;
256
- // asset.Height = 0;
257
- // uint8_t* imgData = stbi_load_from_memory(reinterpret_cast<const stbi_uc*>(res->Buffer->data()), res->Buffer->size(),
258
- // &asset.Width, &asset.Height, nullptr, 4);
259
-
260
-
261
- // if (imgData == nullptr) {
262
- // SPDLOG_ERROR("Error loading imgui texture {}", stbi_failure_reason());
263
- // return;
264
- // }
265
243
266
244
GfxRenderingAPI* api = gfx_get_current_rendering_api ();
267
245
@@ -272,19 +250,6 @@ void Gui::LoadTextureFromRawImage(const std::string& name, const std::string& pa
272
250
api->upload_texture (guiTexture->Data , guiTexture->Metadata .Width , guiTexture->Metadata .Height );
273
251
274
252
mGuiTextures [name] = guiTexture->Metadata ;
275
- // stbi_image_free(imgData);
276
-
277
- // auto initData = std::make_shared<ResourceInitData>();
278
- // initData->Format = RESOURCE_FORMAT_BINARY;
279
- // initData->Type = static_cast<uint32_t>(RESOURCE_TYPE_GUI_TEXTURE);
280
- // initData->ResourceVersion = 0;
281
- // auto guiTextureResource = std::static_pointer_cast<GuiTextureResource>(Context::GetInstance()->GetResourceManager()->LoadResource(path, false, initData));
282
-
283
- // if (guiTextureResource == nullptr) {
284
- // return;
285
- // }
286
-
287
- // mGuiTextures[name] = guiTextureResource->GuiTextureData;
288
253
}
289
254
290
255
bool Gui::SupportsViewports () {
0 commit comments