Commit graph

136 commits

Author SHA1 Message Date
ehouse
377fc3c87a Fix to compile and work with recent API changes. Still need to have
font caching in draw code work with the cellHt passed into
draw_boardBegin rather than each cell's height since the latter can
change now.
2010-04-24 03:56:50 +00:00
ehouse
59aa9f6e15 instead of measuring glyphs one at a time, put hdc in TRANSPARENT mode
and draw them all, then measure the stack.  Candidate for merge to
main for wince release.
2010-01-25 00:12:09 +00:00
ehouse
b084c5e5b2 reduce logging 2009-12-21 06:21:37 +00:00
ehouse
c8aa9d7f72 fix non-dbg build compile errors and warnings 2009-12-03 03:05:35 +00:00
ehouse
3cdf4aa0bf Fix to compile when RELAY feature disabled 2009-11-22 17:56:54 +00:00
ehouse
98ad2c3147 draw pending score smaller when has more digits; move rem up one pixel same as score. 2009-11-19 02:29:39 +00:00
ehouse
370d04f318 Add notion of minimum length to font match and calc longest score
string in the scoreboard at beginning of draw.  Fixes problem where
scores > 99 didn't fit vertical scoreboard.
2009-11-18 13:51:32 +00:00
ehouse
e9287fcbbf reorder some formal params; provide width so score font isn't
recalculated each time.
2009-11-17 05:32:21 +00:00
ehouse
17f27f3764 revert r2797; endian issues are screwing up mask calculation 2009-11-15 21:05:44 +00:00
ehouse
784906fde0 set biPlanes and color table entry 0. Now works, though not well yet,
on both PPC and Win32.
2009-11-15 20:44:50 +00:00
ehouse
caf4165eba Process bitmap buffers 16- rather than 8-bits at a time. 2009-11-15 18:25:09 +00:00
ehouse
b38891269e Use scoreboard font for Remaining tiles display. Rewrite
glyph-measurement code to use device-independent monochrome bitmaps
and to look at the buffer rather than call GetPixel over and over.
Not tested yet on WinMo (beyond confirming that it compiles/links) but
it seems much faster on desktop.
2009-11-15 18:19:07 +00:00
ehouse
34032a9d0a set rem text color, which otherwise varies. 2009-10-25 14:57:42 +00:00
ehouse
5602827ebf Print remaining tiles in scoreboard smaller and using tile background
color in attempt to make it clearer what the number means.  The goal
is to remove clutter and make more room for player name.
2009-10-24 14:53:17 +00:00
ehouse
899c67f3fe ce code no longer needs to ask if dict is utf-8, as internally all
are.
2009-10-23 09:02:02 +00:00
ehouse
ab853ffb3b All dict strings are utf8, so don't ever convert using CP_ACP. Fixes
misdisplay of Spanish Ñ in tray and on board.
2009-10-23 08:56:43 +00:00
ehouse
8ec7b01595 fix catalan trade miniwindow by making buffer large enough to convert
text without errors.
2009-10-23 07:53:31 +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
e539b49948 include name of player whose turn it is in scoreboard entry, reducing
length until it fits.
2009-10-15 12:42:07 +00:00
ehouse
91ccf3bac5 Replace four bitmaps with one drawn on top of background of green and
red based on connection progress.  Store the bitmap as a pgm, and
generate the .bmp from it at build time.
2009-09-24 04:26:28 +00:00
ehouse
98e175965d Replace letters as indicators of network status with icons. So far
just rects that change from red to green as we connect -- which could
be done in less space by painting.
2009-09-22 03:49:26 +00:00
ehouse
7d48ad714f fix some warnings when building without debugging 2009-09-20 20:49:37 +00:00
ehouse
4ce9a87be5 Use new relay status callback, and similar callback added to socket
read/writer, to provide connection status beside scoreboard (in area
outside that managed by code in common/).  Simple letters now, it'll
be icons eventually.
2009-09-15 13:04:34 +00:00
ehouse
2f0ec7e583 fix some string display bugs by using utf8 when converting; handle
Resend Messages menuitem (with error when standalone); add string for
that new error.
2009-09-11 07:44:27 +00:00
ehouse
c5ade1431a Move a few more strings into resources. 2009-04-19 17:34:14 +00:00
ehouse
2727cacae0 Start factoring out strings for localization: move most to resource,
add new file that loads resources (working around LoadString not
working as docs say it should).  Add all-caps version for testing and
not-yet-working cmdline change to use it.
2009-04-09 13:48:38 +00:00
ehouse
f3b53e4aaf When dict is utf8, convert to wchar_t assuming CP_UTF8 rather than CP_ACP. 2009-04-05 20:18:46 +00:00
ehouse
44a3888d6d Add enum to debug-only logging. 2009-02-14 16:24:06 +00:00
ehouse
0d08147472 Turn off SMS by default (pending confirming a way to use the apis in unsigned app); add commented-out NO_DRAW option. 2009-01-31 18:02:02 +00:00
ehouse
52a4a92e14 If smallest bitmap is too big, use it anyway at full size. 2009-01-18 19:52:46 +00:00
ehouse
50a6f93b99 Pick largest possible bitmap; fix inconsistency between cedict's idea
of bitmap format and cedraw's: rows are padded to 8-bit boundary, not
necessarily 16-bit.
2009-01-18 18:29:27 +00:00
ehouse
e1bc780beb In tray, when values are hidden draw letters instead of bitmap if
they'll fit.
2009-01-17 20:30:49 +00:00
ehouse
e6132b3dde Scale bitmaps for specials to the size of an M so they look right next
to other letters.
2009-01-17 18:49:35 +00:00
ehouse
2e488374f1 bug fix: fix reversed width and height params to StretchBlt 2009-01-17 15:45:24 +00:00
ehouse
08ceeb85b7 Fix size test for bitmap caching 2009-01-14 13:27:56 +00:00
ehouse
aee316372e Use new api. Use small for cell and large for tile still, but now
create and cache an actual HBITMAP, and prefer it to letters.  This is
needed for Catalan where "L-L" will never fit.  Still to be done:
prefer letters to bitmap where they'll actually fit (devices where
tiles drawn wider), and position better in tray.  May also want to
allow scaling.
2009-01-13 13:11:05 +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
bc01341f95 When values are hidden, draw letters as large as possible in the tile. 2008-12-13 07:34:16 +00:00
ehouse
59cd2a83d1 Make tray tiles one pixel taller, extending all the way to bottom of
screen.
2008-12-12 13:40:41 +00:00
ehouse
6da758b5fa set text color before drawing star bitmap to make color consistent;
add utility function for setting colors to reduce code size.
2008-12-06 16:22:43 +00:00
ehouse
a9fbd3c027 Ignore bitmap for tiles, using string instead. 2008-12-04 06:16:37 +00:00
ehouse
088ab1451e Use minimum height for tile value; draw bitmaps (clipped) even if too large. 2008-12-03 13:42:30 +00:00
ehouse
de6f6dcdef draw bitmaps larger when will fit; draw hint region border thicker and
in player color; rename constants.
2008-12-02 13:47:18 +00:00
ehouse
44ae99a075 remove redundant set of #defines for whether we're compiling for desktop or wince 2008-11-22 16:43:55 +00:00
ehouse
e2cd0b5807 Speed up font calculation by interleaving width and height
constraints; simplify pending score display by using %dp rather than
trying to fit two strings in the many possible sizes of tiles.
2008-11-08 16:25:49 +00:00
ehouse
3958950ad1 When finding font to fit height, optionally force it to fit width as
well.  Mechanism used for Rem only so far, but will work for score too
as long as we don't need it to shrink font as score gets longer.
Current impl worries about height first, then width; would be better
to look at both simultaneously to reach the goal more quickly.
2008-11-02 23:17:38 +00:00
ehouse
e6399c74c1 Fix bug making glyphs from random garbage; when narrowing in on
correct font size, compute based on ratio from what we have rather
than just reducing by one each pass.
2008-11-02 04:17:42 +00:00
ehouse
9e9d8a9d79 show non-dived focus as tray with background and perimeter tiles with
background rather than opaque border.  Looks better on a range of
screen sizes.
2008-10-31 04:33:20 +00:00
ehouse
cbdf8edcf5 Use SHGetSpecialFolderPath to locate dicts in /Document Files/Crosswords; reserve 1-pixel space around Rem: text 2008-10-29 08:46:02 +00:00
ehouse
3b5337d7d2 wince support for Rem: focus and showing remaining tiles 2008-10-24 09:05:13 +00:00