Commit graph

95 commits

Author SHA1 Message Date
Eric House
4504302b3b make "release" builds compile again
Release isn't really a thing on linux, but I'm fixing something that
only reproduces when DEBUG is undefined.
2018-02-18 11:30:54 -08:00
Eric House
220918e5cd fix to compile with gdk3.2 (latest Debian) 2017-11-01 05:16:32 -07:00
Eric House
618ee89add fix crash drawing game timer
It's outside the normal begin_/end_draw flow and so cairo wasn't set up
as expected.
2017-09-20 07:26:26 -07:00
Eric House
7f513313b0 fix crash loading new game before snapshot exists 2016-08-05 10:37:42 -07:00
Eric House
0c6283ea63 add board_drawSnapshot
Toward something that should work with android: pass a potentially
unique draw context into new method that creates a new board just for
the draw and makes its scoreboard and tray disappear.
2016-08-05 10:23:39 -07:00
Eric House
3c0a128266 produce, store and display actual snapshot
Done in a way that won't work for Android just to try out the gtk
way. Tweaks and reuses the existing draw context and board, which is
precisely what the android version can't easily do.
2016-08-05 09:42:55 -07:00
Eric House
b4393d5965 fix cursor-hiliting of player in scoreboard 2016-08-04 16:13:54 -07:00
Eric House
df6c1e0d3a make beginDraw return a boolean so can abort
When a gtk3 window's shutting down it appears we can't get a cairo_t*
for it. This change makes it possible to turn that fact into aborting
the whole draw operation.
2016-08-04 15:12:05 -07:00
Eric House
66e26c1489 hook up draw signal
Whenver we get the draw signal, invalidate the whole board and draw
it. This is resulting in a lot of wasted effort that might be mitigated
if I figured out how to get the invalid region out of the cairo_t*
that's passed in, but this is a test app and my machine's pleny fast. So
go with it for now.
2016-08-04 11:41:43 -07:00
Eric House
1892d24317 get all layouts from the same place 2016-08-03 17:56:38 -07:00
Eric House
9521b71be9 fix remtext rendering 2016-08-03 17:35:44 -07:00
Eric House
670f0034af fix a bunch of color setting 2016-08-03 16:54:45 -07:00
Eric House
eb6fb508bf fix crash dragging tiles
Add new begin() and end() methods around all drawing and get/destroy
cairo context there.
2016-08-03 15:50:17 -07:00
Eric House
b57e50a255 snapshot toward building with gtk3
Board renders, but only when touched. Tray and scoreboard skipped for
now. Lots of changed still to go, and some asserts added where I didn't
want to stop to solve a compile problem.
2016-08-03 15:19:12 -07:00
Eric House
799e89fdc1 gtk: use accessors instead of peeking at structs 2016-08-03 08:09:47 -07:00
Eric House
2ff7582688 enforce and follow new gtk header rules 2016-08-03 06:15:49 -07:00
Eric House
12932bf788 fix crash on 64-bit system 2013-12-30 06:46:57 -08:00
Eric House
a26dced506 drawing tray tiles can fail, e.g. when font info not yet available, so
only clear bits when successful. Fixes problem where tray didn't get
drawn until tiles were somehow invalidated.
2013-11-07 07:29:54 -08:00
Eric House
f0b554213b assert rect isn't too small to inset 2013-11-04 05:59:18 -08:00
Eric House
88b380503e add function, not compiled by default, to return bounding rect of all
non-empty tiles. As a test, add menu that uses it to grey out that
region.
2013-10-27 21:51:30 -07:00
Eric House
d50c808f96 Merge branch 'android_branch' into gtk_multigame
Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java
	xwords4/common/comms.c
	xwords4/linux/cursesmain.c
	xwords4/linux/cursesmain.h
	xwords4/linux/gtkmain.c
	xwords4/linux/gtkmain.h
	xwords4/linux/linuxmain.c
	xwords4/linux/main.h
	xwords4/linux/scripts/discon_ok2.sh
	xwords4/relay/xwrelay.cpp

