Add xpm icon for X11.

This commit is contained in:
David Capello 2011-09-06 19:37:35 -03:00
parent c64a0d1171
commit 8a9bb6c45c
2 changed files with 44 additions and 1 deletions

View File

@ -334,7 +334,11 @@ if(WIN32)
set(win32_resources resources_win32.rc)
endif(WIN32)
add_executable(aseprite WIN32 main.cpp ${win32_resources})
if(UNIX)
set(x11_resources xpm_icon.c)
endif(UNIX)
add_executable(aseprite WIN32 main.cpp ${win32_resources} ${x11_resources})
target_link_libraries(aseprite ${all_libs})

39
src/xpm_icon.c Normal file
View File

@ -0,0 +1,39 @@
#include <allegro.h>
/* XPM */
static const char *ase16png_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 8 1",
" c #010000",
". c #325C70",
"X c #AD947D",
"o c #529BC1",
"O c #65D7DE",
"+ c #EDD6C0",
"@ c #FFFFFF",
"# c None",
/* pixels */
"################",
"################",
"########XXXX@ ##",
"#######oX+@@ ##",
"######oOX@++Xo##",
"#####oOoo+++Xo##",
"####oOo@Oo+XXo##",
"###oOo@OO@oXX.##",
"##.Oo@OOOOoo.###",
"##.o@OOOOoo.####",
"##.OOOOOoo.#####",
"##.oOOOoo.######",
"###.oOoo.#######",
"####....########",
"################",
"################"
};
#if defined ALLEGRO_WITH_XWINDOWS && defined ALLEGRO_USE_CONSTRUCTOR
extern void *allegro_icon;
CONSTRUCTOR_FUNCTION(static void _set_allegro_icon(void));
static void _set_allegro_icon(void)
{
allegro_icon = ase16png_xpm;
}
#endif