From e43bceafaba72d34dfbea1deecd56c2f694d704a Mon Sep 17 00:00:00 2001 From: neoraider Date: Tue, 24 Oct 2006 15:04:02 +0000 Subject: Beleuchtung und Rendering ge?ndert, um Schatten zu erm?glichen. --- zoom/level.h | 17 ++++++++++++++++- zoom/light.h | 23 +++++++++++++++++++++++ zoom/render.h | 7 +++++++ zoom/types.h | 15 --------------- 4 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 zoom/light.h (limited to 'zoom') diff --git a/zoom/level.h b/zoom/level.h index 0ed961c..c93fd3b 100644 --- a/zoom/level.h +++ b/zoom/level.h @@ -3,6 +3,7 @@ #include #include +#include #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 diff --git a/zoom/light.h b/zoom/light.h new file mode 100644 index 0000000..06d6756 --- /dev/null +++ b/zoom/light.h @@ -0,0 +1,23 @@ +#ifndef ZOOM_LIGHT_H +#define ZOOM_LIGHT_H + +#include + +#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 diff --git a/zoom/render.h b/zoom/render.h index 606d6eb..b25a65c 100644 --- a/zoom/render.h +++ b/zoom/render.h @@ -1,6 +1,13 @@ #ifndef ZOOM_RENDER_H #define ZOOM_RENDER_H +#include +#include +#include + + void Render(); +void RenderWall(WALL, GLuint*); +void RenderWallLight(WALL, LIGHT); #endif diff --git a/zoom/types.h b/zoom/types.h index 9e40ea6..0a60876 100644 --- a/zoom/types.h +++ b/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; -- cgit v1.2.3