PageRenderTime 213ms CodeModel.GetById 121ms app.highlight 4ms RepoModel.GetById 86ms app.codeStats 0ms

/FallingSandpaper/jni/setup.c

http://thelements.googlecode.com/
C | 53 lines | 43 code | 4 blank | 6 comment | 4 complexity | c89c5a3c90f6791e07b6d101308ec591 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;
14	cpoint = 0;
15	play = 1;
16	size = 4;
17	unsigned char blankred = red[3];
18	unsigned char blankgreen = green[3];
19	unsigned char blankblue = blue[3];
20
21	for (j = 0; j < TPoints; j++)
22	{
23		x[j] = 0;
24		y[j] = 0;
25		xvel[j] = 0;
26		yvel[j] = 0;
27		element[j] = 0;
28		oldx[j] = 0;
29		oldy[j] = 0;
30		set[j] = 0;
31		avail[j] = j;
32		spawn[j] = -1;
33		frozen[j] = 0;
34	}
35	for (j = 0; j < 8; j++)
36	{
37		username[j] = 0;
38		password[j] = 0;
39	}
40	userlength = 0;
41	passlength = 0;
42
43	for (o = 0; o < HEIGHT; o++)
44	{
45		for (k = 0; k < WIDTH; k++)
46		{
47			allcoords[k][o] = -1; // -1 is empty
48			colors[3 * (k + WIDTH * o)] = blankred; //0
49			colors[3 * (k + WIDTH * o) + 1] = blankblue; //0
50			colors[3 * (k + WIDTH * o) + 2] = blankgreen; //0
51		}
52	}
53}