TypeDefine.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <OgrePlatform.h>
  17. #include <OgreString.h>
  18. typedef Ogre::uint8 u8;
  19. typedef Ogre::uint16 u16;
  20. typedef Ogre::uint32 u32;
  21. typedef Ogre::int8 s8;
  22. typedef Ogre::int16 s16;
  23. typedef Ogre::int32 s32;
  24. namespace QGears{
  25. typedef Ogre::uchar uchar;
  26. typedef Ogre::uint8 uint8;
  27. typedef Ogre::uint16 uint16;
  28. typedef Ogre::uint32 uint32;
  29. typedef Ogre::int8 sint8;
  30. typedef Ogre::int16 sint16;
  31. typedef Ogre::int32 sint32;
  32. typedef Ogre::String String;
  33. /**
  34. * Color components.
  35. */
  36. struct ColorComponents{
  37. /**
  38. * Blue component of the color.
  39. */
  40. uint8 blue;
  41. /**
  42. * Green component of the color.
  43. */
  44. uint8 green;
  45. /**
  46. * Red component of the color.
  47. */
  48. uint8 red;
  49. /**
  50. * Alpha component of the color.
  51. */
  52. uint8 alpha;
  53. };
  54. /**
  55. * @todo: Understand and document.
  56. */
  57. union ColorA8R8G8B8{
  58. ColorComponents comp;
  59. uint32 all;
  60. };
  61. /**
  62. * Pixel coordinates.
  63. */
  64. struct Pixel{
  65. /**
  66. * X coordinate of the pixel.
  67. */
  68. sint16 x;
  69. /**
  70. * Y coordinate of the pixel.
  71. */
  72. sint16 y;
  73. };
  74. /**
  75. * Extension for material files.
  76. */
  77. extern const String EXT_MATERIAL;
  78. /**
  79. * Extension for mesh files.
  80. */
  81. extern const String EXT_MESH;
  82. /**
  83. * Extension for skeleton files.
  84. */
  85. extern const String EXT_SKELETON;
  86. /**
  87. * Extension for configuration files.
  88. */
  89. extern const String EXT_CONFIG;
  90. /**
  91. * Extension for log files.
  92. */
  93. extern const String EXT_LOG;
  94. /**
  95. * Extension for P files.
  96. *
  97. * P files are binary files containing data which form 3D model. The files
  98. * specifies model's vertices, polygons, colors, texture coordinates and
  99. * model sub-groups. The files do not specify references to the texture
  100. * files, animations, model skeleton or anything else.
  101. *
  102. * P-files are used as parts of field models, battle models, battle
  103. * locations on PC version of FF7.
  104. */
  105. extern const String EXT_P;
  106. /**
  107. * Extension for PLY files.
  108. *
  109. * PLY file contain polygon data.
  110. */
  111. extern const String EXT_PLY;
  112. /**
  113. * Exteesion for RSD files.
  114. *
  115. * RSD files are product of the original Playstation Psy-Q 3D development
  116. * libraries. They are often expoted by 3D modelers when converting from an
  117. * LWO or DXF file to something more understandable by the PSX. It is in
  118. * ascii, making it easy to edit by hand. When a 3D editor does an export,
  119. * four text files are actually created, .rsd, .ply, .mat, and .grp. These
  120. * can then be "compiled" into a binary .rsd file for the PSX.
  121. *
  122. * In the PC version of Final Fantasy 7, the text .rsd file is used while
  123. * the other files were "compiled" into Polygon(.p) format.
  124. */
  125. extern const String EXT_RSD;
  126. /**
  127. * Extension for TIM files.
  128. *
  129. * TIM files are a standard image file format for the Sony PlayStation. The
  130. * file structure closely mimics the way textures are managed in the frame
  131. * buffer by the GPU. TIM files are little endian-based.
  132. */
  133. extern const String EXT_TIM;
  134. /**
  135. * Extension for TEX files.
  136. *
  137. * TEX files are the PC's version of Final Fantasy VII texture files.
  138. */
  139. extern const String EXT_TEX;
  140. /**
  141. * Extension for trigger files.
  142. *
  143. * Triggers are located in fields maps.
  144. */
  145. extern const String EXT_TRIGGERS;
  146. /**
  147. * Extension for background files.
  148. *
  149. * Backgrounds are located in field maps.
  150. */
  151. extern const String EXT_BACKGROUND;
  152. /**
  153. * Extension for cam matrix files.
  154. *
  155. * Camera matrices are located in field maps.
  156. */
  157. extern const String EXT_CAMERA_MATRIX;
  158. /**
  159. * Extension for model list files.
  160. *
  161. * Model lists are a part of field maps.
  162. */
  163. extern const String EXT_MODEL_LIST;
  164. /**
  165. * Extension for palette files.
  166. */
  167. extern const String EXT_PALETTE;
  168. /**
  169. * Extension for walkmesh files.
  170. *
  171. * Walkmeshes are part of field maps.
  172. */
  173. extern const String EXT_WALKMESH;
  174. }