diff options
Diffstat (limited to 'zoom')
-rw-r--r-- | zoom/level.h | 17 | ||||
-rw-r--r-- | zoom/light.h | 23 | ||||
-rw-r--r-- | zoom/render.h | 7 | ||||
-rw-r--r-- | zoom/types.h | 15 |
4 files changed, 46 insertions, 16 deletions
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 <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
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 <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 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 <zoom/types.h> +#include <zoom/light.h> +#include <GL/gl.h> + + 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;
|