Commit graph

69 commits

Author SHA1 Message Date
ehouse
28265749f9 fix unused var warning in release build 2009-12-17 13:09:10 +00:00
ehouse
35f068e05c Implement new callback giving progress connecting with relay. 2009-12-14 04:06:26 +00:00
ehouse
c893fd4a9e On receipt of connection-denied message via new rerror callback, put
up new error messages and then conns dialog so user can connect again
after changing room name or just waiting.  A new game is started so
that comms is re-inited and will try again to connect to relay.
2009-12-04 08:18:49 +00:00
ehouse
a13e1d6488 add util_clearTimer, implement on all platforms, and call when closing
comms to fix crash on Wince when timer fired after comms had been
deleted.  The closure stored and passed in was no longer a valid ptr.
2009-09-21 12:49:08 +00:00
ehouse
18e9301e87 rename Cookie to Invite, a change that may change. Rename everywhere
in clients but not in relay where cookie is too pervasive.  (There are
no code changes in this checkin.)
2009-09-14 03:11:11 +00:00
ehouse
6c4b991566 Modify comms and games APIs so single struct of callbacks is passed
instead of multiple callbacks; add callback called when relay state
changes; adapt linux and palm clients to new API.  (Wince changes
pending.)
2009-09-12 21:39:13 +00:00
ehouse
6827ab5d88 Unify signal handlers that do same thing; clean memory leaks and a
double-dispose.
2009-08-30 15:23:05 +00:00
ehouse
537de614b9 remove timer assert; log socket errors 2009-08-21 12:15:40 +00:00
ehouse
fbd3559e3b Fix assertion failures 2009-07-31 13:03:05 +00:00
ehouse
192fb50bf8 add SIGINT handler that calls quit (to save files). Listen for errors in poll. 2009-07-29 04:29:29 +00:00
ehouse
4c523b628c Make slow-robot work for curses client too. 2009-07-10 05:04:04 +00:00
ehouse
a954286960 avoid mempool assertions by cleaning up on way out 2009-06-30 12:55:47 +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
c672fcfafd Make it possible to run same binary against relay with relay heartbeat
and direct with comms heartbeat.  This mostly means changing ifdefs.
2009-02-01 15:50:58 +00:00
ehouse
09c879dccc Add sms support, largely untested. 2009-01-13 13:33:56 +00:00
ehouse
863f79bfb9 Fix compile errors using latest gcc (fread etc must have return value checked) 2009-01-03 18:12:34 +00:00
ehouse
cefd69d8b3 Since there's now a flag indicating whether to show the value of a
tile, make value unsigned.  Adjust/fix platforms.  Add cmdline flag to
linux apps for hiding values.
2008-12-29 03:09:35 +00:00
ehouse
e30c72c829 make -q option take number of seconds to pause before quitting 2008-10-26 15:33:21 +00:00
ehouse
9b17c20117 gtk/ncurses support for Rem: focus and showing remaining tiles. Also
rewrite gtkask to use gtk_message_dialog and add sigint handler.
2008-10-24 09:07:30 +00:00
ehouse
f021964213 fix ncurses version so it can save games and read them back in: make existing gtk code run on both. 2008-09-18 03:46:27 +00:00
ehouse
ad52e63ff0 separate UI-specific code so that a non-UI linux library can be compiled, e.g. for use with a toolkit not gtk or ncurses 2008-06-30 03:39:27 +00:00
ehouse
c6da605b56 add missing error message 2008-05-24 16:08:13 +00:00
ehouse
c3555440fd get rid of const-related warnings 2008-02-16 15:49:03 +00:00
ehouse
ea7949dd22 Make a couple of dialogs format for narrower screen and respect keypad buttons. 2008-02-02 20:58:44 +00:00
ehouse
2910bab3a0 fix perimeter focus clearing and board size setting. 2008-02-02 17:21:57 +00:00
ehouse
b98b7fd993 Move toward running curses on a small screen: replace omnipresent menu
with one drawn on demand; change size and location of scoreboard and
tray if needed; use wgetch rather than reading stdin to support keypad
keys for navigation.  Also stick g_ in front of some frequently used
global names.
2008-02-02 16:56:20 +00:00
ehouse
6e9e5b5c99 Fix to compile and run standalone 2008-01-19 16:03:53 +00:00
ehouse
b115cc6f0c fix unused param warning 2008-01-02 01:43:45 +00:00
ehouse
d5d29adc0c Change util function to use signed type; other cleanup to compile with various features. 2007-12-05 06:28:51 +00:00
ehouse
5457ea1b59 replace all __FUNCTION__ with __func__ 2007-12-02 19:13:25 +00:00
ehouse
a560c9f8a8 Add files forgotten with last checkin; add additional parameter to
addListener so listeners can be removed on reset.
2007-11-28 03:59:26 +00:00
ehouse
e1d5632a7b Re-add direct-via-ip transport, and implement for linux in order to
better test heartbeats.  Fix so can play against Palm over BT.
Assertions failing on Linux when reset, but it's otherwise done.
2007-11-26 02:58:25 +00:00
ehouse
4c8cf98d24 Add and set a compile-time option so comms will set a periodic timer
and use it to send and check for heartbeats over any transport.
Caller must supply a reset proc which is called when heartbeat hasn't
been received in too long.  No changes required to comms protocol, but
that means the heartbeat interval is fixed at compile time: can't be
negotiated, and the two ends had better agree.  Currently tested with
linux host and PalmOS guest, where only the first heartbeat failure is
recovered from.  So there's some debugging to be done still.
2007-11-18 23:43:27 +00:00
ehouse
edfdda6fd2 Fix so compiles curses-only, and so curses cell can be 2x1 (for square board) 2007-06-01 02:08:04 +00:00
ehouse
dd7a5c8104 type name change only 2007-05-26 14:14:01 +00:00
ehouse
20ecd5f7d7 get rid of draw methods; always highlight cursor same way;
board_handleKeyUp becomse board_handleKey for curses
2007-01-19 08:20:58 +00:00
ehouse
098a2ec5c4 Use new keydown/up APIs from linux, and add key support and drawing
changes to implement keyboard navigation/focus in gtk port.
2007-01-06 17:46:02 +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
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
cac0fd94d7 Use new top-level focus drawing model, and new API indicating whether
key handled.
2006-11-14 06:47:50 +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
e8b74e1cc3 set focus to board if not held prior to passing keys 2006-11-08 05:05:11 +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
ehouse
44eaa36319 More progress on one-handed navigation: fix ncurses board clipped to
bottom of tray; add focus-related params to draw*Finished routines
(and simplify to one) so platforms don't have to save from Begin
routines (and stop palm doing that); check version of saved game, and
handle case where older binary tries to open newer version; redraw
Palm tray buttons after focus change to stop focus-rect ghosting; fix
annoying overlap in saved games dialog; palm version goes to a3.
2006-11-05 16:54:18 +00:00
ehouse
3153e2b867 Lots of progress on one-handed navigation: add gadgets to stand in for board
scoreboard and tray on palm; make center drill into the focussed object and
spacebar come back up then move the focus among them.  Integrate with other
focussable objects on main form.  Go from separate drawCursor routines to
same for all three, with cursor only visible when focus is drilled down.
On curses, add a hilite rect routine that can be called after text is laid
down, and use for cursors.
2006-11-03 06:23:54 +00:00
ehouse
5f25ba9f57 remove BEYOND_IR, replacing with XWFEATURE_RELAY and
XWFEATURE_BLUETOOTH.  The goal is to be able to build to support
bluetooth only, or relay/ip only, e.g. for a palm bluetooth beta.
Seems to work.
2006-10-10 01:34:37 +00:00
ehouse
9137eff9fa Largely untested changes to allow BT in ncurses mode, centered around
integrating sockets into poll fdset; move relay and bt globals out of
a union so can test if in use without knowing current connection method.
2006-09-19 03:39:08 +00:00
ehouse
fb87fd31d2 Start adding bt support to linux port. Required removing assumptions
that all connectivity was with relay and over streaming sockets (since
BT is using l2cap's datagram-style sockets.)  With this checkin, a full
robot-vs-robot game is possible with palm as host and linux as client.
Linux as host isn't started yet.
2006-08-26 21:15:20 +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
19414ae505 Finish scrollbar work by passing number of visible rows to
util_trayHiddenChange, which means an API change.  In board, calculate
bottom of board based on bottom of tray when tray is hidden, and round
so that it's an exact multiple of cell height.  In wince, take
advantage of the new parameter to fix the scrollbar so that very
constrained boards can be scrolled even when the tray is hidden.
2006-05-19 13:44:05 +00:00