File: Types.h

package info (click to toggle)
blockout2 2.4%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,268 kB
  • sloc: cpp: 8,725; ansic: 143; makefile: 105
file content (172 lines) | stat: -rw-r--r-- 3,801 bytes parent folder | download | duplicates (4)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
 	File:        Types.h 
  Description: Various basic types definitions
  Program:     BlockOut
  Author:      Jean-Luc PONS

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
*/

#include "GLApp/GLApp.h"

#ifndef TYPESH
#define TYPESH

//-----------------------------------------------------------------------------
// Global definitions
//-----------------------------------------------------------------------------

#define PI                 3.1415926535f
#define STARTZ             0.87f
#define FAR_DISTANCE       10.0f
#define MAX_CUBE           50
#define NB_POLYCUBE        41

// Vertex format
#define VERTEX_FORMAT      (D3DFVF_XYZ)
#define FACEVERTEX_FORMAT  (D3DFVF_XYZ | D3DFVF_NORMAL)
#define TFACEVERTEX_FORMAT  (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1)

// Max pit dimension
#define MAX_PITWIDTH       7
#define MAX_PITHEIGHT      7
#define MAX_PITDEPTH       18

// Min pit dimension
#define MIN_PITWIDTH       3
#define MIN_PITHEIGHT      3
#define MIN_PITDEPTH       6

// Block set
#define BLOCKSET_FLAT      0
#define BLOCKSET_BASIC     1
#define BLOCKSET_EXTENDED  2

// Animation speed
#define ASPEED_SLOW        0
#define ASPEED_FAST        10

// Face transparency
#define FTRANS_MIN         0 
#define FTRANS_MAX         10

// Game state
#define GAME_PLAYING       1
#define GAME_PAUSED        2
#define GAME_OVER          3
#define GAME_DEMO          4

// Screen resoltion
#define RES_640x480        0
#define RES_800x600        1
#define RES_1024x768       2
#define RES_1280x1024      3

// Game style
#define STYLE_CLASSIC      0
#define STYLE_MARBLE       1
#define STYLE_ARCADE       2

// Game sound
#define SOUND_BLOCKOUT2    0
#define SOUND_BLOCKOUT     1

// Frame limiter
#define FR_NOLIMIT    0
#define FR_LIMIT50    1
#define FR_LIMIT60    2
#define FR_LIMIT75    3
#define FR_LIMIT100   4

//-----------------------------------------------------------------------------
// Structure definitions
//-----------------------------------------------------------------------------
typedef struct {

  int x;
  int y;

} POINT;

typedef struct  {

  float x;
  float y;
  float z;

} VERTEX;

typedef struct {

  int x;
  int y;
  int z;

} BLOCKITEM;

typedef struct SCORERECLINK {

  int   setupId;
  int   score;
  int   nbCube;
  int   nbLine1;
  int   nbLine2;
  int   nbLine3;
  int   nbLine4;
  int   nbLine5;
  int   startLevel;
  int   date;
  char  name[11];
  BYTE  emptyPit;
  int   scoreId;
  float gameTime;

  SCORERECLINK *next;

} SCOREREC;

typedef struct {

  char name[11];
  int  rank;
  int  highScore;

} PLAYER_INFO;

typedef struct {

  int rotate;
  int tx;
  int ty;
  int tz;

} AI_MOVE;

//-----------------------------------------------------------------------------
// Util functions
//-----------------------------------------------------------------------------

extern VERTEX v(float x,float y,float z);
extern void Normalize(VERTEX *v);
extern int fround(float x);
extern char *FormatTime(float seconds);
extern char *FormatDate(int time);
extern char *FormatDateShort(int time);
extern int CreateTexture(int width,int height,char *imgName,GLuint *hmap);
extern char GetChar(BYTE *keys);
extern void ZeroMemory(void *buff,int size);
extern BOOL DirExists(char *dirname);
extern BOOL CheckEnv();
extern char *LID(char *fileName);
extern char *LHD(char *fileName);


#endif /* TYPESH */