diff options
| author | Japa | 2011-04-03 11:55:02 +0000 |
|---|---|---|
| committer | Japa | 2011-04-03 11:55:02 +0000 |
| commit | 1a3d5f667e2fb32014d1b8f603d7948ccb7a4c89 (patch) | |
| tree | 69dc28900e5397a23019e7292551cc57e0a71372 /MapLoading.cpp | |
| parent | b9c1e819ac4b10773e4caf4d7a2392d3839522c3 (diff) | |
| download | stonesense-1a3d5f667e2fb32014d1b8f603d7948ccb7a4c89.tar.gz stonesense-1a3d5f667e2fb32014d1b8f603d7948ccb7a4c89.tar.bz2 stonesense-1a3d5f667e2fb32014d1b8f603d7948ccb7a4c89.tar.xz | |
Added engravings.
Diffstat (limited to 'MapLoading.cpp')
| -rw-r--r-- | MapLoading.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/MapLoading.cpp b/MapLoading.cpp index d2696f0..880505c 100644 --- a/MapLoading.cpp +++ b/MapLoading.cpp @@ -633,6 +633,16 @@ WorldSegment* ReadMapSegment(DFHack::Context &DF, int x, int y, int z, int sizex config.skipConstructions = true;
}
}
+ DFHack::Engravings *Eng;
+ try
+ {
+ Eng = DF.getEngravings();
+ }
+ catch (exception &e)
+ {
+ WriteErr("DFhack exeption: %s\n", e.what());
+ config.skipConstructions = true;
+ }
DFHack::World *Wold;
if(!config.skipWorld)
{
@@ -804,6 +814,35 @@ WorldSegment* ReadMapSegment(DFHack::Context &DF, int x, int y, int z, int sizex //translate constructions
changeConstructionMaterials(segment, &allConstructions);
+ uint32_t numengravings = 0;
+ try
+ {
+ if (Eng->Start(numengravings))
+ {
+ dfh_engraving engraved;
+ t_engraving &tempeng = engraved.s;
+ index = 0;
+ Block * b = 0;
+ while(index < numengravings)
+ {
+ Eng->Read(index, engraved);
+ if(segment->CoordinateInsideSegment(tempeng.x, tempeng.y, tempeng.z))
+ {
+ b = segment->getBlock(tempeng.x, tempeng.y, tempeng.z);
+ b->engraving_character = tempeng.display_character;
+ b->engraving_flags = tempeng.flags;
+ b->engraving_quality = tempeng.quality;
+ }
+ index++;
+ }
+ Eng->Finish();
+ }
+ }
+ catch(exception &e)
+ {
+ WriteErr("DFhack exception: %s\n", e.what());
+ }
+
//Read Vegetation
//uint32_t numtrees;
|
