Card.hpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #include "gosFX.hpp"
  6. #include "Singleton.hpp"
  7. #include <MLR\MLR.hpp>
  8. namespace MidLevelRenderer {class MLRCardCloud;}
  9. namespace gosFX
  10. {
  11. //############################################################################
  12. //######################## Card__Specification #############################
  13. //############################################################################
  14. class Card;
  15. class Card__Specification:
  16. public Singleton__Specification
  17. {
  18. friend class Card;
  19. //----------------------------------------------------------------------
  20. // Constructors/Destructors
  21. //
  22. protected:
  23. Card__Specification(
  24. Stuff::MemoryStream *stream,
  25. int gfx_version
  26. );
  27. public:
  28. Card__Specification();
  29. void
  30. Save(Stuff::MemoryStream *stream);
  31. void
  32. BuildDefaults();
  33. bool
  34. IsDataValid(bool fix_data=false);
  35. static Card__Specification*
  36. Make(
  37. Stuff::MemoryStream *stream,
  38. int gfx_version
  39. );
  40. void
  41. Copy(Card__Specification *spec);
  42. //-------------------------------------------------------------------------
  43. // FCurves
  44. //
  45. public:
  46. SeededCurveOf<ConstantCurve, ComplexCurve,Curve::e_ConstantComplexType>
  47. m_halfHeight,
  48. m_aspectRatio;
  49. SeededCurveOf<ComplexCurve, SplineCurve,Curve::e_ComplexSplineType>
  50. m_index;
  51. ConstantCurve
  52. m_UOffset,
  53. m_VOffset,
  54. m_USize,
  55. m_VSize;
  56. bool
  57. m_animated;
  58. BYTE
  59. m_width;
  60. void
  61. SetWidth();
  62. };
  63. //############################################################################
  64. //############################# Card #################################
  65. //############################################################################
  66. class Card : public Singleton
  67. {
  68. //----------------------------------------------------------------------------
  69. // Class Registration Support
  70. //
  71. public:
  72. static void InitializeClass();
  73. static void TerminateClass();
  74. typedef Card__Specification Specification;
  75. //----------------------------------------------------------------------------
  76. // Class Data Support
  77. //
  78. protected:
  79. Card(
  80. Specification *spec,
  81. unsigned flags
  82. );
  83. ~Card();
  84. Stuff::Scalar
  85. m_halfX,
  86. m_halfY;
  87. MidLevelRenderer::MLRCardCloud
  88. *m_cardCloud;
  89. Stuff::Point3D
  90. m_vertices[4];
  91. Stuff::RGBAColor
  92. m_colors[4];
  93. Stuff::Vector2DOf<Stuff::Scalar>
  94. m_uvs[4];
  95. const int
  96. m_cardCount;
  97. public:
  98. static Card*
  99. Make(
  100. Specification *spec,
  101. unsigned flags
  102. );
  103. Specification*
  104. GetSpecification()
  105. {
  106. Check_Object(this);
  107. return
  108. Cast_Object(Specification*, m_specification);
  109. }
  110. static ClassData
  111. *DefaultData;
  112. //----------------------------------------------------------------------------
  113. // Testing
  114. //
  115. public:
  116. void
  117. TestInstance() const;
  118. //----------------------------------------------------------------------------
  119. // API
  120. //
  121. public:
  122. void
  123. Start(ExecuteInfo *info);
  124. bool
  125. Execute(ExecuteInfo *info);
  126. void
  127. Draw(DrawInfo *info);
  128. void
  129. Kill();
  130. };
  131. }