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 /GUI.cpp | |
| parent | b9c1e819ac4b10773e4caf4d7a2392d3839522c3 (diff) | |
| download | stonesense-1a3d5f667e2fb32014d1b8f603d7948ccb7a4c89.tar.gz stonesense-1a3d5f667e2fb32014d1b8f603d7948ccb7a4c89.tar.bz2 stonesense-1a3d5f667e2fb32014d1b8f603d7948ccb7a4c89.tar.xz | |
Added engravings.
Diffstat (limited to 'GUI.cpp')
| -rw-r--r-- | GUI.cpp | 69 |
1 files changed, 47 insertions, 22 deletions
@@ -39,6 +39,10 @@ ALLEGRO_BITMAP* IMGCreatureSheet; ALLEGRO_BITMAP* IMGRampSheet;
ALLEGRO_BITMAP* IMGStatusSheet;
ALLEGRO_BITMAP* IMGBloodSheet;
+ALLEGRO_BITMAP* IMGEngFloorSheet;
+ALLEGRO_BITMAP* IMGEngLeftSheet;
+ALLEGRO_BITMAP* IMGEngRightSheet;
+
ALLEGRO_BITMAP* buffer = 0;
ALLEGRO_BITMAP* bigFile = 0;
vector<ALLEGRO_BITMAP*> IMGCache;
@@ -448,11 +452,11 @@ void drawDebugCursorAndInfo(){ b->building.info.type, b->building.info.vtable,
matName?matName:"Unknown",subMatName?"/":"",subMatName?subMatName:"",
b->building.info.material.type,b->building.info.material.index);
- - if(b->building.custom_building_type != -1) - { +
+ if(b->building.custom_building_type != -1)
+ {
draw_textf_border(font, al_map_rgb(255,255,255), 2, al_get_bitmap_height(al_get_target_bitmap())-20-(i--*al_get_font_line_height(font)), 0,
- "Custom workshop type %s (%d)", contentLoader.custom_workshop_types[b->building.custom_building_type].c_str(),b->building.custom_building_type); + "Custom workshop type %s (%d)", contentLoader.custom_workshop_types[b->building.custom_building_type].c_str(),b->building.custom_building_type);
}
}
@@ -471,30 +475,30 @@ void drawDebugCursorAndInfo(){ draw_textf_border(font, al_map_rgb(255,255,255), 2, al_get_bitmap_height(al_get_target_bitmap())-20-(i--*al_get_font_line_height(font)), 0,
"flag1: %s Sex: %d Mood: %d Job: %s", strCreature, b->creature->sex + 1, b->creature->mood, (b->creature->current_job.active?contentLoader.MemInfo->getJob(b->creature->current_job.jobType).c_str():""));
}
- catch(exception &e) - { - WriteErr("DFhack exeption: %s\n", e.what()); + catch(exception &e)
+ {
+ WriteErr("DFhack exeption: %s\n", e.what());
}
if((!config.skipCreatureTypes) && (!config.skipCreatureTypesEx) && (!config.skipDescriptorColors))
{
int yy = al_get_bitmap_height(al_get_target_bitmap())-20-(i--*al_get_font_line_height(font));
int xx = 2;
- for(unsigned int j = 0; j<b->creature->nbcolors ; j++) - { + for(unsigned int j = 0; j<b->creature->nbcolors ; j++)
+ {
if(contentLoader.Mats->raceEx.at(b->creature->race).castes.at(b->creature->caste).ColorModifier.at(j).colorlist.size() > b->creature->color[j])
- { - uint32_t cr_color = contentLoader.Mats->raceEx[b->creature->race].castes[b->creature->caste].ColorModifier[j].colorlist[b->creature->color[j]]; - if(cr_color < contentLoader.Mats->color.size()) - { - draw_textf_border(font, - al_map_rgb_f( - contentLoader.Mats->color[cr_color].r, - contentLoader.Mats->color[cr_color].v, - contentLoader.Mats->color[cr_color].b), xx, yy, 0, - "%s ", contentLoader.Mats->raceEx[b->creature->race].castes[b->creature->caste].ColorModifier[j].part); - xx += get_textf_width(font, "%s ", contentLoader.Mats->raceEx[b->creature->race].castes[b->creature->caste].ColorModifier[j].part); - } - } + {
+ uint32_t cr_color = contentLoader.Mats->raceEx[b->creature->race].castes[b->creature->caste].ColorModifier[j].colorlist[b->creature->color[j]];
+ if(cr_color < contentLoader.Mats->color.size())
+ {
+ draw_textf_border(font,
+ al_map_rgb_f(
+ contentLoader.Mats->color[cr_color].r,
+ contentLoader.Mats->color[cr_color].v,
+ contentLoader.Mats->color[cr_color].b), xx, yy, 0,
+ "%s ", contentLoader.Mats->raceEx[b->creature->race].castes[b->creature->caste].ColorModifier[j].part);
+ xx += get_textf_width(font, "%s ", contentLoader.Mats->raceEx[b->creature->race].castes[b->creature->caste].ColorModifier[j].part);
+ }
+ }
}
}
}
@@ -826,6 +830,12 @@ void loadGraphicsFromDisk(){ IMGStatusSheet = al_create_sub_bitmap(IMGFilelist[index], 0, 0, al_get_bitmap_width(IMGFilelist[index]), al_get_bitmap_height(IMGFilelist[index]));
index = loadImgFile("gibs.png");
IMGBloodSheet = al_create_sub_bitmap(IMGFilelist[index], 0, 0, al_get_bitmap_width(IMGFilelist[index]), al_get_bitmap_height(IMGFilelist[index]));
+ index = loadImgFile("engravings_floor.png");
+ IMGEngFloorSheet = al_create_sub_bitmap(IMGFilelist[index], 0, 0, al_get_bitmap_width(IMGFilelist[index]), al_get_bitmap_height(IMGFilelist[index]));
+ index = loadImgFile("engravings_left.png");
+ IMGEngLeftSheet = al_create_sub_bitmap(IMGFilelist[index], 0, 0, al_get_bitmap_width(IMGFilelist[index]), al_get_bitmap_height(IMGFilelist[index]));
+ index = loadImgFile("engravings_right.png");
+ IMGEngRightSheet = al_create_sub_bitmap(IMGFilelist[index], 0, 0, al_get_bitmap_width(IMGFilelist[index]), al_get_bitmap_height(IMGFilelist[index]));
createEffectSprites();
}
@@ -855,6 +865,21 @@ void flushImgFiles() al_destroy_bitmap(IMGStatusSheet);
IMGStatusSheet = 0;
}
+ if(IMGEngFloorSheet)
+ {
+ al_destroy_bitmap(IMGEngFloorSheet);
+ IMGEngFloorSheet = 0;
+ }
+ if(IMGEngLeftSheet)
+ {
+ al_destroy_bitmap(IMGEngLeftSheet);
+ IMGEngLeftSheet = 0;
+ }
+ if(IMGEngRightSheet)
+ {
+ al_destroy_bitmap(IMGEngRightSheet);
+ IMGEngRightSheet = 0;
+ }
uint32_t numFiles = (uint32_t)IMGFilelist.size();
assert( numFiles == IMGFilenames.size());
for(uint32_t i = 0; i < numFiles; i++)
|
