Beleuchtung und Rendering ge?ndert, um Schatten zu erm?glichen.
This commit is contained in:
parent
79801b6b79
commit
e43bceafab
12 changed files with 340 additions and 145 deletions
17
zoom/level.h
17
zoom/level.h
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <GL/gl.h>
|
||||
#include <zoom/types.h>
|
||||
#include <zoom/render.h>
|
||||
|
||||
#pragma pack(push, 2)
|
||||
typedef struct _LEVELHEADER {
|
||||
|
@ -40,9 +41,23 @@ typedef struct _LEVEL {
|
|||
} LEVEL;
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef struct _POLYGON {
|
||||
VERTEX vertices[3];
|
||||
VECTOR normal;
|
||||
|
||||
GLuint texture;
|
||||
TEXCOORDS texcoords[3];
|
||||
} POLYGON;
|
||||
|
||||
typedef struct _POLYGON_LIST {
|
||||
int nPolygons;
|
||||
|
||||
POLYGON polygons[0];
|
||||
} POLYGON_LIST;
|
||||
|
||||
|
||||
int LoadLevel(char *, LEVEL *);
|
||||
void DrawRoom(LEVEL *, int);
|
||||
POLYGON_LIST *DrawRoom(LEVEL *, int);
|
||||
void FreeLevel(LEVEL *);
|
||||
|
||||
#endif
|
||||
|
|
23
zoom/light.h
Normal file
23
zoom/light.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef ZOOM_LIGHT_H
|
||||
#define ZOOM_LIGHT_H
|
||||
|
||||
#include <zoom/types.h>
|
||||
|
||||
#define LIGHT_UNKNOWN 0
|
||||
#define LIGHT_POINT 1
|
||||
#define LIGHT_DIRECTIONAL 2
|
||||
#define LIGHT_SPOT 3
|
||||
|
||||
typedef struct _LIGHT {
|
||||
unsigned char type;
|
||||
COLOR diffuse;
|
||||
VERTEX pos;
|
||||
} LIGHT;
|
||||
|
||||
|
||||
void SetAmbient(COLOR);
|
||||
void AddLight(LIGHT);
|
||||
void ResetLights();
|
||||
void ApplyLightScale();
|
||||
|
||||
#endif
|
|
@ -1,6 +1,13 @@
|
|||
#ifndef ZOOM_RENDER_H
|
||||
#define ZOOM_RENDER_H
|
||||
|
||||
#include <zoom/types.h>
|
||||
#include <zoom/light.h>
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
void Render();
|
||||
void RenderWall(WALL, GLuint*);
|
||||
void RenderWallLight(WALL, LIGHT);
|
||||
|
||||
#endif
|
||||
|
|
15
zoom/types.h
15
zoom/types.h
|
@ -7,11 +7,6 @@
|
|||
#define TRIANGLE_WALL 1
|
||||
#define TRIANGLE_FLOOR 2
|
||||
|
||||
#define LIGHT_UNKNOWN 0
|
||||
#define LIGHT_POINT 1
|
||||
#define LIGHT_DIRECTIONAL 2
|
||||
#define LIGHT_SPOT 3
|
||||
|
||||
#define THING_UNKNOWN 0
|
||||
#define THING_MEDIPAK25 1
|
||||
#define THING_MEDIPAK50 2
|
||||
|
@ -41,16 +36,6 @@ typedef struct WALL {
|
|||
TEXCOORDS texcoords[3];
|
||||
} WALL;
|
||||
|
||||
typedef struct _COLOR {
|
||||
float r, g, b;
|
||||
} COLOR;
|
||||
|
||||
typedef struct _LIGHT {
|
||||
unsigned char type;
|
||||
COLOR diffuse;
|
||||
VERTEX pos;
|
||||
} LIGHT;
|
||||
|
||||
typedef struct _THING {
|
||||
unsigned char type;
|
||||
unsigned char visible;
|
||||
|
|
Reference in a new issue