diff options
author | Travis Howell | 2003-10-21 06:35:19 +0000 |
---|---|---|
committer | Travis Howell | 2003-10-21 06:35:19 +0000 |
commit | ed0c30fcbf7f0fdd2633451c894ea7bd4980076c (patch) | |
tree | 0c8c0a7dd1f869b1ee1ededf633c447b2b22dfb7 | |
parent | 01c0bd5eb7d3776c939db78c9812897bb0b48957 (diff) | |
download | scummvm-rg350-ed0c30fcbf7f0fdd2633451c894ea7bd4980076c.tar.gz scummvm-rg350-ed0c30fcbf7f0fdd2633451c894ea7bd4980076c.tar.bz2 scummvm-rg350-ed0c30fcbf7f0fdd2633451c894ea7bd4980076c.zip |
Fix text spacing when backspace key is used when entering save game name in Hebrew version. Need to pass along last character printed, so correct spacing can be used.
svn-id: r10922
-rw-r--r-- | simon/charset.cpp | 8 | ||||
-rw-r--r-- | simon/items.cpp | 4 | ||||
-rw-r--r-- | simon/simon.cpp | 6 | ||||
-rw-r--r-- | simon/simon.h | 4 |
4 files changed, 12 insertions, 10 deletions
diff --git a/simon/charset.cpp b/simon/charset.cpp index bdebc8947b..81fb8d81d0 100644 --- a/simon/charset.cpp +++ b/simon/charset.cpp @@ -210,7 +210,7 @@ void SimonEngine::showmessage_helper_3(uint a, uint b) { _num_letters_to_print = 0; } -void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c) { +void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c, byte b) { byte width = 6; if (c == 0xC) { @@ -219,8 +219,8 @@ void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c) { video_putchar_newline(fcs); } else if ((c == 1 && _language != 20) || (c == 8)) { if (_language == 20) { //Hebrew - if (c >= 64 && c < 91) - width = _hebrew_char_widths [c-64]; + if (b >= 64 && b < 91) + width = _hebrew_char_widths [b - 64]; if (fcs->textLength != 0) { fcs->textLength--; @@ -252,7 +252,7 @@ void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c) { if (_language == 20) { //Hebrew if (c >= 64 && c < 91) - width = _hebrew_char_widths [c-64]; + width = _hebrew_char_widths [c - 64]; fcs->textColumnOffset -= width; if (fcs->textColumnOffset >= width) { fcs->textColumn++; diff --git a/simon/items.cpp b/simon/items.cpp index 3c2e647420..0a5457f5c4 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -1485,10 +1485,10 @@ void SimonEngine::o_unk_132_helper_3() { set_hitarea_bit_0x40(i); } -void SimonEngine::o_unk_132_helper_2(FillOrCopyStruct *fcs, int x) { +void SimonEngine::o_unk_132_helper_2(FillOrCopyStruct *fcs, int x, byte b) { byte old_text; - video_putchar(fcs, x); + video_putchar(fcs, x, b); old_text = fcs->text_color; fcs->text_color = fcs->fill_color; diff --git a/simon/simon.cpp b/simon/simon.cpp index b36dbaeb3c..9ec2a877fb 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -2749,7 +2749,7 @@ restart:; if (_language == 20) { //Hebrew byte width = 6; if (name[name_len] >= 64 && name[name_len] < 91) - width = _hebrew_char_widths [name[name_len]-64]; + width = _hebrew_char_widths [name[name_len] - 64]; fcs->textLength++; fcs->textColumnOffset -= width; if (fcs->textColumnOffset < width) { @@ -2806,8 +2806,10 @@ restart:; // do_backspace if (name_len != 0) { int x; + byte b; name_len--; + b = name[name_len]; if (_language == 20) //Hebrew x = 8; @@ -2816,7 +2818,7 @@ restart:; name[name_len] = 0; - o_unk_132_helper_2(_fcs_ptr_array_3[5], x); + o_unk_132_helper_2(_fcs_ptr_array_3[5], x, b); } } else if (i >= 32 && name_len != 17) { name[name_len++] = i; diff --git a/simon/simon.h b/simon/simon.h index 7dfc856c60..e6b1fe3fde 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -526,7 +526,7 @@ protected: HitArea *findHitAreaByID(uint hitarea_id); void showActionString(uint x, const byte *string); - void video_putchar(FillOrCopyStruct *fcs, byte c); + void video_putchar(FillOrCopyStruct *fcs, byte c, byte b = 0); void video_fill_or_copy_from_3_to_2(FillOrCopyStruct *fcs); void video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte d); @@ -788,7 +788,7 @@ protected: void save_or_load_dialog(bool load); void o_unk_132_helper_3(); int o_unk_132_helper(bool *b, char *buf); - void o_unk_132_helper_2(FillOrCopyStruct *fcs, int x); + void o_unk_132_helper_2(FillOrCopyStruct *fcs, int x, byte b = 0); void savegame_dialog(char *buf); int count_savegames(); |