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.

99 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IVRADDLL_H
  8. #define IVRADDLL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. #include "bspfile.h"
  14. #define VRAD_INTERFACE_VERSION "vraddll_1"
  15. class CBSPInfo
  16. {
  17. public:
  18. byte *dlightdata;
  19. int lightdatasize;
  20. dface_t *dfaces;
  21. unsigned char *m_pFacesTouched; // If non-null, then this has 1 byte for each face and
  22. // tells which faces had their lightmaps updated.
  23. int numfaces;
  24. dvertex_t *dvertexes;
  25. int numvertexes;
  26. dedge_t *dedges;
  27. int numedges;
  28. int *dsurfedges;
  29. int numsurfedges;
  30. texinfo_t *texinfo;
  31. int numtexinfo;
  32. dtexdata_t *dtexdata;
  33. int numtexdata;
  34. ddispinfo_t *g_dispinfo;
  35. int g_numdispinfo;
  36. char *texDataStringData;
  37. int nTexDataStringData;
  38. int *texDataStringTable;
  39. int nTexDataStringTable;
  40. };
  41. // This is the DLL interface to VRAD.
  42. class IVRadDLL
  43. {
  44. public:
  45. // All vrad.exe does is load the VRAD DLL and run this.
  46. virtual int main( int argc, char **argv ) = 0;
  47. // Load the BSP file into memory.
  48. virtual bool Init( char const *pFilename ) = 0;
  49. // You must call this if you call Init(), to free resources.
  50. virtual void Release() = 0;
  51. // Get some data from the BSP file that's in memory.
  52. virtual void GetBSPInfo( CBSPInfo *pInfo ) = 0;
  53. // Incrementally relight the BSP file in memory given the new entity
  54. // descriptions in pVMFFile. pVMFFile should only contain light entities.
  55. //
  56. // Returns true only if the lightmaps are updated. If the process is
  57. // interrupted or there is an error, false is returned.
  58. virtual bool DoIncrementalLight( char const *pVMFFile ) = 0;
  59. // Calling DoIncrementalLight doesn't actually write anything to disk.
  60. // Calling this will write the incremental light file out and will write the
  61. // current in-memory light data into the BSP.
  62. // NOTE: if DoIncrementalLight never finished, this will do nothing and return false.
  63. virtual bool Serialize() = 0;
  64. // Returns a 0-1 value telling how close it is to completing the task.
  65. // This can be called from a separate thread than DoIncrementLight.
  66. virtual float GetPercentComplete() = 0;
  67. // This can be called from a separate thread than the DoIncrementalLight thread.
  68. // It asynchronously tells DoIncrementalLight to stop as soon as possible and exit.
  69. virtual void Interrupt() = 0;
  70. };
  71. #endif // IVRADDLL_H