From 7a94a9c4663041e34dd987b188a911602ec85693 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Fri, 28 Jun 2024 22:34:46 +0200 Subject: [PATCH] Removed never called idDeferredImage code --- neo/renderer/Image.h | 40 ----------------------------------- neo/renderer/ImageManager.cpp | 20 ------------------ neo/renderer/Image_files.cpp | 20 ------------------ 3 files changed, 80 deletions(-) diff --git a/neo/renderer/Image.h b/neo/renderer/Image.h index 67159682..6cee7f3f 100644 --- a/neo/renderer/Image.h +++ b/neo/renderer/Image.h @@ -251,40 +251,6 @@ typedef enum CF_SINGLE, // SP: A single texture cubemap. All six sides in one image. } cubeFiles_t; -class idDeferredImage -{ -public: - idDeferredImage( const char* imageName ); - ~idDeferredImage(); - - idStr name; - byte* pic; - int width; - int height; - textureFilter_t textureFilter; - textureRepeat_t textureRepeat; - textureUsage_t textureUsage; -}; - -ID_INLINE idDeferredImage::idDeferredImage( const char* imageName ) - : name( imageName ) - , pic( nullptr ) - , width( 0 ) - , height( 0 ) - , textureFilter( TF_DEFAULT ) - , textureRepeat( TR_CLAMP ) - , textureUsage( TD_DEFAULT ) -{ -} - -ID_INLINE idDeferredImage::~idDeferredImage() -{ - if( pic ) - { - delete pic; - } -} - typedef void ( *ImageGeneratorFunction )( idImage* image, nvrhi::ICommandList* commandList ); #include "BinaryImage.h" @@ -666,8 +632,6 @@ public: idImage* AllocImage( const char* name ); idImage* AllocStandaloneImage( const char* name ); - idDeferredImage* AllocDeferredImage( const char* name ); - bool ExcludePreloadImage( const char* name ); idList images; @@ -676,10 +640,6 @@ public: // Transient list of images to load on the main thread to the gpu. Freed after images are loaded. idList imagesToLoad; - // Permanent images to load from memory instead of a file system. - idList deferredImages; - idHashIndex deferredImageHash; - bool insideLevelLoad; // don't actually load images now bool preloadingMapImages; // unless this is set diff --git a/neo/renderer/ImageManager.cpp b/neo/renderer/ImageManager.cpp index 961a17ff..6ba776a0 100644 --- a/neo/renderer/ImageManager.cpp +++ b/neo/renderer/ImageManager.cpp @@ -328,23 +328,6 @@ idImage* idImageManager::AllocStandaloneImage( const char* name ) return image; } -/* -============== -AllocDeferredImage - -Allocates an idDeferredImage to load images from memory, adds it to the hash chain -============== -*/ -idDeferredImage* idImageManager::AllocDeferredImage( const char* name ) -{ - idDeferredImage* image = new( TAG_IMAGE ) idDeferredImage( name ); - - int hash = idStr( name ).FileNameHash(); - deferredImageHash.Add( hash, deferredImages.Append( image ) ); - - return image; -} - /* ================== ImageFromFunction @@ -356,7 +339,6 @@ system to be completely regenerated if needed. */ idImage* idImageManager::ImageFromFunction( const char* _name, ImageGeneratorFunction generatorFunction ) { - // strip any .tga file extensions from anywhere in the _name idStr name = _name; name.Replace( ".tga", "" ); @@ -780,8 +762,6 @@ void idImageManager::Shutdown() { images.DeleteContents( true ); imageHash.Clear(); - deferredImages.DeleteContents( true ); - deferredImageHash.Clear(); commandList.Reset(); } diff --git a/neo/renderer/Image_files.cpp b/neo/renderer/Image_files.cpp index f9350bf9..2fc06228 100644 --- a/neo/renderer/Image_files.cpp +++ b/neo/renderer/Image_files.cpp @@ -1115,26 +1115,6 @@ retry: } } } - else - { - // Try loading from a deferred image hash list - int hash = name.FileNameHash(); - for( int i = globalImages->deferredImageHash.First( hash ); i != -1; i = globalImages->deferredImageHash.Next( i ) ) - { - idDeferredImage* image = globalImages->deferredImages[i]; - if( name.Icmp( image->name ) == 0 ) - { - if( pic && *pic == nullptr ) - { - *usage = image->textureUsage; - *width = image->width; - *height = image->height; - memcpy( *pic, image->pic, 4 * *width * *height ); - break; - } - } - } - } // RB end if( ( width && *width < 1 ) || ( height && *height < 1 ) )