/TheElements/jni/app.h

http://thelements.googlecode.com/ · C Header · 144 lines · 68 code · 27 blank · 49 comment · 0 complexity · 938cd69761eb5643b2fc50dbe793bc85 MD5 · raw file

  1. /*
  2. * app.h
  3. * --------------------------------
  4. * Contains all the extern declarations for
  5. * our variables, so that they are essentially
  6. * global external variables accessible from
  7. * all files necessary.
  8. */
  9. #ifndef APP_H_INCLUDED
  10. #define APP_H_INCLUDED
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. //Include the global macros
  15. #include "macros.h"
  16. // The simple framework expects the application code to define these functions.
  17. extern void appInit();
  18. extern void appDeinit();
  19. extern void appRender();
  20. /* Value is non-zero when application is alive, and 0 when it is closing.
  21. * Defined by the application framework.
  22. */
  23. extern int gAppAlive;
  24. //Current element selected
  25. extern int celement;
  26. //Current point during processing
  27. extern int cpoint;
  28. //Play state
  29. extern int play;
  30. //Size variable
  31. extern int size;
  32. //Array for bitmap drawing
  33. extern unsigned char colors[TPixels*3]; // 3 bytes per pixel
  34. //Coordinates
  35. extern float x[TPoints];
  36. extern float y[TPoints];
  37. //Old coordinates (for collision resolving)
  38. extern short int oldx[TPoints];
  39. extern short int oldy[TPoints];
  40. //Velocities
  41. extern short int xvel[TPoints];
  42. extern short int yvel[TPoints];
  43. //Element type
  44. extern char element[TPoints];
  45. //Frozen state
  46. extern char frozen[TPoints];
  47. //Spawn type
  48. extern char spawn[TPoints];
  49. //RGB properties
  50. extern unsigned char red[TElements];
  51. extern unsigned char green[TElements];
  52. extern unsigned char blue[TElements];
  53. //Fall velocity property
  54. extern int fallvel[TElements];
  55. //Density property
  56. extern int density[TElements];
  57. //Solid property
  58. extern int solid[TElements];
  59. //Growing property
  60. extern int growing[TElements];
  61. //Condensing property
  62. extern int condensing[TElements];
  63. //Fire-like burning property
  64. extern int fireburn[TElements];
  65. //Explosiveness property
  66. extern int exploness[TElements];
  67. extern char shouldClear;
  68. //Custom element collision data
  69. extern int colliseelement1[TCollision];
  70. //Collision matrix
  71. extern int collision[TElements][TElements];
  72. //Index set state
  73. extern int set[TPoints];
  74. //Index available state
  75. extern int avail[TPoints];
  76. //Location in avail array
  77. extern int loq;
  78. //Zoom value
  79. extern int screensize;
  80. //Gravity values
  81. extern float gravx;
  82. extern float gravy;
  83. //Accelerometer control state
  84. extern int accelcon;
  85. //Flipped state
  86. extern int flipped;
  87. //The extent of the screen (what area to draw in)
  88. extern int maxx;
  89. extern int maxy;
  90. // A map of all the coordinates on the screen
  91. extern int allcoords[WIDTH][HEIGHT];
  92. //Mouse positions
  93. extern int xm;
  94. extern int ym;
  95. //Old mouse positions
  96. extern int lmx;
  97. extern int lmy;
  98. //Finger down state
  99. extern int fd;
  100. //Buffer building variables
  101. extern char username[8];
  102. extern char password[8];
  103. extern char userlength;
  104. extern char passlength;
  105. extern char buffer[ 1/*3 + 1 + (2 * TPoints * 4) + 200*/];
  106. extern int bufferlength;
  107. //Error variable
  108. extern char* error;
  109. //Socket variables
  110. extern int sockfd; //The file descriptor for the socket
  111. extern int n; //Used in sending and recieving data
  112. extern struct sockaddr_in serv_addr; //The server address struct
  113. extern struct hostent *server; //Pointer to a hostent struct that is used to set up serv_addr
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. #endif // !APP_H_INCLUDED