diff options
author | Matthew Stewart | 2018-07-27 01:59:01 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | f412328181baaac3ec6726de3bd9b914731cc551 (patch) | |
tree | 654036cd532542e22a2ce2be7741d73a411bab9d /engines/startrek/font.cpp | |
parent | b2213cac9b2766b62e29368394837fbe261233d3 (diff) | |
download | scummvm-rg350-f412328181baaac3ec6726de3bd9b914731cc551.tar.gz scummvm-rg350-f412328181baaac3ec6726de3bd9b914731cc551.tar.bz2 scummvm-rg350-f412328181baaac3ec6726de3bd9b914731cc551.zip |
STARTREK: Implement text input boxes
Needed for SINS mission with the keypads
Diffstat (limited to 'engines/startrek/font.cpp')
-rw-r--r-- | engines/startrek/font.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/engines/startrek/font.cpp b/engines/startrek/font.cpp index 7cba71196e..6cd3f1b416 100644 --- a/engines/startrek/font.cpp +++ b/engines/startrek/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/font.cpp $ - * $Id: font.cpp 2 2009-09-12 20:13:40Z clone2727 $ - * */ #include "startrek/font.h" @@ -47,4 +44,38 @@ byte *Font::getCharData(int i) { return _characters[i].data; } +bool Font::isDisplayableCharacter(char c) { + // True if lowercase, uppercase, a digit, punctuation, or space + return _fontProperties[c & 0xff] & 0x57; +} + + +// Bit 0 set for lowercase characters; +// Bit 1 set for uppercase characters; +// Bit 2 set for digits; +// Bit 3 set for certain control characters (nl, tab, cr?); +// Bit 4 set for punctuation, also &, @, etc; +// Bit 5 set for "undrawable" characters (?); +// Bit 6 set for space only (?); +// Bit 7 set for hexadecimal characters. +// NOTE: May need to update this for French, German languages? +const byte Font::_fontProperties[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, 0x28, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x48, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10, 0x10, 0x10, 0x10, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + } |