Fixed broken buildings, also added floodgate functionality.

develop
Japa 2013-06-28 23:47:54 +05:30
parent b9634098a9
commit 102b2ed450
3 changed files with 10 additions and 1 deletions

@ -21,6 +21,7 @@
#include "df/world.h" #include "df/world.h"
#include "df/building.h" #include "df/building.h"
#include "df/building_doorst.h" #include "df/building_doorst.h"
#include "df/building_floodgatest.h"
#include "df/plant.h" #include "df/plant.h"
#include "df/plant_raw.h" #include "df/plant_raw.h"
@ -903,6 +904,12 @@ void lightingEngineViewscreen::doOcupancyAndLights()
if(!door->door_flags.bits.closed) if(!door->door_flags.bits.closed)
continue; continue;
} }
else if(type==df::enums::building_type::Floodgate)
{
df::building_floodgatest* gate=static_cast<df::building_floodgatest*>(bld);
if(!gate->gate_flags.bits.closed)
continue;
}
if(def->useMaterial) if(def->useMaterial)

@ -127,6 +127,7 @@ struct buildingLightDef
bool useMaterial; bool useMaterial;
float thickness; float thickness;
float size; float size;
buildingLightDef():poweredOnly(false),useMaterial(true),thickness(1.0f),size(1.0f){}
}; };
class lightingEngineViewscreen:public lightingEngine class lightingEngineViewscreen:public lightingEngine
{ {

@ -146,3 +146,4 @@ addBuilding("Bed",{1,1,1},{0.3,0.2,0.0},2)
addBuilding("WindowGlass",nil,nil,0,{"useMaterial"}) addBuilding("WindowGlass",nil,nil,0,{"useMaterial"})
addBuilding("WindowGem",nil,nil,0,{"useMaterial"}) addBuilding("WindowGem",nil,nil,0,{"useMaterial"})
addBuilding("Door",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light addBuilding("Door",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light
addBuilding("Floodgate",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light