PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/TheElements/jni/setup.c

http://thelements.googlecode.com/
C | 52 lines | 41 code | 4 blank | 7 comment | 4 complexity | 6157d8b339bb1e2f599836a0cfdcbaa7 MD5 | raw file
 1/*
 2 * setup.c
 3 * -----------------------------
 4 * Defines the rsetup function, which initializes
 5 * all of the arrays and variables necessary.
 6 */
 7
 8#include "setup.h"
 9
10void rsetup()
11{
12	int j, o, k;
13	loq = TPoints-1;
14	cpoint = 0;
15	//size = 4;  if size stuff is failing this may need to be uncommented
16	unsigned char blankred = red[3];
17	unsigned char blankgreen = green[3];
18	unsigned char blankblue = blue[3];
19
20	for (j = 0; j < TPoints; j++)
21	{
22		x[j] = -1;
23		y[j] = -1;
24		xvel[j] = 0;
25		yvel[j] = 0;
26		element[j] = 0;
27		oldx[j] = 0;
28		oldy[j] = 0;
29		set[j] = 0;
30		avail[j] = j;
31		spawn[j] = -1;
32		frozen[j] = 0;
33	}
34	for (j = 0; j < 8; j++)
35	{
36		username[j] = 0;
37		password[j] = 0;
38	}
39	userlength = 0;
40	passlength = 0;
41
42	for (o = 0; o < HEIGHT; o++)
43	{
44		for (k = 0; k < WIDTH; k++)
45		{
46			allcoords[k][o] = -1; // -1 is empty
47			colors[3 * (k + WIDTH * o)] = blankred; //0
48			colors[3 * (k + WIDTH * o) + 1] = blankblue; //0
49			colors[3 * (k + WIDTH * o) + 2] = blankgreen; //0
50		}
51	}
52}