PageRenderTime 102ms CodeModel.GetById 40ms app.highlight 8ms RepoModel.GetById 32ms app.codeStats 0ms

/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
 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
 79extern char shouldClear;
 80
 81//Custom element collision data
 82extern int colliseelement1[TCollision];
 83
 84//Collision matrix
 85extern int collision[TElements][TElements];
 86
 87//Index set state
 88extern int set[TPoints];
 89//Index available state
 90extern int avail[TPoints];
 91
 92//Location in avail array
 93extern int loq;
 94//Zoom value
 95extern int screensize;
 96
 97//Gravity values
 98extern float gravx;
 99extern float gravy;
100
101//Accelerometer control state
102extern int accelcon;
103//Flipped state
104extern int flipped;
105
106//The extent of the screen (what area to draw in)
107extern int maxx;
108extern int maxy;
109
110// A map of all the coordinates on the screen
111extern int allcoords[WIDTH][HEIGHT];
112
113//Mouse positions
114extern int xm;  
115extern int ym;
116//Old mouse positions
117extern int lmx;
118extern int lmy;
119//Finger down state
120extern int fd;
121
122//Buffer building variables
123extern char username[8];
124extern char password[8];
125extern char userlength;
126extern char passlength;
127extern char buffer[ 1/*3 + 1 + (2 * TPoints * 4) + 200*/];
128extern int bufferlength;
129
130//Error variable
131extern char* error;
132
133//Socket variables
134extern int sockfd; //The file descriptor for the socket
135extern int n; //Used in sending and recieving data
136extern struct sockaddr_in serv_addr; //The server address struct
137extern struct hostent *server; //Pointer to a hostent struct that is used to set up serv_addr
138
139#ifdef __cplusplus
140}
141#endif
142
143
144#endif // !APP_H_INCLUDED