/FallingSandpaper/jni/app.h

http://thelements.googlecode.com/ · C Header · 142 lines · 67 code · 26 blank · 49 comment · 0 complexity · 92bb47b86884a7d58958557b4860607e 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. //Custom element collision data
  68. extern int colliseelement1[TCollision];
  69. //Collision matrix
  70. extern int collision[TElements][TElements];
  71. //Index set state
  72. extern char set[TPoints];
  73. //Index available state
  74. extern short int avail[TPoints];
  75. //Location in avail array
  76. extern int loq;
  77. //Zoom value
  78. extern int screensize;
  79. //Gravity values
  80. extern float gravx;
  81. extern float gravy;
  82. //Accelerometer control state
  83. extern int accelcon;
  84. //Flipped state
  85. extern int flipped;
  86. //The extent of the screen (what area to draw in)
  87. extern int maxx;
  88. extern int maxy;
  89. // A map of all the coordinates on the screen
  90. extern int allcoords[WIDTH][HEIGHT];
  91. //Mouse positions
  92. extern int xm;
  93. extern int ym;
  94. //Old mouse positions
  95. extern int lmx;
  96. extern int lmy;
  97. //Finger down state
  98. extern int fd;
  99. //Buffer building variables
  100. extern char username[8];
  101. extern char password[8];
  102. extern char userlength;
  103. extern char passlength;
  104. extern char buffer[3 + 1 + (2 * TPoints * 4) + 200];
  105. extern int bufferlength;
  106. //Error variable
  107. extern char* error;
  108. //Socket variables
  109. extern int sockfd; //The file descriptor for the socket
  110. extern int n; //Used in sending and recieving data
  111. extern struct sockaddr_in serv_addr; //The server address struct
  112. extern struct hostent *server; //Pointer to a hostent struct that is used to set up serv_addr
  113. #ifdef __cplusplus
  114. }
  115. #endif
  116. #endif // !APP_H_INCLUDED