PageRenderTime 76ms CodeModel.GetById 34ms app.highlight 7ms RepoModel.GetById 33ms app.codeStats 0ms

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