Counter Strike : Global Offensive Source Code
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.

163 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, 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 GetPreviewImageWidth() const
  37. {
  38. return(0);
  39. }
  40. inline int GetPreviewImageHeight() 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 GetMappingWidth() const
  61. {
  62. return(0);
  63. }
  64. inline int GetMappingHeight() const
  65. {
  66. return(0);
  67. }
  68. inline int GetTextureID() const
  69. {
  70. return(0);
  71. }
  72. inline TEXTUREFORMAT GetTextureFormat() const
  73. {
  74. return(m_eTextureFormat);
  75. }
  76. inline int GetSurfaceAttributes() const
  77. {
  78. return(0);
  79. }
  80. inline int GetSurfaceContents() const
  81. {
  82. return(0);
  83. }
  84. inline int GetSurfaceValue() const
  85. {
  86. return(0);
  87. }
  88. inline bool HasAlpha() const
  89. {
  90. return(false);
  91. }
  92. inline bool HasData() const
  93. {
  94. return(false);
  95. }
  96. inline bool HasPalette() const
  97. {
  98. return(false);
  99. }
  100. bool Load( void );
  101. void Reload( bool bFullReload ) {}
  102. inline bool IsLoaded() const
  103. {
  104. return true;
  105. }
  106. inline void SetTextureFormat(TEXTUREFORMAT eFormat)
  107. {
  108. m_eTextureFormat = eFormat;
  109. }
  110. inline void SetTextureID( int nTextureID )
  111. {
  112. }
  113. bool IsWater( void ) const
  114. {
  115. return false;
  116. }
  117. protected:
  118. char m_szName[MAX_PATH];
  119. char m_szFileName[MAX_PATH];
  120. TEXTUREFORMAT m_eTextureFormat;
  121. };
  122. #endif // DUMMYTEXTURE_H