Commit graph

357 commits

Author SHA1 Message Date
ehouse
a0919dcc54 Fix bug: scoreboard doesn't reflect connected state until some other
event causes update.  Fix by calling turnChangeListener any time turn
changes, including on initial set.
2007-02-27 02:48:51 +00:00
ehouse
c0b515457b Cleanup: compile warning and to make logging easier. 2007-02-08 15:17:23 +00:00
ehouse
a424d54445 Add a one-byte header to BT messages so one device can signal another
that a new game's begun without dropping the connection.  On Palm,
remove connection-drop on new game.  With this change starting a new
game takes imperciptible time, down from 30 seconds.
2007-02-08 02:53:10 +00:00
ehouse
ff82dd61c0 Fix linked-list bug in removeFromQueue. 2007-02-07 11:58:01 +00:00
ehouse
3028c9e598 deal with case where guest begins new game but connects to host that's
running the old game: the host may reply, but guest must not take that
as evidence of a connection having been established: don't remove sent
messages (this isn't an ACK), and don't assert later on.
2007-02-06 05:49:45 +00:00
ehouse
183f0f716f enable juggle button after role change 2007-02-06 05:47:20 +00:00
ehouse
9a61f5c38b Add assert; don't call comms if has been set to null (fixes device
reset); fix failure to install connCB (removes need to manually resend
messages when client starts up first.)
2007-02-04 17:13:01 +00:00
ehouse
7c8b7294cd add const to a bunch of char* decls in APIs and variables; no code change 2007-02-03 17:54:20 +00:00
ehouse
3f111c5657 name change only: Connectedness becomes DeviceRole 2007-02-02 08:34:37 +00:00
ehouse
ad77b04766 When role changes from client, where only local players are shown, to
host or standalone where all are shown, change the number shown
appropriately.  The goal is to make the experience natural,
particularly for the common case where the players aren't changing.
Give up once user manually changes number shown.
2007-02-02 08:15:07 +00:00
ehouse
f441b22e78 cleanup: only one return per function. 2007-02-02 08:11:14 +00:00
ehouse
f56b170b2a cleanup. No change in generated code. 2007-01-27 15:07:02 +00:00
ehouse
1486c764fb use varargs for LOG_RETURNF macro 2007-01-27 15:04:57 +00:00
ehouse
1890fcac6b forward declaration stops compiler warning 2007-01-27 15:04:19 +00:00
ehouse
ebeefe457f check and flip before hiliting cells. Fixes bug with feedback on hint
search on flipped board.
2007-01-23 04:09:26 +00:00
ehouse
a998e96de9 Tweak scroll-of-focussed-board inval code so we don't inval the whole
board, which looks crappy.  Instead inval only what was previously a
border row, and pass a new param to draw_vertScrollBoard so the
platform can choose not to scroll cells that will just get overwritten
with different bits.
2007-01-21 22:59:29 +00:00
ehouse
15acf8c8bb When scrolling a focussed board, inval everything. Otherwise border
cells scroll into the center drawn as border.
2007-01-21 18:05:25 +00:00
ehouse
6ed6fe4976 Change how flip works, keeping board data like invalFlags and limits
in sync with the board rather than the model and flipping coordinates
only in time to access the model or pass to engine.  With that done,
drawing can skip any rows scrolled off-screen, and the board's
perimeter focus rect can be drawn and invalidated correctly on a
flipped, scrolled screen: zodiac, eventually.
2007-01-21 06:21:12 +00:00
ehouse
0a426b0876 Get rid of draw_eraseMiniWindow: just inval what's under it; make use
of CELL_ISCURSOR consistent: when focus not dived all elements have it
set (or only perimeter for board, settable at compile time); get rid
of draw_drawCursor since CELL_ISCURSOR is all that's needed;
2007-01-19 08:20:11 +00:00
ehouse
c01615e86b reintroduce board_handleKey 2007-01-18 02:42:37 +00:00
ehouse
c02c3fec17 Set focusHasDived before invalidating so newly focussed object drawn correctly. 2007-01-16 02:42:58 +00:00
ehouse
1afe502436 Fix bugs in recent focus/key changes. 2007-01-12 03:37:30 +00:00
ehouse
f329966a8a on keyDown, look at what keyUp will do and, if nothing, don't handle
the event.  This lets focus transfer work as before there was keyDown.
2007-01-12 03:28:20 +00:00
ehouse
e6ba8c872c fix crash when linux is bt server: if no addr provided it's not a duplicate. 2007-01-09 02:43:09 +00:00
ehouse
994ee5b254 remove dead code. 2007-01-09 02:38:22 +00:00
ehouse
fef8891e3c fix problems created by key-nav changes: don't drop hardware scroll
keys, and redraw after key-repeat if either up or down handled.
2007-01-07 05:25:28 +00:00
ehouse
e0010901f1 add board_handleKeyRepeat, and call it from palm and gtk. This lets a
held nav key walk the cursor across the board.
2007-01-07 04:32:29 +00:00
ehouse
593980817f Clean up for non-keyboard and non-keyboard-nav cases. Wince is the
latter: make it compile again.
2007-01-07 01:01:20 +00:00
ehouse
0303e56c43 Break key handling into keyUp and keyDown, and treat keyDown the same
as penDown.  Idea is to be able to set timers to get bonus square
hints etc. without stylus.  Works, but transitions are rough because
keyDown doesn't know whether keyUp will result in a focus change.
2007-01-06 17:32:08 +00:00
ehouse
02c225c413 Fix so IR-only multi-device build works again. 2007-01-06 16:46:45 +00:00
ehouse
5b34e786bc bug fix: clear focusHasDived on pen event along with other focus state 2006-12-20 04:11:17 +00:00
ehouse
bb45f89a6f Unfocus any board object whenever pen touches board 2006-11-27 01:13:48 +00:00
ehouse
afc302a29b When alt key pressed cursor can move onto occupied squares it normally skips. 2006-11-22 13:49:14 +00:00
ehouse
06e6d4a903 Post-Slovak change, 7 bits required to save face and blank bit. Use 7, but expect the old 6 for previous version streams. 2006-11-19 06:40:56 +00:00
ehouse
7fe5718cc5 When "dived" focus reaches and crosses border of object, return as if
not handled.  This causes the platform to handle the key event itself,
typically by moving the focus to the next top-level object.
2006-11-17 13:41:13 +00:00
ehouse
abca6a4092 Two big changes. Pass focus bit into all or and players when focus
not dived and tray or scoreboard focussed.  This lets platform decide
to display top-level focus via mods to all elements.  Second, when
moving focus to top level from dived, claim not to have handled the
key event (but return true if needs redraw).  This allows platform to
handle shifting focus without requiring callback (which removed.)
2006-11-14 06:46:04 +00:00
ehouse
30897a709f Debug-build macros to pass __LINE__ and __FILE__ for logging 2006-11-14 06:40:36 +00:00
ehouse
29c4cb7c10 Exit trade mode silently if user clicks 'D' when it's not his turn.
(Better than refusing because "not your turn".)
2006-11-13 02:01:54 +00:00
ehouse
bfd555c22f bug: need to OR in inval value rather than replace. 2006-11-12 21:03:15 +00:00
ehouse
8125f8405b Break scoreboard code out into a new module. board.o was getting too
big on palm.
2006-11-12 20:09:00 +00:00
ehouse
a37fab39e8 new UNUSED macro for keynav 2006-11-12 15:20:36 +00:00
ehouse
d3812271a2 Add to draw APIs of individual elements (e.g. board cells) whether
they're focussed so that they can draw that during rather than after
everything else.  On palm, use this to draw focus using the system
selected color rather than with the blue nav rect.  Since a new param
was too much, add new enum type CellFlags and pass as bitvector to
draw APIs.
2006-11-12 14:36:15 +00:00
ehouse
130c0f5a92 Refactor to not return from middle of function. No behavior change. 2006-11-11 22:38:20 +00:00
ehouse
e2f3a55611 reject initial messages coming in on the same address a second time.
Fixes problem that surfaces when clients are more agressive about
resending early in game.
2006-11-11 22:37:36 +00:00
ehouse
1838640823 Fix bug where sign extention on 16-bit processors caused too many bits
set in crosschecks.
2006-11-10 08:08:59 +00:00
ehouse
b171900dfb When moving focus through tray, skip empty space; when through board,
skip cells with tiles permanently played.  Space char raises focus but does
not move it laterally.
2006-11-09 06:05:40 +00:00
ehouse
1f5ec02172 If no arrow visible, use cursor loc as destination when moving tile to tray. 2006-11-08 13:44:34 +00:00
ehouse
414580904f board doesn't handle focus-related keys unless it has the focus. 2006-11-08 05:04:44 +00:00
ehouse
2e9afb1ff2 remove typo blocking compilation 2006-11-07 13:43:30 +00:00
ehouse
2aa9664884 When internal focus reaches edge of object, move it back up and onto
the next object using a callback to the platform to determine what, if
any, object is next.  Adjust curses platform to cooperate.  Works
well.  Palm is next.
2006-11-07 05:46:44 +00:00