(Note: The curses app crashes on exit with mempool assertions, but that's a problem before the merge.)
2013-07-09 07:18:00 -07:00
Eric House
d41c1a4ca8 add new param so pending text can be drawn differently when it's not
the player's turn.
2013-05-30 07:17:13 -07:00
Eric House
a6784464ff first set of networking changes testing per-device communication with
relay on behalf of a number of games.  Works as long as all the games
are open.
2013-01-16 06:46:33 -08:00
Eric House
a107365c88 change names of two types and variables of that type to make a common
pattern more sensible.  No code changes.
2013-01-15 19:04:20 -08:00
Eric House
4af30c534c snapshot. New game button works and game gets saved in DB. Next: display and open from DB. 2013-01-05 16:08:19 -08:00
Eric House
63487dc5d0 assert gdk setup going ok 2013-01-03 08:18:35 -08:00
Eric House
968340f665 Fix release-build warnings that new compiler flags. 2012-10-07 11:43:50 -07:00
Eric House
6ddd4a61c1 fix compile errors (mostly unused variables) found by gcc on latest
Ubuntu (12.04).
2012-09-25 07:28:02 -07:00
Eric House
9b0436d1ee Make rem string measure function return boolean to indicate rect will
be invisible rather than setting width and height to 0.  No real
change beyond simplifying/speeding platform code.
2012-07-15 09:30:27 -07:00
Eric House
f1c5ebeb31 don't hide REM tiles square when drops to 0 2012-07-09 21:43:35 -07:00
Eric House
2fc2a60842 create alternate scoreboard draw flow, disabled by compile-time flag,
that does layout and draw in a single pass and with more information
so platform has more responsibilty for dealing with space constraints
and can, I hope, do a better job.  There's no change until the flag is
turned on.  Works for GTK with flag on, but is stubbed out for ncurses.
2012-06-26 07:20:09 -07:00
Eric House
405cb23023 fix bug where current player's scoreboard would disappear if other
players' names were too long by giving all a the same proportion of
what they request and passing in the percent given in case draw
implementation wants to use it as a cue to truncate.
2012-06-15 06:26:40 -07:00
Andy2
52d02f04dd pass tile value into drawCell(). Java code doesn't use it yet, but I
want to play with drawing cells tray-tile-style when they're big
enough.
2011-12-02 18:58:52 -08:00
Andy2
3ec97d5c07 Turn "Turn done" into "Pass" when the pending score is 0. To do that
I had to pass the score into draw_trayBegin since
draw_drawPendingScore() isn't called until the first tile's placed.
Note: as long as I'm messinng with this menuitem it should be disabled
when it's not the player's turn.
2011-10-04 18:48:33 -07:00
Eric House
c01981bc8f Make miniwindow stuff compile-time optional. The goal's to use native
features where they look better or are easier to manage, e.g. Toasts
and dialogs on Android.
2011-08-29 20:36:01 -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
f6be6222a1 draw timer in player color 2011-04-01 07:22:40 -07:00
Andy2
15f40f01af fix to compile with new gdk that's on ubuntu 10.10. Need to fix the
APIs eventually.....
2011-02-18 22:28:32 -08:00
Andy2
c9fec737e5 changes, protected by a disabled compile-time flag, to use cairo-based
API for drawing instead of now-deprecated gdk ones.  Unfortunately
nothing actually draws and I'm putting the debugging off until I have
some time.
2011-01-14 18:15:33 -08:00
Andy2
e7dbac41a6 fix to compile with new gdk that's on ubuntu 10.10. Need to fix the
APIs eventually.....
2011-01-12 19:00:20 -08:00
Andy2
2d69d8f2b0 use new crosshairs flags to draw a cross in the middle third of cells 2010-08-11 18:51:09 -07:00
eehouse
92e02c9c2e catch up with API changes 2010-05-28 02:31:04 +00:00
eehouse
1950e38bda remove bogus assert and logging 2010-04-08 04:15:08 +00:00
eehouse
a87ecf5638 pass vScale and hScale into draw_boardBegin so platform can use same
size font for all cells regardless of size; fix scrolling to pass
actual sum of the disappearing rows' heights.
2010-04-08 04:14:55 +00:00
eehouse
00e8742ad8 show blank as a ? rather than a _. 2010-03-08 06:10:46 +00:00
eehouse
47402bd3b5 remove unused field 2010-02-27 18:05:00 +00:00
ehouse
b8e7cd411f fix to use new API. (this and prev checkin via terminal app on phone :-) 2009-11-19 02:26:38 +00:00
ehouse
1fa8b2e48f remove unused param (not even compiled on Palm); on wince, try to
duplicate for timer the vertical offset used for scores.
2009-10-16 03:20:39 +00:00
ehouse
f80b1d74f2 include name of player whose turn it is in scoreboard entry, reducing
length until it fits.  (Still needs polishing...)
2009-10-15 12:44:53 +00:00
ehouse
1da25307e5 Display relay state on board, horizontal scoreboard mode only for now. 2009-09-20 18:45:25 +00:00