Verzeichnisstruktur ge?ndert
This commit is contained in:
commit
f3df7ef89a
36 changed files with 49537 additions and 0 deletions
11
zoom/collision.h
Normal file
11
zoom/collision.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef GAME_COLLISION_H
|
||||
#define GAME_COLLISION_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
int CollisionPointTriangle(VERTEX, TRIANGLE);
|
||||
int CollisionRayTriangle(VERTEX, VECTOR, TRIANGLE, float*);
|
||||
int CollisionSphereTriangle(VERTEX, float,TRIANGLE);
|
||||
int CollisionMovingSphereTriangle(VERTEX, float, VECTOR, float, TRIANGLE);
|
||||
|
||||
#endif
|
7
zoom/init.h
Normal file
7
zoom/init.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef GAME_INIT_H
|
||||
#define GAME_INIT_H
|
||||
|
||||
int InitGame();
|
||||
void UninitGame();
|
||||
|
||||
#endif
|
48
zoom/level.h
Normal file
48
zoom/level.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
#ifndef GAME_LEVEL_H
|
||||
#define GAME_LEVEL_H
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include "types.h"
|
||||
|
||||
#pragma pack(push, 2)
|
||||
typedef struct _LEVELHEADER {
|
||||
char l, f;
|
||||
int nRooms;
|
||||
int nTextures;
|
||||
} LEVELHEADER;
|
||||
|
||||
typedef struct _ROOMHEADER {
|
||||
int nTriangles;
|
||||
int nObjects;
|
||||
int nGates;
|
||||
} ROOMHEADER;
|
||||
|
||||
typedef struct _GATEINFO {
|
||||
unsigned short state;
|
||||
unsigned short timer;
|
||||
} GATEINFO;
|
||||
|
||||
typedef struct _ROOM {
|
||||
int nTriangles;
|
||||
int nObjects;
|
||||
int nGates;
|
||||
TRIANGLE *triangles;
|
||||
OBJECT *objects;
|
||||
GATE *gates;
|
||||
GATEINFO *gateinfo;
|
||||
} ROOM;
|
||||
|
||||
typedef struct _LEVEL {
|
||||
int nRooms;
|
||||
ROOM *rooms;
|
||||
int nTextures;
|
||||
GLuint *textures;
|
||||
} LEVEL;
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
int LoadLevel(char *, LEVEL *);
|
||||
void DrawRoom(LEVEL *, int);
|
||||
void FreeLevel(LEVEL *);
|
||||
|
||||
#endif
|
21
zoom/math.h
Normal file
21
zoom/math.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef GAME_MATH_H
|
||||
#define GAME_MATH_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
float VectorDot(VECTOR, VECTOR);
|
||||
VECTOR VectorCross(VECTOR, VECTOR);
|
||||
VECTOR VectorSub(VECTOR, VECTOR);
|
||||
VECTOR VectorAdd(VECTOR, VECTOR);
|
||||
VECTOR VectorMul(VECTOR, float);
|
||||
VECTOR VectorNormalize(VECTOR);
|
||||
VECTOR VectorNeg(VECTOR);
|
||||
float VectorLength(VECTOR);
|
||||
float VectorLengthSq(VECTOR);
|
||||
int VectorEqual(VECTOR, VECTOR);
|
||||
MATRIX MatrixMul(MATRIX, MATRIX);
|
||||
MATRIX MatrixIdentity();
|
||||
MATRIX VectorMatrix(VERTEX, VECTOR, VERTEX, VECTOR);
|
||||
VECTOR VectorMatrixMul(VECTOR, MATRIX);
|
||||
|
||||
#endif
|
24
zoom/player.h
Normal file
24
zoom/player.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#ifndef GAME_PLAYER_H
|
||||
#define GAME_PLAYER_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define INPUT_UP 1
|
||||
#define INPUT_DOWN 2
|
||||
#define INPUT_RIGHT 4
|
||||
#define INPUT_LEFT 8
|
||||
#define INPUT_OPEN 16
|
||||
|
||||
typedef struct _PLAYER {
|
||||
VERTEX pos;
|
||||
float rotx;
|
||||
float rotysin, rotycos;
|
||||
int health;
|
||||
int shield;
|
||||
int room;
|
||||
} PLAYER;
|
||||
|
||||
void MouseInput(int, int);
|
||||
void DoInput(int);
|
||||
|
||||
#endif
|
6
zoom/render.h
Normal file
6
zoom/render.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef GAME_RENDER_H
|
||||
#define GAME_RENDER_H
|
||||
|
||||
void Render();
|
||||
|
||||
#endif
|
11
zoom/texture.h
Normal file
11
zoom/texture.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef GAME_TEXTURE_H
|
||||
#define GAME_TEXTURE_H
|
||||
|
||||
typedef struct _TEXLIST {
|
||||
char name[30];
|
||||
GLuint id;
|
||||
} TEXLIST;
|
||||
|
||||
GLuint LoadTexture(char *);
|
||||
|
||||
#endif
|
63
zoom/types.h
Normal file
63
zoom/types.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
#ifndef GAME_TYPES_H
|
||||
#define GAME_TYPES_H
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#define TRIANGLE_UNKNOWN 0
|
||||
#define TRIANGLE_WALL 1
|
||||
#define TRIANGLE_FLOOR 2
|
||||
|
||||
#define OBJECT_UNKNOWN 0
|
||||
#define OBJECT_MEDIPAK25 1
|
||||
#define OBJECT_MEDIPAK50 2
|
||||
#define OBJECT_MEDIPAK100 3
|
||||
|
||||
#define GATE_UNKNOWN 0
|
||||
#define GATE_SIDE 1
|
||||
|
||||
#define STATE_UNKNOWN 0
|
||||
#define STATE_OPENED 1
|
||||
#define STATE_CLOSED 2
|
||||
#define STATE_OPENING 3
|
||||
#define STATE_CLOSING 4
|
||||
|
||||
#pragma pack(push, 2)
|
||||
typedef union _MATRIX {
|
||||
float m[4][4];
|
||||
float f[16];
|
||||
} MATRIX;
|
||||
|
||||
typedef struct _VECTOR_VERTEX {
|
||||
float x, y, z;
|
||||
} VECTOR, VERTEX;
|
||||
|
||||
typedef struct _TEXCOORDS {
|
||||
float s, t;
|
||||
} TEXCOORDS;
|
||||
|
||||
typedef struct _TRIANGLE {
|
||||
unsigned char type;
|
||||
unsigned char visible;
|
||||
VERTEX vertices[3];
|
||||
VECTOR normal;
|
||||
int texture;
|
||||
TEXCOORDS texcoords[3];
|
||||
} TRIANGLE;
|
||||
|
||||
typedef struct _OBJECT {
|
||||
unsigned char type;
|
||||
unsigned char visible;
|
||||
VERTEX pos;
|
||||
} OBJECT;
|
||||
|
||||
typedef struct _GATE {
|
||||
unsigned char type;
|
||||
unsigned char open;
|
||||
TRIANGLE triangles[2];
|
||||
VERTEX point;
|
||||
int room;
|
||||
int gate;
|
||||
} GATE;
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
Reference in a new issue