PageRenderTime 42ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/game/gameobject.h

https://github.com/acieroid/gish
C Header | 133 lines | 106 code | 7 blank | 20 comment | 0 complexity | 431473b25ad3e3ec3a6f717c366a8af2 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. #ifndef GISH_GAME_GAMEOBJECT_H
  2. #define GISH_GAME_GAMEOBJECT_H
  3. /*
  4. Copyright (C) 2005, 2010 - Cryptic Sea
  5. This file is part of Gish.
  6. Gish is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. This program 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.
  13. See the GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. void createbox(float position[3],float sizex,float sizey,float mass,float friction);
  19. void createtarboy(float position[3]);
  20. void createwheel(float position[3],float sizex,float sizey,float mass,float friction,int anchor);
  21. void setupobjecttypes(void);
  22. void createrope(int type,int particlenum,int particlenum2,int objectnum,int objectnum2,int texturenum);
  23. void createanchor(float position[3]);
  24. void createbutton(float position[3],float mass);
  25. void createswitch(float position[3],float mass,int rotate);
  26. void createbeast(int beasttype,float position[3],float sizex,float sizey,float mass,float friction);
  27. void createbobble(int beasttype,float position[3],float sizex,float sizey,float mass,float friction);
  28. void createhead(float position[3],float sizex,float sizey,float mass,float friction);
  29. void createamber(float position[3]);
  30. void createareaswitch(float position[3],float sizex,float sizey);
  31. void creategenerator(float position[3],float mass);
  32. void deleteobject(int objectnum);
  33. void deleterope(int ropenum);
  34. void objecttimetolive(void);
  35. void createcar(float position[3],float sizex,float sizey,float mass,float friction);
  36. typedef struct
  37. {
  38. int type;
  39. int texturenum;
  40. int timetolive;
  41. int prevhitpoints;
  42. int hitpoints;
  43. int damagedelay;
  44. int animationnum;
  45. int animationtype;
  46. int frame;
  47. float framedelay;
  48. int direction;
  49. int link;
  50. float mass;
  51. float axis[8];
  52. int button;
  53. float data[8];
  54. int idata[8];
  55. int soundnum[4];
  56. float size[2];
  57. float position[3];
  58. float prevposition[3];
  59. int numoforientations;
  60. float orientation[3][3];
  61. float angle;
  62. float velocity[3];
  63. float prevvelocity[3];
  64. float radius;
  65. float friction;
  66. float frictionapplied;
  67. int numofparticles;
  68. int particle[32];
  69. int particlestick[32];
  70. float particlestickposition[32][3];
  71. float particlesticknormal[32][3];
  72. int numofcdlines;
  73. int cdline[32][2];
  74. float texcoord[4][2];
  75. int lighttype;
  76. int lighton;
  77. float lightcolor[3];
  78. float lightintensity;
  79. float lightintensitymax;
  80. int rotate;
  81. int ai;
  82. int beasttype;
  83. } _object;
  84. typedef struct
  85. {
  86. int collide[256];
  87. int numofpoints;
  88. struct
  89. {
  90. int type;
  91. float position[3];
  92. float mass;
  93. } point[64];
  94. int numoflinks;
  95. struct
  96. {
  97. int type;
  98. int part1;
  99. int part2;
  100. } link[256];
  101. } _objecttype;
  102. typedef struct
  103. {
  104. int type;
  105. int part1;
  106. int part2;
  107. int bondnum;
  108. int link;
  109. int texturenum;
  110. float angle;
  111. float cycle;
  112. float cyclelength;
  113. float cyclecount;
  114. float range;
  115. } _rope;
  116. extern int numofobjects;
  117. extern _object object[512];
  118. extern _objecttype objecttype[128];
  119. extern int numofropes;
  120. extern _rope rope[1024];
  121. #endif /* GISH_GAME_GAMEOBJECT_H */