summaryrefslogtreecommitdiff
path: root/MapLoading.cpp
diff options
context:
space:
mode:
authorJapa Illo2012-03-26 13:16:58 +0200
committerJapa Illo2012-03-26 13:16:58 +0200
commitdf37cc7e59b3cf5fadfa680a68793b91810a30ff (patch)
treec1f9e2b3d4e2d1cf6d2fe7b9a15e801d441cbae9 /MapLoading.cpp
parent3f7c63d777bf3722c07fdea721652da22fd2bbc2 (diff)
downloadstonesense-df37cc7e59b3cf5fadfa680a68793b91810a30ff.tar.gz
stonesense-df37cc7e59b3cf5fadfa680a68793b91810a30ff.tar.bz2
stonesense-df37cc7e59b3cf5fadfa680a68793b91810a30ff.tar.xz
Added configurable sprite support for items on the floor.
Signed-off-by: Japa Illo <japa.mala.illo@gmail.com>
Diffstat (limited to 'MapLoading.cpp')
-rw-r--r--MapLoading.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/MapLoading.cpp b/MapLoading.cpp
index 9037947..1581d6a 100644
--- a/MapLoading.cpp
+++ b/MapLoading.cpp
@@ -13,6 +13,7 @@
#include "df/item_constructed.h"
#include "df/itemimprovement.h"
#include "df/itemimprovement_threadst.h"
+#include "df/item_threadst.h"
/*
static DFHack::Core* pDFApiHandle = 0;
static DFHack::Process * DFProc = 0;
@@ -507,7 +508,7 @@ void ReadCellToSegment(DFHack::Core& DF, WorldSegment& segment, int CellX, int C
b->Item.matt.type = found_item->getActualMaterial();
b->Item.matt.index = found_item->getActualMaterialIndex();
- if(found_item->isDyed())
+ if(1)//found_item->isDyed())
{
auto Constructed_Item = virtual_cast<df::item_constructed>(found_item);
if(Constructed_Item)
@@ -521,10 +522,21 @@ void ReadCellToSegment(DFHack::Core& DF, WorldSegment& segment, int CellX, int C
auto Improvement_Thread = virtual_cast<df::itemimprovement_threadst>(Constructed_Item->improvements[idex]);
if(!Improvement_Thread)
continue;
+ if (Improvement_Thread->dye.mat_type < 0) break;
b->Item.matt.type = Improvement_Thread->dye.mat_type;
b->Item.matt.index = Improvement_Thread->dye.mat_index;
+ b->Item.dyed = 1;
}
}
+ else if (found_item->getType() == item_type::THREAD)
+ {
+ auto Thread_Item = virtual_cast<df::item_threadst>(found_item);
+ if(!Thread_Item) break;
+ if (Thread_Item->dye_mat_type < 0) break;
+ b->Item.matt.type = Thread_Item->dye_mat_type;
+ b->Item.matt.index = Thread_Item->dye_mat_index;
+ b->Item.dyed = 1;
+ }
}
}