|
|
|
@ -271,13 +271,16 @@ void lightingEngineViewscreen::initRawSpecific()
|
|
|
|
|
static size_t max_list_size = 100000; // Avoid iterating over huge lists
|
|
|
|
|
void lightingEngineViewscreen::doOcupancyAndLights()
|
|
|
|
|
{
|
|
|
|
|
lightSource sun(lightCell(1,1,1),15);
|
|
|
|
|
// TODO better curve (+red dawn ?)
|
|
|
|
|
float daycol = abs((*df::global::cur_year_tick % 1200) - 600.0) / 600.0;
|
|
|
|
|
lightCell sky_col(daycol, daycol, daycol);
|
|
|
|
|
lightSource sky(sky_col, 15);
|
|
|
|
|
|
|
|
|
|
lightSource lava(lightCell(0.8f,0.2f,0.2f),5);
|
|
|
|
|
lightSource candle(lightCell(0.96f,0.84f,0.03f),5);
|
|
|
|
|
lightSource torch(lightCell(0.9f,0.75f,0.3f),8);
|
|
|
|
|
rect2d vp=getMapViewport();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int window_x=*df::global::window_x;
|
|
|
|
|
int window_y=*df::global::window_y;
|
|
|
|
|
int window_z=*df::global::window_z;
|
|
|
|
@ -295,7 +298,7 @@ void lightingEngineViewscreen::doOcupancyAndLights()
|
|
|
|
|
for(int block_x = 0; block_x < 16; block_x++)
|
|
|
|
|
for(int block_y = 0; block_y < 16; block_y++)
|
|
|
|
|
{
|
|
|
|
|
cellArray[block_x][block_y] = lightCell(1,1,1);
|
|
|
|
|
cellArray[block_x][block_y] = sky_col;
|
|
|
|
|
}
|
|
|
|
|
int totalBlank = 0;
|
|
|
|
|
int topLevel = df::global::world->map.z_count-1;
|
|
|
|
@ -365,7 +368,7 @@ void lightingEngineViewscreen::doOcupancyAndLights()
|
|
|
|
|
if(!type)
|
|
|
|
|
{
|
|
|
|
|
//unallocated, do sky
|
|
|
|
|
addLight(tile,sun);
|
|
|
|
|
addLight(tile,sky);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
df::tiletype_shape shape = ENUM_ATTR(tiletype,shape,*type);
|
|
|
|
@ -456,8 +459,7 @@ void lightingEngineViewscreen::doOcupancyAndLights()
|
|
|
|
|
}
|
|
|
|
|
if(d->bits.outside && d->bits.flow_size==0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
addLight(tile,sun);
|
|
|
|
|
addLight(tile,sky);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|