summaryrefslogtreecommitdiff
path: root/lighting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lighting.cpp')
-rw-r--r--lighting.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lighting.cpp b/lighting.cpp
index bf01831..b140611 100644
--- a/lighting.cpp
+++ b/lighting.cpp
@@ -15,9 +15,8 @@ struct GPU_Light {
float brightness;
v3f colour;
int caster_id;
- int type;
float range;
- int pad[2];
+ int pad[3];
};
struct GPU_Caster {
@@ -101,6 +100,7 @@ void Lighting::write_bufs(
GPU_Light* ldst = (GPU_Light*)lptr;
GPU_Caster* cdst = (GPU_Caster*)cptr;
int count = 0, ccount = 0;
+ sun_range[0] = count;
for (auto v : w.view<Sun_Light>()) {
GPU_Light gl;
Sun_Light& l = v.get<Sun_Light>();
@@ -108,7 +108,6 @@ void Lighting::write_bufs(
print_war("Over light limit.\n");
goto cancel;
}
- gl.type = (int)Light::Type::sun;
gl.brightness = l.brightness;
gl.colour = l.colour;
gl.pos = l.dir;
@@ -127,6 +126,8 @@ void Lighting::write_bufs(
gl.caster_id = -1;
ldst[count++] = gl;
}
+ sun_range[1] = count;
+ point_range[0] = count;
for (auto v : w.view<Transform, Point_Light>()) {
GPU_Light gl;
Transform& t = v.get<Transform>();
@@ -135,7 +136,6 @@ void Lighting::write_bufs(
print_war("Over light limit.\n");
goto cancel;
}
- gl.type = (int)Light::Type::point;
gl.brightness = l.brightness;
gl.colour = l.colour;
gl.pos = v3f(
@@ -147,6 +147,7 @@ void Lighting::write_bufs(
gl.range = l.range;
ldst[count++] = gl;
}
+ point_range[1] = count;
cancel:
light_count = count;
caster_count = ccount;