Textures.h 3.4 KB

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