From 50073ae406474e270a37d262f9aab9652413a3f0 Mon Sep 17 00:00:00 2001 From: jj Date: Mon, 24 Jun 2013 00:45:45 +0200 Subject: [PATCH] rendermax: make citizen glow --- plugins/rendermax/renderer_light.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index 187b3d2d8..05f1d2c96 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -2,12 +2,14 @@ #include #include +#include #include "Types.h" #include "modules/Gui.h" #include "modules/Screen.h" #include "modules/Maps.h" +#include "modules/Units.h" #include "df/graphic.h" #include "df/viewscreen_dwarfmodest.h" @@ -503,4 +505,15 @@ void lightingEngineViewscreen::doOcupancyAndLights() int tile=getIndex(wx,wy); addLight(tile,cursor); } -} \ No newline at end of file + lightSource citizen(lightCell(0.80f,0.80f,0.90f),6); + for (int i=0;iunits.active.size();++i) + { + df::unit *u = df::global::world->units.active[i]; + if (u->pos.z != window_z || + (u->pos.x < window_x || u->pos.x >= window_x+vpW) || + (u->pos.y < window_y || u->pos.y >= window_y+vpH)) + continue; + if (DFHack::Units::isCitizen(u)) + addLight(getIndex(u->pos.x-window_x+1, u->pos.y-window_y+1),citizen); + } +}