From 82deeafe89dd30547f00029a340933e21dea520e Mon Sep 17 00:00:00 2001 From: Warmist Date: Sun, 23 Jun 2013 22:28:26 +0300 Subject: [PATCH] Torches for statues, candles on the tables. --- plugins/rendermax/renderer_light.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index f7fad23ff..463290121 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -218,7 +218,9 @@ void lightingEngineViewscreen::doOcupancyAndLights() { lightSource sun(lightCell(1,1,1),15); lightSource lava(lightCell(0.8f,0.2f,0.2f),5); - + lightSource candle(lightCell(0.96f,0.84f,0.03f),5); + candle.flicker=true; + lightSource torch(lightCell(0.96f,0.5f,0.1f),8); rect2d vp=getMapViewport(); int window_x=*df::global::window_x; @@ -282,6 +284,25 @@ void lightingEngineViewscreen::doOcupancyAndLights() curCell*=lightCell(0.75f,0.95f,0.95f); } } + if (type == df::enums::building_type::Table) + { + addLight(tile,candle); + } + if (type==df::enums::building_type::Statue) + { + addLight(tile,torch); + } + if (type==df::enums::building_type::WindowGem) + { + DFHack::MaterialInfo mat(bld->mat_index,bld->mat_type); + if(mat.isInorganic()) + { + int color=mat.inorganic->material.basic_color[0]; + curCell*=lightCell(df::global::enabler->ccolor[color][0]/255.0f, + df::global::enabler->ccolor[color][1]/255.0f, + df::global::enabler->ccolor[color][2]/255.0f); + } + } } } } @@ -290,7 +311,6 @@ void lightingEngineViewscreen::doOcupancyAndLights() { curCell*=lightCell(0.7f,0.7f,0.8f); } - //todo constructions //lights if((d->bits.liquid_type && d->bits.flow_size>0)|| @@ -314,6 +334,7 @@ void lightingEngineViewscreen::doOcupancyAndLights() for(int blocky=window_y/16;blocky<(window_x+vpW)/16;blocky++) { df::map_block* block=Maps::getBlock(blockx,blocky,window_z); + if(!block) continue; for(int i=0;iflows.size();i++)