Textures.h (3436B)
1 /* 2 =========================================================================== 3 Copyright (C) 1999-2005 Id Software, Inc. 4 5 This file is part of Quake III Arena source code. 6 7 Quake III Arena source code is free software; you can redistribute it 8 and/or modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the License, 10 or (at your option) any later version. 11 12 Quake III Arena source code is distributed in the hope that it will be 13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with Foobar; if not, write to the Free Software 19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 =========================================================================== 21 */ 22 23 //--typedef struct texdef_s 24 //--{ 25 //-- char name[32]; 26 //-- float shift[2]; 27 //-- float rotate; 28 //-- float scale[2]; 29 //-- int contents; 30 //-- int flags; 31 //-- int value; 32 //--} texdef_t; 33 //-- 34 //--typedef struct 35 //--{ 36 //-- int width, height; 37 //-- int originy; 38 //-- texdef_t texdef; 39 //-- int m_nTotalHeight; 40 //--} texturewin_t; 41 //-- 42 //--#define QER_TRANS 0x00000001 43 //--#define QER_NOCARVE 0x00000002 44 //-- 45 //--typedef struct qtexture_s 46 //--{ 47 //-- struct qtexture_s *next; 48 //-- char name[64]; // includes partial directory and extension 49 //-- int width, height; 50 //-- int contents; 51 //-- int flags; 52 //-- int value; 53 //-- int texture_number; // gl bind number 54 //-- 55 //-- char shadername[1024]; // old shader stuff 56 //-- qboolean bFromShader; // created from a shader 57 //-- float fTrans; // amount of transparency 58 //-- int nShaderFlags; // qer_ shader flags 59 //-- vec3_t color; // for flat shade mode 60 //-- qboolean inuse; // true = is present on the level 61 //--} qtexture_t; 62 //-- 63 64 // a texturename of the form (0 0 0) will 65 // create a solid color texture 66 67 void Texture_Init (bool bHardInit = true); 68 void Texture_FlushUnused (); 69 void Texture_Flush (bool bReload = false); 70 void Texture_ClearInuse (void); 71 void Texture_ShowInuse (void); 72 void Texture_ShowDirectory (int menunum, bool bLinked = false); 73 void Texture_ShowAll(); 74 void Texture_Cleanup(CStringList *pList = NULL); 75 76 // TTimo: added bNoAlpha flag to ignore alpha channel when parsing a .TGA file, transparency is usually achieved through qer_trans keyword in shaders 77 // in some cases loading an empty alpha channel causes display bugs (brushes not seen) 78 qtexture_t *Texture_ForName (const char *name, bool bReplace = false, bool bShader = false, bool bNoAlpha = false, bool bReload = false, bool makeShader = true); 79 80 void Texture_Init (void); 81 // Timo 82 // added an optional IPluginTexdef when one is available 83 // we need a forward declaration, this is crap 84 class IPluginTexdef; 85 void Texture_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef *pTexdef = NULL, bool bSetSelection = true); 86 87 void Texture_SetMode(int iMenu); // GL_TEXTURE_NEAREST, etc.. 88 void Texture_ResetPosition(); 89 90 void FreeShaders(); 91 void LoadShaders(); 92 void ReloadShaders(); 93 int WINAPI Texture_LoadSkin(char *pName, int *pnWidth, int *pnHeight); 94 void Texture_LoadFromPlugIn(LPVOID vp); 95 void Texture_StartPos (void); 96 qtexture_t *Texture_NextPos (int *x, int *y);