Source code of Windows XP (NT5)
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.

149 lines
3.7 KiB

  1. /**
  2. ** File : cpmesh.h
  3. ** Description: Interface implementations
  4. **/
  5. #ifndef _cpmesh_h_
  6. #define _cpmesh_h_
  7. #include "global.h"
  8. #include "interface.h"
  9. #include "aglmesh.h"
  10. #include "excptn.h"
  11. #include "vsplit.h"
  12. #include "aglmesh.h"
  13. /*************************************************************************
  14. Defines
  15. *************************************************************************/
  16. #define DLLEXPORT __declspec(dllexport)
  17. /*************************************************************************
  18. Structs and Classes
  19. *************************************************************************/
  20. class CPMeshGL: public IPMesh, public IPMeshGL, public CAugGlMesh
  21. {
  22. private:
  23. /*
  24. * Enums used for compression
  25. */
  26. enum
  27. {
  28. NORM_EXPLICIT, // All normal explicitly stored
  29. NORM_NONE, // No normals stored. Generate from faces
  30. NORM_PARTIAL,
  31. NORM_MASK = 3
  32. };
  33. // Texture coordinates stored or not.
  34. // This is or'ed with normal flags
  35. enum
  36. {
  37. TEX_EXPLICIT = 4,
  38. TEX_NONE,
  39. TEX_MASK = 1<<2
  40. };
  41. enum
  42. {
  43. INTC_MAX, // Fixed integer size to fit the largest possible value
  44. INTC_MUL8, // Integer size based on the range.
  45. // Clamped to multiple of 8 bits
  46. INTC_VAR // Integer size based on range: ceil(log(maxval)/log(2))
  47. };
  48. /*
  49. * COM overhead
  50. */
  51. DWORD m_cRef; // Reference count
  52. /*
  53. * BaseMesh data
  54. */
  55. DWORD m_baseVertices; // # of vertices.
  56. DWORD m_baseWedges; // # of wedges.
  57. DWORD m_baseFaces; // # of faces.
  58. /*
  59. * Current position in the Vsplit array
  60. */
  61. DWORD m_currPos;
  62. /*
  63. * Max data obtained from the PMesh header.
  64. * Parameters for the fully detailed mesh.
  65. */
  66. DWORD m_maxVertices; // # of vertices.
  67. DWORD m_maxWedges; // # of wedges.
  68. DWORD m_maxFaces; // # of faces.
  69. DWORD m_maxMaterials; // # of materials.
  70. DWORD m_maxTextures; // # of textures.
  71. /*
  72. * Array of Vsplit record, possibly shared
  73. */
  74. VsplitArray* m_vsarr;
  75. /*
  76. * No idea what this is for
  77. */
  78. HRESULT LoadStream(IStream* is, DWORD*, DWORD*);
  79. public:
  80. /*
  81. * Constructor-Destructor
  82. */
  83. CPMeshGL();
  84. ~CPMeshGL();
  85. /*
  86. * IUnknown Methods
  87. */
  88. STDMETHODIMP_(ULONG) AddRef(void);
  89. STDMETHODIMP_(ULONG) Release(void);
  90. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR*);
  91. /*
  92. * IPMesh Methods
  93. */
  94. //Loads
  95. STDMETHODIMP Load(const char* const, const char* const, DWORD* const,
  96. DWORD* const, LPPMESHLOADCB);
  97. STDMETHODIMP LoadStat(const char* const, const char* const, DWORD* const,
  98. DWORD* const) { return E_NOTIMPL; };
  99. // Gets
  100. STDMETHODIMP GetNumFaces(DWORD* const);
  101. STDMETHODIMP GetNumVertices(DWORD* const);
  102. STDMETHODIMP GetMaxVertices(DWORD* const);
  103. STDMETHODIMP GetMaxFaces(DWORD* const);
  104. //Sets
  105. STDMETHODIMP SetNumFaces(DWORD);
  106. STDMETHODIMP SetNumVertices(DWORD);
  107. //Geomorph stuff
  108. STDMETHODIMP GeomorphToVertices(LPPMGEOMORPH, DWORD* const)
  109. { return E_NOTIMPL; };
  110. STDMETHODIMP GeomorphToFaces(LPPMGEOMORPH, DWORD* const)
  111. { return E_NOTIMPL; };
  112. STDMETHODIMP ClonePM(IPMesh* const) { return E_NOTIMPL; };
  113. // IPMeshGL Methods
  114. STDMETHODIMP Initialize (void);
  115. STDMETHODIMP Render (void);
  116. };
  117. DLLEXPORT HRESULT CreatePMeshGL (REFIID,
  118. LPVOID FAR *, //dunno what this is for
  119. IUnknown *,
  120. DWORD);
  121. #endif //_cpmesh_h_