doom3-bfg/neo/stub/Image_stub.cpp
2024-06-17 21:37:10 +02:00

201 lines
4.6 KiB
C++

/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
Copyright (C) 2013-2023 Robert Beckebans
Copyright (C) 2022 Stephen Pridham
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "precompiled.h"
#pragma hdrstop
idCVar image_pixelLook( "image_pixelLook", "0", CVAR_BOOL | CVAR_ARCHIVE, "Turn off linear filtering on most textures to achieve the 90s software renderer look" );
#include "../renderer/RenderCommon.h"
/*
====================
idImage::idImage
====================
*/
idImage::idImage( const char* name ) : imgName( name )
{
texture.Reset();
generatorFunction = NULL;
filter = TF_DEFAULT;
repeat = TR_REPEAT;
usage = TD_DEFAULT;
cubeFiles = CF_2D;
cubeMapSize = 0;
isLoaded = false;
referencedOutsideLevelLoad = false;
levelLoadReferenced = false;
defaulted = false;
sourceFileTime = FILE_NOT_FOUND_TIMESTAMP;
binaryFileTime = FILE_NOT_FOUND_TIMESTAMP;
refCount = 0;
DeferredLoadImage();
}
/*
====================
idImage::~idImage
====================
*/
idImage::~idImage()
{
PurgeImage();
// SRS - if image found in deferred load list, remove it now to avoid problems later
DeferredPurgeImage();
}
/*
====================
idImage::IsLoaded
====================
*/
bool idImage::IsLoaded() const
{
return isLoaded;
}
void idImage::CreateSampler()
{
}
/*
==============
Bind
Automatically enables 2D mapping or cube mapping if needed
==============
*/
void idImage::Bind()
{
}
/*
====================
CopyFramebuffer
====================
*/
void idImage::CopyFramebuffer( int x, int y, int imageWidth, int imageHeight )
{
}
/*
====================
CopyDepthbuffer
====================
*/
void idImage::CopyDepthbuffer( int x, int y, int imageWidth, int imageHeight )
{
}
/*
========================
idImage::SubImageUpload
========================
*/
void idImage::SubImageUpload( int mipLevel, int x, int y, int z, int width, int height, const void* pic, nvrhi::ICommandList* commandList, int pixelPitch )
{
assert( x >= 0 && y >= 0 && mipLevel >= 0 && width >= 0 && height >= 0 && mipLevel < opts.numLevels );
}
/*
========================
idImage::SetSamplerState
========================
*/
void idImage::SetSamplerState( textureFilter_t tf, textureRepeat_t tr )
{
}
/*
========================
idImage::SetTexParameters
========================
*/
void idImage::SetTexParameters()
{
}
/*
========================
idImage::GetSampler
========================
*/
void* idImage::GetSampler( SamplerCache& samplerCache )
{
return NULL;
}
/*
========================
idImage::AllocImage
Every image will pass through this function. Allocates all the necessary MipMap levels for the
Image, but doesn't put anything in them.
This should not be done during normal game-play, if you can avoid it.
========================
*/
void idImage::AllocImage()
{
PurgeImage();
}
/*
========================
idImage::PurgeImage
========================
*/
void idImage::PurgeImage()
{
isLoaded = false;
defaulted = false;
}
/*
========================
idImage::Resize
========================
*/
void idImage::Resize( int width, int height )
{
if( opts.width == width && opts.height == height )
{
return;
}
opts.width = width;
opts.height = height;
AllocImage();
}