mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
new macros for new dawg node format
This commit is contained in:
parent
a19a3a57cb
commit
c98da8bff3
1 changed files with 33 additions and 15 deletions
|
@ -128,9 +128,23 @@ static XP_S16 cmpMoves( PossibleMove* m1, PossibleMove* m2 );
|
||||||
error: need to pick one!!!
|
error: need to pick one!!!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ISACCEPTING(d,e) ((ACCEPTINGMASK & ((array_edge_old*)(e))->bits) != 0)
|
#ifdef NODE_CAN_4
|
||||||
#define IS_LAST_EDGE(d,e) ((LASTEDGEMASK & ((array_edge_old*)(e))->bits) != 0)
|
# define ISACCEPTING(d,e) \
|
||||||
#define EDGETILE(d,edge) ((Tile)(((array_edge_old*)(edge))->bits & LETTERMASK))
|
((ACCEPTINGMASK_NEW & ((array_edge_old*)(e))->bits) != 0)
|
||||||
|
# define IS_LAST_EDGE(d,e) \
|
||||||
|
((LASTEDGEMASK_NEW & ((array_edge_old*)(e))->bits) != 0)
|
||||||
|
# define EDGETILE(e,edge) \
|
||||||
|
((Tile)(((array_edge_old*)(edge))->bits & \
|
||||||
|
((e)->is_4_byte?LETTERMASK_NEW_4:LETTERMASK_NEW_3)))
|
||||||
|
#else
|
||||||
|
# define ISACCEPTING(d,e) \
|
||||||
|
((ACCEPTINGMASK_OLD & ((array_edge_old*)(e))->bits) != 0)
|
||||||
|
# define IS_LAST_EDGE(d,e) \
|
||||||
|
((LASTEDGEMASK_OLD & ((array_edge_old*)(e))->bits) != 0)
|
||||||
|
# define EDGETILE(d,edge) \
|
||||||
|
((Tile)(((array_edge_old*)(edge))->bits & LETTERMASK_OLD))
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CROSSCHECK_CONTAINS(chk,tile) (((chk) & (1L<<(tile))) != 0)
|
#define CROSSCHECK_CONTAINS(chk,tile) (((chk) & (1L<<(tile))) != 0)
|
||||||
|
|
||||||
#define HILITE_CELL( engine, col, row ) \
|
#define HILITE_CELL( engine, col, row ) \
|
||||||
|
@ -1081,23 +1095,27 @@ static unsigned long
|
||||||
index_from( DictionaryCtxt* dict, array_edge* p_edge )
|
index_from( DictionaryCtxt* dict, array_edge* p_edge )
|
||||||
{
|
{
|
||||||
unsigned long result;
|
unsigned long result;
|
||||||
if ( 0 ) {
|
|
||||||
#ifdef NODE_CAN_4
|
#ifdef NODE_CAN_4
|
||||||
} else if ( dict->nodeSize == 4 ) {
|
array_edge_new* edge = (array_edge_new*)p_edge;
|
||||||
array_edge_new* edge = (array_edge_new*)p_edge;
|
result = ((edge->o.highByte << 8) | edge->o.lowByte) & 0x0000FFFF;
|
||||||
result = ((edge->o.highByte << 8) | edge->o.lowByte) & 0x0000FFFF;
|
|
||||||
result |= ((XP_U32)edge->moreBits) << 17;
|
if ( dict->is_4_byte ) {
|
||||||
if ( (edge->o.bits & LASTBITMASK) != 0 ) {
|
result |= ((XP_U32)edge->moreBits) << 16;
|
||||||
result |= 0x00010000; /* using | instead of + saves 4 bytes */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
array_edge_old* edge = (array_edge_old*)p_edge;
|
XP_ASSERT( dict->nodeSize == 3 );
|
||||||
result = ((edge->highByte << 8) | edge->lowByte) & 0x0000FFFF;
|
if ( (edge->o.bits & EXTRABITMASK_NEW) != 0 ) {
|
||||||
if ( (edge->bits & LASTBITMASK) != 0 ) {
|
|
||||||
result |= 0x00010000; /* using | instead of + saves 4 bytes */
|
result |= 0x00010000; /* using | instead of + saves 4 bytes */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
array_edge_old* edge = (array_edge_old*)p_edge;
|
||||||
|
result = ((edge->highByte << 8) | edge->lowByte) & 0x0000FFFF;
|
||||||
|
if ( (edge->bits & EXTRABITMASK_OLD) != 0 ) {
|
||||||
|
result |= 0x00010000; /* using | instead of + saves 4 bytes */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} /* index_from */
|
} /* index_from */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue