From 466733e5fd75e0d705bf80dddb48468c4c9885a7 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 9 Oct 2014 16:33:49 +0200 Subject: [PATCH] eliminated ISO-8859-1 characters from source code files --- src/conftime.h | 2 +- src/editor.c | 32 ++++++++++++++++---------------- src/game_em/Makefile | 2 +- src/game_sp/init.c | 18 +++++++++--------- src/libgame/misc.c | 18 +++++++++--------- src/libgame/sdl.c | 2 +- src/libgame/text.h | 36 ++++++++++++++++++++++++++---------- src/main.c | 28 ++++++++++++++-------------- src/main.h | 2 +- src/screens.c | 4 ++-- src/tools.c | 2 +- 11 files changed, 81 insertions(+), 65 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index d765e447..6199c5b8 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-10-09 01:55" +#define COMPILE_DATE_STRING "2014-10-09 16:18" diff --git a/src/editor.c b/src/editor.c index 206d1c1d..271cd2b1 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3999,13 +3999,13 @@ static int editor_el_chars[] = EL_CHAR('^'), EL_CHAR('_'), - EL_CHAR('©'), - EL_CHAR('Ä'), - EL_CHAR('Ö'), - EL_CHAR('Ü'), + EL_CHAR(CHAR_BYTE_COPYRIGHT), + EL_CHAR(CHAR_BYTE_UMLAUT_A), + EL_CHAR(CHAR_BYTE_UMLAUT_O), + EL_CHAR(CHAR_BYTE_UMLAUT_U), - EL_CHAR('°'), - EL_CHAR('®'), + EL_CHAR(CHAR_BYTE_DEGREE), + EL_CHAR(CHAR_BYTE_REGISTERED), EL_CHAR(FONT_ASCII_CURSOR), EL_CHAR(FONT_ASCII_BUTTON), @@ -4109,13 +4109,13 @@ static int editor_el_steel_chars[] = EL_STEEL_CHAR('^'), EL_STEEL_CHAR('_'), - EL_STEEL_CHAR('©'), - EL_STEEL_CHAR('Ä'), - EL_STEEL_CHAR('Ö'), - EL_STEEL_CHAR('Ü'), + EL_STEEL_CHAR(CHAR_BYTE_COPYRIGHT), + EL_STEEL_CHAR(CHAR_BYTE_UMLAUT_A), + EL_STEEL_CHAR(CHAR_BYTE_UMLAUT_O), + EL_STEEL_CHAR(CHAR_BYTE_UMLAUT_U), - EL_STEEL_CHAR('°'), - EL_STEEL_CHAR('®'), + EL_STEEL_CHAR(CHAR_BYTE_DEGREE), + EL_STEEL_CHAR(CHAR_BYTE_REGISTERED), EL_STEEL_CHAR(FONT_ASCII_CURSOR), EL_STEEL_CHAR(FONT_ASCII_BUTTON), @@ -10074,7 +10074,7 @@ static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y, else if (element >= NUM_FILE_ELEMENTS) element_mapped = EL_UNKNOWN; - printf("%c%03d", (mode == CB_DUMP_BRUSH ? '`' : '¸'), element_mapped); + printf("%c%03d", (mode == CB_DUMP_BRUSH ? '`' : '¸'), element_mapped); } printf("\n"); @@ -10233,11 +10233,11 @@ static int DrawLevelText(int sx, int sy, char letter, int mode) /* map lower case letters to upper case and convert special characters */ if (letter >= 'a' && letter <= 'z') letter_element = EL_CHAR_ASCII0 + letter + (int)('A' - 'a'); - else if (letter == 'ä' || letter == 'Ä') + else if (letter == CHAR_BYTE_UMLAUT_a || letter == CHAR_BYTE_UMLAUT_A) letter_element = EL_CHAR_AUMLAUT; - else if (letter == 'ö' || letter == 'Ö') + else if (letter == CHAR_BYTE_UMLAUT_o || letter == CHAR_BYTE_UMLAUT_O) letter_element = EL_CHAR_OUMLAUT; - else if (letter == 'ü' || letter == 'Ü') + else if (letter == CHAR_BYTE_UMLAUT_u || letter == CHAR_BYTE_UMLAUT_U) letter_element = EL_CHAR_UUMLAUT; else if (letter == '^') letter_element = EL_CHAR_COPYRIGHT; diff --git a/src/game_em/Makefile b/src/game_em/Makefile index 97ec305c..c5c0fc3d 100644 --- a/src/game_em/Makefile +++ b/src/game_em/Makefile @@ -7,7 +7,7 @@ # http://www.artsoft.org/ # ----------------------------------------------------------------------------- # The native Emerald Mine game engine is based on: -# Emerald Mine for X11 © 2000,2001 David Tritscher +# Emerald Mine for X11 (c) 2000,2001 David Tritscher # ----------------------------------------------------------------------------- # src/game_em/Makefile # ============================================================================= diff --git a/src/game_sp/init.c b/src/game_sp/init.c index ebd6d296..1fef7fae 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -6,16 +6,16 @@ char *preceding_playfield_memory[] = { "95 89 95 89 95 89 3b 8a 3b 8a 3b 8a 3b 8a 3b 8a", // |......;.;.;.;.;.| - "3b 8a 3b 8a 3b 8a e8 8a e8 8a e8 8a e8 8a e8 8a", // |;.;.;.è.è.è.è.è.| - "e8 8a e8 8a e8 8a b1 8b b1 8b b1 8b b1 8b b1 8b", // |è.è.è.±.±.±.±.±.| - "b1 8b b1 8b b1 8b 85 8c 85 8c 85 8c 85 8c 85 8c", // |±.±.±...........| + "3b 8a 3b 8a 3b 8a e8 8a e8 8a e8 8a e8 8a e8 8a", // |;.;.;...........| + "e8 8a e8 8a e8 8a b1 8b b1 8b b1 8b b1 8b b1 8b", // |................| + "b1 8b b1 8b b1 8b 85 8c 85 8c 85 8c 85 8c 85 8c", // |................| "85 8c 85 8c 85 8c 5b 8d 5b 8d 5b 8d 5b 8d 5b 8d", // |......[.[.[.[.[.| "5b 8d 5b 8d 5b 8d 06 8e 06 8e 06 8e 06 8e 06 8e", // |[.[.[...........| - "06 8e 06 8e 06 8e ac 8e ac 8e ac 8e ac 8e ac 8e", // |......¬.¬.¬.¬.¬.| - "ac 8e ac 8e ac 8e 59 8f 59 8f 59 8f 59 8f 59 8f", // |¬.¬.¬.Y.Y.Y.Y.Y.| - "59 8f 59 8f 59 8f 00 00 70 13 00 00 00 00 e8 17", // |Y.Y.Y...p.....è.| + "06 8e 06 8e 06 8e ac 8e ac 8e ac 8e ac 8e ac 8e", // |................| + "ac 8e ac 8e ac 8e 59 8f 59 8f 59 8f 59 8f 59 8f", // |......Y.Y.Y.Y.Y.| + "59 8f 59 8f 59 8f 00 00 70 13 00 00 00 00 e8 17", // |Y.Y.Y...p.......| "00 00 00 00 00 00 69 38 00 00 00 00 00 00 00 00", // |......i8........| - "00 00 00 00 00 00 00 00 d0 86 00 00 b2 34 00 00", // |........Ð...²4..| + "00 00 00 00 00 00 00 00 d0 86 00 00 b2 34 00 00", // |.............4..| "00 00 00 00 00 00 8f 8b 1d 34 00 00 00 00 00 00", // |.........4......| "00 00 00 00 23 39 09 09 00 0c 00 08 00 58 00 00", // |....#9.......X..| "00 00 00 25 77 06 7f 00 00 00 01 00 00 00 00 00", // |...%w...........| @@ -27,7 +27,7 @@ char *preceding_playfield_memory[] = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| - "00 00 00 00 00 00 00 00 00 ec 06 26 05 00 00 00", // |.........ì.&....| + "00 00 00 00 00 00 00 00 00 ec 06 26 05 00 00 00", // |...........&....| "00 00 00 01 00 00 00 00 31 32 33 34 35 36 37 38", // |........12345678| "39 30 2d 00 08 00 51 57 45 52 54 59 55 49 4f 50", // |90-...QWERTYUIOP| "00 00 0a 00 41 53 44 46 47 48 4a 4b 4c 00 00 00", // |....ASDFGHJKL...| @@ -39,7 +39,7 @@ char *preceding_playfield_memory[] = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 2e 00 1e 00 31 00 14 00 39 00", // |..........1...9.| - "1f 00 14 00 18 00 ff ff 01 00 01 4c 45 56 45 4c", // |......ÿÿ...LEVEL| + "1f 00 14 00 18 00 ff ff 01 00 01 4c 45 56 45 4c", // |...........LEVEL| "53 2e 44 41 54 00 00 00 00 00 00 00 00 00 00 00", // |S.DAT...........| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 78dddf8a..883dd7d2 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -387,9 +387,9 @@ static char *get_corrected_real_name(char *real_name) if (*from_ptr == ',') break; - /* the user's real name may contain 'ß' characters (german sharp s), + /* the user's real name may contain 'german sharp s' characters, which have no equivalent in upper case letters (used by our fonts) */ - if (*from_ptr == 'ß') + if (*from_ptr == CHAR_BYTE_SHARP_S) { from_ptr++; *to_ptr++ = 's'; @@ -1419,13 +1419,13 @@ void translate_keyname(Key *keysym, char **x11name, char **name, int mode) { KSYM_asciitilde, "XK_asciitilde", "~" }, /* special (non-ASCII) keys (ISO-Latin-1) */ - { KSYM_degree, "XK_degree", "°" }, - { KSYM_Adiaeresis, "XK_Adiaeresis", "Ä" }, - { KSYM_Odiaeresis, "XK_Odiaeresis", "Ö" }, - { KSYM_Udiaeresis, "XK_Udiaeresis", "Ü" }, - { KSYM_adiaeresis, "XK_adiaeresis", "ä" }, - { KSYM_odiaeresis, "XK_odiaeresis", "ö" }, - { KSYM_udiaeresis, "XK_udiaeresis", "ü" }, + { KSYM_degree, "XK_degree", "degree" }, + { KSYM_Adiaeresis, "XK_Adiaeresis", "A umlaut" }, + { KSYM_Odiaeresis, "XK_Odiaeresis", "O umlaut" }, + { KSYM_Udiaeresis, "XK_Udiaeresis", "U umlaut" }, + { KSYM_adiaeresis, "XK_adiaeresis", "a umlaut" }, + { KSYM_odiaeresis, "XK_odiaeresis", "o umlaut" }, + { KSYM_udiaeresis, "XK_udiaeresis", "u umlaut" }, { KSYM_ssharp, "XK_ssharp", "sharp s" }, #if defined(TARGET_SDL2) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 12b39d86..2217842e 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -1338,7 +1338,7 @@ Pixel SDLGetPixel(Bitmap *src_bitmap, int x, int y) /* ========================================================================= */ /* The following functions were taken from the SGE library */ -/* (SDL Graphics Extension Library) by Anders Lindström */ +/* (SDL Graphics Extension Library) by Anders Lindström */ /* http://www.etek.chalmers.se/~e8cal1/sge/index.html */ /* ========================================================================= */ diff --git a/src/libgame/text.h b/src/libgame/text.h index 4447d87b..1273f399 100644 --- a/src/libgame/text.h +++ b/src/libgame/text.h @@ -30,6 +30,19 @@ /* text output definitions */ #define MAX_OUTPUT_LINESIZE 1024 +/* special constants for old ISO-8859-1 character byte values */ +#define CHAR_BYTE_UMLAUT_A (0xc4) +#define CHAR_BYTE_UMLAUT_O (0xd6) +#define CHAR_BYTE_UMLAUT_U (0xdc) +#define CHAR_BYTE_UMLAUT_a (0xe4) +#define CHAR_BYTE_UMLAUT_o (0xf6) +#define CHAR_BYTE_UMLAUT_u (0xfc) +#define CHAR_BYTE_SHARP_S (0xdf) +#define CHAR_BYTE_COPYRIGHT (0xa9) +#define CHAR_BYTE_REGISTERED (0xae) +#define CHAR_BYTE_DEGREE (0xb0) +#define CHAR_BYTE_CURSOR (0xa0) + /* special character mapping for default fonts */ #define FONT_ASCII_CURSOR ((char)160) #define FONT_ASCII_BUTTON ((char)128) @@ -39,16 +52,19 @@ #define FONT_ASCII_RIGHT ((char)'>') #define MAP_FONT_ASCII(c) ((c) >= 'a' && (c) <= 'z' ? 'A' + (c) - 'a' : \ - (c) == '©' ? 96 : \ - (c) == 'ä' || (c) == 'Ä' ? 97 : \ - (c) == 'ö' || (c) == 'Ö' ? 98 : \ - (c) == 'ü' || (c) == 'Ü' ? 99 : \ - (c) == '°' ? 100 : \ - (c) == '®' ? 101 : \ - (c) == FONT_ASCII_CURSOR ? 102 : \ - (c) == FONT_ASCII_BUTTON ? 109 : \ - (c) == FONT_ASCII_UP ? 110 : \ - (c) == FONT_ASCII_DOWN ? 111 : \ + (c) == CHAR_BYTE_COPYRIGHT ? 96 : \ + (c) == CHAR_BYTE_UMLAUT_a ? 97 : \ + (c) == CHAR_BYTE_UMLAUT_A ? 97 : \ + (c) == CHAR_BYTE_UMLAUT_o ? 98 : \ + (c) == CHAR_BYTE_UMLAUT_O ? 98 : \ + (c) == CHAR_BYTE_UMLAUT_u ? 99 : \ + (c) == CHAR_BYTE_UMLAUT_U ? 99 : \ + (c) == CHAR_BYTE_DEGREE ? 100 : \ + (c) == CHAR_BYTE_REGISTERED ? 101 : \ + (c) == FONT_ASCII_CURSOR ? 102 : \ + (c) == FONT_ASCII_BUTTON ? 109 : \ + (c) == FONT_ASCII_UP ? 110 : \ + (c) == FONT_ASCII_DOWN ? 111 : \ (c)) /* 64 regular ordered ASCII characters, 6 special characters, 1 cursor char. */ diff --git a/src/main.c b/src/main.c index 8a727907..74e53965 100644 --- a/src/main.c +++ b/src/main.c @@ -1094,37 +1094,37 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "char_copyright", "char", - "letter '©'" + "letter '\xa9'" }, { "char_aumlaut", "char", - "letter 'Ä'" + "letter '\xc4'" }, { "char_oumlaut", "char", - "letter 'Ö'" + "letter '\xd6'" }, { "char_uumlaut", "char", - "letter 'Ü'" + "letter '\xdc'" }, { "char_degree", "char", - "letter '°'" + "letter '\xb0'" }, { "char_trademark", "char", - "letter '®'" + "letter '\xae'" }, { "char_cursor", "char", - "letter ' '" + "letter '\xa0'" }, { "char_unused", @@ -4154,37 +4154,37 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "steel_char_copyright", "steel_char", - "steel letter '©'" + "steel letter '\xa9'" }, { "steel_char_aumlaut", "steel_char", - "steel letter 'Ä'" + "steel letter '\xc4'" }, { "steel_char_oumlaut", "steel_char", - "steel letter 'Ö'" + "steel letter '\xd6'" }, { "steel_char_uumlaut", "steel_char", - "steel letter 'Ü'" + "steel letter '\xdc'" }, { "steel_char_degree", "steel_char", - "steel letter '°'" + "steel letter '\xb0'" }, { "steel_char_trademark", "steel_char", - "steel letter '®'" + "steel letter '\xae'" }, { "steel_char_cursor", "steel_char", - "steel letter ' '" + "steel letter '\xa0'" }, { "steel_char_unused", diff --git a/src/main.h b/src/main.h index c4b43f79..08a540af 100644 --- a/src/main.h +++ b/src/main.h @@ -1976,7 +1976,7 @@ #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2014 by Holger Schemel" +#define PROGRAM_COPYRIGHT_STRING "Copyright \xa91995-2014 by Holger Schemel" #define PROGRAM_EMAIL_STRING "info@artsoft.org" #define PROGRAM_WEBSITE_STRING "http://www.artsoft.org/" #define PROGRAM_GAME_BY_STRING "A Game by Artsoft Entertainment" diff --git a/src/screens.c b/src/screens.c index a6c7e0a6..32eec479 100644 --- a/src/screens.c +++ b/src/screens.c @@ -2620,7 +2620,7 @@ static void DrawInfoScreen_CreditsScreen(int screen_nr) DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "and"); DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, - "Jürgen Bonhagen"); + "J\xfcrgen Bonhagen"); DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "for the continuous creation"); DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_2, @@ -2674,7 +2674,7 @@ static void DrawInfoScreen_CreditsScreen(int screen_nr) DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "Thanks to"); DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_3, - "Karl Hörnell"); + "Karl H\xf6rnell"); DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_2, "for some additional toons"); } diff --git a/src/tools.c b/src/tools.c index 7a814a0a..49e927d3 100644 --- a/src/tools.c +++ b/src/tools.c @@ -6174,7 +6174,7 @@ em_object_mapping_list[] = }, { Xalpha_copyr, TRUE, FALSE, - EL_CHAR('©'), -1, -1 + EL_CHAR(CHAR_BYTE_COPYRIGHT), -1, -1 }, { -- 2.34.1