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.

82 lines
3.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef DECAL_PRIVATE_H
  9. #define DECAL_PRIVATE_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "gl_model_private.h"
  14. #include "idispinfo.h"
  15. #define DECAL_NORMAL 0x00 // Default
  16. #define DECAL_CUSTOM 0x01 // Clan logo, etc.
  17. // JAY: Compress this as much as possible
  18. // decal instance
  19. struct decal_t
  20. {
  21. decal_t *pnext; // linked list for each surface
  22. decal_t *pDestroyList; //
  23. SurfaceHandle_t surfID; // Surface id for persistence / unlinking
  24. IMaterial *material;
  25. float lightmapOffset;
  26. // FIXME:
  27. // make dx and dy in decal space and get rid of position, so that
  28. // position can be rederived from the decal basis.
  29. Vector position; // location of the decal center in world space.
  30. Vector saxis; // direction of the s axis in world space
  31. float dx; // Offsets into surface texture (in texture coordinates, so we don't need floats)
  32. float dy;
  33. float scale; // Pixel scale
  34. float flSize; // size of decal, used for rejecting on dispinfo planes
  35. float fadeDuration; // Negative value means to fade in
  36. float fadeStartTime;
  37. color32 color;
  38. void *userdata; // For player decals only, decal index ( first player at slot 1 )
  39. DispDecalHandle_t m_DispDecal; // Handle to displacement decals associated with this
  40. unsigned short clippedVertCount;
  41. unsigned short cacheHandle;
  42. unsigned short m_iDecalPool; // index into the decal pool.
  43. short flags; // Decal flags DECAL_* !!!SAVED AS A BYTE (SEE HOST_CMD.C)
  44. short entityIndex; // Entity this is attached to
  45. // NOTE: The following variables are dynamic variables.
  46. // We could put these into a separate array and reference them
  47. // by index to reduce memory costs of this...
  48. int m_iSortTree; // MaterialSort tree id
  49. int m_iSortMaterial; // MaterialSort id.
  50. };
  51. #define FDECAL_PERMANENT 0x01 // This decal should not be removed in favor of any new decals
  52. #define FDECAL_REFERENCE 0x02 // This is a decal that's been moved from another level
  53. #define FDECAL_CUSTOM 0x04 // This is a custom clan logo and should not be saved/restored
  54. #define FDECAL_HFLIP 0x08 // Flip horizontal (U/S) axis
  55. #define FDECAL_VFLIP 0x10 // Flip vertical (V/T) axis
  56. // NOTE: There are used by footprints; maybe we separate into a separate struct?
  57. #define FDECAL_USESAXIS 0x80 // Uses the s axis field to determine orientation
  58. #define FDECAL_DYNAMIC 0x100 // Indicates the decal is dynamic
  59. #define FDECAL_SECONDPASS 0x200 // Decals that have to be drawn after everything else
  60. #define FDECAL_DONTSAVE 0x800 // Decal was loaded from adjacent level, don't save out to save file for this level
  61. #define FDECAL_PLAYERSPRAY 0x1000 // Decal is a player spray
  62. #define FDECAL_DISTANCESCALE 0x2000 // Decal is dynamically scaled based on distance.
  63. #define FDECAL_HASUPDATED 0x4000 // Decal has not been updated this frame yet
  64. // Max decal (see r_decal.cpp for initialization).
  65. extern int g_nMaxDecals;
  66. struct worldbrushdata_t;
  67. void R_DecalUnlink( decal_t *pdecal, worldbrushdata_t *model );
  68. #endif // DECAL_PRIVATE_H