-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfrag.h
73 lines (63 loc) · 1.63 KB
/
frag.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* $Id: frag.h,v 1.2 2003/03/21 02:59:49 kenta Exp $
*
* Copyright 2003 Kenta Cho. All rights reserved.
*/
/**
* Fragment data.
*
* @version $Revision: 1.2 $
*/
#ifndef FRAG_H
#define FRAG_H
#include "vector.h"
#define FRAG_COLOR_NUM 2
//senquack - converted to fixed point:
//typedef struct {
// float x, y, z;
// float mx, my, mz;
// float width, height;
// int d1, d2, md1, md2;
// int r[FRAG_COLOR_NUM], g[FRAG_COLOR_NUM], b[FRAG_COLOR_NUM];
// int cnt;
//} Frag;
typedef struct
{
#ifdef FIXEDMATH
GLfixed fx, fy, fz;
GLfixed fmx, fmy, fmz;
GLfixed fwidth, fheight;
#else
float x, y, z;
float mx, my, mz;
float width, height;
#endif //FIXEDMATH
//senquack TODO: poss. optimization, should we change the degrees to floats?:
int d1, d2, md1, md2;
int r[FRAG_COLOR_NUM], g[FRAG_COLOR_NUM], b[FRAG_COLOR_NUM];
int cnt;
} Frag;
#define FRAG_MAX 512
void initFrags ();
void moveFrags ();
void drawFrags ();
void addLaserFrag (int x, int y, int width);
#ifdef FIXEDMATH
//senquack - fixed point version:
void addBossFrag(GLfixed x, GLfixed y, GLfixed z, GLfixed width, int d);
#else
void addBossFrag(float x, float y, float z, float width, int d);
#endif //FIXEDMATH
#ifdef FIXEDMATH
//senquack - fixed point version:
void addShipFrag(GLfixed x, GLfixed y);
#else
void addShipFrag(float x, float y);
#endif //FIXEDMATH
void addGrazeFrag (int x, int y, int mx, int my);
#ifdef FIXEDMATH
void addShapeFrag(GLfixed x, GLfixed y, GLfixed size, int d, int cnt, int type, int mx, int my);
#else
void addShapeFrag(GLfloat x, GLfloat y, GLfloat size, int d, int cnt, int type, int mx, int my);
#endif //FIXEDMATH
#endif // FRAG_H