From b95683adb2567a713175e7ad5de7d927b7d74eca Mon Sep 17 00:00:00 2001 From: jj Date: Mon, 24 Jun 2013 02:22:30 +0200 Subject: [PATCH 1/3] rendermax: sunlight travels down stairs --- plugins/rendermax/renderer_light.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index d5d19815a..8aa45cc14 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -317,13 +317,17 @@ void lightingEngineViewscreen::doOcupancyAndLights() { 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) + else if(basic_shape==df::tiletype_shape_basic::Floor || basic_shape==df::tiletype_shape_basic::Ramp || shape==df::tiletype_shape::STAIR_UP) { if(ZZ!=window_z) { cellArray[block_x][block_y]=lightCell(0,0,0); } } + else if(shape==df::tiletype_shape::STAIR_DOWN || shape==df::tiletype_shape::STAIR_UPDOWN) + { + cellArray[block_x][block_y]*=lightCell(0.9,0.9,0.9); + } 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)); From 19952b9139803155ba24aedcdb87e8448f9ce55f Mon Sep 17 00:00:00 2001 From: jj Date: Mon, 24 Jun 2013 02:27:43 +0200 Subject: [PATCH 2/3] rendermax: lights off when sleeping --- plugins/rendermax/renderer_light.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index 8aa45cc14..01042fc95 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -535,7 +535,7 @@ void lightingEngineViewscreen::doOcupancyAndLights() (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)) + if (DFHack::Units::isCitizen(u) && !u->counters.unconscious) addLight(getIndex(u->pos.x-window_x+1, u->pos.y-window_y+1),citizen); } } From abc9dc300ea084f0858dd34e1ddd37120f136a11 Mon Sep 17 00:00:00 2001 From: Warmist Date: Mon, 24 Jun 2013 03:47:42 +0300 Subject: [PATCH 3/3] Prelimenary work on advmode --- plugins/rendermax/renderer_light.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index 187b3d2d8..41754c0fe 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -11,6 +11,7 @@ #include "df/graphic.h" #include "df/viewscreen_dwarfmodest.h" +#include "df/viewscreen_dungeonmodest.h" #include "df/flow_info.h" #include "df/world.h" #include "df/building.h" @@ -29,7 +30,15 @@ rect2d getMapViewport() const int AREA_MAP_WIDTH = 23; const int MENU_WIDTH = 30; if(!gps || !df::viewscreen_dwarfmodest::_identity.is_instance(DFHack::Gui::getCurViewscreen())) - return mkrect_wh(0,0,0,0); + { + if(gps && df::viewscreen_dungeonmodest::_identity.is_instance(DFHack::Gui::getCurViewscreen())) + { + return mkrect_wh(0,0,gps->dimx,gps->dimy); + } + else + return mkrect_wh(0,0,0,0); + + } int w=gps->dimx; int h=gps->dimy; int view_height=h-2;