summaryrefslogtreecommitdiff
path: root/src/Graphics.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-27 20:19:42 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-27 20:19:42 (GMT)
commit07525180c2f8065c61dfd38bb273ff0f0a8abc85 (patch)
tree717389467f699071c7e530713f2c3a3ae7ecb2f5 /src/Graphics.cpp
parent597d11f9f79c1486db4cdc1c0aca215cc4ab6074 (diff)
downloadpowder-07525180c2f8065c61dfd38bb273ff0f0a8abc85.zip
powder-07525180c2f8065c61dfd38bb273ff0f0a8abc85.tar.gz
Icon management, fix element menu order, fix renderer crash
Diffstat (limited to 'src/Graphics.cpp')
-rw-r--r--src/Graphics.cpp58
1 files changed, 46 insertions, 12 deletions
diff --git a/src/Graphics.cpp b/src/Graphics.cpp
index a48f6d6..678e138 100644
--- a/src/Graphics.cpp
+++ b/src/Graphics.cpp
@@ -1141,20 +1141,54 @@ TPT_INLINE void Graphics::blendpixel(int x, int y, int r, int g, int b, int a)
#endif
}
-void Graphics::draw_icon(int x, int y, char ch, int flag)
+void Graphics::draw_icon(int x, int y, Icon icon)
{
- char t[2];
- t[0] = ch;
- t[1] = 0;
- if (flag)
+ switch(icon)
{
- fillrect(x-1, y-1, 17, 17, 255, 255, 255, 255);
- drawtext(x+3, y+2, t, 0, 0, 0, 255);
- }
- else
- {
- drawrect(x, y, 15, 15, 255, 255, 255, 255);
- drawtext(x+3, y+2, t, 255, 255, 255, 255);
+ case IconOpen:
+ drawchar(x, y, 0x81, 255, 255, 255, 255);
+ break;
+ case IconReload:
+ drawchar(x, y, 0x91, 255, 255, 255, 255);
+ break;
+ case IconSave:
+ drawchar(x, y, 0x82, 255, 255, 255, 255);
+ break;
+ case IconVoteUp:
+ drawchar(x, y, 0xCB, 0, 187, 18, 255);
+ break;
+ case IconVoteDown:
+ drawchar(x, y, 0xCA, 187, 40, 0, 255);
+ break;
+ case IconTag:
+ drawchar(x, y, 0x83, 255, 255, 255, 255);
+ break;
+ case IconNew:
+ drawchar(x, y, 0x92, 255, 255, 255, 255);
+ break;
+ case IconLogin:
+ drawchar(x, y, 0x84, 255, 255, 255, 255);
+ break;
+ case IconSimulationSettings:
+ drawchar(x, y, 0xCF, 255, 255, 255, 255);
+ break;
+ case IconRenderSettings:
+ addchar(x, y, 0xD8, 255, 0, 0, 255);
+ addchar(x, y, 0xD9, 0, 255, 0, 255);
+ addchar(x, y, 0xDA, 0, 0, 255, 255);
+ break;
+ case IconPause:
+ drawchar(x, y, 0x90, 255, 255, 255, 255);
+ break;
+ case IconVoteSort:
+ case IconDateSort:
+ case IconFavourite:
+ case IconFolder:
+ case IconSearch:
+ case IconDelete:
+ default:
+ drawchar(x, y, 't', 255, 255, 255, 255);
+ break;
}
}