summaryrefslogtreecommitdiff
path: root/Creatures.cpp
diff options
context:
space:
mode:
authorJapa2012-08-26 09:59:42 +0530
committerJapa2012-08-26 09:59:42 +0530
commitea37f39ae1cde3d5229a500c870eea7a62c85888 (patch)
treebbd729157425be1077ebd0dee3602aa69f143653 /Creatures.cpp
parent2a62ba5ed2607f4dbf0473e77502d4e19c19678e (diff)
downloadstonesense-ea37f39ae1cde3d5229a500c870eea7a62c85888.tar.gz
stonesense-ea37f39ae1cde3d5229a500c870eea7a62c85888.tar.bz2
stonesense-ea37f39ae1cde3d5229a500c870eea7a62c85888.tar.xz
Made unknown creatures use proper caste and profession colors.
Diffstat (limited to 'Creatures.cpp')
-rw-r--r--Creatures.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Creatures.cpp b/Creatures.cpp
index bface8c..811934d 100644
--- a/Creatures.cpp
+++ b/Creatures.cpp
@@ -283,8 +283,11 @@ void DrawCreature(int drawx, int drawy, t_unit* creature, Block * b){
{
df::creature_raw *raw = df::global::world->raws.creatures.all[creature->race];
int spritenum = raw->creature_tile;
+ if(raw->caste[creature->caste]->caste_tile)
+ spritenum = raw->caste[creature->caste]->caste_tile;
spritenum += (spritenum/16)*4;
- DrawSpriteFromSheet(spritenum,IMGLetterSheet,config.colors.getDfColor(raw->color[0],raw->color[2]),drawx,drawy,b);
+ ALLEGRO_COLOR tilecolor = config.colors.getDfColor(DFHack::Units::getCasteProfessionColor(creature->race,creature->caste,(df::profession)creature->profession));
+ DrawSpriteFromSheet(spritenum,IMGLetterSheet,tilecolor,drawx,drawy,b);
}
unsigned int offsety = config.show_creature_names ? al_get_font_line_height(font) : 0;