Use XPM for symbols and pictures on all platforms

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2006-03-28 11:12:48 +00:00
parent 8e13c1ec4e
commit 91feb0d1ae
5 changed files with 80 additions and 107 deletions

View File

@ -36,10 +36,8 @@
#include "forty.h"
#include "card.h"
#ifndef __WXMSW__
#include "pictures.xpm"
#include "symbols.xbm"
#endif
#include "symbols.xpm"
wxBitmap* Card::m_pictureBmap = 0;
wxBitmap* Card::m_symbolBmap = 0;
@ -61,11 +59,7 @@ Card::Card(int value, WayUp way_up) :
{
if (!m_symbolBmap)
{
#ifdef __WXMSW__
m_symbolBmap = new wxBitmap(_T("CardSymbols"), wxBITMAP_TYPE_BMP_RESOURCE);
#else
m_symbolBmap = new wxBitmap(Symbols_bits, Symbols_width, Symbols_height);
#endif
m_symbolBmap = new wxBitmap(symbols_xpm);
if (!m_symbolBmap->Ok())
{
::wxMessageBox(_T("Failed to load bitmap CardSymbols"), _T("Error"));
@ -73,11 +67,7 @@ Card::Card(int value, WayUp way_up) :
}
if (!m_pictureBmap)
{
#ifdef __WXMSW__
m_pictureBmap = new wxBitmap(_T("CardPictures"), wxBITMAP_TYPE_BMP_RESOURCE);
#else
m_pictureBmap = new wxBitmap(Pictures);
#endif
if (!m_pictureBmap->Ok())
{
::wxMessageBox(_T("Failed to load bitmap CardPictures"), _T("Error"));

View File

@ -3,6 +3,4 @@ aaaaa ICON "cards.ico"
#include "wx/msw/wx.rc"
CardsIcon ICON "cards.ico"
CardPictures BITMAP "pictures.bmp"
CardSymbols BITMAP "symbols.bmp"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,93 +1,78 @@
/* XPM */
static char *symbols[] = {
/* width height num_colors chars_per_pixel */
" 117 70 16 1",
/* colors */
"` c #ffffff",
". c #ff0000",
"# c #000000",
"a c #b40000",
"b c #000000",
"c c #000000",
"d c #000000",
"e c #000000",
"f c #000000",
"g c #000000",
"h c #000000",
"i c #000000",
"j c #000000",
"k c #000000",
"l c #000000",
"m c #000000",
/* pixels */
"```#``````.````..`..````#````````````````````````````````````````````````````````````````````````````````````````````",
"``###````...``.......``###```````````````````````````````````````````````````````````````````````````````````````````",
"`#`#`#``.....`.......`#####``````````````````````````````````````````````````````````````````````````````````````````",
"#######..............#######`````````````````````````````````````````````````````````````````````````````````````````",
"`#`#`#``.....``.....``#####``````````````````````````````````````````````````````````````````````````````````````````",
"```#`````...````...`````#````````````````````````````````````````````````````````````````````````````````````````````",
"``###`````.``````.`````###```````````````````````````````````````````````````````````````````````````````````````````",
"``###`````.``````.`````###```````````````````````````````````````````````````````````````````````````````````````````",
"```#`````...````...`````#````````````````````````````````````````````````````````````````````````````````````````````",
"`#`#`#``.....``.....``#####``````````````````````````````````````````````````````````````````````````````````````````",
"#######..............#######`````````````````````````````````````````````````````````````````````````````````````````",
"`#`#`#``.....`.......`#####``````````````````````````````````````````````````````````````````````````````````````````",
"``###````...``.......``###```````````````````````````````````````````````````````````````````````````````````````````",
"```#``````.````..`..````#````````````````````````````````````````````````````````````````````````````````````````````",
"````###`````````.```````..```..```````#``````````````````````````````````````````````````````````````````````````````",
"```#####```````...`````....`....`````###`````````````````````````````````````````````````````````````````````````````",
"```#####```````...````...........```#####````````````````````````````````````````````````````````````````````````````",
"````###```````.....```...........``#######```````````````````````````````````````````````````````````````````````````",
"`##``#``##```.......``...........`#########``````````````````````````````````````````````````````````````````````````",
"####`#`####`.........`...........###########`````````````````````````````````````````````````````````````````````````",
"###########``.......```.........`###########`````````````````````````````````````````````````````````````````````````",
"####`#`####```.....`````.......``####`#`####`````````````````````````````````````````````````````````````````````````",
"`##``#``##`````...```````.....````##``#``##``````````````````````````````````````````````````````````````````````````",
"````###````````...````````...````````###`````````````````````````````````````````````````````````````````````````````",
"``#######```````.``````````.```````#######```````````````````````````````````````````````````````````````````````````",
"``#######```````.``````````.```````#######```````````````````````````````````````````````````````````````````````````",
"````###````````...````````...````````###`````````````````````````````````````````````````````````````````````````````",
"`##``#``##`````...```````.....````##``#``##``````````````````````````````````````````````````````````````````````````",
"####`#`####```.....`````.......``####`#`####`````````````````````````````````````````````````````````````````````````",
"###########``.......```.........`###########`````````````````````````````````````````````````````````````````````````",
"####`#`####`.........`...........###########`````````````````````````````````````````````````````````````````````````",
"`##``#``##```.......``...........`#########``````````````````````````````````````````````````````````````````````````",
"````###```````.....```...........``#######```````````````````````````````````````````````````````````````````````````",
"```#####```````...````...........```#####````````````````````````````````````````````````````````````````````````````",
"```#####```````...`````....`....`````###`````````````````````````````````````````````````````````````````````````````",
"````###`````````.```````..```..```````#``````````````````````````````````````````````````````````````````````````````",
"``##````###``#####````#``#####``###``#####``###```###`#``##``#####``###``#```#```````````````````````````````````````",
"`#``#``#```#````#````##``#`````#`````````#`#```#`#```##`#``#````#``#```#`#``#````````````````````````````````````````",
"#````#`````#```#````#`#``####``#````````#``#```#`#```##`#``#````#``#```#`#`#`````````````````````````````````````````",
"#````#```##```###``#``#``````#`####````#````###```#####`#``#````#``#```#`##``````````````````````````````````````````",
"######``#````````#`#####`````#`#```#```#```#```#`````##`#``#````#``#`#`#`#`#`````````````````````````````````````````",
"#````#`#`````#```#````#``#```#`#```#```#```#```#````#`#`#``#`#``#``#``#``#``#````````````````````````````````````````",
"#````#`#####``###`````#```###```###````#````###````#``#``##```##````##`#`#```#```````````````````````````````````````",
"#````#`#####``###```#`````###```###````#````###````#```##``#```##``#`##``#```#```````````````````````````````````````",
"#````#`````#`#```#``#````#```#`#```#```#```#```#``#```#``#`#``#``#``#``#``#``#```````````````````````````````````````",
"######````#``#`````#####`#`````#```#```#```#```#`#````#``#`#``#````#`#`#```#`#```````````````````````````````````````",
"#````#``##````###```#``#`#`````#####```#````###``####`#``#`#``#````#```#````##```````````````````````````````````````",
"#````#`#```````#````#`#```####`````#``#````#```#`#```##``#`#``#````#```#```#`#```````````````````````````````````````",
"`#``#``#```#``#`````##```````#`````#`#`````#```#`#```##``#`#``#````#```#``#``#```````````````````````````````````````",
"``##````###``#####``#````#####``###``#####``###```###``##``#`#####``###``#```#```````````````````````````````````````",
"```##``````#####```#######``````##```#######````####```#######```#####````#####``##``###```#######```#####```##````#`",
"``####````#######``######``````###```#######```#####```#######``#######``#######`##`#####``#######``#######``##```##`",
"`######```##```##`````##``````####```##```````###``````````###``##```##``##```##`##`##`##``````##```##```##``##``###`",
"###``###``````###````##``````#####```######```##``````````###```###`###``##```##`##`##`##``````##```##```##``##`###``",
"##````##````####````####````###`##```#######``######`````###`````#####```#######`##`##`##``````##```##```##``#####```",
"########```####`````#####```##``##````````##``#######````##``````#####````######`##`##`##``````##```##```##``####````",
"########``###``````````###``#######```````##``##```##````##`````###`###``````###`##`##`##``````##```####`##``#####```",
"##````##``##```````##```##``#######``##```##``##```##````##`````##```##`````###``##`##`##``##``##```##`####``##`###``",
"##````##``#######``#######``````##```#######``#######````##`````#######````###```##`#####``######```######```##``###`",
"##````##``#######```#####```````##````#####````#####`````##``````#####````###````##``###````####`````######``##```##`",
"`##````##`#######```#####````##```````#####````#####``````##`````#####``````###````###``##```####```######```##```##`",
"`##````##`#######``#######```##``````#######``#######`````##````#######````###````#####`##``######```######``###``##`",
"`##````##``````##``##```##``#######``##```##``##```##`````##````##```##```###`````##`##`##``##``##``####`##```###`##`",
"`########`````###``###``````#######``##```````##```##`````##````###`###``###``````##`##`##``##``````##`####````#####`",
"`########```####````#####````##``##``##```````#######`````##`````#####```######```##`##`##``##``````##```##`````####`",
"`##````##``####``````####````##`###``#######```######````###`````#####```#######``##`##`##``##``````##```##````#####`",
"`###``###`###`````````##`````#####````######```````##```###`````###`###``##```##``##`##`##``##``````##```##```###`##`",
"``######``##```##````##``````####`````````##``````###``###``````##```##``##```##``##`##`##``##``````##```##``###``##`",
"```####```#######```######```###`````#######```#####```#######``#######``#######``#####`##`#######``#######``##```##`",
"````##`````#####```#######```##``````#######```####````#######```#####````#####````###``##`#######```#####```#````##`"
};
/* XPM */
static char *symbols_xpm[] = {
/* columns rows colors chars-per-pixel */
"117 70 2 1",
". c Black",
" c #FFFFFF",
/* pixels */
" . . .. .. . ",
" ... ... ....... ... ",
" . . . ..... ....... ..... ",
"............................ ",
" . . . ..... ..... ..... ",
" . ... ... . ",
" ... . . ... ",
" ... . . ... ",
" . ... ... . ",
" . . . ..... ..... ..... ",
"............................ ",
" . . . ..... ....... ..... ",
" ... ... ....... ... ",
" . . .. .. . ",
" ... . .. .. . ",
" ..... ... .... .... ... ",
" ..... ... ........... ..... ",
" ... ..... ........... ....... ",
" .. . .. ....... ........... ......... ",
".... . .... ......... ...................... ",
"........... ....... ......... ........... ",
".... . .... ..... ....... .... . .... ",
" .. . .. ... ..... .. . .. ",
" ... ... ... ... ",
" ....... . . ....... ",
" ....... . . ....... ",
" ... ... ... ... ",
" .. . .. ... ..... .. . .. ",
".... . .... ..... ....... .... . .... ",
"........... ....... ......... ........... ",
".... . .... ......... ...................... ",
" .. . .. ....... ........... ......... ",
" ... ..... ........... ....... ",
" ..... ... ........... ..... ",
" ..... ... .... .... ... ",
" ... . .. .. . ",
" .. ... ..... . ..... ... ..... ... ... . .. ..... ... . . ",
" . . . . . .. . . . . . . .. . . . . . . . ",
". . . . . . .... . . . . . .. . . . . . . . ",
". . .. ... . . . .... . ... ..... . . . . . .. ",
"...... . . ..... . . . . . . .. . . . . . . . . ",
". . . . . . . . . . . . . . . . . . . . . . . ",
". . ..... ... . ... ... . ... . . .. .. .. . . . ",
". . ..... ... . ... ... . ... . .. . .. . .. . . ",
". . . . . . . . . . . . . . . . . . . . . . . ",
"...... . . ..... . . . . . . . . . . . . . . . . ",
". . .. ... . . . ..... . ... .... . . . . . . .. ",
". . . . . . .... . . . . . .. . . . . . . . ",
" . . . . . .. . . . . . . .. . . . . . . . ",
" ... ... ..... . ..... ... ..... ... ... .. . ..... ... . . ",
" .. ..... ....... .. ....... .... ....... ..... ..... .. ... ....... ..... .. . ",
" .... ....... ...... ... ....... ..... ....... ....... ....... .. ..... ....... ....... .. .. ",
" ...... .. .. .. .... .. ... ... .. .. .. .. .. .. .. .. .. .. .. ... ",
"... ... ... .. ..... ...... .. ... ... ... .. .. .. .. .. .. .. .. .. ... ",
".. .. .... .... ... .. ....... ...... ... ..... ....... .. .. .. .. .. .. ..... ",
"........ .... ..... .. .. .. ....... .. ..... ...... .. .. .. .. .. .. .... ",
"........ ... ... ....... .. .. .. .. ... ... ... .. .. .. .. .... .. ..... ",
".. .. .. .. .. ....... .. .. .. .. .. .. .. ... .. .. .. .. .. .. .... .. ... ",
".. .. ....... ....... .. ....... ....... .. ....... ... .. ..... ...... ...... .. ... ",
".. .. ....... ..... .. ..... ..... .. ..... ... .. ... .... ...... .. .. ",
" .. .. ....... ..... .. ..... ..... .. ..... ... ... .. .... ...... .. .. ",
" .. .. ....... ....... .. ....... ....... .. ....... ... ..... .. ...... ...... ... .. ",
" .. .. .. .. .. ....... .. .. .. .. .. .. .. ... .. .. .. .. .. .... .. ... .. ",
" ........ ... ... ....... .. .. .. .. ... ... ... .. .. .. .. .. .... ..... ",
" ........ .... ..... .. .. .. ....... .. ..... ...... .. .. .. .. .. .. .... ",
" .. .. .... .... .. ... ....... ...... ... ..... ....... .. .. .. .. .. .. ..... ",
" ... ... ... .. ..... ...... .. ... ... ... .. .. .. .. .. .. .. .. ... .. ",
" ...... .. .. .. .... .. ... ... .. .. .. .. .. .. .. .. .. .. ... .. ",
" .... ....... ...... ... ....... ..... ....... ....... ....... ..... .. ....... ....... .. .. ",
" .. ..... ....... .. ....... .... ....... ..... ..... ... .. ....... ..... . .. "
};