Clone of PhatAC @ https://github.com/floaterxk/PhatAC

TurbineDungeon.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #pragma once
  2. #include "TurbineObject.h"
  3. class TurbineDungeon;
  4. class DungeonPortal;
  5. class DungeonVertex;
  6. class DungeonTriFan;
  7. typedef TurbineDungeon DUNGEON, *LPDUNGEON;
  8. typedef DungeonPortal DUNGEONPORTAL, *LPDUNGEONPORTAL;
  9. typedef DungeonVertex DUNGEONVERTEX, *LPDUNGEONVERTEX;
  10. typedef DungeonTriFan DUNGEONTRIFAN, *LPDUNGEONTRIFAN;
  11. class DungeonVertex
  12. {
  13. public:
  14. DungeonVertex()
  15. {
  16. x = y = z = nx = ny = nz = 0;
  17. }
  18. float x, y, z, nx, ny, nz;
  19. };
  20. class DungeonTriFan
  21. {
  22. public:
  23. DungeonTriFan()
  24. {
  25. m_pVertexIndices = NULL;
  26. m_cNumVertices = 0;
  27. }
  28. ~DungeonTriFan()
  29. {
  30. SafeDeleteArray(m_pVertexIndices);
  31. }
  32. WORD *m_pVertexIndices;
  33. unsigned char m_cNumVertices;
  34. };
  35. class DungeonPortal
  36. {
  37. public:
  38. DungeonPortal()
  39. {
  40. m_pVertices = NULL;
  41. m_dwNumVertices = 0;
  42. m_pTriFans = NULL;
  43. m_dwNumTriFans = 0;
  44. }
  45. ~DungeonPortal()
  46. {
  47. SafeDeleteArray(m_pVertices);
  48. SafeDeleteArray(m_pTriFans);
  49. }
  50. DUNGEONVERTEX *m_pVertices;
  51. DWORD m_dwNumVertices;
  52. DUNGEONTRIFAN *m_pTriFans;
  53. DWORD m_dwNumTriFans;
  54. };
  55. class TurbineDungeon : public TurbineObject
  56. {
  57. public:
  58. TurbineDungeon(DWORD dwID);
  59. ~TurbineDungeon();
  60. void Initialize(BYTE *pbData, DWORD dwLength);
  61. BOOL IsLandingZone(DUNGEONVERTEX* pVertex1, DUNGEONVERTEX* pVertex2, DUNGEONVERTEX* pVertex3);
  62. loc_t FindLandingZone(WORD wPortal);
  63. protected:
  64. DWORD m_dwNumPortals;
  65. DUNGEONPORTAL *m_pPortals;
  66. };