diff options
Diffstat (limited to 'player.c')
-rw-r--r-- | player.c | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -2,6 +2,7 @@ #include <math.h> #include <zoom/player.h> #include <zoom/level.h> +#include <zoom/light.h> #include <neofx/collision.h> #include <neofx/math.h> @@ -20,7 +21,8 @@ float rotxspeed = 0, rotyspeed = 0; float objrot = 0; extern LEVEL level; -extern LIGHT light; +extern int nLights; +extern LIGHT *lights; void MouseInput(int x, int y) { roty += x * 0.3; @@ -223,28 +225,28 @@ void DoInput(int delta) { else i = 24000 - lightpos; if(i == 0) { - light.pos.x = 0.0; - light.pos.y = 0.0; - light.pos.z = 0.0; + lights[0].pos.x = 0.0; + lights[0].pos.y = 0.0; + lights[0].pos.z = 0.0; } else if(i < 4000) { - light.pos.x = 0.0; - light.pos.y = 0.0; - light.pos.z = -i * 0.001; + lights[0].pos.x = 0.0; + lights[0].pos.y = 0.0; + lights[0].pos.z = -i * 0.001; } else if(i < 8000) { - light.pos.x = (i-4000) * 0.001; - light.pos.y = 0.0; - light.pos.z = -4.0; + lights[0].pos.x = (i-4000) * 0.001; + lights[0].pos.y = 0.0; + lights[0].pos.z = -4.0; } else if(i < 12000) { - light.pos.x = 4.0; - light.pos.y = 0.0; - light.pos.z = -4.0 - (i-8000) * 0.001; + lights[0].pos.x = 4.0; + lights[0].pos.y = 0.0; + lights[0].pos.z = -4.0 - (i-8000) * 0.001; } else { - light.pos.x = 4.0; - light.pos.y = 0.0; - light.pos.z = -8.0; + lights[0].pos.x = 4.0; + lights[0].pos.y = 0.0; + lights[0].pos.z = -8.0; } } |