From: Holger Schemel Date: Sat, 8 Feb 2003 16:51:21 +0000 (+0100) Subject: rnd-20030208-2-src X-Git-Tag: 3.0.0^2~147 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=601cca5b35649856ff49e1bcb3806592b736662c;p=rocksndiamonds.git rnd-20030208-2-src --- diff --git a/Makefile b/Makefile index 538f6c04..a5b3d976 100644 --- a/Makefile +++ b/Makefile @@ -88,12 +88,7 @@ clean: #-----------------------------------------------------------------------------# auto-conf: - ./Scripts/create_element_defs.pl --gfx > src/conf_gfx.h - ./Scripts/create_element_defs.pl --snd > src/conf_snd.h - ./Scripts/create_element_defs.pl --chr > src/conf_chr.c - ./Scripts/create_element_defs.pl --cus > src/conf_cus.c - ./Scripts/create_element_defs.pl --e2g > src/conf_e2g.c - ./Scripts/create_element_defs.pl --esg > src/conf_esg.c + @$(MAKE_CMD) auto-conf run: @$(MAKE_CMD) TARGET=$(DEFAULT_TARGET) && ./rocksndiamonds --verbose diff --git a/src/Makefile b/src/Makefile index f0d9c3ed..89e04758 100644 --- a/src/Makefile +++ b/src/Makefile @@ -153,6 +153,17 @@ OBJS = main.o \ network.o \ netserv.o +CNFS = conf_gfx.h \ + conf_snd.h \ + conf_chr.c \ + conf_chr.h \ + conf_cus.c \ + conf_cus.h \ + conf_e2g.c \ + conf_esg.c + +CNFS_CMD = ../Scripts/create_element_defs.pl + TIMESTAMP_FILE = conftime.h LIBDIR = libgame @@ -175,15 +186,17 @@ libgame_dir: $(LIBGAME): @$(MAKE) -C $(LIBDIR) +auto-conf: + @for i in $(CNFS); do \ + echo "$(CNFS_CMD) $$i > $$i"; \ + $(CNFS_CMD) $$i > $$i; \ + done + conf_gfx.h: conf_gfx.c - ../Scripts/create_element_defs.pl --gfx > conf_gfx.h - ../Scripts/create_element_defs.pl --chr > conf_chr.c - ../Scripts/create_element_defs.pl --cus > conf_cus.c - ../Scripts/create_element_defs.pl --e2g > conf_e2g.c - ../Scripts/create_element_defs.pl --esg > conf_esg.c + @$(MAKE) auto-conf conf_snd.h: conf_snd.c - ../Scripts/create_element_defs.pl --snd > conf_snd.h + @$(MAKE) auto-conf $(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) @date '+"[%Y-%m-%d %H:%M]"' \ diff --git a/src/conf_chr.h b/src/conf_chr.h new file mode 100644 index 00000000..4f8abbc1 --- /dev/null +++ b/src/conf_chr.h @@ -0,0 +1,90 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_chr.h * +***********************************************************/ + +/* ----- this file was automatically generated -- do not edit by hand ----- */ + +#ifndef CONF_CHR_H +#define CONF_CHR_H + +/* values for elements configuration (character elements) */ + +#define EL_CHAR_SPACE (EL_CHAR_ASCII0 + 32) +#define EL_CHAR_EXCLAM (EL_CHAR_ASCII0 + 33) +#define EL_CHAR_QUOTEDBL (EL_CHAR_ASCII0 + 34) +#define EL_CHAR_NUMBERSIGN (EL_CHAR_ASCII0 + 35) +#define EL_CHAR_DOLLAR (EL_CHAR_ASCII0 + 36) +#define EL_CHAR_PROCENT (EL_CHAR_ASCII0 + 37) +#define EL_CHAR_AMPERSAND (EL_CHAR_ASCII0 + 38) +#define EL_CHAR_APOSTROPHE (EL_CHAR_ASCII0 + 39) +#define EL_CHAR_PARENLEFT (EL_CHAR_ASCII0 + 40) +#define EL_CHAR_PARENRIGHT (EL_CHAR_ASCII0 + 41) +#define EL_CHAR_ASTERISK (EL_CHAR_ASCII0 + 42) +#define EL_CHAR_PLUS (EL_CHAR_ASCII0 + 43) +#define EL_CHAR_COMMA (EL_CHAR_ASCII0 + 44) +#define EL_CHAR_MINUS (EL_CHAR_ASCII0 + 45) +#define EL_CHAR_PERIOD (EL_CHAR_ASCII0 + 46) +#define EL_CHAR_SLASH (EL_CHAR_ASCII0 + 47) +#define EL_CHAR_0 (EL_CHAR_ASCII0 + 48) +#define EL_CHAR_1 (EL_CHAR_ASCII0 + 49) +#define EL_CHAR_2 (EL_CHAR_ASCII0 + 50) +#define EL_CHAR_3 (EL_CHAR_ASCII0 + 51) +#define EL_CHAR_4 (EL_CHAR_ASCII0 + 52) +#define EL_CHAR_5 (EL_CHAR_ASCII0 + 53) +#define EL_CHAR_6 (EL_CHAR_ASCII0 + 54) +#define EL_CHAR_7 (EL_CHAR_ASCII0 + 55) +#define EL_CHAR_8 (EL_CHAR_ASCII0 + 56) +#define EL_CHAR_9 (EL_CHAR_ASCII0 + 57) +#define EL_CHAR_COLON (EL_CHAR_ASCII0 + 58) +#define EL_CHAR_SEMICOLON (EL_CHAR_ASCII0 + 59) +#define EL_CHAR_LESS (EL_CHAR_ASCII0 + 60) +#define EL_CHAR_EQUAL (EL_CHAR_ASCII0 + 61) +#define EL_CHAR_GREATER (EL_CHAR_ASCII0 + 62) +#define EL_CHAR_QUESTION (EL_CHAR_ASCII0 + 63) +#define EL_CHAR_AT (EL_CHAR_ASCII0 + 64) +#define EL_CHAR_A (EL_CHAR_ASCII0 + 65) +#define EL_CHAR_B (EL_CHAR_ASCII0 + 66) +#define EL_CHAR_C (EL_CHAR_ASCII0 + 67) +#define EL_CHAR_D (EL_CHAR_ASCII0 + 68) +#define EL_CHAR_E (EL_CHAR_ASCII0 + 69) +#define EL_CHAR_F (EL_CHAR_ASCII0 + 70) +#define EL_CHAR_G (EL_CHAR_ASCII0 + 71) +#define EL_CHAR_H (EL_CHAR_ASCII0 + 72) +#define EL_CHAR_I (EL_CHAR_ASCII0 + 73) +#define EL_CHAR_J (EL_CHAR_ASCII0 + 74) +#define EL_CHAR_K (EL_CHAR_ASCII0 + 75) +#define EL_CHAR_L (EL_CHAR_ASCII0 + 76) +#define EL_CHAR_M (EL_CHAR_ASCII0 + 77) +#define EL_CHAR_N (EL_CHAR_ASCII0 + 78) +#define EL_CHAR_O (EL_CHAR_ASCII0 + 79) +#define EL_CHAR_P (EL_CHAR_ASCII0 + 80) +#define EL_CHAR_Q (EL_CHAR_ASCII0 + 81) +#define EL_CHAR_R (EL_CHAR_ASCII0 + 82) +#define EL_CHAR_S (EL_CHAR_ASCII0 + 83) +#define EL_CHAR_T (EL_CHAR_ASCII0 + 84) +#define EL_CHAR_U (EL_CHAR_ASCII0 + 85) +#define EL_CHAR_V (EL_CHAR_ASCII0 + 86) +#define EL_CHAR_W (EL_CHAR_ASCII0 + 87) +#define EL_CHAR_X (EL_CHAR_ASCII0 + 88) +#define EL_CHAR_Y (EL_CHAR_ASCII0 + 89) +#define EL_CHAR_Z (EL_CHAR_ASCII0 + 90) +#define EL_CHAR_AE (EL_CHAR_ASCII0 + 91) +#define EL_CHAR_OE (EL_CHAR_ASCII0 + 92) +#define EL_CHAR_UE (EL_CHAR_ASCII0 + 93) +#define EL_CHAR_COPYRIGHT (EL_CHAR_ASCII0 + 94) +#define EL_CHAR_UNDERSCORE (EL_CHAR_ASCII0 + 95) +#define EL_CHAR_EMPTY (EL_CHAR_ASCII0 + 96) +#define EL_CHAR_DEGREE (EL_CHAR_ASCII0 + 97) +#define EL_CHAR_TM (EL_CHAR_ASCII0 + 98) +#define EL_CHAR_CURSOR (EL_CHAR_ASCII0 + 99) + +#endif /* CONF_CHR_C */ diff --git a/src/conf_cus.h b/src/conf_cus.h new file mode 100644 index 00000000..425334be --- /dev/null +++ b/src/conf_cus.h @@ -0,0 +1,150 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2002 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_cus.h * +***********************************************************/ + +/* ----- this file was automatically generated -- do not edit by hand ----- */ + +#ifndef CONF_CUS_H +#define CONF_CUS_H + +/* values for elements configuration (custom elements) */ + +#define EL_CUSTOM_1 (EL_CUSTOM_START + 0) +#define EL_CUSTOM_2 (EL_CUSTOM_START + 1) +#define EL_CUSTOM_3 (EL_CUSTOM_START + 2) +#define EL_CUSTOM_4 (EL_CUSTOM_START + 3) +#define EL_CUSTOM_5 (EL_CUSTOM_START + 4) +#define EL_CUSTOM_6 (EL_CUSTOM_START + 5) +#define EL_CUSTOM_7 (EL_CUSTOM_START + 6) +#define EL_CUSTOM_8 (EL_CUSTOM_START + 7) +#define EL_CUSTOM_9 (EL_CUSTOM_START + 8) +#define EL_CUSTOM_10 (EL_CUSTOM_START + 9) +#define EL_CUSTOM_11 (EL_CUSTOM_START + 10) +#define EL_CUSTOM_12 (EL_CUSTOM_START + 11) +#define EL_CUSTOM_13 (EL_CUSTOM_START + 12) +#define EL_CUSTOM_14 (EL_CUSTOM_START + 13) +#define EL_CUSTOM_15 (EL_CUSTOM_START + 14) +#define EL_CUSTOM_16 (EL_CUSTOM_START + 15) +#define EL_CUSTOM_17 (EL_CUSTOM_START + 16) +#define EL_CUSTOM_18 (EL_CUSTOM_START + 17) +#define EL_CUSTOM_19 (EL_CUSTOM_START + 18) +#define EL_CUSTOM_20 (EL_CUSTOM_START + 19) +#define EL_CUSTOM_21 (EL_CUSTOM_START + 20) +#define EL_CUSTOM_22 (EL_CUSTOM_START + 21) +#define EL_CUSTOM_23 (EL_CUSTOM_START + 22) +#define EL_CUSTOM_24 (EL_CUSTOM_START + 23) +#define EL_CUSTOM_25 (EL_CUSTOM_START + 24) +#define EL_CUSTOM_26 (EL_CUSTOM_START + 25) +#define EL_CUSTOM_27 (EL_CUSTOM_START + 26) +#define EL_CUSTOM_28 (EL_CUSTOM_START + 27) +#define EL_CUSTOM_29 (EL_CUSTOM_START + 28) +#define EL_CUSTOM_30 (EL_CUSTOM_START + 29) +#define EL_CUSTOM_31 (EL_CUSTOM_START + 30) +#define EL_CUSTOM_32 (EL_CUSTOM_START + 31) +#define EL_CUSTOM_33 (EL_CUSTOM_START + 32) +#define EL_CUSTOM_34 (EL_CUSTOM_START + 33) +#define EL_CUSTOM_35 (EL_CUSTOM_START + 34) +#define EL_CUSTOM_36 (EL_CUSTOM_START + 35) +#define EL_CUSTOM_37 (EL_CUSTOM_START + 36) +#define EL_CUSTOM_38 (EL_CUSTOM_START + 37) +#define EL_CUSTOM_39 (EL_CUSTOM_START + 38) +#define EL_CUSTOM_40 (EL_CUSTOM_START + 39) +#define EL_CUSTOM_41 (EL_CUSTOM_START + 40) +#define EL_CUSTOM_42 (EL_CUSTOM_START + 41) +#define EL_CUSTOM_43 (EL_CUSTOM_START + 42) +#define EL_CUSTOM_44 (EL_CUSTOM_START + 43) +#define EL_CUSTOM_45 (EL_CUSTOM_START + 44) +#define EL_CUSTOM_46 (EL_CUSTOM_START + 45) +#define EL_CUSTOM_47 (EL_CUSTOM_START + 46) +#define EL_CUSTOM_48 (EL_CUSTOM_START + 47) +#define EL_CUSTOM_49 (EL_CUSTOM_START + 48) +#define EL_CUSTOM_50 (EL_CUSTOM_START + 49) +#define EL_CUSTOM_51 (EL_CUSTOM_START + 50) +#define EL_CUSTOM_52 (EL_CUSTOM_START + 51) +#define EL_CUSTOM_53 (EL_CUSTOM_START + 52) +#define EL_CUSTOM_54 (EL_CUSTOM_START + 53) +#define EL_CUSTOM_55 (EL_CUSTOM_START + 54) +#define EL_CUSTOM_56 (EL_CUSTOM_START + 55) +#define EL_CUSTOM_57 (EL_CUSTOM_START + 56) +#define EL_CUSTOM_58 (EL_CUSTOM_START + 57) +#define EL_CUSTOM_59 (EL_CUSTOM_START + 58) +#define EL_CUSTOM_60 (EL_CUSTOM_START + 59) +#define EL_CUSTOM_61 (EL_CUSTOM_START + 60) +#define EL_CUSTOM_62 (EL_CUSTOM_START + 61) +#define EL_CUSTOM_63 (EL_CUSTOM_START + 62) +#define EL_CUSTOM_64 (EL_CUSTOM_START + 63) +#define EL_CUSTOM_65 (EL_CUSTOM_START + 64) +#define EL_CUSTOM_66 (EL_CUSTOM_START + 65) +#define EL_CUSTOM_67 (EL_CUSTOM_START + 66) +#define EL_CUSTOM_68 (EL_CUSTOM_START + 67) +#define EL_CUSTOM_69 (EL_CUSTOM_START + 68) +#define EL_CUSTOM_70 (EL_CUSTOM_START + 69) +#define EL_CUSTOM_71 (EL_CUSTOM_START + 70) +#define EL_CUSTOM_72 (EL_CUSTOM_START + 71) +#define EL_CUSTOM_73 (EL_CUSTOM_START + 72) +#define EL_CUSTOM_74 (EL_CUSTOM_START + 73) +#define EL_CUSTOM_75 (EL_CUSTOM_START + 74) +#define EL_CUSTOM_76 (EL_CUSTOM_START + 75) +#define EL_CUSTOM_77 (EL_CUSTOM_START + 76) +#define EL_CUSTOM_78 (EL_CUSTOM_START + 77) +#define EL_CUSTOM_79 (EL_CUSTOM_START + 78) +#define EL_CUSTOM_80 (EL_CUSTOM_START + 79) +#define EL_CUSTOM_81 (EL_CUSTOM_START + 80) +#define EL_CUSTOM_82 (EL_CUSTOM_START + 81) +#define EL_CUSTOM_83 (EL_CUSTOM_START + 82) +#define EL_CUSTOM_84 (EL_CUSTOM_START + 83) +#define EL_CUSTOM_85 (EL_CUSTOM_START + 84) +#define EL_CUSTOM_86 (EL_CUSTOM_START + 85) +#define EL_CUSTOM_87 (EL_CUSTOM_START + 86) +#define EL_CUSTOM_88 (EL_CUSTOM_START + 87) +#define EL_CUSTOM_89 (EL_CUSTOM_START + 88) +#define EL_CUSTOM_90 (EL_CUSTOM_START + 89) +#define EL_CUSTOM_91 (EL_CUSTOM_START + 90) +#define EL_CUSTOM_92 (EL_CUSTOM_START + 91) +#define EL_CUSTOM_93 (EL_CUSTOM_START + 92) +#define EL_CUSTOM_94 (EL_CUSTOM_START + 93) +#define EL_CUSTOM_95 (EL_CUSTOM_START + 94) +#define EL_CUSTOM_96 (EL_CUSTOM_START + 95) +#define EL_CUSTOM_97 (EL_CUSTOM_START + 96) +#define EL_CUSTOM_98 (EL_CUSTOM_START + 97) +#define EL_CUSTOM_99 (EL_CUSTOM_START + 98) +#define EL_CUSTOM_100 (EL_CUSTOM_START + 99) +#define EL_CUSTOM_101 (EL_CUSTOM_START + 100) +#define EL_CUSTOM_102 (EL_CUSTOM_START + 101) +#define EL_CUSTOM_103 (EL_CUSTOM_START + 102) +#define EL_CUSTOM_104 (EL_CUSTOM_START + 103) +#define EL_CUSTOM_105 (EL_CUSTOM_START + 104) +#define EL_CUSTOM_106 (EL_CUSTOM_START + 105) +#define EL_CUSTOM_107 (EL_CUSTOM_START + 106) +#define EL_CUSTOM_108 (EL_CUSTOM_START + 107) +#define EL_CUSTOM_109 (EL_CUSTOM_START + 108) +#define EL_CUSTOM_110 (EL_CUSTOM_START + 109) +#define EL_CUSTOM_111 (EL_CUSTOM_START + 110) +#define EL_CUSTOM_112 (EL_CUSTOM_START + 111) +#define EL_CUSTOM_113 (EL_CUSTOM_START + 112) +#define EL_CUSTOM_114 (EL_CUSTOM_START + 113) +#define EL_CUSTOM_115 (EL_CUSTOM_START + 114) +#define EL_CUSTOM_116 (EL_CUSTOM_START + 115) +#define EL_CUSTOM_117 (EL_CUSTOM_START + 116) +#define EL_CUSTOM_118 (EL_CUSTOM_START + 117) +#define EL_CUSTOM_119 (EL_CUSTOM_START + 118) +#define EL_CUSTOM_120 (EL_CUSTOM_START + 119) +#define EL_CUSTOM_121 (EL_CUSTOM_START + 120) +#define EL_CUSTOM_122 (EL_CUSTOM_START + 121) +#define EL_CUSTOM_123 (EL_CUSTOM_START + 122) +#define EL_CUSTOM_124 (EL_CUSTOM_START + 123) +#define EL_CUSTOM_125 (EL_CUSTOM_START + 124) +#define EL_CUSTOM_126 (EL_CUSTOM_START + 125) +#define EL_CUSTOM_127 (EL_CUSTOM_START + 126) +#define EL_CUSTOM_128 (EL_CUSTOM_START + 127) + +#endif /* CONF_CUS_C */ diff --git a/src/conf_e2g.c b/src/conf_e2g.c index 2f48bf00..82d0051f 100644 --- a/src/conf_e2g.c +++ b/src/conf_e2g.c @@ -2328,6 +2328,790 @@ element_to_graphic[] = EL_SIGN_YINYANG, -1, -1, IMG_CHAR_QUESTION }, + { + EL_CHAR_SPACE, -1, -1, + IMG_CHAR_SPACE + }, + { + EL_CHAR_EXCLAM, -1, -1, + IMG_CHAR_EXCLAM + }, + { + EL_CHAR_QUOTEDBL, -1, -1, + IMG_CHAR_QUOTEDBL + }, + { + EL_CHAR_NUMBERSIGN, -1, -1, + IMG_CHAR_NUMBERSIGN + }, + { + EL_CHAR_DOLLAR, -1, -1, + IMG_CHAR_DOLLAR + }, + { + EL_CHAR_PROCENT, -1, -1, + IMG_CHAR_PROCENT + }, + { + EL_CHAR_AMPERSAND, -1, -1, + IMG_CHAR_AMPERSAND + }, + { + EL_CHAR_APOSTROPHE, -1, -1, + IMG_CHAR_APOSTROPHE + }, + { + EL_CHAR_PARENLEFT, -1, -1, + IMG_CHAR_PARENLEFT + }, + { + EL_CHAR_PARENRIGHT, -1, -1, + IMG_CHAR_PARENRIGHT + }, + { + EL_CHAR_ASTERISK, -1, -1, + IMG_CHAR_ASTERISK + }, + { + EL_CHAR_PLUS, -1, -1, + IMG_CHAR_PLUS + }, + { + EL_CHAR_COMMA, -1, -1, + IMG_CHAR_COMMA + }, + { + EL_CHAR_MINUS, -1, -1, + IMG_CHAR_MINUS + }, + { + EL_CHAR_PERIOD, -1, -1, + IMG_CHAR_PERIOD + }, + { + EL_CHAR_SLASH, -1, -1, + IMG_CHAR_SLASH + }, + { + EL_CHAR_0, -1, -1, + IMG_CHAR_0 + }, + { + EL_CHAR_1, -1, -1, + IMG_CHAR_1 + }, + { + EL_CHAR_2, -1, -1, + IMG_CHAR_2 + }, + { + EL_CHAR_3, -1, -1, + IMG_CHAR_3 + }, + { + EL_CHAR_4, -1, -1, + IMG_CHAR_4 + }, + { + EL_CHAR_5, -1, -1, + IMG_CHAR_5 + }, + { + EL_CHAR_6, -1, -1, + IMG_CHAR_6 + }, + { + EL_CHAR_7, -1, -1, + IMG_CHAR_7 + }, + { + EL_CHAR_8, -1, -1, + IMG_CHAR_8 + }, + { + EL_CHAR_9, -1, -1, + IMG_CHAR_9 + }, + { + EL_CHAR_COLON, -1, -1, + IMG_CHAR_COLON + }, + { + EL_CHAR_SEMICOLON, -1, -1, + IMG_CHAR_SEMICOLON + }, + { + EL_CHAR_LESS, -1, -1, + IMG_CHAR_LESS + }, + { + EL_CHAR_EQUAL, -1, -1, + IMG_CHAR_EQUAL + }, + { + EL_CHAR_GREATER, -1, -1, + IMG_CHAR_GREATER + }, + { + EL_CHAR_QUESTION, -1, -1, + IMG_CHAR_QUESTION + }, + { + EL_CHAR_AT, -1, -1, + IMG_CHAR_AT + }, + { + EL_CHAR_A, -1, -1, + IMG_CHAR_A + }, + { + EL_CHAR_B, -1, -1, + IMG_CHAR_B + }, + { + EL_CHAR_C, -1, -1, + IMG_CHAR_C + }, + { + EL_CHAR_D, -1, -1, + IMG_CHAR_D + }, + { + EL_CHAR_E, -1, -1, + IMG_CHAR_E + }, + { + EL_CHAR_F, -1, -1, + IMG_CHAR_F + }, + { + EL_CHAR_G, -1, -1, + IMG_CHAR_G + }, + { + EL_CHAR_H, -1, -1, + IMG_CHAR_H + }, + { + EL_CHAR_I, -1, -1, + IMG_CHAR_I + }, + { + EL_CHAR_J, -1, -1, + IMG_CHAR_J + }, + { + EL_CHAR_K, -1, -1, + IMG_CHAR_K + }, + { + EL_CHAR_L, -1, -1, + IMG_CHAR_L + }, + { + EL_CHAR_M, -1, -1, + IMG_CHAR_M + }, + { + EL_CHAR_N, -1, -1, + IMG_CHAR_N + }, + { + EL_CHAR_O, -1, -1, + IMG_CHAR_O + }, + { + EL_CHAR_P, -1, -1, + IMG_CHAR_P + }, + { + EL_CHAR_Q, -1, -1, + IMG_CHAR_Q + }, + { + EL_CHAR_R, -1, -1, + IMG_CHAR_R + }, + { + EL_CHAR_S, -1, -1, + IMG_CHAR_S + }, + { + EL_CHAR_T, -1, -1, + IMG_CHAR_T + }, + { + EL_CHAR_U, -1, -1, + IMG_CHAR_U + }, + { + EL_CHAR_V, -1, -1, + IMG_CHAR_V + }, + { + EL_CHAR_W, -1, -1, + IMG_CHAR_W + }, + { + EL_CHAR_X, -1, -1, + IMG_CHAR_X + }, + { + EL_CHAR_Y, -1, -1, + IMG_CHAR_Y + }, + { + EL_CHAR_Z, -1, -1, + IMG_CHAR_Z + }, + { + EL_CHAR_AE, -1, -1, + IMG_CHAR_AE + }, + { + EL_CHAR_OE, -1, -1, + IMG_CHAR_OE + }, + { + EL_CHAR_UE, -1, -1, + IMG_CHAR_UE + }, + { + EL_CHAR_COPYRIGHT, -1, -1, + IMG_CHAR_COPYRIGHT + }, + { + EL_CHAR_UNDERSCORE, -1, -1, + IMG_CHAR_UNDERSCORE + }, + { + EL_CHAR_EMPTY, -1, -1, + IMG_CHAR_EMPTY + }, + { + EL_CHAR_DEGREE, -1, -1, + IMG_CHAR_DEGREE + }, + { + EL_CHAR_TM, -1, -1, + IMG_CHAR_TM + }, + { + EL_CHAR_CURSOR, -1, -1, + IMG_CHAR_CURSOR + }, + { + EL_CUSTOM_1, -1, -1, + IMG_CUSTOM_1 + }, + { + EL_CUSTOM_2, -1, -1, + IMG_CUSTOM_2 + }, + { + EL_CUSTOM_3, -1, -1, + IMG_CUSTOM_3 + }, + { + EL_CUSTOM_4, -1, -1, + IMG_CUSTOM_4 + }, + { + EL_CUSTOM_5, -1, -1, + IMG_CUSTOM_5 + }, + { + EL_CUSTOM_6, -1, -1, + IMG_CUSTOM_6 + }, + { + EL_CUSTOM_7, -1, -1, + IMG_CUSTOM_7 + }, + { + EL_CUSTOM_8, -1, -1, + IMG_CUSTOM_8 + }, + { + EL_CUSTOM_9, -1, -1, + IMG_CUSTOM_9 + }, + { + EL_CUSTOM_10, -1, -1, + IMG_CUSTOM_10 + }, + { + EL_CUSTOM_11, -1, -1, + IMG_CUSTOM_11 + }, + { + EL_CUSTOM_12, -1, -1, + IMG_CUSTOM_12 + }, + { + EL_CUSTOM_13, -1, -1, + IMG_CUSTOM_13 + }, + { + EL_CUSTOM_14, -1, -1, + IMG_CUSTOM_14 + }, + { + EL_CUSTOM_15, -1, -1, + IMG_CUSTOM_15 + }, + { + EL_CUSTOM_16, -1, -1, + IMG_CUSTOM_16 + }, + { + EL_CUSTOM_17, -1, -1, + IMG_CUSTOM_17 + }, + { + EL_CUSTOM_18, -1, -1, + IMG_CUSTOM_18 + }, + { + EL_CUSTOM_19, -1, -1, + IMG_CUSTOM_19 + }, + { + EL_CUSTOM_20, -1, -1, + IMG_CUSTOM_20 + }, + { + EL_CUSTOM_21, -1, -1, + IMG_CUSTOM_21 + }, + { + EL_CUSTOM_22, -1, -1, + IMG_CUSTOM_22 + }, + { + EL_CUSTOM_23, -1, -1, + IMG_CUSTOM_23 + }, + { + EL_CUSTOM_24, -1, -1, + IMG_CUSTOM_24 + }, + { + EL_CUSTOM_25, -1, -1, + IMG_CUSTOM_25 + }, + { + EL_CUSTOM_26, -1, -1, + IMG_CUSTOM_26 + }, + { + EL_CUSTOM_27, -1, -1, + IMG_CUSTOM_27 + }, + { + EL_CUSTOM_28, -1, -1, + IMG_CUSTOM_28 + }, + { + EL_CUSTOM_29, -1, -1, + IMG_CUSTOM_29 + }, + { + EL_CUSTOM_30, -1, -1, + IMG_CUSTOM_30 + }, + { + EL_CUSTOM_31, -1, -1, + IMG_CUSTOM_31 + }, + { + EL_CUSTOM_32, -1, -1, + IMG_CUSTOM_32 + }, + { + EL_CUSTOM_33, -1, -1, + IMG_CUSTOM_33 + }, + { + EL_CUSTOM_34, -1, -1, + IMG_CUSTOM_34 + }, + { + EL_CUSTOM_35, -1, -1, + IMG_CUSTOM_35 + }, + { + EL_CUSTOM_36, -1, -1, + IMG_CUSTOM_36 + }, + { + EL_CUSTOM_37, -1, -1, + IMG_CUSTOM_37 + }, + { + EL_CUSTOM_38, -1, -1, + IMG_CUSTOM_38 + }, + { + EL_CUSTOM_39, -1, -1, + IMG_CUSTOM_39 + }, + { + EL_CUSTOM_40, -1, -1, + IMG_CUSTOM_40 + }, + { + EL_CUSTOM_41, -1, -1, + IMG_CUSTOM_41 + }, + { + EL_CUSTOM_42, -1, -1, + IMG_CUSTOM_42 + }, + { + EL_CUSTOM_43, -1, -1, + IMG_CUSTOM_43 + }, + { + EL_CUSTOM_44, -1, -1, + IMG_CUSTOM_44 + }, + { + EL_CUSTOM_45, -1, -1, + IMG_CUSTOM_45 + }, + { + EL_CUSTOM_46, -1, -1, + IMG_CUSTOM_46 + }, + { + EL_CUSTOM_47, -1, -1, + IMG_CUSTOM_47 + }, + { + EL_CUSTOM_48, -1, -1, + IMG_CUSTOM_48 + }, + { + EL_CUSTOM_49, -1, -1, + IMG_CUSTOM_49 + }, + { + EL_CUSTOM_50, -1, -1, + IMG_CUSTOM_50 + }, + { + EL_CUSTOM_51, -1, -1, + IMG_CUSTOM_51 + }, + { + EL_CUSTOM_52, -1, -1, + IMG_CUSTOM_52 + }, + { + EL_CUSTOM_53, -1, -1, + IMG_CUSTOM_53 + }, + { + EL_CUSTOM_54, -1, -1, + IMG_CUSTOM_54 + }, + { + EL_CUSTOM_55, -1, -1, + IMG_CUSTOM_55 + }, + { + EL_CUSTOM_56, -1, -1, + IMG_CUSTOM_56 + }, + { + EL_CUSTOM_57, -1, -1, + IMG_CUSTOM_57 + }, + { + EL_CUSTOM_58, -1, -1, + IMG_CUSTOM_58 + }, + { + EL_CUSTOM_59, -1, -1, + IMG_CUSTOM_59 + }, + { + EL_CUSTOM_60, -1, -1, + IMG_CUSTOM_60 + }, + { + EL_CUSTOM_61, -1, -1, + IMG_CUSTOM_61 + }, + { + EL_CUSTOM_62, -1, -1, + IMG_CUSTOM_62 + }, + { + EL_CUSTOM_63, -1, -1, + IMG_CUSTOM_63 + }, + { + EL_CUSTOM_64, -1, -1, + IMG_CUSTOM_64 + }, + { + EL_CUSTOM_65, -1, -1, + IMG_CUSTOM_65 + }, + { + EL_CUSTOM_66, -1, -1, + IMG_CUSTOM_66 + }, + { + EL_CUSTOM_67, -1, -1, + IMG_CUSTOM_67 + }, + { + EL_CUSTOM_68, -1, -1, + IMG_CUSTOM_68 + }, + { + EL_CUSTOM_69, -1, -1, + IMG_CUSTOM_69 + }, + { + EL_CUSTOM_70, -1, -1, + IMG_CUSTOM_70 + }, + { + EL_CUSTOM_71, -1, -1, + IMG_CUSTOM_71 + }, + { + EL_CUSTOM_72, -1, -1, + IMG_CUSTOM_72 + }, + { + EL_CUSTOM_73, -1, -1, + IMG_CUSTOM_73 + }, + { + EL_CUSTOM_74, -1, -1, + IMG_CUSTOM_74 + }, + { + EL_CUSTOM_75, -1, -1, + IMG_CUSTOM_75 + }, + { + EL_CUSTOM_76, -1, -1, + IMG_CUSTOM_76 + }, + { + EL_CUSTOM_77, -1, -1, + IMG_CUSTOM_77 + }, + { + EL_CUSTOM_78, -1, -1, + IMG_CUSTOM_78 + }, + { + EL_CUSTOM_79, -1, -1, + IMG_CUSTOM_79 + }, + { + EL_CUSTOM_80, -1, -1, + IMG_CUSTOM_80 + }, + { + EL_CUSTOM_81, -1, -1, + IMG_CUSTOM_81 + }, + { + EL_CUSTOM_82, -1, -1, + IMG_CUSTOM_82 + }, + { + EL_CUSTOM_83, -1, -1, + IMG_CUSTOM_83 + }, + { + EL_CUSTOM_84, -1, -1, + IMG_CUSTOM_84 + }, + { + EL_CUSTOM_85, -1, -1, + IMG_CUSTOM_85 + }, + { + EL_CUSTOM_86, -1, -1, + IMG_CUSTOM_86 + }, + { + EL_CUSTOM_87, -1, -1, + IMG_CUSTOM_87 + }, + { + EL_CUSTOM_88, -1, -1, + IMG_CUSTOM_88 + }, + { + EL_CUSTOM_89, -1, -1, + IMG_CUSTOM_89 + }, + { + EL_CUSTOM_90, -1, -1, + IMG_CUSTOM_90 + }, + { + EL_CUSTOM_91, -1, -1, + IMG_CUSTOM_91 + }, + { + EL_CUSTOM_92, -1, -1, + IMG_CUSTOM_92 + }, + { + EL_CUSTOM_93, -1, -1, + IMG_CUSTOM_93 + }, + { + EL_CUSTOM_94, -1, -1, + IMG_CUSTOM_94 + }, + { + EL_CUSTOM_95, -1, -1, + IMG_CUSTOM_95 + }, + { + EL_CUSTOM_96, -1, -1, + IMG_CUSTOM_96 + }, + { + EL_CUSTOM_97, -1, -1, + IMG_CUSTOM_97 + }, + { + EL_CUSTOM_98, -1, -1, + IMG_CUSTOM_98 + }, + { + EL_CUSTOM_99, -1, -1, + IMG_CUSTOM_99 + }, + { + EL_CUSTOM_100, -1, -1, + IMG_CUSTOM_100 + }, + { + EL_CUSTOM_101, -1, -1, + IMG_CUSTOM_101 + }, + { + EL_CUSTOM_102, -1, -1, + IMG_CUSTOM_102 + }, + { + EL_CUSTOM_103, -1, -1, + IMG_CUSTOM_103 + }, + { + EL_CUSTOM_104, -1, -1, + IMG_CUSTOM_104 + }, + { + EL_CUSTOM_105, -1, -1, + IMG_CUSTOM_105 + }, + { + EL_CUSTOM_106, -1, -1, + IMG_CUSTOM_106 + }, + { + EL_CUSTOM_107, -1, -1, + IMG_CUSTOM_107 + }, + { + EL_CUSTOM_108, -1, -1, + IMG_CUSTOM_108 + }, + { + EL_CUSTOM_109, -1, -1, + IMG_CUSTOM_109 + }, + { + EL_CUSTOM_110, -1, -1, + IMG_CUSTOM_110 + }, + { + EL_CUSTOM_111, -1, -1, + IMG_CUSTOM_111 + }, + { + EL_CUSTOM_112, -1, -1, + IMG_CUSTOM_112 + }, + { + EL_CUSTOM_113, -1, -1, + IMG_CUSTOM_113 + }, + { + EL_CUSTOM_114, -1, -1, + IMG_CUSTOM_114 + }, + { + EL_CUSTOM_115, -1, -1, + IMG_CUSTOM_115 + }, + { + EL_CUSTOM_116, -1, -1, + IMG_CUSTOM_116 + }, + { + EL_CUSTOM_117, -1, -1, + IMG_CUSTOM_117 + }, + { + EL_CUSTOM_118, -1, -1, + IMG_CUSTOM_118 + }, + { + EL_CUSTOM_119, -1, -1, + IMG_CUSTOM_119 + }, + { + EL_CUSTOM_120, -1, -1, + IMG_CUSTOM_120 + }, + { + EL_CUSTOM_121, -1, -1, + IMG_CUSTOM_121 + }, + { + EL_CUSTOM_122, -1, -1, + IMG_CUSTOM_122 + }, + { + EL_CUSTOM_123, -1, -1, + IMG_CUSTOM_123 + }, + { + EL_CUSTOM_124, -1, -1, + IMG_CUSTOM_124 + }, + { + EL_CUSTOM_125, -1, -1, + IMG_CUSTOM_125 + }, + { + EL_CUSTOM_126, -1, -1, + IMG_CUSTOM_126 + }, + { + EL_CUSTOM_127, -1, -1, + IMG_CUSTOM_127 + }, + { + EL_CUSTOM_128, -1, -1, + IMG_CUSTOM_128 + }, { -1, -1, -1, -1 diff --git a/src/conftime.h b/src/conftime.h index 07d88bf1..14bfe670 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-02-08 11:56]" +#define COMPILE_DATE_STRING "[2003-02-08 17:50]" diff --git a/src/init.c b/src/init.c index 31214f1d..5a97a827 100644 --- a/src/init.c +++ b/src/init.c @@ -30,32 +30,6 @@ #include "conf_esg.c" /* include auto-generated data structure definitions */ -static char *image_filename[NUM_PICTURES] = -{ -#if 0 - "RocksScreen.pcx", - "RocksDoor.pcx", - "RocksToons.pcx", - "RocksFontBig.pcx", - "RocksFontSmall.pcx", - "RocksFontMedium.pcx", - "RocksFontEM.pcx" -#else - "RocksScreen.pcx", - "RocksElements.pcx", - "RocksDoor.pcx", - "RocksHeroes.pcx", - "RocksToons.pcx", - "RocksSP.pcx", - "RocksDC.pcx", - "RocksMore.pcx", - "RocksFontBig.pcx", - "RocksFontSmall.pcx", - "RocksFontMedium.pcx", - "RocksFontEM.pcx" -#endif -}; - static Bitmap *bitmap_font_initial = NULL; static void InitGlobal(); @@ -477,9 +451,17 @@ void FreeTileClipmasks() void InitGfx() { -#if 0 + char *config_token_font_initial = "font.small"; + char *filename_font_initial = NULL; int i; -#endif + + /* determine filename for initial font (for displaying startup messages) */ + for (i=0; image_config[i].token != NULL; i++) + if (strcmp(image_config[i].token, config_token_font_initial) == 0) + filename_font_initial = image_config[i].value; + + if (filename_font_initial == NULL) /* should not happen */ + Error(ERR_EXIT, "cannot get filename for '%s'", config_token_font_initial); /* initialize screen properties */ InitGfxFieldInfo(SX, SY, SXSIZE, SYSIZE, @@ -492,40 +474,15 @@ void InitGfx() bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH); bitmap_db_door = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH); -#if 0 - pix[PIX_FONT_SMALL] = LoadCustomImage(image_filename[PIX_FONT_SMALL]); - - InitFontInfo(NULL, NULL, pix[PIX_FONT_SMALL], NULL); -#else - bitmap_font_initial = LoadCustomImage(image_filename[PIX_FONT_SMALL]); + bitmap_font_initial = LoadCustomImage(filename_font_initial); InitFontInfo(bitmap_font_initial, NULL, NULL, NULL, NULL); -#endif DrawInitText(WINDOW_TITLE_STRING, 20, FC_YELLOW); DrawInitText(WINDOW_SUBTITLE_STRING, 50, FC_RED); DrawInitText("Loading graphics:", 120, FC_GREEN); -#if 0 - for (i=0; i -1; i++) @@ -901,11 +860,18 @@ static void InitElementSoundInfo() /* soon to come */ } -static void set_graphic_parameters(int graphic, int *parameter) +static void set_graphic_parameters(int graphic, char **parameter_raw) { Bitmap *src_bitmap = getBitmapFromImageID(graphic); int num_xtiles = (src_bitmap ? src_bitmap->width : TILEX) / TILEX; int num_ytiles = (src_bitmap ? src_bitmap->height * 2 / 3 : TILEY) / TILEY; + int parameter[NUM_GFX_ARGS]; + int i; + + /* get integer values from string parameters */ + for (i=0; i < NUM_GFX_ARGS; i++) + parameter[i] = + get_parameter_value(image_config_suffix[i].type, parameter_raw[i]); graphic_info[graphic].bitmap = src_bitmap; @@ -1151,8 +1117,16 @@ static void InitGraphicInfo() clipmasks_initialized = TRUE; } -static void set_sound_parameters(int sound, int *parameter) +static void set_sound_parameters(int sound, char **parameter_raw) { + int parameter[NUM_SND_ARGS]; + int i; + + /* get integer values from string parameters */ + for (i=0; i < NUM_SND_ARGS; i++) + parameter[i] = + get_parameter_value(sound_config_suffix[i].type, parameter_raw[i]); + /* explicit loop mode setting in configuration overrides default value */ if (parameter[SND_ARG_MODE_LOOP] != ARG_UNDEFINED_VALUE) sound_info[sound].loop = parameter[SND_ARG_MODE_LOOP]; diff --git a/src/libgame/image.c b/src/libgame/image.c index c77924c9..d6e3013c 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -908,10 +908,6 @@ void CreateImageWithSmallImages(int pos) if (img_info == NULL || img_info->contains_small_images) return; -#if 0 - printf(" creating small image for '%s'\n", img_info->source_filename); -#endif - CreateBitmapWithSmallBitmaps(img_info->bitmap); img_info->contains_small_images = TRUE; diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 75fd4434..3e3f5b71 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -475,6 +475,14 @@ char *getStringToLower(char *s) return s_copy; } +void setString(char **old_value, char *new_value) +{ + if (*old_value != NULL) + free(*old_value); + + *old_value = getStringCopy(new_value); +} + /* ------------------------------------------------------------------------- */ /* command line option handling functions */ @@ -1499,17 +1507,17 @@ boolean FileIsArtworkType(char *basename, int type) /* functions for loading artwork configuration information */ /* ------------------------------------------------------------------------- */ -static void FreeCustomArtworkList(struct ArtworkListInfo *, - struct ListNodeInfo ***, int *); - -static int get_parameter_value(int type, char *value) +int get_parameter_value(int type, char *value) { return (strcmp(value, ARG_UNDEFINED) == 0 ? ARG_UNDEFINED_VALUE : type == TYPE_INTEGER ? get_integer_from_string(value) : type == TYPE_BOOLEAN ? get_boolean_from_string(value) : - -1); + ARG_UNDEFINED_VALUE); } +static void FreeCustomArtworkList(struct ArtworkListInfo *, + struct ListNodeInfo ***, int *); + struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, struct ConfigInfo *suffix_list, int num_file_list_entries) @@ -1517,7 +1525,7 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, struct FileInfo *file_list; int num_file_list_entries_found = 0; int num_suffix_list_entries = 0; - int list_pos = 0; + int list_pos; int i, j; file_list = checked_calloc(num_file_list_entries * sizeof(struct FileInfo)); @@ -1529,46 +1537,31 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, for (i=0; i 0) { - int parameter_array_size = num_suffix_list_entries * sizeof(int); + int parameter_array_size = num_suffix_list_entries * sizeof(char *); file_list[i].default_parameter = checked_calloc(parameter_array_size); file_list[i].parameter = checked_calloc(parameter_array_size); for (j=0; j '%s'\n", - i, config_list[i].token, config_list[i].value); - - len_config_token = strlen(config_list[i].token); - len_config_value = strlen(config_list[i].value); - is_file_entry = TRUE; - -#else int len_config_token = strlen(config_list[i].token); int len_config_value = strlen(config_list[i].value); boolean is_file_entry = TRUE; -#endif for (j=0; suffix_list[j].token != NULL; j++) { @@ -1578,8 +1571,8 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, strcmp(&config_list[i].token[len_config_token - len_suffix], suffix_list[j].token) == 0) { - file_list[list_pos].default_parameter[j] = - get_parameter_value(suffix_list[j].type, config_list[i].value); + setString(&file_list[list_pos].default_parameter[j], + config_list[i].value); is_file_entry = FALSE; break; @@ -1663,17 +1656,13 @@ static void read_token_parameters(struct SetupFileList *setup_file_list, char *known_token_value = KNOWN_TOKEN_VALUE; int i; - if (file_list_entry->filename != NULL) - free(file_list_entry->filename); - if (filename != NULL) { + setString(&file_list_entry->filename, filename); + /* when file definition found, set all parameters to default values */ for (i=0; suffix_list[i].token != NULL; i++) - file_list_entry->parameter[i] = - get_parameter_value(suffix_list[i].type, suffix_list[i].value); - - file_list_entry->filename = getStringCopy(filename); + setString(&file_list_entry->parameter[i], suffix_list[i].value); file_list_entry->redefined = TRUE; @@ -1681,8 +1670,7 @@ static void read_token_parameters(struct SetupFileList *setup_file_list, setTokenValue(setup_file_list, file_list_entry->token, known_token_value); } else - file_list_entry->filename = - getStringCopy(file_list_entry->default_filename); + setString(&file_list_entry->filename, file_list_entry->default_filename); /* check for config tokens that can be build by base token and suffixes */ for (i=0; suffix_list[i].token != NULL; i++) @@ -1692,8 +1680,7 @@ static void read_token_parameters(struct SetupFileList *setup_file_list, if (value != NULL) { - file_list_entry->parameter[i] = - get_parameter_value(suffix_list[i].type, value); + setString(&file_list_entry->parameter[i], value); /* mark config file token as well known from default config */ setTokenValue(setup_file_list, token, known_token_value); @@ -1711,7 +1698,7 @@ static void add_dynamic_file_list_entry(struct FileInfo **list, char *token) { struct FileInfo *new_list_entry; - int parameter_array_size = num_suffix_list_entries * sizeof(int); + int parameter_array_size = num_suffix_list_entries * sizeof(char *); #if 0 if (IS_PARENT_PROCESS()) @@ -1778,12 +1765,10 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info) /* always start with reliable default values */ for (i=0; i src_bitmap->width || src_y + MINI_TILEY > src_bitmap->height) { /* graphic of desired size seems not to be contained in this image; dirty workaround: get it from the middle of the normal sized image */ + printf("::: using dirty workaround for %d (%d, %d)\n", + graphic, src_bitmap->width, src_bitmap->height); + getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y); src_x += (TILEX / 2 - MINI_TILEX / 2); src_y += (TILEY / 2 - MINI_TILEY / 2); } +#endif *bitmap = src_bitmap; *x = src_x;