From 81f793a18c25c459a8633654ee7e8644a0d45c63 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 14 Sep 2022 06:21:42 +0000 Subject: [PATCH 1/2] Fix Negative Texture Level Issues --- .../Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp b/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp index 4dcfcc0be2..a3759238dc 100644 --- a/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp +++ b/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp @@ -372,7 +372,7 @@ void ERS_CLASS_AsyncTextureUpdater::SetLevelRAM(ERS_STRUCT_Model* Model, bool Lo // Also apparenly I don't know how to spell... // Load New Levels Into Memory if (Model->TextureLevelInRAM_ < Model->TargetTextureLevelRAM) { - for (int LevelToLoad = Model->TextureLevelInRAM_; LevelToLoad <= Model->TargetTextureLevelRAM; LevelToLoad++) { + for (int LevelToLoad = std::max(Model->TextureLevelInRAM_, 0); LevelToLoad <= Model->TargetTextureLevelRAM; LevelToLoad++) { for (unsigned int TextureIndex = 0; TextureIndex < Model->Textures_.size(); TextureIndex++) { LoadImageDataRAM(&Model->Textures_[TextureIndex], LevelToLoad, LogEnable); } From 519ae98244f81662385c7411a5c986d2c6b9a758 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Wed, 14 Sep 2022 06:28:39 +0000 Subject: [PATCH 2/2] Fix Formatting --- .../ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp b/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp index a3759238dc..39d89603c0 100644 --- a/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp +++ b/Source/Core/Loader/ERS_ModelLoader/ERS_CLASS_AsyncTextureUpdater.cpp @@ -623,7 +623,6 @@ void ERS_CLASS_AsyncTextureUpdater::SortModels(ERS_STRUCT_Scene* Scene) { } - void ERS_CLASS_AsyncTextureUpdater::TexturePusherThread(int Index) { // Name Thread @@ -724,24 +723,18 @@ void ERS_CLASS_AsyncTextureUpdater::TextureLoaderThread(int Index) { // Shut Down FreeImage FreeImage_DeInitialise(); } - - int ERS_CLASS_AsyncTextureUpdater::GetNumLoaderThreads() { return NumLoaderThreads_; } - int ERS_CLASS_AsyncTextureUpdater::GetNumStreamerThreads() { return NumPusherThreads_; } - void ERS_CLASS_AsyncTextureUpdater::SetNumLoaderThreads(int NumThreads) { NumLoaderThreads_ = NumThreads; } - void ERS_CLASS_AsyncTextureUpdater::SetNumStreamerThreads(int NumThreads) { NumPusherThreads_ = NumThreads; } - void ERS_CLASS_AsyncTextureUpdater::SetupPusherThreads() { // Setup Threads