29 #include "../idlib/precompiled.h"
35 "GL_LINEAR_MIPMAP_NEAREST",
36 "GL_LINEAR_MIPMAP_LINEAR",
39 "GL_NEAREST_MIPMAP_NEAREST",
40 "GL_NEAREST_MIPMAP_LINEAR",
101 {
"models/characters",
"Characters",
IC_NPC, 512, 512 },
102 {
"models/weapons",
"Weapons",
IC_WEAPON, 512, 512 },
103 {
"models/monsters",
"Monsters",
IC_MONSTER, 512, 512 },
105 {
"models/items",
"Items",
IC_ITEMS, 512, 512 },
107 {
"guis/assets",
"Guis",
IC_GUIS, 256, 256 },
114 static int ClassifyImage(
const char *
name ) {
119 return IC_Info[
i].
type;
136 for (x=0 ; x<256 ; x++) {
154 static void R_SpecularTableImage(
idImage *image ) {
158 for (x=0 ; x<256 ; x++) {
171 int b = (
int)(f * 255);
191 static void R_Specular2DTableImage(
idImage *image ) {
193 byte data[256][256][4];
195 memset( data, 0,
sizeof( data ) );
196 for ( x = 0 ; x < 256 ; x++ ) {
197 float f = x / 255.0f;
198 for ( y = 0; y < 256; y++ ) {
200 int b = (
int)( pow( f, y ) * 255.0f );
226 static void R_AlphaRampImage(
idImage *image ) {
230 for (x=0 ; x<256 ; x++) {
251 #define DEFAULT_SIZE 16
279 data[DEFAULT_SIZE-1][
x][0] =
280 data[DEFAULT_SIZE-1][
x][1] =
281 data[DEFAULT_SIZE-1][
x][2] =
282 data[DEFAULT_SIZE-1][
x][3] = 255;
284 data[
x][DEFAULT_SIZE-1][0] =
285 data[
x][DEFAULT_SIZE-1][1] =
286 data[
x][DEFAULT_SIZE-1][2] =
287 data[
x][DEFAULT_SIZE-1][3] = 255;
307 static void R_DefaultImage(
idImage *image ) {
311 static void R_WhiteImage(
idImage *image ) {
315 memset( data, 255,
sizeof( data ) );
320 static void R_BlackImage(
idImage *image ) {
324 memset( data, 0,
sizeof( data ) );
331 static const int BORDER_CLAMP_SIZE = 32;
332 static void R_BorderClampImage(
idImage *image ) {
333 byte data[BORDER_CLAMP_SIZE][BORDER_CLAMP_SIZE][4];
336 memset( data, 255,
sizeof( data ) );
337 for (
int i = 0 ;
i < BORDER_CLAMP_SIZE ;
i++ ) {
343 data[
i][BORDER_CLAMP_SIZE-1][0] =
344 data[
i][BORDER_CLAMP_SIZE-1][1] =
345 data[
i][BORDER_CLAMP_SIZE-1][2] =
346 data[
i][BORDER_CLAMP_SIZE-1][3] =
353 data[BORDER_CLAMP_SIZE-1][
i][0] =
354 data[BORDER_CLAMP_SIZE-1][
i][1] =
355 data[BORDER_CLAMP_SIZE-1][
i][2] =
356 data[BORDER_CLAMP_SIZE-1][
i][3] = 0;
368 color[0] = color[1] = color[2] = color[3] = 0;
372 static void R_RGBA8Image(
idImage *image ) {
375 memset( data, 0,
sizeof( data ) );
385 static void R_RGB8Image(
idImage *image ) {
388 memset( data, 0,
sizeof( data ) );
398 static void R_AlphaNotchImage(
idImage *image ) {
403 data[0][0] = data[0][1] = data[0][2] = 255;
405 data[1][0] = data[1][1] = data[1][2] = 255;
412 static void R_FlatNormalImage(
idImage *image ) {
417 int alpha = ( red == 0 ) ? 3 : 0;
419 for ( i = 0 ; i < 4 ; i++ ) {
420 data[0][
i][red] = 128;
429 static void R_AmbientNormalImage(
idImage *image ) {
434 int alpha = ( red == 0 ) ? 3 : 0;
436 for ( i = 0 ; i < 4 ; i++ ) {
443 for ( i = 0 ; i < 6 ; i++ ) {
444 pics[
i] = data[0][0];
451 static void CreateSquareLight(
void ) {
458 width = height = 128;
462 for ( x = 0 ; x < 128 ; x++ ) {
465 }
else if ( x > 96 ) {
470 for ( y = 0 ; y < 128 ; y++ ) {
473 }
else if ( y > 96 ) {
486 buffer[(y*128+
x)*4+0] =
487 buffer[(y*128+x)*4+1] =
488 buffer[(y*128+
x)*4+2] = d;
489 buffer[(y*128+
x)*4+3] = 255;
493 R_WriteTGA(
"lights/squarelight.tga", buffer, width, height );
498 static void CreateFlashOff(
void ) {
509 for ( x = 0 ; x <
width ; x++ ) {
510 for ( y = 0 ; y <
height ; y++ ) {
511 d = 255 - ( x * 256 /
width );
512 buffer[(y*width+
x)*4+0] =
513 buffer[(y*width+x)*4+1] =
514 buffer[(y*width+
x)*4+2] = d;
515 buffer[(y*width+
x)*4+3] = 255;
519 R_WriteTGA(
"lights/flashoff.tga", buffer, width, height );
531 byte data[16][16][4];
534 memset( data, 0,
sizeof( data ) );
535 for ( i = 0 ; i < 16 ; i++ ) {
550 for ( j = 0 ; j < 16 ; j++ ) {
558 R_WriteTGA(
"shapes/pitFalloff.tga", data[0][0], 16, 16 );
567 byte data[16][16][4];
570 for ( i = 0 ; i < 16 ; i++ ) {
573 for ( j = 0 ; j < 16 ; j++ ) {
574 if ( i == 0 || i == 15 || j == 0 || j == 15 ) {
586 R_WriteTGA(
"shapes/alphaSquare.tga", data[0][0], 16, 16 );
589 #define NORMAL_MAP_SIZE 32
596 static void getCubeVector(
int i,
int cubesize,
int x,
int y,
float *vector) {
597 float s,
t, sc,
tc, mag;
637 mag =
idMath::InvSqrt(vector[0]*vector[0] + vector[1]*vector[1] + vector[2]*vector[2]);
648 static void makeNormalizeVectorCubeMap(
idImage *image ) {
656 pixels[0] = (GLubyte*)
Mem_Alloc(size*size*4*6);
658 for (i = 0; i < 6; i++) {
659 pixels[
i] = pixels[0] + i*size*size*4;
660 for (y = 0; y <
size; y++) {
661 for (x = 0; x <
size; x++) {
662 getCubeVector(i, size, x, y, vector);
663 pixels[
i][4*(y*size+
x) + 0] = (
byte)(128 + 127*vector[0]);
664 pixels[
i][4*(y*size+
x) + 1] = (
byte)(128 + 127*vector[1]);
665 pixels[
i][4*(y*size+
x) + 2] = (
byte)(128 + 127*vector[2]);
666 pixels[
i][4*(y*size+
x) + 3] = 255;
687 static void R_CreateNoFalloffImage(
idImage *image ) {
691 memset( data, 0,
sizeof( data ) );
693 for (y=1 ; y<15 ; y++) {
722 float remaining = 1.0;
723 for ( i = 0 ; i < 256 ; i++ ) {
733 + (y - FOG_SIZE/2) * (y - FOG_SIZE / 2) );
739 }
else if ( b > 255 ) {
742 b = (
byte)(255 * ( 1.0 - step[b] ));
743 if ( x == 0 || x == FOG_SIZE-1 || y == 0 || y == FOG_SIZE-1 ) {
765 static const float RAMP_RANGE = 8;
766 static const float DEEP_RANGE = -30;
767 static float FogFraction(
float viewHeight,
float targetHeight ) {
768 float total =
idMath::Fabs( targetHeight - viewHeight );
773 if ( targetHeight > 0 && viewHeight > 0 ) {
776 if ( targetHeight < -RAMP_RANGE && viewHeight < -RAMP_RANGE ) {
781 if ( targetHeight > 0 ) {
782 above = targetHeight;
783 }
else if ( viewHeight > 0 ) {
789 float rampTop, rampBottom;
791 if ( viewHeight > targetHeight ) {
792 rampTop = viewHeight;
793 rampBottom = targetHeight;
795 rampTop = targetHeight;
796 rampBottom = viewHeight;
801 if ( rampBottom < -RAMP_RANGE ) {
802 rampBottom = -RAMP_RANGE;
805 float rampSlope = 1.0 / RAMP_RANGE;
808 return -viewHeight * rampSlope;
811 float ramp = ( 1.0 - ( rampTop * rampSlope + rampBottom * rampSlope ) * -0.5 ) * ( rampTop - rampBottom );
813 float frac = ( total - above - ramp ) / total;
816 float deepest = viewHeight < targetHeight ? viewHeight : targetHeight;
818 float deepFrac = deepest / DEEP_RANGE;
819 if ( deepFrac >= 1.0 ) {
823 frac = frac * ( 1.0 - deepFrac ) + deepFrac;
845 d = FogFraction( x - (FOG_ENTER_SIZE / 2), y - (FOG_ENTER_SIZE / 2) );
850 }
else if ( b > 255 ) {
872 static const int QUADRATIC_WIDTH = 32;
873 static const int QUADRATIC_HEIGHT = 4;
877 byte data[QUADRATIC_HEIGHT][QUADRATIC_WIDTH][4];
881 for (x=0 ; x<QUADRATIC_WIDTH ; x++) {
882 for (y=0 ; y<QUADRATIC_HEIGHT ; y++) {
885 d = x - (QUADRATIC_WIDTH/2 - 0.5);
888 d /= QUADRATIC_WIDTH/2;
896 }
else if ( b > 255 ) {
933 {
"GL_LINEAR_MIPMAP_NEAREST", GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR},
934 {
"GL_LINEAR_MIPMAP_LINEAR", GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR},
935 {
"GL_NEAREST", GL_NEAREST, GL_NEAREST},
936 {
"GL_LINEAR", GL_LINEAR, GL_LINEAR},
937 {
"GL_NEAREST_MIPMAP_NEAREST", GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST},
938 {
"GL_NEAREST_MIPMAP_LINEAR", GL_NEAREST_MIPMAP_LINEAR, GL_NEAREST}
947 for ( i = 0; i < 6; i++ ) {
948 if ( !
idStr::Icmp( textureFilters[i].name,
string ) ) {
973 unsigned int texEnum = GL_TEXTURE_2D;
977 switch( glt->
type ) {
979 texEnum = GL_TEXTURE_2D;
1061 bool checkPrecompressed;
1067 checkPrecompressed =
false;
1069 if ( args.
Argc() == 2 ) {
1074 checkPrecompressed =
true;
1081 for ( i = 0 ; i < globalImages->
images.
Num() ; i++ ) {
1082 image = globalImages->
images[
i ];
1083 image->
Reload( checkPrecompressed, all );
1098 static int R_QsortImageSizes(
const void *
a,
const void *b ) {
1119 int i,
j, partialSize;
1124 bool uncompressedOnly =
false;
1125 bool unloaded =
false;
1126 bool partial =
false;
1127 bool cached =
false;
1128 bool uncached =
false;
1129 bool failed =
false;
1130 bool touched =
false;
1131 bool sorted =
false;
1132 bool duplicated =
false;
1133 bool byClassification =
false;
1134 bool overSized =
false;
1136 if ( args.
Argc() == 1 ) {
1138 }
else if ( args.
Argc() == 2 ) {
1140 uncompressedOnly =
true;
1158 byClassification =
true;
1161 byClassification =
true;
1172 common->
Printf(
"usage: listImages [ sorted | partial | unloaded | cached | uncached | tagged | duplicated | touched | classify | showOverSized ]\n" );
1176 const char *header =
" -w-- -h-- filt -fmt-- wrap size --name-------\n";
1183 for ( i = 0 ; i < globalImages->
images.
Num() ; i++ ) {
1184 image = globalImages->
images[
i ];
1186 if ( uncompressedOnly ) {
1212 for ( j = i+1 ; j < globalImages->
images.
Num() ; j++ ) {
1217 if ( j == globalImages->
images.
Num() ) {
1242 qsort( sortedArray, count,
sizeof(
sortedImage_t ), R_QsortImageSizes );
1244 for ( i = 0 ; i <
count ; i++ ) {
1248 if ( ( (i+1) % 10 ) == 0 ) {
1249 common->
Printf(
"-------- %5.1f of %5.1f megs --------\n",
1250 partialSize / (1024*1024.0), totalSize / (1024*1024.0) );
1257 common->
Printf(
" %5.1f total megabytes of images\n\n\n", totalSize / (1024*1024.0) );
1259 if ( byClassification ) {
1263 for ( i = 0 ; i <
count ; i++ ) {
1264 int cl = ClassifyImage( sortedArray[i].image->
imgName );
1265 classifications[ cl ].
Append( i );
1271 for ( j = 0; j < classifications[
i ].
Num(); j++ ) {
1275 overSizedList.
Append( classifications[ i ][ j ] );
1279 common->
Printf (
" Classification %s contains %i images using %5.1f megabytes\n", IC_Info[i].desc, classifications[i].Num(), partialSize / ( 1024*1024.0 ) );
1280 if ( overSized && overSizedList.
Num() ) {
1281 common->
Printf(
" The following images may be oversized\n" );
1282 for ( j = 0; j < overSizedList.
Num(); j++ ) {
1306 int compressedToOriginal[16];
1309 for ( i = 0 ; i < 8 ; i++ ) {
1312 f = ( i + 1 ) / 8.5;
1316 compressedToOriginal[7-
i] = 127 - (
int)( y * 127 + 0.5 );
1317 compressedToOriginal[8+
i] = 128 + (
int)( y * 127 + 0.5 );
1320 for ( i = 0 ; i < 256 ; i++ ) {
1321 if ( i <= compressedToOriginal[0] ) {
1323 }
else if ( i >= compressedToOriginal[15] ) {
1326 for ( j = 0 ; j < 14 ; j++ ) {
1327 if ( i <= compressedToOriginal[j+1] ) {
1331 if ( i - compressedToOriginal[j] < compressedToOriginal[j+1] - i ) {
1340 for ( i = 0; i < 16; i++ ) {
1341 for ( j = 0 ; j < 16 ; j++ ) {
1343 v[0] = ( i - 7.5 ) / 8;
1344 v[1] = ( j - 7.5 ) / 8;
1346 t = 1.0 - ( v[0]*v[0] + v[1]*v[1] );
1352 temptable[(i*16+
j)*3+0] = 128 + floor( 127 * v[0] + 0.5 );
1353 temptable[(i*16+
j)*3+1] = 128 + floor( 127 * v[1] );
1354 temptable[(i*16+
j)*3+2] = 128 + floor( 127 * v[2] );
1358 for ( i = 0; i < 16; i++ ) {
1359 for ( j = 0 ; j < 16 ; j++ ) {
1361 v[0] = ( compressedToOriginal[
i] - 127.5 ) / 128;
1362 v[1] = ( compressedToOriginal[
j] - 127.5 ) / 128;
1364 t = 1.0 - ( v[0]*v[0] + v[1]*v[1] );
1370 temptable[(i*16+
j)*3+0] = (
byte)(128 + floor( 127 * v[0] + 0.5 ));
1371 temptable[(i*16+
j)*3+1] = (
byte)(128 + floor( 127 * v[1] ));
1372 temptable[(i*16+
j)*3+2] = (
byte)(128 + floor( 127 * v[2] ));
1378 temptable[255*3+0] =
1379 temptable[255*3+1] =
1380 temptable[255*3+2] = 128;
1409 common->
Error (
"idImageManager::AllocImage: \"%s\" is too long\n", name);
1487 if ( !_name || !_name[0] ||
idStr::Icmp( _name,
"default" ) == 0 ||
idStr::Icmp( _name,
"_default" ) == 0 ) {
1505 if ( name[0] ==
'_' ) {
1509 common->
Error(
"Image '%s' has been referenced with conflicting cube map states", _name );
1512 if ( image->
filter != filter || image->
repeat != repeat ) {
1530 allowDownSize =
false;
1532 if ( image->
depth > depth ) {
1533 depth = image->
depth;
1566 if ( name.
Find(
"fontImage_") >= 0 ) {
1567 allowDownSize =
false;
1633 if ( !_name || !_name[0] ||
idStr::Icmp( _name,
"default" ) == 0 ||
idStr::Icmp( _name,
"_default" ) == 0 ) {
1695 if ( args.
Argc() != 2 ) {
1696 common->
Printf(
"usage: combineCubeImages <baseName>\n" );
1697 common->
Printf(
" combines basename[1-6][0001-9999].tga to basenameCM[0001-9999].tga\n" );
1698 common->
Printf(
" 1: forward 2:right 3:back 4:left 5:up 6:down\n" );
1705 for (
int frameNum = 1 ; frameNum < 10000 ; frameNum++ ) {
1710 int orderRemap[6] = { 1,3,4,2,5,6 };
1711 for ( side = 0 ; side < 6 ; side++ ) {
1712 sprintf( filename,
"%s%i%04i.tga", baseName.
c_str(), orderRemap[side], frameNum );
1717 if ( !pics[side] ) {
1748 for (
int i = 0 ; i < side ; side++ ) {
1755 for ( side = 0 ; side < 6 ; side++ ) {
1756 memcpy( combined+width*height*4*side, pics[side], width*height*4 );
1759 sprintf( filename,
"%sCM%04i.tga", baseName.
c_str(), frameNum );
1762 R_WriteTGA( filename, combined, width, height*6 );
1817 totalSize += check->StorageSize();
1862 image->
bglNext = remainingList;
1863 remainingList =
image;
2008 for (
int i = 0 ; i <
images.
Num() ; i++ ) {
2046 common->
Printf(
"----- idImageManager::EndLevelLoad -----\n" );
2053 for (
int i = 0 ; i <
images.
Num() ; i++ ) {
2070 for (
int i = 0 ; i <
images.
Num() ; i++ ) {
2081 if ( ( loadCount & 15 ) == 0 ) {
2088 common->
Printf(
"%5i purged from previous\n", purgeCount );
2089 common->
Printf(
"%5i kept from previous\n", keepCount );
2091 common->
Printf(
"all images loaded in %5.1f seconds\n", (end-start) * 0.001 );
2092 common->
Printf(
"----------------------------------------\n" );
2114 char *buffer =
NULL;
2119 int n = str.
Find(
'\n' );
2137 for ( i = 0; i < ddsNum; i++ ) {
2139 batchFile->
Printf(
"@echo Finished compressing %d of %d. %.1f percent done.\n", i+1, ddsNum, ((
float)(i+1)/(
float)ddsNum)*100.f );
2155 if ( !( cmd && *cmd ) ) {
2161 if (
ddsList[i].Icmp( cmd ) == 0 ) {
2177 int i,
j, total = 0;
2193 for ( i = 0; i <
images.
Num() - 1; i++ ) {
2194 for ( j = i + 1; j <
images.
Num(); j++ ) {
2195 if (
images[sortIndex[i]]->StorageSize() <
images[sortIndex[
j]]->StorageSize() ) {
2196 int temp = sortIndex[
i];
2197 sortIndex[
i] = sortIndex[
j];
2198 sortIndex[
j] = temp;
idImage * specular2DTableImage
bool ShouldImageBePartialCached()
virtual idFile * OpenFileRead(const char *relativePath, bool allowCopyFiles=true, const char *gamedir=NULL)=0
void R_FogImage(idImage *image)
static idCVar image_anisotropy
int Next(const int index) const
static idCVar image_preload
void CreatealphaSquareImage(void)
void GenerateImage(const byte *pic, int width, int height, textureFilter_t filter, bool allowDownSize, textureRepeat_t repeat, textureDepth_t depth)
#define GL_TEXTURE_LOD_BIAS_EXT
void R_FogEnterImage(idImage *image)
static idCVar image_useCompression
float GetFloat(void) const
int numActiveBackgroundImageLoads
const int FALLOFF_TEXTURE_SIZE
bool anisotropicAvailable
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
bool textureLODBiasAvailable
idCVar com_purgeAll("com_purgeAll","0", CVAR_BOOL|CVAR_ARCHIVE|CVAR_SYSTEM,"purge everything between level loads")
int Sys_Milliseconds(void)
static idCVar image_downSizeBump
idFileSystem * fileSystem
void R_LoadImage(const char *name, byte **pic, int *width, int *height, ID_TIME_T *timestamp, bool makePowerOf2)
idCVar com_developer("developer","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"developer mode")
idImage * GetImage(const char *name) const
void R_ListImages_f(const idCmdArgs &args)
GLenum GLsizei GLenum GLenum const GLvoid * image
GLint GLint GLsizei GLsizei GLsizei depth
GLenum GLsizei const GLvoid * string
idImage * currentRenderImage
static float Sqrt(float x)
const char * Left(int len, idStr &result) const
void FinishBuild(bool removeDups=false)
GLclampf GLclampf GLclampf alpha
void PrintMemInfo(MemInfo_t *mi)
void CompleteBackgroundImageLoads()
virtual void BackgroundDownload(backgroundDownload_t *bgl)=0
void R_LoadImageProgram(const char *name, byte **pic, int *width, int *height, ID_TIME_T *timestamp, textureDepth_t *depth=NULL)
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT
bool sharedTexturePaletteAvailable
int Icmp(const char *text) const
idStr & BackSlashesToSlashes(void)
#define GL_TEXTURE_MAX_ANISOTROPY_EXT
int First(const int key) const
bool backgroundLoadInProgress
idImage * alphaNotchImage
idImage * ambientNormalMap
void GenerateCubeImage(const byte *pic[6], int size, textureFilter_t filter, bool allowDownSize, textureDepth_t depth)
void ChangeTextureFilter()
GLuint GLuint GLsizei count
static idCVar image_forceDownSize
void R_ReloadImages_f(const idCmdArgs &args)
float maxTextureAnisotropy
idImage * backgroundImageLoads
idImage * normalCubeMapImage
idImage * AllocImage(const char *name)
static idStr FormatNumber(int number)
idImageManager imageManager
const imageClassificate_t IC_Info[]
static float Fabs(float f)
bool referencedOutsideLevelLoad
void ActuallyLoadImage(bool checkForPrecompressed, bool fromBackEnd)
#define GL_COLOR_INDEX8_EXT
static idCVar image_downSizeBumpLimit
static idCVar image_usePrecompressedTextures
GLsizei GLsizei GLenum GLenum const GLvoid * data
idImageManager * globalImages
int GetInteger(void) const
void R_HorizontalFlip(byte *data, int width, int height)
virtual void virtual void FatalError(const char *fmt,...) id_attribute((format(printf
void R_CombineCubeImages_f(const idCmdArgs &args)
virtual idFile * OpenFileWrite(const char *relativePath, const char *basePath="fs_savepath")=0
void StartBackgroundImageLoad()
static idCVar image_useNormalCompression
void R_WriteTGA(const char *filename, const byte *data, int width, int height, bool flipVertical=false)
idImage * borderClampImage
static idCVar image_writeTGA
idImage * imageHashTable[FILE_HASH_SIZE]
const char * imageFilter[]
static idCVar serverDedicated
void DeleteContents(bool clear)
const char * Right(int len, idStr &result) const
idImage * ImageFromFunction(const char *name, void(*generatorFunction)(idImage *image))
idImage * scratchCubeMapImage
int Find(const char c, int start=0, int end=-1) const
virtual int WriteFloatString(const char *fmt,...) id_attribute((format(printf
static float InvSqrt(float x)
static idCVar image_downSizeSpecular
static idCVar image_writeNormalTGA
GLubyte GLubyte GLubyte a
virtual void Printf(const char *fmt,...) id_attribute((format(printf
static idCVar image_downSize
int FileNameHash(void) const
byte originalToCompressed[256]
GLenum GLsizei GLsizei height
static idCVar image_downSizeLimit
static idCVar image_lodbias
virtual void MediaPrint(const char *fmt,...) id_attribute((format(printf
static idCVar image_roundDown
idDeclManager * declManager
int GenerateKey(const char *string, bool caseSensitive=true) const
void R_RotatePic(byte *data, int width)
void ImageProgramStringToCompressedFileName(const char *imageProg, char *fileName) const
idImage * ImageFromFile(const char *name, textureFilter_t filter, bool allowDownSize, textureRepeat_t repeat, textureDepth_t depth, cubeFiles_t cubeMap=CF_2D)
void UploadPrecompressedImage(byte *data, int len)
static idCVar image_cacheMinK
void TokenizeString(const char *text, bool keepAsStrings)
const char * GetString(void) const
void(* generatorFunction)(idImage *image)
void RB_LogComment(const char *comment,...)
int Append(const type &obj)
textureType_t textureType
virtual void PacifierUpdate()=0
idList< idImage * > images
static idCVar image_writeNormalTGAPalletized
int AddUnique(const type &obj)
void R_VerticalFlip(byte *data, int width, int height)
static idCVar image_filter
static idCVar image_cacheMegs
void * R_StaticAlloc(int bytes)
static idCVar image_useAllFormats
static idCVar image_ignoreHighQuality
bool IsModified(void) const
static idCVar image_showBackgroundLoads
void Reload(bool checkPrecompressed, bool force)
const char * c_str(void) const
#define GL_SHARED_TEXTURE_PALETTE_EXT
static const int TEXTURE_NOT_LOADED
#define GL_TEXTURE_CUBE_MAP_EXT
void R_QuadraticImage(idImage *image)
void AddDDSCommand(const char *cmd)
const char * Argv(int arg) const
static idCVar image_useCache
static const int MAX_BACKGROUND_IMAGE_LOADS
void * Mem_Alloc(const int size)
virtual void SetRefreshOnPrint(bool set)=0
#define qglTexParameterfv
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
virtual void CloseFile(idFile *f)=0
void R_StaticFree(void *data)
virtual void DPrintf(const char *fmt,...) id_attribute((format(printf
idImage * specularTableImage
virtual void Error(const char *fmt,...) id_attribute((format(printf
void Replace(const char *old, const char *nw)
idVec4 ambientLightVector
bool R_LoadCubeImages(const char *cname, cubeFiles_t extensions, byte *pic[6], int *size, ID_TIME_T *timestamp)
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
int sprintf(idStr &string, const char *fmt,...)
static idCVar image_useOffLineCompression
static idCVar image_colorMipLevels
static idCVar image_writePrecompressedTextures
virtual int Printf(const char *fmt,...) id_attribute((format(printf
virtual void AddCommand(const char *cmdName, cmdFunction_t function, int flags, const char *description, argCompletion_t argCompletion=NULL)=0
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
void CreatePitFogImage(void)
static idCVar image_downSizeSpecularLimit
tmu_t tmu[MAX_MULTITEXTURE_UNITS]
byte compressedPalette[768]