mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-12 08:11:10 +02:00
Added minigame hook ups.
This commit is contained in:
@@ -1048,6 +1048,36 @@ bool idRenderSystemLocal::UploadImage( const char *imageName, const byte *data,
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
idRenderSystemLocal::CreateScratchImage
|
||||
===============
|
||||
*/
|
||||
bool idRenderSystemLocal::CreateScratchImage( const char *imageName, int width, int height ) {
|
||||
if ( !imageName || !imageName[0] || width <= 0 || height <= 0 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
idImage *image = globalImages->GetImage( imageName );
|
||||
if ( !image ) {
|
||||
image = globalImages->AllocImage( imageName );
|
||||
}
|
||||
if ( !image ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const int bytes = width * height * 4;
|
||||
byte *data = (byte *)Mem_Alloc( bytes );
|
||||
memset( data, 0, bytes );
|
||||
for ( int i = 3; i < bytes; i += 4 ) {
|
||||
data[i] = 255;
|
||||
}
|
||||
|
||||
image->GenerateImage( data, width, height, TF_LINEAR, false, TR_CLAMP, TD_DEFAULT );
|
||||
Mem_Free( data );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
idRenderSystemLocal::LoadImage
|
||||
|
||||
Reference in New Issue
Block a user