Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Paste Description for Mine

Rockbox solitaire plugin

Mine
Sunday, August 6th, 2006 at 9:21:42pm UTC 

  1. Index: solitaire.c
  2. ===================================================================
  3. RCS file: /cvsroot/rockbox/apps/plugins/solitaire.c,v
  4. retrieving revision 1.39
  5. diff -u -r1.39 solitaire.c
  6. --- solitaire.c 3 Aug 2006 20:58:35 -0000        1.39
  7. +++ solitaire.c 6 Aug 2006 21:07:45 -0000
  8. @@ -5,7 +5,7 @@
  9.   *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
  10.   *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
  11.   *                     \/            \/     \/    \/            \/
  12. - * $Id: solitaire.c,v 1.39 2006-08-03 20:58:35 dionoea Exp $
  13. + * $Id: solitaire.c,v 1.39 2006/08/03 20:58:35 dionoea Exp $
  14.   *
  15.   * Copyright (C) 2004-2006 Antoine Cellerier <dionoea @t videolan d.t org>
  16.   *
  17. @@ -246,14 +246,20 @@
  18.  
  19.  
  20.  #define draw_number( num, x, y ) \
  21. -    rb->lcd_bitmap_part( numbers, 0, num * NUMBER_HEIGHT, NUMBER_STRIDE, \
  22. -                         x, y, NUMBER_WIDTH, NUMBER_HEIGHT );
  23. +    rb->lcd_mono_bitmap_part( (const unsigned char *)numbers, 0, num * NUMBER_HEIGHT, \
  24. +                         NUMBER_STRIDE, x, y, NUMBER_WIDTH, NUMBER_HEIGHT );
  25.  extern const fb_data solitaire_numbers[];
  26.  #define numbers solitaire_numbers
  27.  
  28. +#ifdef HAVE_LCD_COLOR
  29. +#define draw_suit( num, x, y ) \
  30. +    rb->lcd_bitmap_part(suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \
  31. +                         x, y, SUIT_WIDTH, SUIT_HEIGHT );
  32. +#else
  33.  #define draw_suit( num, x, y ) \
  34. -    rb->lcd_bitmap_part( suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \
  35. +    rb->lcd_mono_bitmap_part( (const unsigned char *)suits, 0, num * SUIT_HEIGHT, SUIT_STRIDE, \
  36.                           x, y, SUIT_WIDTH, SUIT_HEIGHT );
  37. +#endif
  38.  extern const fb_data solitaire_suits[];
  39.  #define suits   solitaire_suits
  40.  
  41. @@ -264,9 +270,16 @@
  42.  #   define SUITI_WIDTH  SUIT_WIDTH
  43.  #   define draw_suiti( num, x, y ) draw_suit( num, x, y )
  44.  #else
  45. +
  46. +#ifdef HAVE_LCD_COLOR
  47.  #   define draw_suiti( num, x, y ) \
  48.      rb->lcd_bitmap_part( suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \
  49.                           x, y, SUITI_WIDTH, SUITI_HEIGHT );
  50. +#else
  51. +#   define draw_suiti( num, x, y ) \
  52. +    rb->lcd_mono_bitmap_part( (const unsigned char *)suitsi, 0, num * SUITI_HEIGHT, SUITI_STRIDE, \
  53. +                         x, y, SUITI_WIDTH, SUITI_HEIGHT );
  54. +#endif
  55.      extern const fb_data solitaire_suitsi[];
  56.  #   define suitsi  solitaire_suitsi
  57.  #endif
  58. @@ -283,6 +296,15 @@
  59.      extern const fb_data solitaire_cardback[];
  60.  #endif
  61.  
  62. +#if LCD_DEPTH>1
  63. +static const unsigned colors[4] = {
  64. +#ifdef HAVE_LCD_COLOR
  65. +    LCD_BLACK, LCD_RGBPACK(255, 0, 0), LCD_BLACK, LCD_RGBPACK(255, 0, 0) };
  66. +#else
  67. +    LCD_BLACK, LCD_BRIGHTNESS(127), LCD_BLACK, LCD_BRIGHTNESS(127) };
  68. +#endif
  69. +#endif
  70. +
  71.  #define CONFIG_FILENAME "sol.cfg"
  72.  
  73.  #define NOT_A_CARD 255
  74. @@ -384,6 +406,10 @@
  75.          rb->lcd_set_foreground( LCD_WHITE );
  76.          rb->lcd_fillrect( x+1, y+1, CARD_WIDTH-1, CARD_HEIGHT-1 );
  77.  #endif
  78. +#if LCD_DEPTH > 1
  79. +        rb->lcd_set_foreground(colors[card.suit]);
  80. +#endif
  81. +       
  82.          if( leftstyle )
  83.          {
  84.  #if UPPER_ROW_MARGIN > 0
  85. @@ -423,6 +449,10 @@
  86.  #if LCD_DEPTH == 1
  87.      rb->lcd_set_drawmode( DRMODE_SOLID );
  88.  #endif
  89. +
  90. +#if (LCD_DEPTH > 1) && (LCD_DEPTH < 16)
  91. +        rb->lcd_set_foreground(colors[s]);
  92. +#endif
  93.      draw_suiti( s, x+(CARD_WIDTH-SUITI_WIDTH)/2,
  94.                  y+(CARD_HEIGHT-SUITI_HEIGHT)/2 );
  95.  
  96. Index: bitmaps/mono/SOURCES
  97. ===================================================================
  98. RCS file: /cvsroot/rockbox/apps/plugins/bitmaps/mono/SOURCES,v
  99. retrieving revision 1.7
  100. diff -u -r1.7 SOURCES
  101. --- bitmaps/mono/SOURCES        5 Jun 2006 20:41:49 -0000       1.7
  102. +++ bitmaps/mono/SOURCES        6 Aug 2006 21:07:45 -0000
  103. @@ -26,6 +26,18 @@
  104.  
  105.  #endif
  106.  
  107. +/* Solitaire */
  108. +#if LCD_HEIGHT > 64
  109. +solitaire_numbers.8x10x1.bmp
  110. +#ifndef HAVE_LCD_COLOR
  111. +solitaire_suits.8x10x1.bmp
  112. +solitaire_suitsi.15x16x1.bmp
  113. +#endif
  114. +#else
  115. +solitaire_numbers.6x6x1.bmp
  116. +solitaire_suits.6x6x1.bmp
  117. +#endif
  118. +
  119.  /* Tetrox */
  120.  #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
  121.  tetrox_background.112x64x1.bmp
  122. Index: bitmaps/native/SOURCES
  123. ===================================================================
  124. RCS file: /cvsroot/rockbox/apps/plugins/bitmaps/native/SOURCES,v
  125. retrieving revision 1.32
  126. diff -u -r1.32 SOURCES
  127. --- bitmaps/native/SOURCES      2 Aug 2006 22:14:58 -0000     1.32
  128. +++ bitmaps/native/SOURCES      6 Aug 2006 21:07:46 -0000
  129. @@ -152,27 +152,14 @@
  130.  
  131.  /* Solitaire */
  132.  #ifdef HAVE_LCD_COLOR
  133. +solitaire_suits.8x10x16.bmp
  134. +solitaire_suitsi.15x16x16.bmp
  135.  #if (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176)
  136.  solitaire_cardback.220x176x16.bmp
  137.  #else
  138.  solitaire_cardback.176x132x16.bmp
  139.  #endif
  140.  #endif
  141. -#if defined( HAVE_LCD_COLOR )
  142. -solitaire_numbers.8x10x1.bmp
  143. -solitaire_suits.8x10x16.bmp
  144. -#elif LCD_HEIGHT > 64
  145. -solitaire_numbers.8x10x1.bmp
  146. -solitaire_suits.8x10x1.bmp
  147. -#else
  148. -solitaire_numbers.6x6x1.bmp
  149. -solitaire_suits.6x6x1.bmp
  150. -#endif
  151. -#ifdef HAVE_LCD_COLOR
  152. -solitaire_suitsi.15x16x16.bmp
  153. -#else
  154. -solitaire_suitsi.15x16x1.bmp
  155. -#endif
  156.  
  157.  /* Sudoku */
  158.  #if (LCD_WIDTH == 112) && (LCD_HEIGHT==64) && (LCD_DEPTH == 1)

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right worth-right