resources.h
上传用户:jnfxsk
上传日期:2022-06-16
资源大小:3675k
文件大小:4k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. /*
  2. ** Haaf's Game Engine 1.7
  3. ** Copyright (C) 2003-2007, Relish Games
  4. ** hge.relishgames.com
  5. **
  6. ** hgeResourceManager resources header
  7. */
  8. #ifndef HGERESOURCES_H
  9. #define HGERESOURCES_H
  10. #include "....includehgeresource.h"
  11. #include "parser.h"
  12. #define RES_SCRIPT 0
  13. #define RES_RESOURCE 1
  14. #define RES_TEXTURE 2
  15. #define RES_EFFECT 3
  16. #define RES_MUSIC 4
  17. #define RES_STREAM 5
  18. #define RES_TARGET 6
  19. #define RES_SPRITE 7
  20. #define RES_ANIMATION 8
  21. #define RES_FONT 9
  22. #define RES_PARTICLE 10
  23. #define RES_DISTORT 11
  24. #define RES_STRTABLE 12
  25. void AddRes(hgeResourceManager *rm, int type, ResDesc *resource);
  26. ResDesc* FindRes(hgeResourceManager *rm, int type, const char *name);
  27. struct RScript : public ResDesc
  28. {
  29. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  30. virtual DWORD Get(hgeResourceManager *rm) {return 0;}
  31. virtual void  Free() {}
  32. };
  33. struct RResource : public ResDesc
  34. {
  35. char   filename[MAXRESCHARS];
  36. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  37. virtual DWORD Get(hgeResourceManager *rm);
  38. virtual void  Free();
  39. };
  40. struct RTexture : public ResDesc
  41. {
  42. char   filename[MAXRESCHARS];
  43. bool   mipmap;
  44. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  45. virtual DWORD Get(hgeResourceManager *rm);
  46. virtual void  Free();
  47. };
  48. struct REffect : public ResDesc
  49. {
  50. char   filename[MAXRESCHARS];
  51. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  52. virtual DWORD Get(hgeResourceManager *rm);
  53. virtual void  Free();
  54. };
  55. struct RMusic : public ResDesc
  56. {
  57. char   filename[MAXRESCHARS];
  58. int   amplify;
  59. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  60. virtual DWORD Get(hgeResourceManager *rm);
  61. virtual void  Free();
  62. };
  63. struct RStream : public ResDesc
  64. {
  65. char   filename[MAXRESCHARS];
  66. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  67. virtual DWORD Get(hgeResourceManager *rm);
  68. virtual void  Free();
  69. };
  70. struct RTarget : public ResDesc
  71. {
  72. int width;
  73. int height;
  74. bool zbuffer;
  75. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  76. virtual DWORD Get(hgeResourceManager *rm);
  77. virtual void  Free();
  78. };
  79. struct RSprite : public ResDesc
  80. {
  81. char texname[MAXRESCHARS];
  82. float tx, ty, w, h;
  83. float hotx, hoty;
  84. int blend;
  85. DWORD color;
  86. float z;
  87. bool bXFlip, bYFlip;
  88. // float x,y;
  89. // float scale;
  90. // float rotation;
  91. // int collision;
  92. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  93. virtual DWORD Get(hgeResourceManager *rm);
  94. virtual void  Free();
  95. };
  96. struct RAnimation : public RSprite
  97. {
  98. int frames;
  99. float fps;
  100. int mode;
  101. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  102. virtual DWORD Get(hgeResourceManager *rm);
  103. virtual void  Free();
  104. };
  105. struct RFont : public ResDesc
  106. {
  107. char filename[MAXRESCHARS];
  108. bool mipmap;
  109. int blend;
  110. DWORD color;
  111. float z;
  112. float scale;
  113. float proportion;
  114. float tracking;
  115. float spacing;
  116. float rotation;
  117. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  118. virtual DWORD Get(hgeResourceManager *rm);
  119. virtual void  Free();
  120. };
  121. struct RParticle : public ResDesc
  122. {
  123. char filename[MAXRESCHARS];
  124. char spritename[MAXRESCHARS];
  125. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  126. virtual DWORD Get(hgeResourceManager *rm);
  127. virtual void  Free();
  128. };
  129. struct RDistort : public ResDesc
  130. {
  131. char texname[MAXRESCHARS];
  132. float tx, ty, w, h;
  133. int cols, rows;
  134. int blend;
  135. DWORD color;
  136. float z;
  137. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  138. virtual DWORD Get(hgeResourceManager *rm);
  139. virtual void  Free();
  140. };
  141. struct RStringTable : public ResDesc
  142. {
  143. char   filename[MAXRESCHARS];
  144. static  void  Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename);
  145. virtual DWORD Get(hgeResourceManager *rm);
  146. virtual void  Free();
  147. };
  148. #endif