rendermax: make citizen glow

develop
jj 2013-06-24 00:45:45 +02:00 committed by Warmist
parent 0a413e179e
commit 2058a822a3
1 changed files with 14 additions and 1 deletions

@ -2,12 +2,14 @@
#include <functional> #include <functional>
#include <string> #include <string>
#include <math.h>
#include "Types.h" #include "Types.h"
#include "modules/Gui.h" #include "modules/Gui.h"
#include "modules/Screen.h" #include "modules/Screen.h"
#include "modules/Maps.h" #include "modules/Maps.h"
#include "modules/Units.h"
#include "df/graphic.h" #include "df/graphic.h"
#include "df/viewscreen_dwarfmodest.h" #include "df/viewscreen_dwarfmodest.h"
@ -523,4 +525,15 @@ void lightingEngineViewscreen::doOcupancyAndLights()
int tile=getIndex(wx,wy); int tile=getIndex(wx,wy);
addLight(tile,cursor); addLight(tile,cursor);
} }
lightSource citizen(lightCell(0.80f,0.80f,0.90f),6);
for (int i=0;i<df::global::world->units.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);
}
} }