mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-07 20:46:17 +01:00
add palm-style patterns for bonus squares (via compile-time option)
This commit is contained in:
parent
67ac5c9ba0
commit
e9a9125d41
2 changed files with 29 additions and 1 deletions
|
@ -104,6 +104,12 @@ frank_draw_drawCell( DrawCtx* p_dctx, XP_Rect* xprect,
|
||||||
if ( *letters == LETTER_NONE ) {
|
if ( *letters == LETTER_NONE ) {
|
||||||
if ( bonus != BONUS_NONE ) {
|
if ( bonus != BONUS_NONE ) {
|
||||||
XP_ASSERT( bonus <= 4 );
|
XP_ASSERT( bonus <= 4 );
|
||||||
|
#ifdef USE_PATTERNS
|
||||||
|
dctx->window->DrawTiledImage( xprect->left, xprect->top,
|
||||||
|
xprect->width,
|
||||||
|
xprect->height,
|
||||||
|
&dctx->bonusImages[bonus-1] );
|
||||||
|
#else
|
||||||
RECT filledR = rectInset;
|
RECT filledR = rectInset;
|
||||||
COLOR color;
|
COLOR color;
|
||||||
insetRect( &filledR, 1 );
|
insetRect( &filledR, 1 );
|
||||||
|
@ -127,6 +133,7 @@ frank_draw_drawCell( DrawCtx* p_dctx, XP_Rect* xprect,
|
||||||
}
|
}
|
||||||
|
|
||||||
dctx->window->DrawRectFilled( &filledR, color );
|
dctx->window->DrawRectFilled( &filledR, color );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isStar ) {
|
if ( isStar ) {
|
||||||
|
@ -544,6 +551,15 @@ const unsigned char startMark_bits[] = {
|
||||||
0xc1, 0x80, /* ##-- ---# # */
|
0xc1, 0x80, /* ##-- ---# # */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef USE_PATTERNS
|
||||||
|
const unsigned char bonus_bits[][4] = {
|
||||||
|
{ 0x88, 0x44, 0x22, 0x11 },
|
||||||
|
{ 0xaa, 0x55, 0xaa, 0x55 },
|
||||||
|
{ 0xCC, 0x66, 0x33, 0x99 },
|
||||||
|
{ 0xCC, 0xCC, 0x33, 0x33 }
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
DrawCtx*
|
DrawCtx*
|
||||||
frank_drawctxt_make( MPFORMAL CWindow* window )
|
frank_drawctxt_make( MPFORMAL CWindow* window )
|
||||||
{
|
{
|
||||||
|
@ -613,6 +629,15 @@ frank_drawctxt_make( MPFORMAL CWindow* window )
|
||||||
XP_MEMCPY( (IMAGE*)&dctx->startMark, &startMark,
|
XP_MEMCPY( (IMAGE*)&dctx->startMark, &startMark,
|
||||||
sizeof(dctx->startMark) );
|
sizeof(dctx->startMark) );
|
||||||
|
|
||||||
|
#ifdef USE_PATTERNS
|
||||||
|
for ( i = 0; i < BONUS_LAST; ++i ) {
|
||||||
|
IMAGE bonus = { 8, 4, 1,
|
||||||
|
COLOR_MODE_MONO, 0, (const COLOR *) 0,
|
||||||
|
(U8*)bonus_bits[i] };
|
||||||
|
XP_MEMCPY( (IMAGE*)&dctx->bonusImages[i], &bonus,
|
||||||
|
sizeof(dctx->bonusImages[i]) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return (DrawCtx*)dctx;
|
return (DrawCtx*)dctx;
|
||||||
} /* frank_drawctxt_make */
|
} /* frank_drawctxt_make */
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,9 @@ extern "C" {
|
||||||
const IMAGE rightcursor;
|
const IMAGE rightcursor;
|
||||||
const IMAGE downcursor;
|
const IMAGE downcursor;
|
||||||
const IMAGE startMark;
|
const IMAGE startMark;
|
||||||
|
#ifdef USE_PATTERNS
|
||||||
|
const IMAGE bonusImages[BONUS_LAST];
|
||||||
|
#endif
|
||||||
} FrankDrawCtx;
|
} FrankDrawCtx;
|
||||||
|
|
||||||
void debugf( char* format, ... );
|
void debugf( char* format, ... );
|
||||||
|
|
Loading…
Add table
Reference in a new issue