From 3d6f4d347820e7ee0263ef4edbae3cc05166c8b9 Mon Sep 17 00:00:00 2001 From: Warmist Date: Mon, 24 Jun 2013 00:36:43 +0300 Subject: [PATCH 1/2] Added transparency to ice walls --- plugins/rendermax/renderer_light.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index 01bde38be..3f8f58fff 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -242,7 +242,7 @@ void addPlant(const std::string& id,std::map& map,const lightSo } } void lightingEngineViewscreen::initRawSpecific() -{ +{ addPlant("TOWER_CAP",glowPlants,lightSource(lightCell(0.65,0.65,0.65),6)); addPlant("MUSHROOM_CUP_DIMPLE",glowPlants,lightSource(lightCell(0.03,0.03,0.5),3)); addPlant("CAVE MOSS",glowPlants,lightSource(lightCell(0.1,0.1,0.4),2)); @@ -282,11 +282,15 @@ void lightingEngineViewscreen::doOcupancyAndLights() df::tile_designation* d=Maps::getTileDesignation(x,y,window_z); df::tile_designation* d2=Maps::getTileDesignation(x,y,window_z-1); df::tile_occupancy* o=Maps::getTileOccupancy(x,y,window_z); + df::tiletype_material m=ENUM_ATTR(tiletype,material,*type); if(!o || !d ) continue; if(shape==df::tiletype_shape::BROOK_BED || shape==df::tiletype_shape::WALL || shape==df::tiletype_shape::TREE || d->bits.hidden ) { - curCell=lightCell(0,0,0); + if(shape==df::tiletype_shape::WALL && m==df::tiletype_material::FROZEN_LIQUID) + curCell*=lightCell(0.7,0.7,0.9); + else + curCell=lightCell(0,0,0); } else if(o->bits.building) { @@ -350,7 +354,6 @@ void lightingEngineViewscreen::doOcupancyAndLights() { curCell*=lightCell(0.7f,0.7f,0.8f); } - //lights if((d->bits.liquid_type && d->bits.flow_size>0)|| ( From 8c9de7981216d7db6b124a292e82f5308623d343 Mon Sep 17 00:00:00 2001 From: Warmist Date: Mon, 24 Jun 2013 00:53:39 +0300 Subject: [PATCH 2/2] Small fixes --- plugins/rendermax/renderer_light.cpp | 44 +++++++++++++--------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index 7eaa43460..ccc1ae55f 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -283,37 +283,35 @@ void lightingEngineViewscreen::doOcupancyAndLights() { df::map_block* block=Maps::getBlock(blockx,blocky,ZZ); totalBlank = 0; + if(block) for(int block_x = 0; block_x < 16; block_x++) for(int block_y = 0; block_y < 16; block_y++) { - if(block) - { - df::tiletype type = block->tiletype[block_x][block_y]; - df::tile_designation d = block->designation[block_x][block_y]; - df::tile_occupancy o = block->occupancy[block_x][block_y]; - df::tiletype_shape shape = ENUM_ATTR(tiletype,shape,type); - df::tiletype_shape_basic basic_shape = ENUM_ATTR(tiletype_shape, basic_shape, shape); + df::tiletype type = block->tiletype[block_x][block_y]; + df::tile_designation d = block->designation[block_x][block_y]; + df::tile_occupancy o = block->occupancy[block_x][block_y]; + df::tiletype_shape shape = ENUM_ATTR(tiletype,shape,type); + df::tiletype_shape_basic basic_shape = ENUM_ATTR(tiletype_shape, basic_shape, shape); - if(basic_shape==df::tiletype_shape_basic::Wall) - { - cellArray[block_x][block_y]=lightCell(0,0,0); - } - else if(basic_shape==df::tiletype_shape_basic::Floor || basic_shape==df::tiletype_shape_basic::Ramp || basic_shape==df::tiletype_shape_basic::Stair) - { - if(ZZ!=window_z) - { - cellArray[block_x][block_y]=lightCell(0,0,0); - } - } - if(d.bits.liquid_type == df::enums::tile_liquid::Water && d.bits.flow_size) - { - cellArray[block_x][block_y] *= (lightCell(1,1,1) - (lightCell(1,1,1) - lightCell(0.63f,0.63f,0.75f))*(d.bits.flow_size/7)); - } - else if(d.bits.liquid_type == df::enums::tile_liquid::Magma && d.bits.flow_size > 3) + if(basic_shape==df::tiletype_shape_basic::Wall) + { + cellArray[block_x][block_y]=lightCell(0,0,0); + } + else if(basic_shape==df::tiletype_shape_basic::Floor || basic_shape==df::tiletype_shape_basic::Ramp || basic_shape==df::tiletype_shape_basic::Stair) + { + if(ZZ!=window_z) { cellArray[block_x][block_y]=lightCell(0,0,0); } } + if(d.bits.liquid_type == df::enums::tile_liquid::Water && d.bits.flow_size) + { + cellArray[block_x][block_y] *= (lightCell(1,1,1) - (lightCell(1,1,1) - lightCell(0.63f,0.63f,0.75f))*(d.bits.flow_size/7)); + } + else if(d.bits.liquid_type == df::enums::tile_liquid::Magma && d.bits.flow_size > 3) + { + cellArray[block_x][block_y]=lightCell(0,0,0); + } if(cellArray[block_x][block_y].r < 0.003f && cellArray[block_x][block_y].g < 0.003f && cellArray[block_x][block_y].b < 0.003f) totalBlank++; }