Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Implementation of IEditorTexture interface for placeholder textures.
  4. // Placeholder textures are used for textures that are referenced in
  5. // the map file but not found in storage.
  6. //
  7. //=============================================================================//
  8. #ifndef DUMMYTEXTURE_H
  9. #define DUMMYTEXTURE_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include <afxtempl.h>
  14. #include "IEditorTexture.h"
  15. enum TEXTUREFORMAT;
  16. class CDummyTexture : public IEditorTexture
  17. {
  18. public:
  19. CDummyTexture(const char *pszName, TEXTUREFORMAT eFormat);
  20. virtual ~CDummyTexture();
  21. inline const char *GetName() const
  22. {
  23. return(m_szName);
  24. }
  25. int GetShortName(char *pszName) const;
  26. int GetKeywords(char *pszKeywords) const;
  27. void Draw(CDC *pDC, RECT &rect, int iFontHeight, int iIconHeight, DrawTexData_t &DrawTexData);
  28. const char *GetFileName(void) const;
  29. void GetSize(SIZE &size) const;
  30. inline bool IsDummy() const
  31. {
  32. return(true);
  33. }
  34. int GetImageDataRGB( void *pImageRGB );
  35. int GetImageDataRGBA( void *pImageRGBA );
  36. inline int GetImageWidth() const
  37. {
  38. return(0);
  39. }
  40. inline int GetImageHeight() const
  41. {
  42. return(0);
  43. }
  44. inline float GetDecalScale() const
  45. {
  46. return(1.0f);
  47. }
  48. CPalette *GetPalette() const
  49. {
  50. return(NULL);
  51. }
  52. inline int GetWidth() const
  53. {
  54. return(0);
  55. }
  56. inline int GetHeight() const
  57. {
  58. return(0);
  59. }
  60. inline int GetTextureID() const
  61. {
  62. return(0);
  63. }
  64. inline TEXTUREFORMAT GetTextureFormat() const
  65. {
  66. return(m_eTextureFormat);
  67. }
  68. inline int GetSurfaceAttributes() const
  69. {
  70. return(0);
  71. }
  72. inline int GetSurfaceContents() const
  73. {
  74. return(0);
  75. }
  76. inline int GetSurfaceValue() const
  77. {
  78. return(0);
  79. }
  80. inline bool HasAlpha() const
  81. {
  82. return(false);
  83. }
  84. inline bool HasData() const
  85. {
  86. return(false);
  87. }
  88. inline bool HasPalette() const
  89. {
  90. return(false);
  91. }
  92. bool Load( void );
  93. void Reload( bool bFullReload ) {}
  94. inline bool IsLoaded() const
  95. {
  96. return true;
  97. }
  98. inline void SetTextureFormat(TEXTUREFORMAT eFormat)
  99. {
  100. m_eTextureFormat = eFormat;
  101. }
  102. inline void SetTextureID( int nTextureID )
  103. {
  104. }
  105. bool IsWater( void ) const
  106. {
  107. return false;
  108. }
  109. protected:
  110. char m_szName[MAX_PATH];
  111. char m_szFileName[MAX_PATH];
  112. TEXTUREFORMAT m_eTextureFormat;
  113. };
  114. #endif // DUMMYTEXTURE_H