summaryrefslogtreecommitdiff
path: root/GUI.cpp
diff options
context:
space:
mode:
authorJapa Illo2012-02-26 22:56:26 +0530
committerJapa Illo2012-02-26 22:56:26 +0530
commitbf1094b4d195b24acecf947770346623d3a399b5 (patch)
tree2182797323b64794613cf8f0ea8e2e87591fa809 /GUI.cpp
parent730a216f761f643823f2cac7cfa3a23c28fe76dd (diff)
downloadstonesense-bf1094b4d195b24acecf947770346623d3a399b5.tar.gz
stonesense-bf1094b4d195b24acecf947770346623d3a399b5.tar.bz2
stonesense-bf1094b4d195b24acecf947770346623d3a399b5.tar.xz
fixed the stupidly large fire bitmap, also made particle effects scale properly.
Signed-off-by: Japa Illo <japa.mala.illo@gmail.com>
Diffstat (limited to 'GUI.cpp')
-rw-r--r--GUI.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/GUI.cpp b/GUI.cpp
index ba8917b..ced5fbe 100644
--- a/GUI.cpp
+++ b/GUI.cpp
@@ -411,7 +411,14 @@ void drawDebugCursorAndInfo(){
"%s %s:%i Material:%s%s%s (%d,%d)", formName, tform, ttype,
matName?matName:"Unknown",subMatName?"/":"",subMatName?subMatName:"", b->material.type,b->material.index);
}
- //if (tform != NULL)
+ if (tform != NULL)
+ {
+ MaterialInfo mat;
+ mat.decode(b->material.type, b->material.index);
+ ALLEGRO_COLOR color = al_map_rgb_f(contentLoader->Mats->color[mat.material->state_color[0]].red, contentLoader->Mats->color[mat.material->state_color[0]].green, contentLoader->Mats->color[mat.material->state_color[0]].blue);
+ draw_textf_border(font, color, 2, al_get_bitmap_height(al_get_target_bitmap())-20-(i--*al_get_font_line_height(font)), 0,
+ "%s", mat.material->state_name[0].c_str());
+ } //if (tform != NULL)
//{
// draw_textf_border(font, 2, al_get_bitmap_height(al_get_target_bitmap())-20-(i--*al_get_font_line_height(font)), 0,
// "MaterialType: %d, MaterialIndex: %d", b->material.type, b->material.index);
@@ -1335,8 +1342,10 @@ void draw_particle_cloud(int count, float centerX, float centerY, float rangeX,
{
for(int i = 0;i < count;i++)
{
+ int width = al_get_bitmap_width(sprite);
+ int height = al_get_bitmap_height(sprite);
float drawx = centerX + ((((float)rand() / RAND_MAX) - 0.5) * rangeX * config.scale);
float drawy = centerY + ((((float)rand() / RAND_MAX) - 0.5) * rangeY * config.scale);
- al_draw_tinted_bitmap(sprite, tint, drawx, drawy, 0);
+ al_draw_tinted_scaled_bitmap(sprite, tint, 0, 0, width, height, drawx, drawy,width*config.scale, height*config.scale, 0);
}
}