Browse files

Merge branch 'test'

  • Loading branch information...
2 parents ca40092 + b7af8ca commit 2a62ba5ed2607f4dbf0473e77502d4e19c19678e @JapaMala JapaMala committed Aug 24, 2012
Showing with 19 additions and 7 deletions.
  1. +11 −7 Creatures.cpp
  2. +7 −0 GUI.cpp
  3. +1 −0 GUI.h
  4. BIN resources/Sir_Henry's_32x32.png
View
18 Creatures.cpp
@@ -277,11 +277,18 @@ void DrawCreature(int drawx, int drawy, t_unit* creature, Block * b){
}
c_sprite * sprite = GetCreatureSpriteMap( creature );
+ if(sprite)
+ sprite->draw_world(creature->x,creature->y, creature->z, b);
+ else
+ {
+ df::creature_raw *raw = df::global::world->raws.creatures.all[creature->race];
+ int spritenum = raw->creature_tile;
+ spritenum += (spritenum/16)*4;
+ DrawSpriteFromSheet(spritenum,IMGLetterSheet,config.colors.getDfColor(raw->color[0],raw->color[2]),drawx,drawy,b);
+ }
unsigned int offsety = config.show_creature_names ? al_get_font_line_height(font) : 0;
-
- sprite->draw_world(creature->x,creature->y, creature->z, b);
-
+
if(statusIcons.size())
{
for(int i = 0; i < statusIcons.size(); i++)
@@ -551,12 +558,9 @@ CreatureConfiguration *GetCreatureConfig( t_unit* c ){
c_sprite* GetCreatureSpriteMap( t_unit* c )
{
- static c_sprite * defaultSprite = new c_sprite;
- defaultSprite->reset();
- defaultSprite->set_defaultsheet(IMGCreatureSheet);
CreatureConfiguration *testConfig = GetCreatureConfig( c );
if (testConfig == NULL)
- return defaultSprite;
+ return NULL;
testConfig->sprite.set_defaultsheet(IMGCreatureSheet);
return &(testConfig->sprite);
}
View
7 GUI.cpp
@@ -62,6 +62,7 @@ ALLEGRO_BITMAP* IMGBloodSheet;
ALLEGRO_BITMAP* IMGEngFloorSheet;
ALLEGRO_BITMAP* IMGEngLeftSheet;
ALLEGRO_BITMAP* IMGEngRightSheet;
+ALLEGRO_BITMAP* IMGLetterSheet;
ALLEGRO_BITMAP* buffer = 0;
ALLEGRO_BITMAP* bigFile = 0;
@@ -1063,6 +1064,7 @@ void loadGraphicsFromDisk()
if(!load_from_path(p, "engravings_floor.png", IMGEngFloorSheet)) return;
if(!load_from_path(p, "engravings_left.png", IMGEngLeftSheet)) return;
if(!load_from_path(p, "engravings_right.png", IMGEngRightSheet)) return;
+ if(!load_from_path(p, "Sir_Henry's_32x32.png", IMGLetterSheet)) return;
al_destroy_path(p);
createEffectSprites();
}
@@ -1118,6 +1120,11 @@ void flushImgFiles()
al_destroy_bitmap(IMGEngRightSheet);
IMGEngRightSheet = 0;
}
+ if(IMGLetterSheet)
+ {
+ al_destroy_bitmap(IMGLetterSheet);
+ IMGLetterSheet = 0;
+ }
uint32_t numFiles = (uint32_t)IMGFilelist.size();
assert( numFiles == IMGFilenames.size());
for(uint32_t i = 0; i < numFiles; i++)
View
1 GUI.h
@@ -55,6 +55,7 @@ extern ALLEGRO_BITMAP* IMGBloodSheet;
extern ALLEGRO_BITMAP* IMGEngFloorSheet;
extern ALLEGRO_BITMAP* IMGEngLeftSheet;
extern ALLEGRO_BITMAP* IMGEngRightSheet;
+extern ALLEGRO_BITMAP* IMGLetterSheet;
extern Crd3D debugCursor;
extern vector<string*> IMGFilenames;
View
BIN resources/Sir_Henry's_32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2a62ba5

Please sign in to comment.