Commit graph

55 commits

Author SHA1 Message Date
Eric House
c73eec567b fix some const confusion the stricter android gcc found 2014-10-14 06:24:41 -07:00
Eric House
badc40f90b move dividerLoc into model and use to limit sorting to tiles to its
right
2014-10-09 20:09:24 -07:00
Eric House
88248131da show new client-formatted turn summary in notification; remove old
common-formatting code.
2014-08-26 21:37:33 -07:00
Eric House
2d08848715 snapshot: toward having a better description of the last move in
notifications.
2014-08-26 06:55:26 -07:00
Eric House
a7c114e3f9 refcount dicts. Model "owns" its copy and so increments the refcount when gaining one and decrements the count on any being replaced (and on all on exit). This is setting up the real change, which is to let the java world wrap dicts in objects that hang onto them until they're destroyed, which should fix problems where dicts are referenced after they've been destroyed. 2014-03-08 20:57:27 -08:00
Eric House
b5d6c513a6 add canUndo to GameStateInfo and use to hide the undo menu 2013-12-03 07:06:48 -08:00
Eric House
2f8b6cceb5 pass additional param into callback -- unused so far. 2012-09-06 07:19:12 -07:00
Eric House
bfc68656cb move arrow to where removed tile was, and set its direction based on
whether removed tile and the next tile are in the same column or row.
2012-07-10 18:00:23 -07:00
Eric House
adadc9c90c use new hash algorithm for new stream version, old for previous
versions.  Tested upgrade scenario from b44: works.
2012-05-28 11:07:59 -07:00
Eric House
de3107271d changes to make hashing work -- make sure unused space in structs is 0
-- and to detect when an incoming move doesn't make sense.  These
latter changes may not be necessary now that hash code is checked
first thing, but can't hurt, and there will be devices without hash
codes for a while.
2012-05-03 19:02:42 -07:00
Eric House
c52db8a8f0 toward better recovery from out-of-sync move and undo: include a hash
of the move stack with every turn (version permitting), and drop
incoming moves created against a move stack different from ours.
2012-05-01 07:58:11 -07:00
Eric House
f51c0b39e6 use const where possible for game_writeToStream and others it calls.
No other code changes.
2012-03-11 18:28:14 -07:00
Eric House
adb9b3853d fix bugs around new variable-length tiles array changes, and otherwise
improve storage of col/row data so that test runs succeed with
MAX_COLS of 16 or 32.  Still to do: test mid-game upgrade.
2011-11-28 18:46:08 -08:00
Andy2
2eac8e70e0 adding missing ifdef 2011-11-18 07:43:37 -08:00
Andy2
210c59ef9b move bonus square values into model: add API to set an array, and API
to query model for values.  Now everybody else queries new model API
rather than client via util_getSquareBonus(), model uses its internal
values if present otherwise falls back to util_getSquareBonus(), and
internalizes the array as part of the game.  Now it should be easier
to have different bonus patterns and to have them exchanged as part of
network game init.
2011-11-16 19:01:11 -08:00
Andy2
86d5778ec3 remove 16x16 limitation on board size, replacing with 32x32. Change
is enabled by a compile-time flag so Android needn't follow yet.
2011-11-14 18:21:41 -08:00
Eric House
cee738942e back out earlier change using redo: it was broken. Add assert to
catch problem with passing ptr to tiles as src of tiles.
2011-11-10 18:26:32 -08:00
Andy2
7c7cd82e0a add code to iterate over words in a dict. Works on Linux (iterating
forward only) but disabled at compile time.  Idea's to have a dict
browser.  There was some simple refactoring in common code Android
uses, and that tests fine.
2011-10-21 18:51:33 -07:00
Andy2
4eee7f8aa7 Pass selected tiles into new util function, and from there into java
world, so confirming query can include them.
2011-10-19 18:34:26 -07:00
Andy2
6793742f0f remove option to list all words played in a single lookup dialog, and
supporting code in the jni/common C.
2011-10-14 22:32:30 -07:00
Andy2
0e6b4d749f When pen held on committed tile on board, cons up list of all words
played that include that tile and pass to new util_cellSquareHeld()
method.  In java implementation of that method, use existing lookup
activity code to display list of words.  Enabled on the C side by a
compile-time flag in case it has problems.  Right now the time spent
saving a game before launching the lookup activity, and reloading it
after, is pretty apparent, but that's in emulator which is slow.
2011-10-13 19:14:08 -07:00
Andy2
dc20b04a4c remove unused param (on the C/jni side) 2011-10-04 18:54:53 -07:00
Andy2
77b9fa11a5 improving lookup words experience: replace
util_userQuery(QUERY_ROBOT_MOVE) with new util_informMove(), into
which the number of words formed and the words themselves are passed.
The process of consing up the score explanation was already passing
over the model, so storing the words is very little effort, and will
save a call back into the model where the user actually wants to do
the lookup.
2011-10-02 16:21:09 -07:00
Andy2
35a0a3a291 passing pool into word-listing code a mistake as it put tiles back
when undoing and so the pool grew each time.  Fix, and remove server
API as it's unneeded.
2011-09-22 06:41:48 -07:00
Andy2
9eacdb3856 add server_listWordsPlayed, and implement via function in model.c that
uses existing stack and undo features to run a WordNotifierInfo over
some number of scoring passes to gather the words seen.  Seems to work
as tested from gtk version.  Now need to try from android....
2011-09-18 17:20:01 -07:00
Andy2
e4b952222a unify two ways of saving words encountered during scoring, removing
one and changing the site that used it to use the other.  Not visible
outside of common, but should make it easier to harvest a list of all
words for one move or the entire game.
2011-09-02 19:11:04 -07:00
Eric House
3cc105da0b add ability to dump board (model) as text, protected by ifdef that
will likely only get set on Linux.  Uses lower-case to designate
blanks.  For that and maybe string size assumptions is very broken for
non-ascii languages, including Spanish.
2011-04-13 06:45:22 -07:00
Andy2
3b7b4802a9 add ability to specify, track and use separate dictionaries for each
player.  Works for gtk client.  Compiles for Android but there's no UI
yet to specify more than one dict.  Management of dupicate dicts
without duplicating memory -- refcounting -- will be up to the
platforms.
2011-04-01 19:57:10 -07:00
Andy2
92940e6638 add model_getNPlayers() 2010-11-19 18:22:39 -08:00
Andy2
40323b03d2 board_canFlip -> board_visTileCount 2010-07-08 06:38:51 -07:00
Andy2
5f92491ca3 add and implement board_canTogglePending 2010-07-03 11:38:37 -07:00
Andy2
f77cf0e23d add board_redoReplacedTiles and model_redoPendingTiles. The latter
works as long as no blanks are involved.  And new state isn't being
saved so will be lost unless format changed.
2010-07-02 18:52:55 -07:00
Andy2
491cfe7616 add board_canShuffle and implement 2010-07-01 18:55:49 -07:00
Andy2
43c34aa466 add board_canFlip and model_canFlip -- which seem to work though
there's no test that when a single tile is on the board it's not in
the middle.  Sue me.
2010-06-30 20:25:34 -07:00
Andy2
e0dd3701a0 Add model_sortTiles(); use it; fix some comments and const decls.
Sorting always happens now when tiles added; needs to be based on a
preference.
2010-06-17 06:43:16 -07:00
eehouse
ef15f50edf add model_getNMoves 2010-03-13 23:09:53 +00:00
ehouse
76c0a518f1 change -j to -j3. No code change. 2009-04-14 03:27:32 +00:00
ehouse
669e423ca8 Use new dict API to get rid of XP_UCHAR4 type, replacing with const XP_UCHAR*. 2009-04-07 04:23:56 +00:00
ehouse
641ae18864 Use new dict api to support utf8 faces. 2009-04-05 19:20:22 +00:00
ehouse
8d1289d3b7 Create type to hold array rather than passing array whose lenght is assumed. 2009-02-23 04:01:15 +00:00
ehouse
46f72de960 new files into svn:ignore 2009-02-01 16:03:31 +00:00
ehouse
36627fb051 Add listeners to model so board can be notified whenever dictionary
changes.  Pass dict into draw via new API, removing it from the
draw_begin calls.
2008-09-05 12:11:37 +00:00
ehouse
2905af749e Fix crasher: don't start a board-scroll operation and attempt to end
by dropping a tile.  (This part is to detect that no drag actuall happened.)
2008-06-07 23:07:31 +00:00
ehouse
f749fdd560 Remove all tabs. No code changes. 2008-05-31 03:26:16 +00:00
ehouse
ebad668227 add some consts. 2008-05-06 12:49:37 +00:00
ehouse
0b1f4b8f0a merge with drag_n_drop branch: apply patch generated with this command on that branch: svn diff -r 2080:2087 2008-03-08 23:16:21 +00:00
ehouse
4daabf6fe5 Set -Wunused-parameter for those versions of gcc that support it, and
deal with the output by removing params where possible and elsewhere
by adding XP_UNUSED macro wrapping __attribute__((unused)).  There
should be NO change in function in spite of the large number of files.
2006-08-16 13:44:44 +00:00
ehouse
c41b211735 increase possible number of unique tiles from 32 to 64 in order to
support Slovak which has 40.  This change is preliminary: it seems to
work for both existing and dicts with >32 chars, but it breaks backwards
compatibility: existing saved games will crash this code.  I think the
fix is to deduce the number of bits per tile from the number in the
dictionary being used, but that's not in yet.
2006-08-09 04:56:34 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
26cd5c2d88 add model_recentPassCountOk 2005-03-15 03:31:52 +00:00