From: Holger Schemel Date: Tue, 18 Feb 2003 20:03:17 +0000 (+0100) Subject: rnd-20030218-3-src X-Git-Tag: 3.0.0^2~139 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=078d932701464a5152c3889007e5818f87f609c7;p=rocksndiamonds.git rnd-20030218-3-src --- diff --git a/src/conf_chr.c b/src/conf_chr.c index 52940986..72eda551 100644 --- a/src/conf_chr.c +++ b/src/conf_chr.c @@ -1,15 +1,3 @@ -/*********************************************************** -* 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.c * -***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_chr.h b/src/conf_chr.h index 4f8abbc1..9063c7c7 100644 --- a/src/conf_chr.h +++ b/src/conf_chr.h @@ -1,15 +1,3 @@ -/*********************************************************** -* 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 ----- */ diff --git a/src/conf_cus.c b/src/conf_cus.c index d0d10b1b..33deebce 100644 --- a/src/conf_cus.c +++ b/src/conf_cus.c @@ -1,15 +1,3 @@ -/*********************************************************** -* 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.c * -***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_cus.h b/src/conf_cus.h index 425334be..3fa751d6 100644 --- a/src/conf_cus.h +++ b/src/conf_cus.h @@ -1,15 +1,3 @@ -/*********************************************************** -* 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 ----- */ diff --git a/src/conf_e2g.c b/src/conf_e2g.c index 82d0051f..81a18fce 100644 --- a/src/conf_e2g.c +++ b/src/conf_e2g.c @@ -1,15 +1,3 @@ -/*********************************************************** -* 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_e2g.c * -***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ @@ -2221,36 +2209,20 @@ element_to_graphic[] = IMG_INVISIBLE_STEELWALL_VERTICAL }, { - EL_ARROW_BLUE_LEFT, -1, -1, - IMG_ARROW_BLUE_LEFT + EL_ARROW_LEFT, -1, -1, + IMG_ARROW_LEFT }, { - EL_ARROW_BLUE_RIGHT, -1, -1, - IMG_ARROW_BLUE_RIGHT + EL_ARROW_RIGHT, -1, -1, + IMG_ARROW_RIGHT }, { - EL_ARROW_BLUE_UP, -1, -1, - IMG_ARROW_BLUE_UP + EL_ARROW_UP, -1, -1, + IMG_ARROW_UP }, { - EL_ARROW_BLUE_DOWN, -1, -1, - IMG_ARROW_BLUE_DOWN - }, - { - EL_ARROW_RED_LEFT, -1, -1, - IMG_ARROW_RED_LEFT - }, - { - EL_ARROW_RED_RIGHT, -1, -1, - IMG_ARROW_RED_RIGHT - }, - { - EL_ARROW_RED_UP, -1, -1, - IMG_ARROW_RED_UP - }, - { - EL_ARROW_RED_DOWN, -1, -1, - IMG_ARROW_RED_DOWN + EL_ARROW_DOWN, -1, -1, + IMG_ARROW_DOWN }, { EL_DOOR_WHITE, -1, -1, diff --git a/src/conf_esg.c b/src/conf_esg.c index 83ddda90..bd63c25a 100644 --- a/src/conf_esg.c +++ b/src/conf_esg.c @@ -1,15 +1,3 @@ -/*********************************************************** -* 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_esg.c * -***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 830e88d2..8496c637 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -45,6 +45,8 @@ struct ConfigInfo image_config_suffix[] = { ".step_delay", "1", TYPE_INTEGER }, { ".direction", ARG_UNDEFINED, TYPE_STRING }, { ".position", ARG_UNDEFINED, TYPE_STRING }, + { ".draw_xoffset", "0", TYPE_INTEGER }, + { ".draw_yoffset", "0", TYPE_INTEGER }, { ".name", ARG_UNDEFINED, TYPE_STRING }, { NULL, NULL, 0 } @@ -2621,73 +2623,22 @@ struct ConfigInfo image_config[] = { "invisible_steelwall_vertical.EDITOR.xpos", "11" }, { "invisible_steelwall_vertical.EDITOR.ypos", "13" }, - { "arrow_blue.left", "RocksDC.pcx" }, - { "arrow_blue.left.xpos", "8" }, - { "arrow_blue.left.ypos", "8" }, - { "arrow_blue.left.frames", "1" }, - { "arrow_blue.right", "RocksDC.pcx" }, - { "arrow_blue.right.xpos", "9" }, - { "arrow_blue.right.ypos", "8" }, - { "arrow_blue.right.frames", "1" }, - { "arrow_blue.up", "RocksDC.pcx" }, - { "arrow_blue.up.xpos", "10" }, - { "arrow_blue.up.ypos", "8" }, - { "arrow_blue.up.frames", "1" }, - { "arrow_blue.down", "RocksDC.pcx" }, - { "arrow_blue.down.xpos", "11" }, - { "arrow_blue.down.ypos", "8" }, - { "arrow_blue.down.frames", "1" }, - - { "arrow_red.left", "RocksDC.pcx" }, - { "arrow_red.left.xpos", "8" }, - { "arrow_red.left.ypos", "9" }, - { "arrow_red.left.frames", "1" }, - { "arrow_red.right", "RocksDC.pcx" }, - { "arrow_red.right.xpos", "9" }, - { "arrow_red.right.ypos", "9" }, - { "arrow_red.right.frames", "1" }, - { "arrow_red.up", "RocksDC.pcx" }, - { "arrow_red.up.xpos", "10" }, - { "arrow_red.up.ypos", "9" }, - { "arrow_red.up.frames", "1" }, - { "arrow_red.down", "RocksDC.pcx" }, - { "arrow_red.down.xpos", "11" }, - { "arrow_red.down.ypos", "9" }, - { "arrow_red.down.frames", "1" }, - - { "ball_red", "RocksElements.pcx" }, - { "ball_red.xpos", "12" }, - { "ball_red.ypos", "8" }, - { "ball_red.frames", "1" }, - { "ball_blue", "RocksElements.pcx" }, - { "ball_blue.xpos", "13" }, - { "ball_blue.ypos", "8" }, - { "ball_blue.frames", "1" }, - { "ball_yellow", "RocksElements.pcx" }, - { "ball_yellow.xpos", "14" }, - { "ball_yellow.ypos", "8" }, - { "ball_yellow.frames", "1" }, - { "ball_gray", "RocksElements.pcx" }, - { "ball_gray.xpos", "15" }, - { "ball_gray.ypos", "8" }, - { "ball_gray.frames", "1" }, - - { "scrollbar_blue", "RocksDC.pcx" }, - { "scrollbar_blue.xpos", "8" }, - { "scrollbar_blue.ypos", "10" }, - { "scrollbar_blue.frames", "1" }, - { "scrollbar_red", "RocksDC.pcx" }, - { "scrollbar_red.xpos", "9" }, - { "scrollbar_red.ypos", "10" }, - { "scrollbar_red.frames", "1" }, - { "scrollbar_green", "RocksDC.pcx" }, - { "scrollbar_green.xpos", "10" }, - { "scrollbar_green.ypos", "10" }, - { "scrollbar_green.frames", "1" }, - { "scrollbar_yellow", "RocksDC.pcx" }, - { "scrollbar_yellow.xpos", "11" }, - { "scrollbar_yellow.ypos", "10" }, - { "scrollbar_yellow.frames", "1" }, + { "arrow_left", "RocksDC.pcx" }, + { "arrow_left.xpos", "8" }, + { "arrow_left.ypos", "8" }, + { "arrow_left.frames", "1" }, + { "arrow_right", "RocksDC.pcx" }, + { "arrow_right.xpos", "9" }, + { "arrow_right.ypos", "8" }, + { "arrow_right.frames", "1" }, + { "arrow_up", "RocksDC.pcx" }, + { "arrow_up.xpos", "10" }, + { "arrow_up.ypos", "8" }, + { "arrow_up.frames", "1" }, + { "arrow_down", "RocksDC.pcx" }, + { "arrow_down.xpos", "11" }, + { "arrow_down.ypos", "8" }, + { "arrow_down.frames", "1" }, #include "conf_chr.c" /* include auto-generated data structure definitions */ #include "conf_cus.c" /* include auto-generated data structure definitions */ @@ -2881,27 +2832,183 @@ struct ConfigInfo image_config[] = { "toon_20.direction", "down" }, { "toon_20.position", "any" }, - { "global.num_toons", "20" }, + { "menu.calibrate_red", "RocksElements.pcx" }, + { "menu.calibrate_red.xpos", "12" }, + { "menu.calibrate_red.ypos", "8" }, + { "menu.calibrate_red.frames", "1" }, + { "menu.calibrate_blue", "RocksElements.pcx" }, + { "menu.calibrate_blue.xpos", "13" }, + { "menu.calibrate_blue.ypos", "8" }, + { "menu.calibrate_blue.frames", "1" }, + { "menu.calibrate_yellow", "RocksElements.pcx" }, + { "menu.calibrate_yellow.xpos", "14" }, + { "menu.calibrate_yellow.ypos", "8" }, + { "menu.calibrate_yellow.frames", "1" }, + + { "menu.button", "RocksElements.pcx" }, + { "menu.button.xpos", "13" }, + { "menu.button.ypos", "8" }, + { "menu.button.frames", "1" }, + { "menu.button.active", "RocksElements.pcx" }, + { "menu.button.active.xpos", "12" }, + { "menu.button.active.ypos", "8" }, + { "menu.button.active.frames", "1" }, + + { "menu.button_left", "RocksDC.pcx" }, + { "menu.button_left.xpos", "8" }, + { "menu.button_left.ypos", "8" }, + { "menu.button_left.frames", "1" }, + { "menu.button_right", "RocksDC.pcx" }, + { "menu.button_right.xpos", "9" }, + { "menu.button_right.ypos", "8" }, + { "menu.button_right.frames", "1" }, + { "menu.button_up", "RocksDC.pcx" }, + { "menu.button_up.xpos", "10" }, + { "menu.button_up.ypos", "8" }, + { "menu.button_up.frames", "1" }, + { "menu.button_down", "RocksDC.pcx" }, + { "menu.button_down.xpos", "11" }, + { "menu.button_down.ypos", "8" }, + { "menu.button_down.frames", "1" }, + { "menu.button_left.active", "RocksDC.pcx" }, + { "menu.button_left.active.xpos", "8" }, + { "menu.button_left.active.ypos", "9" }, + { "menu.button_left.active.frames", "1" }, + { "menu.button_right.active", "RocksDC.pcx" }, + { "menu.button_right.active.xpos", "9" }, + { "menu.button_right.active.ypos", "9" }, + { "menu.button_right.active.frames", "1" }, + { "menu.button_up.active", "RocksDC.pcx" }, + { "menu.button_up.active.xpos", "10" }, + { "menu.button_up.active.ypos", "9" }, + { "menu.button_up.active.frames", "1" }, + { "menu.button_down.active", "RocksDC.pcx" }, + { "menu.button_down.active.xpos", "11" }, + { "menu.button_down.active.ypos", "9" }, + { "menu.button_down.active.frames", "1" }, + + { "menu.scrollbar", "RocksDC.pcx" }, + { "menu.scrollbar.xpos", "8" }, + { "menu.scrollbar.ypos", "10" }, + { "menu.scrollbar.frames", "1" }, + { "menu.scrollbar.active", "RocksDC.pcx" }, + { "menu.scrollbar.active.xpos", "9" }, + { "menu.scrollbar.active.ypos", "10" }, + { "menu.scrollbar.active.frames", "1" }, + + { "font.initial_1", "RocksFontSmall.pcx" }, + { "font.initial_1.x", "0" }, + { "font.initial_1.y", "0" }, + { "font.initial_1.width", "14" }, + { "font.initial_1.height", "14" }, + { "font.initial_2", "RocksFontSmall.pcx" }, + { "font.initial_2.x", "0" }, + { "font.initial_2.y", "56" }, + { "font.initial_2.width", "14" }, + { "font.initial_2.height", "14" }, + { "font.initial_3", "RocksFontSmall.pcx" }, + { "font.initial_3.x", "0" }, + { "font.initial_3.y", "112" }, + { "font.initial_3.width", "14" }, + { "font.initial_3.height", "14" }, + { "font.initial_4", "RocksFontSmall.pcx" }, + { "font.initial_4.x", "0" }, + { "font.initial_4.y", "168" }, + { "font.initial_4.width", "14" }, + { "font.initial_4.height", "14" }, + + { "font.big_1", "RocksFontBig.pcx" }, + { "font.big_1.x", "0" }, + { "font.big_1.y", "0" }, + { "font.big_1.width", "32" }, + { "font.big_1.height", "32" }, + { "font.big_2", "RocksFontBig.pcx" }, + { "font.big_2.x", "0" }, + { "font.big_2.y", "128" }, + { "font.big_2.width", "32" }, + { "font.big_2.height", "32" }, + { "font.big_3", "RocksFontBig.pcx" }, + { "font.big_3.x", "0" }, + { "font.big_3.y", "256" }, + { "font.big_3.width", "32" }, + { "font.big_3.height", "32" }, + { "font.big_4", "RocksFontBig.pcx" }, + { "font.big_4.x", "0" }, + { "font.big_4.y", "384" }, + { "font.big_4.width", "32" }, + { "font.big_4.height", "32" }, + + { "font.medium_1", "RocksFontMedium.pcx" }, + { "font.medium_1.x", "0" }, + { "font.medium_1.y", "0" }, + { "font.medium_1.width", "16" }, + { "font.medium_1.height", "32" }, + { "font.medium_2", "RocksFontMedium.pcx" }, + { "font.medium_2.x", "0" }, + { "font.medium_2.y", "128" }, + { "font.medium_2.width", "16" }, + { "font.medium_2.height", "32" }, + { "font.medium_3", "RocksFontMedium.pcx" }, + { "font.medium_3.x", "0" }, + { "font.medium_3.y", "256" }, + { "font.medium_3.width", "16" }, + { "font.medium_3.height", "32" }, + { "font.medium_4", "RocksFontMedium.pcx" }, + { "font.medium_4.x", "0" }, + { "font.medium_4.y", "384" }, + { "font.medium_4.width", "16" }, + { "font.medium_4.height", "32" }, + + { "font.small_1", "RocksFontSmall.pcx" }, + { "font.small_1.x", "0" }, + { "font.small_1.y", "0" }, + { "font.small_1.width", "14" }, + { "font.small_1.height", "14" }, + { "font.small_2", "RocksFontSmall.pcx" }, + { "font.small_2.x", "0" }, + { "font.small_2.y", "56" }, + { "font.small_2.width", "14" }, + { "font.small_2.height", "14" }, + { "font.small_3", "RocksFontSmall.pcx" }, + { "font.small_3.x", "0" }, + { "font.small_3.y", "112" }, + { "font.small_3.width", "14" }, + { "font.small_3.height", "14" }, + { "font.small_4", "RocksFontSmall.pcx" }, + { "font.small_4.x", "0" }, + { "font.small_4.y", "168" }, + { "font.small_4.width", "14" }, + { "font.small_4.height", "14" }, + + { "font.tape", "RocksFontSmall.pcx" }, + { "font.tape.x", "0" }, + { "font.tape.y", "224" }, + { "font.tape.width", "11" }, + { "font.tape.height", "14" }, + + { "font.game", "RocksFontEM.pcx" }, + { "font.game.x", "0" }, + { "font.game.y", "160" }, + { "font.game.width", "16" }, + { "font.game.height", "16" }, + + { "font.narrow", "RocksFontSmall.pcx" }, + { "font.narrow.x", "0" }, + { "font.narrow.y", "280" }, + { "font.narrow.width", "10" }, + { "font.narrow.height", "14" }, { "global.border", "RocksScreen.pcx" }, { "global.door", "RocksDoor.pcx" }, - { "menu.main.hide_static_text", "false" }, - - { "font.big", "RocksFontBig.pcx" }, - { "font.medium", "RocksFontMedium.pcx" }, - { "font.small", "RocksFontSmall.pcx" }, - { "font.em", "RocksFontEM.pcx" }, - - { "background.default", UNDEFINED_FILENAME }, - { "background.door", UNDEFINED_FILENAME }, + { "background", UNDEFINED_FILENAME }, { "background.main", UNDEFINED_FILENAME }, - { "background.level_series", UNDEFINED_FILENAME }, - { "background.hall_of_fame", UNDEFINED_FILENAME }, - { "background.editor_settings_level", UNDEFINED_FILENAME }, - { "background.editor_settings_element", UNDEFINED_FILENAME }, + { "background.levels", UNDEFINED_FILENAME }, + { "background.scores", UNDEFINED_FILENAME }, + { "background.editor", UNDEFINED_FILENAME }, { "background.info", UNDEFINED_FILENAME }, { "background.setup", UNDEFINED_FILENAME }, + { "background.door", UNDEFINED_FILENAME }, { "info.font_em_1", "RocksFontEM.pcx" }, { "info.font_em_1.xpos", "0" }, @@ -2929,5 +3036,12 @@ struct ConfigInfo image_config[] = { "info.font_em_5.frames", "4" }, { "info.font_em_5.delay", "10" }, + /* the following directives are not associated with an image, + but make sense to be defined in "graphicsinfo.conf", too */ + + { "global.num_toons", "20" }, + + { "menu.main.hide_static_text", "false" }, + { NULL, NULL } }; diff --git a/src/conf_gfx.h b/src/conf_gfx.h index 9244c8dd..cd81afd0 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1,15 +1,3 @@ -/*********************************************************** -* 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_gfx.h * -***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ @@ -573,259 +561,276 @@ #define IMG_INVISIBLE_STEELWALL_BOTTOMRIGHT_EDITOR 552 #define IMG_INVISIBLE_STEELWALL_HORIZONTAL_EDITOR 553 #define IMG_INVISIBLE_STEELWALL_VERTICAL_EDITOR 554 -#define IMG_ARROW_BLUE_LEFT 555 -#define IMG_ARROW_BLUE_RIGHT 556 -#define IMG_ARROW_BLUE_UP 557 -#define IMG_ARROW_BLUE_DOWN 558 -#define IMG_ARROW_RED_LEFT 559 -#define IMG_ARROW_RED_RIGHT 560 -#define IMG_ARROW_RED_UP 561 -#define IMG_ARROW_RED_DOWN 562 -#define IMG_BALL_RED 563 -#define IMG_BALL_BLUE 564 -#define IMG_BALL_YELLOW 565 -#define IMG_BALL_GRAY 566 -#define IMG_SCROLLBAR_BLUE 567 -#define IMG_SCROLLBAR_RED 568 -#define IMG_SCROLLBAR_GREEN 569 -#define IMG_SCROLLBAR_YELLOW 570 -#define IMG_CHAR_SPACE 571 -#define IMG_CHAR_EXCLAM 572 -#define IMG_CHAR_QUOTEDBL 573 -#define IMG_CHAR_NUMBERSIGN 574 -#define IMG_CHAR_DOLLAR 575 -#define IMG_CHAR_PROCENT 576 -#define IMG_CHAR_AMPERSAND 577 -#define IMG_CHAR_APOSTROPHE 578 -#define IMG_CHAR_PARENLEFT 579 -#define IMG_CHAR_PARENRIGHT 580 -#define IMG_CHAR_ASTERISK 581 -#define IMG_CHAR_PLUS 582 -#define IMG_CHAR_COMMA 583 -#define IMG_CHAR_MINUS 584 -#define IMG_CHAR_PERIOD 585 -#define IMG_CHAR_SLASH 586 -#define IMG_CHAR_0 587 -#define IMG_CHAR_1 588 -#define IMG_CHAR_2 589 -#define IMG_CHAR_3 590 -#define IMG_CHAR_4 591 -#define IMG_CHAR_5 592 -#define IMG_CHAR_6 593 -#define IMG_CHAR_7 594 -#define IMG_CHAR_8 595 -#define IMG_CHAR_9 596 -#define IMG_CHAR_COLON 597 -#define IMG_CHAR_SEMICOLON 598 -#define IMG_CHAR_LESS 599 -#define IMG_CHAR_EQUAL 600 -#define IMG_CHAR_GREATER 601 -#define IMG_CHAR_QUESTION 602 -#define IMG_CHAR_AT 603 -#define IMG_CHAR_A 604 -#define IMG_CHAR_B 605 -#define IMG_CHAR_C 606 -#define IMG_CHAR_D 607 -#define IMG_CHAR_E 608 -#define IMG_CHAR_F 609 -#define IMG_CHAR_G 610 -#define IMG_CHAR_H 611 -#define IMG_CHAR_I 612 -#define IMG_CHAR_J 613 -#define IMG_CHAR_K 614 -#define IMG_CHAR_L 615 -#define IMG_CHAR_M 616 -#define IMG_CHAR_N 617 -#define IMG_CHAR_O 618 -#define IMG_CHAR_P 619 -#define IMG_CHAR_Q 620 -#define IMG_CHAR_R 621 -#define IMG_CHAR_S 622 -#define IMG_CHAR_T 623 -#define IMG_CHAR_U 624 -#define IMG_CHAR_V 625 -#define IMG_CHAR_W 626 -#define IMG_CHAR_X 627 -#define IMG_CHAR_Y 628 -#define IMG_CHAR_Z 629 -#define IMG_CHAR_AE 630 -#define IMG_CHAR_OE 631 -#define IMG_CHAR_UE 632 -#define IMG_CHAR_COPYRIGHT 633 -#define IMG_CHAR_UNDERSCORE 634 -#define IMG_CHAR_EMPTY 635 -#define IMG_CHAR_DEGREE 636 -#define IMG_CHAR_TM 637 -#define IMG_CHAR_CURSOR 638 -#define IMG_CUSTOM_1 639 -#define IMG_CUSTOM_2 640 -#define IMG_CUSTOM_3 641 -#define IMG_CUSTOM_4 642 -#define IMG_CUSTOM_5 643 -#define IMG_CUSTOM_6 644 -#define IMG_CUSTOM_7 645 -#define IMG_CUSTOM_8 646 -#define IMG_CUSTOM_9 647 -#define IMG_CUSTOM_10 648 -#define IMG_CUSTOM_11 649 -#define IMG_CUSTOM_12 650 -#define IMG_CUSTOM_13 651 -#define IMG_CUSTOM_14 652 -#define IMG_CUSTOM_15 653 -#define IMG_CUSTOM_16 654 -#define IMG_CUSTOM_17 655 -#define IMG_CUSTOM_18 656 -#define IMG_CUSTOM_19 657 -#define IMG_CUSTOM_20 658 -#define IMG_CUSTOM_21 659 -#define IMG_CUSTOM_22 660 -#define IMG_CUSTOM_23 661 -#define IMG_CUSTOM_24 662 -#define IMG_CUSTOM_25 663 -#define IMG_CUSTOM_26 664 -#define IMG_CUSTOM_27 665 -#define IMG_CUSTOM_28 666 -#define IMG_CUSTOM_29 667 -#define IMG_CUSTOM_30 668 -#define IMG_CUSTOM_31 669 -#define IMG_CUSTOM_32 670 -#define IMG_CUSTOM_33 671 -#define IMG_CUSTOM_34 672 -#define IMG_CUSTOM_35 673 -#define IMG_CUSTOM_36 674 -#define IMG_CUSTOM_37 675 -#define IMG_CUSTOM_38 676 -#define IMG_CUSTOM_39 677 -#define IMG_CUSTOM_40 678 -#define IMG_CUSTOM_41 679 -#define IMG_CUSTOM_42 680 -#define IMG_CUSTOM_43 681 -#define IMG_CUSTOM_44 682 -#define IMG_CUSTOM_45 683 -#define IMG_CUSTOM_46 684 -#define IMG_CUSTOM_47 685 -#define IMG_CUSTOM_48 686 -#define IMG_CUSTOM_49 687 -#define IMG_CUSTOM_50 688 -#define IMG_CUSTOM_51 689 -#define IMG_CUSTOM_52 690 -#define IMG_CUSTOM_53 691 -#define IMG_CUSTOM_54 692 -#define IMG_CUSTOM_55 693 -#define IMG_CUSTOM_56 694 -#define IMG_CUSTOM_57 695 -#define IMG_CUSTOM_58 696 -#define IMG_CUSTOM_59 697 -#define IMG_CUSTOM_60 698 -#define IMG_CUSTOM_61 699 -#define IMG_CUSTOM_62 700 -#define IMG_CUSTOM_63 701 -#define IMG_CUSTOM_64 702 -#define IMG_CUSTOM_65 703 -#define IMG_CUSTOM_66 704 -#define IMG_CUSTOM_67 705 -#define IMG_CUSTOM_68 706 -#define IMG_CUSTOM_69 707 -#define IMG_CUSTOM_70 708 -#define IMG_CUSTOM_71 709 -#define IMG_CUSTOM_72 710 -#define IMG_CUSTOM_73 711 -#define IMG_CUSTOM_74 712 -#define IMG_CUSTOM_75 713 -#define IMG_CUSTOM_76 714 -#define IMG_CUSTOM_77 715 -#define IMG_CUSTOM_78 716 -#define IMG_CUSTOM_79 717 -#define IMG_CUSTOM_80 718 -#define IMG_CUSTOM_81 719 -#define IMG_CUSTOM_82 720 -#define IMG_CUSTOM_83 721 -#define IMG_CUSTOM_84 722 -#define IMG_CUSTOM_85 723 -#define IMG_CUSTOM_86 724 -#define IMG_CUSTOM_87 725 -#define IMG_CUSTOM_88 726 -#define IMG_CUSTOM_89 727 -#define IMG_CUSTOM_90 728 -#define IMG_CUSTOM_91 729 -#define IMG_CUSTOM_92 730 -#define IMG_CUSTOM_93 731 -#define IMG_CUSTOM_94 732 -#define IMG_CUSTOM_95 733 -#define IMG_CUSTOM_96 734 -#define IMG_CUSTOM_97 735 -#define IMG_CUSTOM_98 736 -#define IMG_CUSTOM_99 737 -#define IMG_CUSTOM_100 738 -#define IMG_CUSTOM_101 739 -#define IMG_CUSTOM_102 740 -#define IMG_CUSTOM_103 741 -#define IMG_CUSTOM_104 742 -#define IMG_CUSTOM_105 743 -#define IMG_CUSTOM_106 744 -#define IMG_CUSTOM_107 745 -#define IMG_CUSTOM_108 746 -#define IMG_CUSTOM_109 747 -#define IMG_CUSTOM_110 748 -#define IMG_CUSTOM_111 749 -#define IMG_CUSTOM_112 750 -#define IMG_CUSTOM_113 751 -#define IMG_CUSTOM_114 752 -#define IMG_CUSTOM_115 753 -#define IMG_CUSTOM_116 754 -#define IMG_CUSTOM_117 755 -#define IMG_CUSTOM_118 756 -#define IMG_CUSTOM_119 757 -#define IMG_CUSTOM_120 758 -#define IMG_CUSTOM_121 759 -#define IMG_CUSTOM_122 760 -#define IMG_CUSTOM_123 761 -#define IMG_CUSTOM_124 762 -#define IMG_CUSTOM_125 763 -#define IMG_CUSTOM_126 764 -#define IMG_CUSTOM_127 765 -#define IMG_CUSTOM_128 766 -#define IMG_TOON_1 767 -#define IMG_TOON_2 768 -#define IMG_TOON_3 769 -#define IMG_TOON_4 770 -#define IMG_TOON_5 771 -#define IMG_TOON_6 772 -#define IMG_TOON_7 773 -#define IMG_TOON_8 774 -#define IMG_TOON_9 775 -#define IMG_TOON_10 776 -#define IMG_TOON_11 777 -#define IMG_TOON_12 778 -#define IMG_TOON_13 779 -#define IMG_TOON_14 780 -#define IMG_TOON_15 781 -#define IMG_TOON_16 782 -#define IMG_TOON_17 783 -#define IMG_TOON_18 784 -#define IMG_TOON_19 785 -#define IMG_TOON_20 786 -#define IMG_GLOBAL_BORDER 787 -#define IMG_GLOBAL_DOOR 788 -#define IMG_FONT_BIG 789 -#define IMG_FONT_MEDIUM 790 -#define IMG_FONT_SMALL 791 -#define IMG_FONT_EM 792 -#define IMG_BACKGROUND_DEFAULT 793 -#define IMG_BACKGROUND_DOOR 794 -#define IMG_BACKGROUND_MAIN 795 -#define IMG_BACKGROUND_LEVEL_SERIES 796 -#define IMG_BACKGROUND_HALL_OF_FAME 797 -#define IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL 798 -#define IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT 799 -#define IMG_BACKGROUND_INFO 800 -#define IMG_BACKGROUND_SETUP 801 -#define IMG_INFO_FONT_EM_1 802 -#define IMG_INFO_FONT_EM_2 803 -#define IMG_INFO_FONT_EM_3 804 -#define IMG_INFO_FONT_EM_4 805 -#define IMG_INFO_FONT_EM_5 806 +#define IMG_ARROW_LEFT 555 +#define IMG_ARROW_RIGHT 556 +#define IMG_ARROW_UP 557 +#define IMG_ARROW_DOWN 558 +#define IMG_CHAR_SPACE 559 +#define IMG_CHAR_EXCLAM 560 +#define IMG_CHAR_QUOTEDBL 561 +#define IMG_CHAR_NUMBERSIGN 562 +#define IMG_CHAR_DOLLAR 563 +#define IMG_CHAR_PROCENT 564 +#define IMG_CHAR_AMPERSAND 565 +#define IMG_CHAR_APOSTROPHE 566 +#define IMG_CHAR_PARENLEFT 567 +#define IMG_CHAR_PARENRIGHT 568 +#define IMG_CHAR_ASTERISK 569 +#define IMG_CHAR_PLUS 570 +#define IMG_CHAR_COMMA 571 +#define IMG_CHAR_MINUS 572 +#define IMG_CHAR_PERIOD 573 +#define IMG_CHAR_SLASH 574 +#define IMG_CHAR_0 575 +#define IMG_CHAR_1 576 +#define IMG_CHAR_2 577 +#define IMG_CHAR_3 578 +#define IMG_CHAR_4 579 +#define IMG_CHAR_5 580 +#define IMG_CHAR_6 581 +#define IMG_CHAR_7 582 +#define IMG_CHAR_8 583 +#define IMG_CHAR_9 584 +#define IMG_CHAR_COLON 585 +#define IMG_CHAR_SEMICOLON 586 +#define IMG_CHAR_LESS 587 +#define IMG_CHAR_EQUAL 588 +#define IMG_CHAR_GREATER 589 +#define IMG_CHAR_QUESTION 590 +#define IMG_CHAR_AT 591 +#define IMG_CHAR_A 592 +#define IMG_CHAR_B 593 +#define IMG_CHAR_C 594 +#define IMG_CHAR_D 595 +#define IMG_CHAR_E 596 +#define IMG_CHAR_F 597 +#define IMG_CHAR_G 598 +#define IMG_CHAR_H 599 +#define IMG_CHAR_I 600 +#define IMG_CHAR_J 601 +#define IMG_CHAR_K 602 +#define IMG_CHAR_L 603 +#define IMG_CHAR_M 604 +#define IMG_CHAR_N 605 +#define IMG_CHAR_O 606 +#define IMG_CHAR_P 607 +#define IMG_CHAR_Q 608 +#define IMG_CHAR_R 609 +#define IMG_CHAR_S 610 +#define IMG_CHAR_T 611 +#define IMG_CHAR_U 612 +#define IMG_CHAR_V 613 +#define IMG_CHAR_W 614 +#define IMG_CHAR_X 615 +#define IMG_CHAR_Y 616 +#define IMG_CHAR_Z 617 +#define IMG_CHAR_AE 618 +#define IMG_CHAR_OE 619 +#define IMG_CHAR_UE 620 +#define IMG_CHAR_COPYRIGHT 621 +#define IMG_CHAR_UNDERSCORE 622 +#define IMG_CHAR_EMPTY 623 +#define IMG_CHAR_DEGREE 624 +#define IMG_CHAR_TM 625 +#define IMG_CHAR_CURSOR 626 +#define IMG_CUSTOM_1 627 +#define IMG_CUSTOM_2 628 +#define IMG_CUSTOM_3 629 +#define IMG_CUSTOM_4 630 +#define IMG_CUSTOM_5 631 +#define IMG_CUSTOM_6 632 +#define IMG_CUSTOM_7 633 +#define IMG_CUSTOM_8 634 +#define IMG_CUSTOM_9 635 +#define IMG_CUSTOM_10 636 +#define IMG_CUSTOM_11 637 +#define IMG_CUSTOM_12 638 +#define IMG_CUSTOM_13 639 +#define IMG_CUSTOM_14 640 +#define IMG_CUSTOM_15 641 +#define IMG_CUSTOM_16 642 +#define IMG_CUSTOM_17 643 +#define IMG_CUSTOM_18 644 +#define IMG_CUSTOM_19 645 +#define IMG_CUSTOM_20 646 +#define IMG_CUSTOM_21 647 +#define IMG_CUSTOM_22 648 +#define IMG_CUSTOM_23 649 +#define IMG_CUSTOM_24 650 +#define IMG_CUSTOM_25 651 +#define IMG_CUSTOM_26 652 +#define IMG_CUSTOM_27 653 +#define IMG_CUSTOM_28 654 +#define IMG_CUSTOM_29 655 +#define IMG_CUSTOM_30 656 +#define IMG_CUSTOM_31 657 +#define IMG_CUSTOM_32 658 +#define IMG_CUSTOM_33 659 +#define IMG_CUSTOM_34 660 +#define IMG_CUSTOM_35 661 +#define IMG_CUSTOM_36 662 +#define IMG_CUSTOM_37 663 +#define IMG_CUSTOM_38 664 +#define IMG_CUSTOM_39 665 +#define IMG_CUSTOM_40 666 +#define IMG_CUSTOM_41 667 +#define IMG_CUSTOM_42 668 +#define IMG_CUSTOM_43 669 +#define IMG_CUSTOM_44 670 +#define IMG_CUSTOM_45 671 +#define IMG_CUSTOM_46 672 +#define IMG_CUSTOM_47 673 +#define IMG_CUSTOM_48 674 +#define IMG_CUSTOM_49 675 +#define IMG_CUSTOM_50 676 +#define IMG_CUSTOM_51 677 +#define IMG_CUSTOM_52 678 +#define IMG_CUSTOM_53 679 +#define IMG_CUSTOM_54 680 +#define IMG_CUSTOM_55 681 +#define IMG_CUSTOM_56 682 +#define IMG_CUSTOM_57 683 +#define IMG_CUSTOM_58 684 +#define IMG_CUSTOM_59 685 +#define IMG_CUSTOM_60 686 +#define IMG_CUSTOM_61 687 +#define IMG_CUSTOM_62 688 +#define IMG_CUSTOM_63 689 +#define IMG_CUSTOM_64 690 +#define IMG_CUSTOM_65 691 +#define IMG_CUSTOM_66 692 +#define IMG_CUSTOM_67 693 +#define IMG_CUSTOM_68 694 +#define IMG_CUSTOM_69 695 +#define IMG_CUSTOM_70 696 +#define IMG_CUSTOM_71 697 +#define IMG_CUSTOM_72 698 +#define IMG_CUSTOM_73 699 +#define IMG_CUSTOM_74 700 +#define IMG_CUSTOM_75 701 +#define IMG_CUSTOM_76 702 +#define IMG_CUSTOM_77 703 +#define IMG_CUSTOM_78 704 +#define IMG_CUSTOM_79 705 +#define IMG_CUSTOM_80 706 +#define IMG_CUSTOM_81 707 +#define IMG_CUSTOM_82 708 +#define IMG_CUSTOM_83 709 +#define IMG_CUSTOM_84 710 +#define IMG_CUSTOM_85 711 +#define IMG_CUSTOM_86 712 +#define IMG_CUSTOM_87 713 +#define IMG_CUSTOM_88 714 +#define IMG_CUSTOM_89 715 +#define IMG_CUSTOM_90 716 +#define IMG_CUSTOM_91 717 +#define IMG_CUSTOM_92 718 +#define IMG_CUSTOM_93 719 +#define IMG_CUSTOM_94 720 +#define IMG_CUSTOM_95 721 +#define IMG_CUSTOM_96 722 +#define IMG_CUSTOM_97 723 +#define IMG_CUSTOM_98 724 +#define IMG_CUSTOM_99 725 +#define IMG_CUSTOM_100 726 +#define IMG_CUSTOM_101 727 +#define IMG_CUSTOM_102 728 +#define IMG_CUSTOM_103 729 +#define IMG_CUSTOM_104 730 +#define IMG_CUSTOM_105 731 +#define IMG_CUSTOM_106 732 +#define IMG_CUSTOM_107 733 +#define IMG_CUSTOM_108 734 +#define IMG_CUSTOM_109 735 +#define IMG_CUSTOM_110 736 +#define IMG_CUSTOM_111 737 +#define IMG_CUSTOM_112 738 +#define IMG_CUSTOM_113 739 +#define IMG_CUSTOM_114 740 +#define IMG_CUSTOM_115 741 +#define IMG_CUSTOM_116 742 +#define IMG_CUSTOM_117 743 +#define IMG_CUSTOM_118 744 +#define IMG_CUSTOM_119 745 +#define IMG_CUSTOM_120 746 +#define IMG_CUSTOM_121 747 +#define IMG_CUSTOM_122 748 +#define IMG_CUSTOM_123 749 +#define IMG_CUSTOM_124 750 +#define IMG_CUSTOM_125 751 +#define IMG_CUSTOM_126 752 +#define IMG_CUSTOM_127 753 +#define IMG_CUSTOM_128 754 +#define IMG_TOON_1 755 +#define IMG_TOON_2 756 +#define IMG_TOON_3 757 +#define IMG_TOON_4 758 +#define IMG_TOON_5 759 +#define IMG_TOON_6 760 +#define IMG_TOON_7 761 +#define IMG_TOON_8 762 +#define IMG_TOON_9 763 +#define IMG_TOON_10 764 +#define IMG_TOON_11 765 +#define IMG_TOON_12 766 +#define IMG_TOON_13 767 +#define IMG_TOON_14 768 +#define IMG_TOON_15 769 +#define IMG_TOON_16 770 +#define IMG_TOON_17 771 +#define IMG_TOON_18 772 +#define IMG_TOON_19 773 +#define IMG_TOON_20 774 +#define IMG_MENU_CALIBRATE_RED 775 +#define IMG_MENU_CALIBRATE_BLUE 776 +#define IMG_MENU_CALIBRATE_YELLOW 777 +#define IMG_MENU_BUTTON 778 +#define IMG_MENU_BUTTON_ACTIVE 779 +#define IMG_MENU_BUTTON_LEFT 780 +#define IMG_MENU_BUTTON_RIGHT 781 +#define IMG_MENU_BUTTON_UP 782 +#define IMG_MENU_BUTTON_DOWN 783 +#define IMG_MENU_BUTTON_LEFT_ACTIVE 784 +#define IMG_MENU_BUTTON_RIGHT_ACTIVE 785 +#define IMG_MENU_BUTTON_UP_ACTIVE 786 +#define IMG_MENU_BUTTON_DOWN_ACTIVE 787 +#define IMG_MENU_SCROLLBAR 788 +#define IMG_MENU_SCROLLBAR_ACTIVE 789 +#define IMG_FONT_INITIAL_1 790 +#define IMG_FONT_INITIAL_2 791 +#define IMG_FONT_INITIAL_3 792 +#define IMG_FONT_INITIAL_4 793 +#define IMG_FONT_BIG_1 794 +#define IMG_FONT_BIG_2 795 +#define IMG_FONT_BIG_3 796 +#define IMG_FONT_BIG_4 797 +#define IMG_FONT_MEDIUM_1 798 +#define IMG_FONT_MEDIUM_2 799 +#define IMG_FONT_MEDIUM_3 800 +#define IMG_FONT_MEDIUM_4 801 +#define IMG_FONT_SMALL_1 802 +#define IMG_FONT_SMALL_2 803 +#define IMG_FONT_SMALL_3 804 +#define IMG_FONT_SMALL_4 805 +#define IMG_FONT_TAPE 806 +#define IMG_FONT_GAME 807 +#define IMG_FONT_NARROW 808 +#define IMG_GLOBAL_BORDER 809 +#define IMG_GLOBAL_DOOR 810 +#define IMG_BACKGROUND 811 +#define IMG_BACKGROUND_MAIN 812 +#define IMG_BACKGROUND_LEVELS 813 +#define IMG_BACKGROUND_SCORES 814 +#define IMG_BACKGROUND_EDITOR 815 +#define IMG_BACKGROUND_INFO 816 +#define IMG_BACKGROUND_SETUP 817 +#define IMG_BACKGROUND_DOOR 818 +#define IMG_INFO_FONT_EM_1 819 +#define IMG_INFO_FONT_EM_2 820 +#define IMG_INFO_FONT_EM_3 821 +#define IMG_INFO_FONT_EM_4 822 +#define IMG_INFO_FONT_EM_5 823 -#define NUM_IMAGE_FILES 807 +#define NUM_IMAGE_FILES 824 #endif /* CONF_GFX_H */ diff --git a/src/conf_snd.h b/src/conf_snd.h index 60ea119f..d5104cb3 100644 --- a/src/conf_snd.h +++ b/src/conf_snd.h @@ -1,15 +1,3 @@ -/*********************************************************** -* 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_snd.h * -***********************************************************/ /* ----- this file was automatically generated -- do not edit by hand ----- */ diff --git a/src/conftime.h b/src/conftime.h index 6e6a198c..1e331afe 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-02-17 00:43]" +#define COMPILE_DATE_STRING "[2003-02-18 21:01]" diff --git a/src/editor.c b/src/editor.c index 0b62ca19..2be95775 100644 --- a/src/editor.c +++ b/src/editor.c @@ -394,7 +394,6 @@ #define INFOTEXT_YPOS (SY + SYSIZE - MINI_TILEX + 2) #define INFOTEXT_XSIZE SXSIZE #define INFOTEXT_YSIZE MINI_TILEX -#define MAX_INFOTEXT_LEN (SXSIZE / FONT2_XSIZE) static struct { @@ -402,28 +401,28 @@ static struct char *text; } control_info[ED_NUM_CTRL_BUTTONS] = { - { 's', "draw single items" }, - { 'd', "draw connected items" }, - { 'l', "draw lines" }, - { 'a', "draw arcs" }, - { 'r', "draw outline rectangles" }, - { 'R', "draw filled rectangles" }, - { '\0', "wrap (rotate) level up" }, - { 't', "enter text elements" }, - { 'f', "flood fill" }, - { '\0', "wrap (rotate) level left" }, - { '?', "properties of drawing element" }, - { '\0', "wrap (rotate) level right" }, - { '\0', "random element placement" }, - { 'b', "grab brush" }, - { '\0', "wrap (rotate) level down" }, - { ',', "pick drawing element" }, - { 'U', "undo last operation" }, - { 'I', "level properties" }, - { 'S', "save level" }, - { 'C', "clear level" }, - { 'T', "test level" }, - { 'E', "exit level editor" } + { 's', "draw single items" }, + { 'd', "draw connected items" }, + { 'l', "draw lines" }, + { 'a', "draw arcs" }, + { 'r', "draw outline rectangles" }, + { 'R', "draw filled rectangles" }, + { '\0', "wrap (rotate) level up" }, + { 't', "enter text elements" }, + { 'f', "flood fill" }, + { '\0', "wrap (rotate) level left" }, + { '?', "properties of drawing element" }, + { '\0', "wrap (rotate) level right" }, + { '\0', "random element placement" }, + { 'b', "grab brush" }, + { '\0', "wrap (rotate) level down" }, + { ',', "pick drawing element" }, + { 'U', "undo last operation" }, + { 'I', "level properties" }, + { 'S', "save level" }, + { 'C', "clear level" }, + { 'T', "test level" }, + { 'E', "exit level editor" } }; /* values for random placement */ @@ -784,11 +783,9 @@ static int undo_buffer_steps = 0; static int edit_mode; -static int counter_xsize = DXSIZE + FONT2_XSIZE - 2 * ED_GADGET_DISTANCE; +static int element_shift = 0; -int element_shift = 0; - -int editor_el_boulderdash[] = +static int editor_el_boulderdash[] = { EL_CHAR('B'), EL_CHAR('O'), @@ -830,9 +827,9 @@ int editor_el_boulderdash[] = EL_BD_FIREFLY_DOWN, EL_EMPTY, }; -int num_editor_el_boulderdash = SIZEOF_ARRAY_INT(editor_el_boulderdash); +static int num_editor_el_boulderdash = SIZEOF_ARRAY_INT(editor_el_boulderdash); -int editor_el_emerald_mine[] = +static int editor_el_emerald_mine[] = { EL_CHAR('E'), EL_CHAR('M'), @@ -924,9 +921,9 @@ int editor_el_emerald_mine[] = EL_EM_GATE3_GRAY, EL_EM_GATE4_GRAY, }; -int num_editor_el_emerald_mine = SIZEOF_ARRAY_INT(editor_el_emerald_mine); +static int num_editor_el_emerald_mine = SIZEOF_ARRAY_INT(editor_el_emerald_mine); -int editor_el_more[] = +static int editor_el_more[] = { EL_CHAR('M'), EL_CHAR('O'), @@ -948,10 +945,10 @@ int editor_el_more[] = EL_GATE3_GRAY, EL_GATE4_GRAY, - EL_ARROW_BLUE_LEFT, - EL_ARROW_BLUE_RIGHT, - EL_ARROW_BLUE_UP, - EL_ARROW_BLUE_DOWN, + EL_ARROW_LEFT, + EL_ARROW_RIGHT, + EL_ARROW_UP, + EL_ARROW_DOWN, EL_AMOEBA_FULL, EL_EMERALD_YELLOW, @@ -1028,9 +1025,9 @@ int editor_el_more[] = EL_EMC_WALL6, EL_EMC_WALL7, }; -int num_editor_el_more = SIZEOF_ARRAY_INT(editor_el_more); +static int num_editor_el_more = SIZEOF_ARRAY_INT(editor_el_more); -int editor_el_sokoban[] = +static int editor_el_sokoban[] = { EL_CHAR('S'), EL_CHAR('O'), @@ -1047,9 +1044,9 @@ int editor_el_sokoban[] = EL_SOKOBAN_FIELD_FULL, EL_STEELWALL, }; -int num_editor_el_sokoban = SIZEOF_ARRAY_INT(editor_el_sokoban); +static int num_editor_el_sokoban = SIZEOF_ARRAY_INT(editor_el_sokoban); -int editor_el_supaplex[] = +static int editor_el_supaplex[] = { EL_CHAR('S'), EL_CHAR('U'), @@ -1111,9 +1108,9 @@ int editor_el_supaplex[] = EL_SP_CHIP_UPPER, EL_SP_CHIP_LOWER, }; -int num_editor_el_supaplex = SIZEOF_ARRAY_INT(editor_el_supaplex); +static int num_editor_el_supaplex = SIZEOF_ARRAY_INT(editor_el_supaplex); -int editor_el_diamond_caves[] = +static int editor_el_diamond_caves[] = { EL_CHAR('D'), EL_CHAR('I'), @@ -1195,9 +1192,9 @@ int editor_el_diamond_caves[] = EL_EXTRA_TIME, EL_EMPTY, }; -int num_editor_el_diamond_caves = SIZEOF_ARRAY_INT(editor_el_diamond_caves); +static int num_editor_el_diamond_caves = SIZEOF_ARRAY_INT(editor_el_diamond_caves); -int editor_el_dx_boulderdash[] = +static int editor_el_dx_boulderdash[] = { EL_CHAR('D'), EL_CHAR('X'), @@ -1239,9 +1236,9 @@ int editor_el_dx_boulderdash[] = EL_EMPTY, EL_EMPTY }; -int num_editor_el_dx_boulderdash = SIZEOF_ARRAY_INT(editor_el_dx_boulderdash); +static int num_editor_el_dx_boulderdash = SIZEOF_ARRAY_INT(editor_el_dx_boulderdash); -int editor_el_chars[] = +static int editor_el_chars[] = { EL_CHAR('T'), EL_CHAR('E'), @@ -1333,9 +1330,9 @@ int editor_el_chars[] = EL_CHAR('´'), EL_CHAR('|') }; -int num_editor_el_chars = SIZEOF_ARRAY_INT(editor_el_chars); +static int num_editor_el_chars = SIZEOF_ARRAY_INT(editor_el_chars); -int editor_el_custom[] = +static int editor_el_custom[] = { EL_CHAR('C'), EL_CHAR('U'), @@ -1517,12 +1514,12 @@ int editor_el_custom[] = EL_CUSTOM_START + 126, EL_CUSTOM_START + 127 }; -int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom); +static int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom); -int *editor_elements = NULL; /* dynamically allocated */ -int num_editor_elements = 0; /* dynamically determined */ +static int *editor_elements = NULL; /* dynamically allocated */ +static int num_editor_elements = 0; /* dynamically determined */ -struct +static struct { boolean *setup_value; int *element_list; @@ -1612,6 +1609,16 @@ static void ReinitializeElementListButtons() initialization_needed = FALSE; } +static int getCounterGadgetWidth() +{ + return (DXSIZE + getFontWidth(FONT_DEFAULT_SMALL) - 2 * ED_GADGET_DISTANCE); +} + +static int getMaxInfoTextLength() +{ + return (SXSIZE / getFontWidth(FONT_DEFAULT_SMALL)); +} + static char *getElementInfoText(int element) { char *info_text = NULL; @@ -1877,6 +1884,7 @@ static void CreateControlButtons() static void CreateCounterButtons() { + int max_infotext_len = getMaxInfoTextLength(); int i; for (i=0; iinfo_text == NULL) return; - strncpy(infotext, gi->info_text, MAX_INFOTEXT_LEN); - infotext[MAX_INFOTEXT_LEN] = '\0'; + strncpy(infotext, gi->info_text, max_infotext_len); + infotext[max_infotext_len] = '\0'; if (gi->custom_id < ED_NUM_CTRL_BUTTONS) { @@ -4589,12 +4591,12 @@ void HandleEditorGadgetInfoText(void *ptr) sprintf(shortcut, " ('%s%c')", (key >= 'A' && key <= 'Z' ? "Shift-" : ""), key); - if (strlen(infotext) + strlen(shortcut) <= MAX_INFOTEXT_LEN) + if (strlen(infotext) + strlen(shortcut) <= max_infotext_len) strcat(infotext, shortcut); } } - DrawText(INFOTEXT_XPOS, INFOTEXT_YPOS, infotext, FS_SMALL, FC_YELLOW); + DrawText(INFOTEXT_XPOS, INFOTEXT_YPOS, infotext, FONT_DEFAULT_SMALL); } static void HandleDrawingAreaInfo(struct GadgetInfo *gi) @@ -4688,18 +4690,18 @@ static void HandleDrawingAreaInfo(struct GadgetInfo *gi) } if (drawing_function == GADGET_ID_PICK_ELEMENT) - DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW, + DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_DEFAULT_SMALL, "%s: %d, %d", infotext, lx, ly); else - DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW, + DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_DEFAULT_SMALL, "%s: %d, %d", infotext, ABS(lx - start_lx) + 1, ABS(ly - start_ly) + 1); } else if (drawing_function == GADGET_ID_PICK_ELEMENT) - DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW, + DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_DEFAULT_SMALL, "%s", getElementInfoText(Feld[lx][ly])); else - DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW, + DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_DEFAULT_SMALL, "Level position: %d, %d", lx, ly); } @@ -4713,13 +4715,13 @@ static void HandleDrawingAreaInfo(struct GadgetInfo *gi) } } else if (id == GADGET_ID_AMOEBA_CONTENT) - DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW, + DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_DEFAULT_SMALL, "Amoeba content"); else if (id == GADGET_ID_RANDOM_BACKGROUND) - DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW, + DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_DEFAULT_SMALL, "Random placement background"); else - DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW, + DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_DEFAULT_SMALL, "Content area %d position: %d, %d", id - GADGET_ID_ELEM_CONTENT_0 + 1, sx, sy); } diff --git a/src/game.c b/src/game.c index 324c8e81..b36eda0d 100644 --- a/src/game.c +++ b/src/game.c @@ -474,13 +474,13 @@ void DrawGameDoorValues() el2edimg(EL_KEY1 + j)); DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS, - int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW); + int2str(local_player->gems_still_needed, 3), FONT_DEFAULT_SMALL); DrawText(DX + XX_DYNAMITE, DY + YY_DYNAMITE, - int2str(local_player->dynamite, 3), FS_SMALL, FC_YELLOW); + int2str(local_player->dynamite, 3), FONT_DEFAULT_SMALL); DrawText(DX + XX_SCORE, DY + YY_SCORE, - int2str(local_player->score, 5), FS_SMALL, FC_YELLOW); + int2str(local_player->score, 5), FONT_DEFAULT_SMALL); DrawText(DX + XX_TIME, DY + YY_TIME, - int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); + int2str(TimeLeft, 3), FONT_DEFAULT_SMALL); } @@ -902,14 +902,15 @@ void InitGame() if (level_nr < 100) DrawText(DX + XX_LEVEL, DY + YY_LEVEL, - int2str(level_nr, 2), FS_SMALL, FC_YELLOW); + int2str(level_nr, 2), FONT_DEFAULT_SMALL); else { DrawTextExt(drawto, DX + XX_EMERALDS, DY + YY_EMERALDS, - int2str(level_nr, 3), FS_SMALL, FC_SPECIAL3, FONT_OPAQUE); + int2str(level_nr, 3), FONT_SPECIAL_NARROW, FONT_OPAQUE); BlitBitmap(drawto, drawto, DX + XX_EMERALDS, DY + YY_EMERALDS + 1, - FONT5_XSIZE * 3, FONT5_YSIZE - 1, + getFontWidth(FONT_SPECIAL_NARROW) * 3, + getFontHeight(FONT_SPECIAL_NARROW) - 1, DX + XX_LEVEL - 1, DY + YY_LEVEL + 1); } @@ -1103,7 +1104,7 @@ void GameWon() TimeLeft -= 10; else TimeLeft--; - DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); + DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_DEFAULT_SMALL); BackToFront(); if (!tape.playing) @@ -1129,7 +1130,7 @@ void GameWon() TimePlayed += 10; else TimePlayed++; - DrawText(DX_TIME, DY_TIME, int2str(TimePlayed, 3), FS_SMALL, FC_YELLOW); + DrawText(DX_TIME, DY_TIME, int2str(TimePlayed, 3), FONT_DEFAULT_SMALL); BackToFront(); if (!tape.playing) @@ -5024,14 +5025,14 @@ void GameActions() if (TimeLeft <= 10 && setup.time_limit) PlaySoundStereo(SND_GAME_RUNNING_OUT_OF_TIME, SOUND_MAX_RIGHT); - DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); + DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_DEFAULT_SMALL); if (!TimeLeft && setup.time_limit) for (i=0; igems_still_needed, 3), - FS_SMALL, FC_YELLOW); + FONT_DEFAULT_SMALL); PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); break; @@ -5877,7 +5878,7 @@ int DigField(struct PlayerInfo *player, if (level.time > 0) { TimeLeft += 10; - DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); + DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_DEFAULT_SMALL); } PlaySoundStereo(SND_EXTRA_TIME_COLLECTING, SOUND_MAX_RIGHT); break; @@ -5901,8 +5902,7 @@ int DigField(struct PlayerInfo *player, player->dynamite++; RaiseScoreElement(EL_DYNAMITE); DrawText(DX_DYNAMITE, DY_DYNAMITE, - int2str(local_player->dynamite, 3), - FS_SMALL, FC_YELLOW); + int2str(local_player->dynamite, 3), FONT_DEFAULT_SMALL); PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); break; @@ -6307,7 +6307,7 @@ int DigField(struct PlayerInfo *player, case EL_TIME_ORB_FULL: Feld[x][y] = EL_TIME_ORB_EMPTY; TimeLeft += 10; - DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); + DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_DEFAULT_SMALL); DrawLevelField(x, y); PlaySoundStereo(SND_TIME_ORB_FULL_COLLECTING, SOUND_MAX_RIGHT); return MF_ACTION; @@ -6528,7 +6528,7 @@ boolean PlaceBomb(struct PlayerInfo *player) player->dynamite--; DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(local_player->dynamite, 3), - FS_SMALL, FC_YELLOW); + FONT_DEFAULT_SMALL); if (IN_SCR_FIELD(SCREENX(jx), SCREENY(jy))) { if (game.emulation == EMU_SUPAPLEX) @@ -6647,7 +6647,7 @@ void RaiseScore(int value) { local_player->score += value; DrawText(DX_SCORE, DY_SCORE, int2str(local_player->score, 5), - FS_SMALL, FC_YELLOW); + FONT_DEFAULT_SMALL); } void RaiseScoreElement(int element) diff --git a/src/init.c b/src/init.c index d7be34a6..b6eaa561 100644 --- a/src/init.c +++ b/src/init.c @@ -29,8 +29,9 @@ #include "conf_e2g.c" /* include auto-generated data structure definitions */ #include "conf_esg.c" /* include auto-generated data structure definitions */ +#define CONFIG_TOKEN_FONT_INITIAL "font.initial" -static Bitmap *bitmap_font_initial = NULL; +struct FontInfo font_info_initial[NUM_INITIAL_FONTS]; static void InitGlobal(); static void InitSetup(); @@ -47,6 +48,7 @@ static void InitMusic(); static void InitGfx(); static void InitGfxBackground(); static void InitGadgets(); +static void InitFontGraphicInfo(); static void InitElementSmallImages(); static void InitElementGraphicInfo(); static void InitElementSpecialGraphicInfo(); @@ -243,14 +245,9 @@ static void ReinitializeGraphics() InitGraphicInfo(); /* graphic properties mapping */ InitElementSmallImages(); /* create editor and preview images */ + InitFontGraphicInfo(); /* initialize text drawing functions */ - InitFontInfo(bitmap_font_initial, - graphic_info[IMG_FONT_BIG].bitmap, - graphic_info[IMG_FONT_MEDIUM].bitmap, - graphic_info[IMG_FONT_SMALL].bitmap, - graphic_info[IMG_FONT_EM].bitmap); - - SetMainBackgroundImage(IMG_BACKGROUND_DEFAULT); + SetMainBackgroundImage(IMG_BACKGROUND); SetDoorBackgroundImage(IMG_BACKGROUND_DOOR); InitGadgets(); @@ -468,17 +465,40 @@ void FreeTileClipmasks() void InitGfx() { - char *config_token_font_initial = "font.small"; char *filename_font_initial = NULL; - int i; + Bitmap *bitmap_font_initial = NULL; + int i, j; - /* determine filename for initial font (for displaying startup messages) */ + /* determine settings 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; + { + for (j=0; j < NUM_INITIAL_FONTS; j++) + { + char font_token[128]; + int len_font_token; + + sprintf(font_token, "%s_%d", CONFIG_TOKEN_FONT_INITIAL, j + 1); + len_font_token = strlen(font_token); + + if (strcmp(image_config[i].token, font_token) == 0) + filename_font_initial = image_config[i].value; + else if (strlen(image_config[i].token) > len_font_token && + strncmp(image_config[i].token, font_token, len_font_token) == 0) + { + if (strcmp(&image_config[i].token[len_font_token], ".x") == 0) + font_info_initial[j].src_x = atoi(image_config[i].value); + else if (strcmp(&image_config[i].token[len_font_token], ".y") == 0) + font_info_initial[j].src_y = atoi(image_config[i].value); + else if (strcmp(&image_config[i].token[len_font_token], ".width") == 0) + font_info_initial[j].width = atoi(image_config[i].value); + else if (strcmp(&image_config[i].token[len_font_token],".height") == 0) + font_info_initial[j].height = atoi(image_config[i].value); + } + } + } if (filename_font_initial == NULL) /* should not happen */ - Error(ERR_EXIT, "cannot get filename for '%s'", config_token_font_initial); + Error(ERR_EXIT, "cannot get filename for '%s'", CONFIG_TOKEN_FONT_INITIAL); /* initialize screen properties */ InitGfxFieldInfo(SX, SY, SXSIZE, SYSIZE, @@ -493,7 +513,10 @@ void InitGfx() bitmap_font_initial = LoadCustomImage(filename_font_initial); - InitFontInfo(bitmap_font_initial, NULL, NULL, NULL, NULL); + for (j=0; j < NUM_INITIAL_FONTS; j++) + font_info_initial[j].bitmap = bitmap_font_initial; + + InitFontGraphicInfo(); DrawInitText(WINDOW_TITLE_STRING, 20, FC_YELLOW); DrawInitText(WINDOW_SUBTITLE_STRING, 50, FC_RED); @@ -699,11 +722,41 @@ void InitElementSmallImages() for (i=0; element_to_special_graphic[i].element > -1; i++) CreateImageWithSmallImages(element_to_special_graphic[i].graphic); + /* !!! CHECK FOR ELEMENT-ONLY GRAPHICS !!! */ /* initialize images from dynamic configuration */ for (i=0; i < num_property_mappings; i++) CreateImageWithSmallImages(property_mapping[i].artwork_index); } +void InitFontGraphicInfo() +{ + static struct FontInfo font_info[NUM_IMG_FONTS]; + int num_fonts = NUM_IMG_FONTS; + int i; + + if (graphic_info == NULL) /* still at startup phase */ + num_fonts = NUM_INITIAL_FONTS; + + for (i=0; i < num_fonts; i++) + { + if (i < NUM_INITIAL_FONTS) + font_info[i] = font_info_initial[i]; + else + { + /* copy font relevant information from graphics information */ + font_info[i].bitmap = graphic_info[FIRST_IMG_FONT + i].bitmap; + font_info[i].src_x = graphic_info[FIRST_IMG_FONT + i].src_x; + font_info[i].src_y = graphic_info[FIRST_IMG_FONT + i].src_y; + font_info[i].width = graphic_info[FIRST_IMG_FONT + i].width; + font_info[i].height = graphic_info[FIRST_IMG_FONT + i].height; + font_info[i].draw_x = graphic_info[FIRST_IMG_FONT + i].draw_x; + font_info[i].draw_y = graphic_info[FIRST_IMG_FONT + i].draw_y; + } + } + + InitFontInfo(font_info, num_fonts); +} + void InitElementGraphicInfo() { struct PropertyMapping *property_mapping = getImageListPropertyMapping(); @@ -980,6 +1033,10 @@ static void set_graphic_parameters(int graphic, char **parameter_raw) /* this is only used for toon animations */ graphic_info[graphic].step_offset = parameter[GFX_ARG_STEP_OFFSET]; graphic_info[graphic].step_delay = parameter[GFX_ARG_STEP_DELAY]; + + /* this is only used for drawing font characters */ + graphic_info[graphic].draw_x = parameter[GFX_ARG_DRAW_XOFFSET]; + graphic_info[graphic].draw_y = parameter[GFX_ARG_DRAW_YOFFSET]; } static void InitGraphicInfo() @@ -2585,9 +2642,6 @@ void CloseAllAndExit(int exit_value) FreeAllImages(); FreeTileClipmasks(); - if (bitmap_font_initial) - FreeBitmap(bitmap_font_initial); - CloseVideoDisplay(); ClosePlatformDependantStuff(); diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index a371bb47..2405c137 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -136,7 +136,7 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) char cursor_string[3]; char text[MAX_GADGET_TEXTSIZE + 1]; int font_type = gi->text.font_type; - int font_width = getFontWidth(FS_SMALL, font_type); + int font_width = getFontWidth(font_type); int border = gi->border.size; strcpy(text, gi->text.value); strcat(text, " "); @@ -159,7 +159,7 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) /* gadget text value */ DrawTextExt(drawto, gi->x + border, gi->y + border, text, - FS_SMALL, font_type, FONT_OPAQUE); + font_type, FONT_OPAQUE); cursor_letter = gi->text.value[gi->text.cursor_position]; cursor_string[0] = '~'; @@ -171,7 +171,7 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) DrawTextExt(drawto, gi->x + border + gi->text.cursor_position * font_width, gi->y + border, cursor_string, - FS_SMALL, font_type, FONT_OPAQUE); + font_type, FONT_OPAQUE); } break; @@ -529,8 +529,8 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) if (gi->type & GD_TYPE_TEXTINPUT) { - int font_width = getFontWidth(FS_SMALL, gi->text.font_type); - int font_height = getFontHeight(FS_SMALL, gi->text.font_type); + int font_width = getFontWidth(gi->text.font_type); + int font_height = getFontHeight(gi->text.font_type); gi->width = 2 * gi->border.size + (gi->text.size + 1) * font_width; gi->height = 2 * gi->border.size + font_height; @@ -802,7 +802,7 @@ void HandleGadgets(int mx, int my, int button) /* if mouse button pressed inside activated text gadget, set cursor */ gi->text.cursor_position = (mx - gi->x - gi->border.size) / - getFontWidth(FS_SMALL, gi->text.font_type); + getFontWidth(gi->text.font_type); if (gi->text.cursor_position < 0) gi->text.cursor_position = 0; diff --git a/src/libgame/system.c b/src/libgame/system.c index cb27850b..119bf479 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -36,7 +36,6 @@ struct OptionInfo options; struct VideoSystemInfo video; struct AudioSystemInfo audio; struct GfxInfo gfx; -struct FontInfo font; struct AnimInfo anim; struct ArtworkInfo artwork; struct JoystickInfo joystick; diff --git a/src/libgame/system.h b/src/libgame/system.h index 511355d3..72dbb28d 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -290,6 +290,18 @@ struct AudioSystemInfo int first_sound_channel; }; +struct FontInfo +{ + Bitmap *bitmap; + int src_x, src_y; /* start position of animation frames */ + int width, height; /* width/height of each animation frame */ + int draw_x, draw_y; /* offset for drawing font characters */ + +#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) + Pixmap *clip_mask; /* single-char-only clip mask array for X11 */ +#endif +}; + struct GfxInfo { int sx, sy; @@ -311,15 +323,9 @@ struct GfxInfo int background_bitmap_mask; boolean menu_main_hide_static_text; -}; -struct FontInfo -{ - Bitmap *bitmap_initial; - Bitmap *bitmap_big; - Bitmap *bitmap_medium; - Bitmap *bitmap_small; - Bitmap *bitmap_tile; + int num_fonts; + struct FontInfo *font; }; struct AnimInfo @@ -581,7 +587,6 @@ extern struct OptionInfo options; extern struct VideoSystemInfo video; extern struct AudioSystemInfo audio; extern struct GfxInfo gfx; -extern struct FontInfo font; extern struct AnimInfo anim; extern struct ArtworkInfo artwork; extern struct JoystickInfo joystick; diff --git a/src/libgame/text.c b/src/libgame/text.c index 48974eb7..bc2a366d 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -15,55 +15,50 @@ #include #include "text.h" +#include "misc.h" /* ========================================================================= */ /* font functions */ /* ========================================================================= */ -#define NUM_FONTS 2 -#define NUM_FONT_COLORS 4 #define NUM_FONT_CHARS (FONT_LINES_PER_FONT * FONT_CHARS_PER_LINE) #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) -static GC tile_clip_gc = None; -static Pixmap tile_clipmask[NUM_FONTS][NUM_FONT_COLORS][NUM_FONT_CHARS]; - -static struct -{ - Bitmap **bitmap; - int xsize, ysize; -} font_info[NUM_FONTS] = -{ - { &font.bitmap_big, FONT1_XSIZE, FONT1_YSIZE }, - { &font.bitmap_medium, FONT6_XSIZE, FONT6_YSIZE } -}; +static GC font_clip_gc = None; static void InitFontClipmasks() { static boolean clipmasks_initialized = FALSE; - boolean fonts_initialized = TRUE; XGCValues clip_gc_values; unsigned long clip_gc_valuemask; GC copy_clipmask_gc; - int i, j, k; - - for (i=0; idrawable, + font_clip_gc = XCreateGC(display, window->drawable, clip_gc_valuemask, &clip_gc_values); /* create graphic context structures needed for clipping */ clip_gc_values.graphics_exposures = False; clip_gc_valuemask = GCGraphicsExposures; - copy_clipmask_gc = XCreateGC(display, (*font_info[0].bitmap)->clip_mask, + copy_clipmask_gc = XCreateGC(display, gfx.font[0].bitmap->clip_mask, clip_gc_valuemask, &clip_gc_values); /* create only those clipping Pixmaps we really need */ - for (i=0; iclip_mask; - int xpos = k % FONT_CHARS_PER_LINE; - int ypos = k / FONT_CHARS_PER_LINE; - int xsize = font_info[i].xsize; - int ysize = font_info[i].ysize; - int src_x = xsize * xpos; - int src_y = ysize * (ypos + j * FONT_LINES_PER_FONT); - - tile_clipmask[i][j][k] = - XCreatePixmap(display, window->drawable, xsize, ysize, 1); - - XCopyArea(display, src_pixmap, tile_clipmask[i][j][k], copy_clipmask_gc, - src_x, src_y, xsize, ysize, 0, 0); + if (gfx.font[i].bitmap == NULL) + continue; + + gfx.font[i].clip_mask = checked_calloc(NUM_FONT_CHARS * sizeof(Pixmap)); + + for (j=0; j < NUM_FONT_CHARS; j++) + { + Bitmap *src_bitmap = gfx.font[i].bitmap; + Pixmap src_pixmap = src_bitmap->clip_mask; + int xpos = j % FONT_CHARS_PER_LINE; + int ypos = j / FONT_CHARS_PER_LINE; + int width = gfx.font[i].width; + int height = gfx.font[i].height; + int src_x = gfx.font[i].src_x + xpos * width; + int src_y = gfx.font[i].src_y + ypos * height; + + gfx.font[i].clip_mask[j] = + XCreatePixmap(display, window->drawable, width, height, 1); + + XCopyArea(display, src_pixmap, gfx.font[i].clip_mask[j], + copy_clipmask_gc, src_x, src_y, width, height, 0, 0); + } } XFreeGC(display, copy_clipmask_gc); - - clipmasks_initialized = TRUE; } #endif /* TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND */ -void InitFontInfo(Bitmap *bitmap_initial, - Bitmap *bitmap_big, Bitmap *bitmap_medium, - Bitmap *bitmap_small, Bitmap *bitmap_tile) +void InitFontInfo(struct FontInfo *font_info, int num_fonts) { - font.bitmap_initial = bitmap_initial; - font.bitmap_big = bitmap_big; - font.bitmap_medium = bitmap_medium; - font.bitmap_small = bitmap_small; - font.bitmap_tile = bitmap_tile; + gfx.num_fonts = num_fonts; + gfx.font = font_info; #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) InitFontClipmasks(); #endif } -int getFontWidth(int font_size, int font_type) +int getFontWidth(int font_nr) { - return (font_type == FC_SPECIAL1 ? FONT3_XSIZE : - font_type == FC_SPECIAL2 ? FONT4_XSIZE : - font_type == FC_SPECIAL3 ? FONT5_XSIZE : - font_size == FS_BIG ? FONT1_XSIZE : - font_size == FS_MEDIUM ? FONT6_XSIZE : - font_size == FS_SMALL ? FONT2_XSIZE : - FONT2_XSIZE); + return gfx.font[font_nr].width; } -int getFontHeight(int font_size, int font_type) +int getFontHeight(int font_nr) { - return (font_type == FC_SPECIAL1 ? FONT3_YSIZE : - font_type == FC_SPECIAL2 ? FONT4_YSIZE : - font_type == FC_SPECIAL3 ? FONT5_YSIZE : - font_size == FS_BIG ? FONT1_YSIZE : - font_size == FS_MEDIUM ? FONT6_YSIZE : - font_size == FS_SMALL ? FONT2_YSIZE : - FONT2_YSIZE); + return gfx.font[font_nr].height; } -void DrawInitText(char *text, int ypos, int color) +void DrawInitText(char *text, int ypos, int font_nr) { - if (window && font.bitmap_initial) + if (window && gfx.num_fonts > 0 && gfx.font[font_nr].bitmap != NULL) { - ClearRectangle(window, 0, ypos, video.width, FONT2_YSIZE); - DrawTextExt(window, (video.width - strlen(text) * FONT2_XSIZE)/2, - ypos, text, FS_INITIAL, color, FONT_OPAQUE); + int text_width = strlen(text) * gfx.font[font_nr].width; + + ClearRectangle(window, 0, ypos, video.width, gfx.font[font_nr].height); + DrawTextExt(window, (video.width - text_width) / 2, ypos, text, font_nr, + FONT_OPAQUE); FlushDisplay(); } } -void DrawTextFCentered(int y, int font_type, char *format, ...) +void DrawTextFCentered(int y, int font, char *format, ...) { char buffer[MAX_OUTPUT_LINESIZE + 1]; - int font_width = getFontWidth(FS_SMALL, font_type); va_list ap; va_start(ap, format); vsprintf(buffer, format, ap); va_end(ap); - DrawText(gfx.sx + (gfx.sxsize - strlen(buffer) * font_width) / 2, - gfx.sy + y, buffer, FS_SMALL, font_type); + if (strlen(buffer) > MAX_OUTPUT_LINESIZE) + Error(ERR_EXIT, "string too long in DrawTextFCentered() -- aborting"); + + DrawText(gfx.sx + (gfx.sxsize - strlen(buffer) * gfx.font[font].width) / 2, + gfx.sy + y, buffer, font); } -void DrawTextF(int x, int y, int font_type, char *format, ...) +void DrawTextF(int x, int y, int font, char *format, ...) { char buffer[MAX_OUTPUT_LINESIZE + 1]; va_list ap; @@ -179,17 +165,20 @@ void DrawTextF(int x, int y, int font_type, char *format, ...) vsprintf(buffer, format, ap); va_end(ap); - DrawText(gfx.sx + x, gfx.sy + y, buffer, FS_SMALL, font_type); + if (strlen(buffer) > MAX_OUTPUT_LINESIZE) + Error(ERR_EXIT, "string too long in DrawTextF() -- aborting"); + + DrawText(gfx.sx + x, gfx.sy + y, buffer, font); } -void DrawText(int x, int y, char *text, int font_size, int font_type) +void DrawText(int x, int y, char *text, int font) { int mask_mode = FONT_OPAQUE; if (DrawingOnBackground(x, y)) mask_mode = FONT_MASKED; - DrawTextExt(drawto, x, y, text, font_size, font_type, mask_mode); + DrawTextExt(drawto, x, y, text, font, mask_mode); if (x < gfx.dx) redraw_mask |= REDRAW_FIELD; @@ -197,47 +186,24 @@ void DrawText(int x, int y, char *text, int font_size, int font_type) redraw_mask |= REDRAW_DOOR_1; } -void DrawTextExt(DrawBuffer *bitmap, int x, int y, char *text, - int font_size, int font_type, int mask_mode) +void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text, + int font_nr, int mask_mode) { - Bitmap *font_bitmap; - int font_width, font_height, font_starty; + struct FontInfo *font = &gfx.font[font_nr]; boolean print_inverse = FALSE; - if (font_size != FS_BIG && font_size != FS_MEDIUM && font_size != FS_SMALL) - font_size = FS_INITIAL; - if (font_type < FC_RED || font_type > FC_SPECIAL3) - font_type = FC_RED; - - font_width = getFontWidth(font_size, font_type); - font_height = getFontHeight(font_size, font_type); - - font_bitmap = (font_type == FC_SPECIAL2 ? font.bitmap_tile : - font_size == FS_BIG ? font.bitmap_big : - font_size == FS_MEDIUM ? font.bitmap_medium : - font_size == FS_SMALL ? font.bitmap_small : - font.bitmap_initial); - - if (font_bitmap == NULL) + if (font->bitmap == NULL) return; - if (font_type == FC_SPECIAL2) - font_starty = (font_size == FS_BIG ? 0 : FONT1_YSIZE) * 5; - else - font_starty = (font_type * (font_size == FS_BIG ? FONT1_YSIZE : - font_size == FS_MEDIUM ? FONT6_YSIZE : - font_size == FS_SMALL ? FONT2_YSIZE : - FONT2_YSIZE) * - FONT_LINES_PER_FONT); - - if (font_type == FC_SPECIAL3) - font_starty -= FONT2_YSIZE * FONT_LINES_PER_FONT; + /* add offset for drawing font characters */ + dst_x += font->draw_x; + dst_y += font->draw_y; while (*text) { char c = *text++; - if (c == '~' && font_size == FS_SMALL) + if (c == '~') { print_inverse = TRUE; continue; @@ -258,74 +224,59 @@ void DrawTextExt(DrawBuffer *bitmap, int x, int y, char *text, if ((c >= 32 && c <= 95) || c == '°' || c == '´' || c == '|') { - int src_x = ((c - 32) % FONT_CHARS_PER_LINE) * font_width; - int src_y = ((c - 32) / FONT_CHARS_PER_LINE) * font_height + font_starty; - int dest_x = x, dest_y = y; + int src_x= font->src_x + ((c - 32) % FONT_CHARS_PER_LINE) * font->width; + int src_y= font->src_y + ((c - 32) / FONT_CHARS_PER_LINE) * font->height; if (c == '°' || c == '´' || c == '|') /* map '°' and 'TM' signs */ { - if (font_type == FC_SPECIAL2) - { - src_x = (c == '°' ? 1 : c == '´' ? 2 : 3) * font_width; - src_y = 4 * font_height; - } - else - { - src_x = FONT_CHARS_PER_LINE * font_width; - src_y = (c == '°' ? 1 : c == '´' ? 2 : 3) * font_height +font_starty; - } + src_x = font->src_x + FONT_CHARS_PER_LINE * font->width; + src_y = font->src_y + (c == '°' ? 1 : c == '´' ? 2 : 3) * font->height; } if (print_inverse) /* special mode for text gadgets */ { /* first step: draw solid colored rectangle (use "cursor" character) */ - BlitBitmap(font_bitmap, bitmap, FONT_CHARS_PER_LINE * font_width, - 3 * font_height + font_starty, - font_width, font_height, x, y); + BlitBitmap(font->bitmap, dst_bitmap, + font->src_x + FONT_CHARS_PER_LINE * font->width, + font->src_y + 3 * font->height, + font->width, font->height, dst_x, dst_y); /* second step: draw masked black rectangle (use "space" character) */ - SetClipOrigin(font_bitmap, font_bitmap->stored_clip_gc, - dest_x - src_x, dest_y - src_y); - BlitBitmapMasked(font_bitmap, bitmap, - 0, 0, font_width, font_height, dest_x, dest_y); + SetClipOrigin(font->bitmap, font->bitmap->stored_clip_gc, + dst_x - src_x, dst_y - src_y); + BlitBitmapMasked(font->bitmap, dst_bitmap, + 0, 0, font->width, font->height, dst_x, dst_y); } else if (mask_mode == FONT_MASKED) { /* clear font character background */ - ClearRectangleOnBackground(bitmap, dest_x, dest_y, - font_width, font_height); + ClearRectangleOnBackground(dst_bitmap, dst_x, dst_y, + font->width, font->height); #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) - /* use special font tile clipmasks, if available */ - if (font_size == FS_BIG || font_size == FS_MEDIUM) + /* use special font tile clipmasks */ { - int font_nr = (font_size == FS_BIG ? 0 : 1); int font_char = (c >= 32 && c <= 95 ? c - 32 : 0); - SetClipMask(font_bitmap, tile_clip_gc, - tile_clipmask[font_nr][font_type][font_char]); - SetClipOrigin(font_bitmap, tile_clip_gc, dest_x, dest_y); - } - else - { - SetClipOrigin(font_bitmap, font_bitmap->stored_clip_gc, - dest_x - src_x, dest_y - src_y); + SetClipMask(font->bitmap, font_clip_gc, + font->clip_mask[font_char]); + SetClipOrigin(font->bitmap, font_clip_gc, dst_x, dst_y); } #else - SetClipOrigin(font_bitmap, font_bitmap->stored_clip_gc, - dest_x - src_x, dest_y - src_y); + SetClipOrigin(font->bitmap, font->bitmap->stored_clip_gc, + dst_x - src_x, dst_y - src_y); #endif - BlitBitmapMasked(font_bitmap, bitmap, src_x, src_y, - font_width, font_height, dest_x, dest_y); + BlitBitmapMasked(font->bitmap, dst_bitmap, src_x, src_y, + font->width, font->height, dst_x, dst_y); } else /* normal, non-masked font blitting */ { - BlitBitmap(font_bitmap, bitmap, src_x, src_y, - font_width, font_height, dest_x, dest_y); + BlitBitmap(font->bitmap, dst_bitmap, src_x, src_y, + font->width, font->height, dst_x, dst_y); } } - x += font_width; + dst_x += font->width; } } diff --git a/src/libgame/text.h b/src/libgame/text.h index fdaf0e8b..505409a3 100644 --- a/src/libgame/text.h +++ b/src/libgame/text.h @@ -22,30 +22,34 @@ #define FS_BIG 1 #define FS_MEDIUM 2 #define FS_SMALL 3 -#define FS_TILE 4 /* font colors */ #define FC_RED 0 #define FC_BLUE 1 #define FC_GREEN 2 #define FC_YELLOW 3 -#define FC_SPECIAL1 4 -#define FC_SPECIAL2 5 -#define FC_SPECIAL3 6 -/* font graphics definitions */ -#define FONT1_XSIZE 32 -#define FONT1_YSIZE 32 -#define FONT2_XSIZE 14 -#define FONT2_YSIZE 14 -#define FONT3_XSIZE 11 -#define FONT3_YSIZE 14 -#define FONT4_XSIZE 16 -#define FONT4_YSIZE 16 -#define FONT5_XSIZE 10 -#define FONT5_YSIZE 14 -#define FONT6_XSIZE 16 -#define FONT6_YSIZE 32 +/* special fonts */ +#define FC_SPECIAL_TAPE 4 +#define FC_SPECIAL_GAME 5 +#define FC_SPECIAL_NARROW 6 + +#define FONT(fs, fc) (( (fs) == FS_INITIAL ? \ + IMG_FONT_INITIAL_1 + (fc) : \ + (fs) == FS_BIG ? \ + IMG_FONT_BIG_1 + (fc) : \ + (fs) == FS_MEDIUM ? \ + IMG_FONT_MEDIUM_1 + (fc) : \ + (fs) == FS_SMALL ? \ + IMG_FONT_SMALL_1 + (fc) : \ + IMG_FONT_SMALL_1 \ + ) - FIRST_IMG_FONT) + +#define FONT_DEFAULT_BIG FONT(FS_BIG, FC_YELLOW) +#define FONT_DEFAULT_SMALL FONT(FS_SMALL, FC_YELLOW) +#define FONT_SPECIAL_TAPE FONT(FS_SMALL, FC_SPECIAL_TAPE) +#define FONT_SPECIAL_GAME FONT(FS_SMALL, FC_SPECIAL_GAME) +#define FONT_SPECIAL_NARROW FONT(FS_SMALL, FC_SPECIAL_NARROW) #define FONT_CHARS_PER_LINE 16 #define FONT_LINES_PER_FONT 4 @@ -54,11 +58,20 @@ #define FONT_MASKED 1 /* text output definitions */ -#define MAX_OUTPUT_LINESIZE 256 +#define MAX_OUTPUT_LINESIZE 1024 /* font structure definitions */ - +#if 1 +void InitFontInfo(struct FontInfo *, int); +int getFontWidth(int); +int getFontHeight(int); +void DrawInitText(char *, int, int); +void DrawTextF(int, int, int, char *, ...); +void DrawTextFCentered(int, int, char *, ...); +void DrawText(int, int, char *, int); +void DrawTextExt(DrawBuffer *, int, int, char *, int, int); +#else void InitFontInfo(Bitmap *, Bitmap *, Bitmap *, Bitmap *, Bitmap *); int getFontWidth(int, int); int getFontHeight(int, int); @@ -67,5 +80,6 @@ void DrawTextF(int, int, int, char *, ...); void DrawTextFCentered(int, int, char *, ...); void DrawText(int, int, char *, int, int); void DrawTextExt(DrawBuffer *, int, int, char *, int, int, int); +#endif #endif /* TEXT_H */ diff --git a/src/main.c b/src/main.c index 743360fd..1ef7deeb 100644 --- a/src/main.c +++ b/src/main.c @@ -2920,26 +2920,6 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-", "-" }, - { - "arrow_red_left", - "-", - "-" - }, - { - "arrow_red_right", - "-", - "-" - }, - { - "arrow_red_up", - "-", - "-" - }, - { - "arrow_red_down", - "-", - "-" - }, { NULL, diff --git a/src/main.h b/src/main.h index 468f910d..856d4d14 100644 --- a/src/main.h +++ b/src/main.h @@ -420,10 +420,10 @@ #define EL_MOLE 110 #define EL_PENGUIN 111 #define EL_SATELLITE 112 -#define EL_ARROW_BLUE_LEFT 113 -#define EL_ARROW_BLUE_RIGHT 114 -#define EL_ARROW_BLUE_UP 115 -#define EL_ARROW_BLUE_DOWN 116 +#define EL_ARROW_LEFT 113 +#define EL_ARROW_RIGHT 114 +#define EL_ARROW_UP 115 +#define EL_ARROW_DOWN 116 #define EL_PIG 117 #define EL_DRAGON 118 @@ -721,12 +721,8 @@ #define EL_DYNABOMB_ACTIVE (EL_FIRST_DUMMY + 13) #define EL_SHIELD_NORMAL_ACTIVE (EL_FIRST_DUMMY + 14) #define EL_SHIELD_DEADLY_ACTIVE (EL_FIRST_DUMMY + 15) -#define EL_ARROW_RED_LEFT (EL_FIRST_DUMMY + 16) -#define EL_ARROW_RED_RIGHT (EL_FIRST_DUMMY + 17) -#define EL_ARROW_RED_UP (EL_FIRST_DUMMY + 18) -#define EL_ARROW_RED_DOWN (EL_FIRST_DUMMY + 19) -#define MAX_NUM_ELEMENTS (EL_FIRST_DUMMY + 20) +#define MAX_NUM_ELEMENTS (EL_FIRST_DUMMY + 16) /* values for graphics/sounds action types */ @@ -786,9 +782,11 @@ #define GFX_ARG_STEP_DELAY 21 #define GFX_ARG_DIRECTION 22 #define GFX_ARG_POSITION 23 -#define GFX_ARG_NAME 24 +#define GFX_ARG_DRAW_XOFFSET 24 +#define GFX_ARG_DRAW_YOFFSET 25 +#define GFX_ARG_NAME 26 -#define NUM_GFX_ARGS 25 +#define NUM_GFX_ARGS 27 /* values for sound configuration suffixes */ @@ -797,6 +795,16 @@ #define NUM_SND_ARGS 1 +/* values for font configuration */ + +#define FIRST_IMG_FONT IMG_FONT_INITIAL_1 +#define LAST_IMG_FONT IMG_FONT_NARROW + +#define NUM_IMG_FONTS (LAST_IMG_FONT - \ + FIRST_IMG_FONT + 1) +#define NUM_INITIAL_FONTS 4 + + /* values for game_status */ #define EXITGAME 0 #define MAINMENU 1 @@ -1040,9 +1048,12 @@ struct GraphicInfo int anim_delay; /* important: delay of 1 means "no delay"! */ int anim_mode; boolean anim_global_sync; + int step_offset; /* optional step offset of toon animations */ int step_delay; /* optional step delay of toon animations */ + int draw_x, draw_y; /* optional offset for drawing fonts chars */ + #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) Pixmap clip_mask; /* single-graphic-only clip mask for X11 */ GC clip_gc; /* single-graphic-only clip gc for X11 */ diff --git a/src/screens.c b/src/screens.c index 830834d8..097eb44e 100644 --- a/src/screens.c +++ b/src/screens.c @@ -89,9 +89,9 @@ static void drawCursorExt(int xpos, int ypos, int color, int graphic) } if (color == FC_RED) - graphic = (graphic == IMG_ARROW_BLUE_LEFT ? IMG_ARROW_RED_LEFT : - graphic == IMG_ARROW_BLUE_RIGHT ? IMG_ARROW_RED_RIGHT : - IMG_BALL_RED); + graphic = (graphic == IMG_MENU_BUTTON_LEFT ? IMG_MENU_BUTTON_LEFT_ACTIVE : + graphic == IMG_MENU_BUTTON_RIGHT ? IMG_MENU_BUTTON_RIGHT_ACTIVE: + IMG_MENU_BUTTON_ACTIVE); ypos += MENU_SCREEN_START_YPOS; @@ -128,21 +128,23 @@ static void PlaySound_Menu_Continue(int sound) PlaySoundLoop(sound); } -void DrawTextStatic(int x, int y, char *text, int font_size, int font_type) +void DrawTextStatic(int x, int y, char *text, int font_nr) { if (game_status == MAINMENU && gfx.menu_main_hide_static_text) return; - DrawText(x, y, text, font_size, font_type); + DrawText(x, y, text, font_nr); } void DrawHeadline() { - int x1 = SX + (SXSIZE - strlen(PROGRAM_TITLE_STRING) * FONT1_XSIZE) / 2; - int x2 = SX + (SXSIZE - strlen(WINDOW_SUBTITLE_STRING) * FONT2_XSIZE) / 2; + int font1_xsize = getFontWidth(FONT(FS_BIG, FC_YELLOW)); + int font2_xsize = getFontWidth(FONT(FS_SMALL, FC_RED)); + int x1 = SX + (SXSIZE - strlen(PROGRAM_TITLE_STRING) * font1_xsize) / 2; + int x2 = SX + (SXSIZE - strlen(WINDOW_SUBTITLE_STRING) * font2_xsize) / 2; - DrawTextStatic(x1, SY + 8, PROGRAM_TITLE_STRING, FS_BIG, FC_YELLOW); - DrawTextStatic(x2, SY + 46, WINDOW_SUBTITLE_STRING, FS_SMALL, FC_RED); + DrawTextStatic(x1, SY + 8, PROGRAM_TITLE_STRING, FONT(FS_BIG, FC_YELLOW)); + DrawTextStatic(x2, SY + 46, WINDOW_SUBTITLE_STRING, FONT(FS_SMALL, FC_RED)); } static void ToggleFullscreenIfNeeded() @@ -172,8 +174,9 @@ static void ToggleFullscreenIfNeeded() void DrawMainMenu() { static LevelDirTree *leveldir_last_valid = NULL; - int i; char *name_text = (!options.network && setup.team_mode ? "Team:" : "Name:"); + int name_width = getFontWidth(FONT(FS_BIG, FC_GREEN)) * strlen("Name:"); + int i; UnmapAllGadgets(); FadeSounds(); @@ -229,51 +232,52 @@ void DrawMainMenu() DrawHeadline(); - DrawTextStatic(SX + 32, SY + 2*32, name_text, FS_BIG, FC_GREEN); - DrawText(SX + 6*32, SY + 2*32, setup.player_name, FS_BIG, FC_RED); - DrawTextStatic(SX + 32, SY + 3*32, "Level:", FS_BIG, FC_GREEN); - DrawText(SX + 11*32, SY + 3*32, int2str(level_nr,3), FS_BIG, - (leveldir_current->readonly ? FC_RED : FC_YELLOW)); - DrawTextStatic(SX + 32, SY + 4*32, "Hall Of Fame", FS_BIG, FC_GREEN); - DrawTextStatic(SX + 32, SY + 5*32, "Level Creator", FS_BIG, FC_GREEN); - DrawTextStatic(SY + 32, SY + 6*32, "Info Screen", FS_BIG, FC_GREEN); - DrawTextStatic(SX + 32, SY + 7*32, "Start Game", FS_BIG, FC_GREEN); - DrawTextStatic(SX + 32, SY + 8*32, "Setup", FS_BIG, FC_GREEN); - DrawTextStatic(SX + 32, SY + 9*32, "Quit", FS_BIG, FC_GREEN); + DrawTextStatic(SX + 32, SY + 2*32, name_text, FONT(FS_BIG, FC_GREEN)); + DrawText(SX + 32 + name_width, SY + 2*32, setup.player_name, + FONT(FS_BIG, FC_RED)); + DrawTextStatic(SX + 32, SY + 3*32, "Level:", FONT(FS_BIG, FC_GREEN)); + DrawText(SX + 11 * 32, SY + 3*32, int2str(level_nr,3), FONT(FS_BIG, + (leveldir_current->readonly ? FC_RED : FC_YELLOW))); + DrawTextStatic(SX + 32, SY + 4*32, "Hall Of Fame", FONT(FS_BIG,FC_GREEN)); + DrawTextStatic(SX + 32, SY + 5*32, "Level Creator",FONT(FS_BIG,FC_GREEN)); + DrawTextStatic(SY + 32, SY + 6*32, "Info Screen", FONT(FS_BIG, FC_GREEN)); + DrawTextStatic(SX + 32, SY + 7*32, "Start Game", FONT(FS_BIG, FC_GREEN)); + DrawTextStatic(SX + 32, SY + 8*32, "Setup", FONT(FS_BIG, FC_GREEN)); + DrawTextStatic(SX + 32, SY + 9*32, "Quit", FONT(FS_BIG, FC_GREEN)); DrawMicroLevel(MICROLEV_XPOS, MICROLEV_YPOS, TRUE); - DrawTextF(7*32 + 6, 3*32 + 9, FC_RED, "%d-%d", + DrawTextF(7*32 + 6, 3*32 + 9, FONT(FS_SMALL, FC_RED), "%d-%d", leveldir_current->first_level, leveldir_current->last_level); if (leveldir_current->readonly) { - DrawTextF(15*32 + 6, 3*32 + 9 - 7, FC_RED, "READ"); - DrawTextF(15*32 + 6, 3*32 + 9 + 7, FC_RED, "ONLY"); + DrawTextF(15*32 + 6, 3*32 + 9 - 7, FONT(FS_SMALL, FC_RED), "READ"); + DrawTextF(15*32 + 6, 3*32 + 9 + 7, FONT(FS_SMALL, FC_RED), "ONLY"); } for(i=0; i<8; i++) - initCursor(i, (i == 1 || i == 6 ? IMG_ARROW_BLUE_RIGHT : IMG_BALL_BLUE)); + initCursor(i, (i == 1 || i == 6 ? IMG_MENU_BUTTON_RIGHT :IMG_MENU_BUTTON)); #if 0 - DrawGraphic(10, 3, IMG_ARROW_BLUE_LEFT, 0); - DrawGraphic(14, 3, IMG_ARROW_BLUE_RIGHT, 0); + DrawGraphic(10, 3, IMG_MENU_BUTTON_LEFT, 0); + DrawGraphic(14, 3, IMG_MENU_BUTTON_RIGHT, 0); #else - drawCursorXY(10, 1, IMG_ARROW_BLUE_LEFT); - drawCursorXY(14, 1, IMG_ARROW_BLUE_RIGHT); + drawCursorXY(10, 1, IMG_MENU_BUTTON_LEFT); + drawCursorXY(14, 1, IMG_MENU_BUTTON_RIGHT); #endif DrawTextStatic(SX + 56, SY + 326, "A Game by Artsoft Entertainment", - FS_SMALL, FC_RED); + FONT(FS_SMALL, FC_RED)); if (leveldir_current->name) { int len = strlen(leveldir_current->name); - int lxpos = SX + (SXSIZE - len * FONT4_XSIZE) / 2; + int lxpos = SX + (SXSIZE - len * getFontWidth(FONT_SPECIAL_GAME)) / 2; int lypos = SY + 352; - DrawText(lxpos, lypos, leveldir_current->name, FS_SMALL, FC_SPECIAL2); + DrawText(lxpos, lypos, leveldir_current->name, FONT_SPECIAL_GAME); } FadeToFront(); @@ -371,7 +375,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) level_nr = new_level_nr; DrawText(SX + 11 * 32, SY + 3 * 32, int2str(level_nr, 3), - FS_BIG, font_color); + FONT(FS_BIG, font_color)); LoadLevel(level_nr); DrawMicroLevel(MICROLEV_XPOS, MICROLEV_YPOS, TRUE); @@ -1035,18 +1039,19 @@ void DrawHelpScreenElText(int start) ClearWindow(); DrawHeadline(); - DrawTextFCentered(100, FC_GREEN, "The game elements:"); + DrawTextFCentered(100, FONT(FS_SMALL, FC_GREEN), "The game elements:"); for(i=start; i < start + MAX_HELPSCREEN_ELS && i < num_helpscreen_els; i++) { DrawText(xstart, ystart + (i - start) * ystep + (*helpscreen_eltext[i][1] ? 0 : 8), - helpscreen_eltext[i][0], FS_SMALL, FC_YELLOW); + helpscreen_eltext[i][0], FONT_DEFAULT_SMALL); DrawText(xstart, ystart + (i - start) * ystep + 16, - helpscreen_eltext[i][1], FS_SMALL, FC_YELLOW); + helpscreen_eltext[i][1], FONT_DEFAULT_SMALL); } - DrawTextFCentered(ybottom, FC_BLUE, "Press any key or button for next page"); + DrawTextFCentered(ybottom, FONT(FS_SMALL, FC_BLUE), + "Press any key or button for next page"); } void DrawHelpScreenMusicText(int num) @@ -1058,22 +1063,24 @@ void DrawHelpScreenMusicText(int num) ClearWindow(); DrawHeadline(); - DrawTextFCentered(100, FC_GREEN, "The game background music loops:"); + DrawTextFCentered(100, FONT(FS_SMALL, FC_GREEN), + "The game background music loops:"); - DrawTextFCentered(ystart + 0 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 0 * ystep, FONT(FS_SMALL, FC_YELLOW), "Excerpt from"); - DrawTextFCentered(ystart + 1 * ystep, FC_RED, "\"%s\"", - helpscreen_music[num][0]); - DrawTextFCentered(ystart + 2 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 1 * ystep, FONT(FS_SMALL, FC_RED), + "\"%s\"", helpscreen_music[num][0]); + DrawTextFCentered(ystart + 2 * ystep, FONT(FS_SMALL, FC_YELLOW), "by"); - DrawTextFCentered(ystart + 3 * ystep, FC_RED, + DrawTextFCentered(ystart + 3 * ystep, FONT(FS_SMALL, FC_RED), "%s", helpscreen_music[num][1]); - DrawTextFCentered(ystart + 4 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 4 * ystep, FONT(FS_SMALL, FC_YELLOW), "from the album"); - DrawTextFCentered(ystart + 5 * ystep, FC_RED, "\"%s\"", - helpscreen_music[num][2]); + DrawTextFCentered(ystart + 5 * ystep, FONT(FS_SMALL, FC_RED), + "\"%s\"", helpscreen_music[num][2]); - DrawTextFCentered(ybottom, FC_BLUE, "Press any key or button for next page"); + DrawTextFCentered(ybottom, FONT(FS_SMALL, FC_BLUE), + "Press any key or button for next page"); #if 0 PlaySoundLoop(background_loop[num]); @@ -1089,22 +1096,23 @@ void DrawHelpScreenCreditsText() ClearWindow(); DrawHeadline(); - DrawTextFCentered(100, FC_GREEN, + DrawTextFCentered(100, FONT(FS_SMALL, FC_GREEN), "Credits:"); - DrawTextFCentered(ystart + 0 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 0 * ystep, FONT(FS_SMALL, FC_YELLOW), "DOS port of the game:"); - DrawTextFCentered(ystart + 1 * ystep, FC_RED, + DrawTextFCentered(ystart + 1 * ystep, FONT(FS_SMALL, FC_RED), "Guido Schulz"); - DrawTextFCentered(ystart + 2 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 2 * ystep, FONT(FS_SMALL, FC_YELLOW), "Additional toons:"); - DrawTextFCentered(ystart + 3 * ystep, FC_RED, + DrawTextFCentered(ystart + 3 * ystep, FONT(FS_SMALL, FC_RED), "Karl Hörnell"); - DrawTextFCentered(ystart + 5 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 5 * ystep, FONT(FS_SMALL, FC_YELLOW), "...and many thanks to all contributors"); - DrawTextFCentered(ystart + 6 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 6 * ystep, FONT(FS_SMALL, FC_YELLOW), "of new levels!"); - DrawTextFCentered(ybottom, FC_BLUE, "Press any key or button for next page"); + DrawTextFCentered(ybottom, FONT(FS_SMALL, FC_BLUE), + "Press any key or button for next page"); } void DrawHelpScreenContactText() @@ -1115,33 +1123,34 @@ void DrawHelpScreenContactText() ClearWindow(); DrawHeadline(); - DrawTextFCentered(100, FC_GREEN, "Program information:"); + DrawTextFCentered(100, FONT(FS_SMALL, FC_GREEN), "Program information:"); - DrawTextFCentered(ystart + 0 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 0 * ystep, FONT(FS_SMALL, FC_YELLOW), "This game is Freeware!"); - DrawTextFCentered(ystart + 1 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 1 * ystep, FONT(FS_SMALL, FC_YELLOW), "If you like it, send e-mail to:"); - DrawTextFCentered(ystart + 2 * ystep, FC_RED, + DrawTextFCentered(ystart + 2 * ystep, FONT(FS_SMALL, FC_RED), "info@artsoft.org"); - DrawTextFCentered(ystart + 3 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 3 * ystep, FONT(FS_SMALL, FC_YELLOW), "or SnailMail to:"); - DrawTextFCentered(ystart + 4 * ystep + 0, FC_RED, + DrawTextFCentered(ystart + 4 * ystep + 0, FONT(FS_SMALL, FC_RED), "Holger Schemel"); - DrawTextFCentered(ystart + 4 * ystep + 20, FC_RED, + DrawTextFCentered(ystart + 4 * ystep + 20, FONT(FS_SMALL, FC_RED), "Detmolder Strasse 189"); - DrawTextFCentered(ystart + 4 * ystep + 40, FC_RED, + DrawTextFCentered(ystart + 4 * ystep + 40, FONT(FS_SMALL, FC_RED), "33604 Bielefeld"); - DrawTextFCentered(ystart + 4 * ystep + 60, FC_RED, + DrawTextFCentered(ystart + 4 * ystep + 60, FONT(FS_SMALL, FC_RED), "Germany"); - DrawTextFCentered(ystart + 7 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 7 * ystep, FONT(FS_SMALL, FC_YELLOW), "If you have created new levels,"); - DrawTextFCentered(ystart + 8 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 8 * ystep, FONT(FS_SMALL, FC_YELLOW), "send them to me to include them!"); - DrawTextFCentered(ystart + 9 * ystep, FC_YELLOW, + DrawTextFCentered(ystart + 9 * ystep, FONT(FS_SMALL, FC_YELLOW), ":-)"); - DrawTextFCentered(ybottom, FC_BLUE, "Press any key or button for main menu"); + DrawTextFCentered(ybottom, FONT(FS_SMALL, FC_BLUE), + "Press any key or button for main menu"); } void DrawHelpScreen() @@ -1240,13 +1249,17 @@ void HandleHelpScreen(int button) void HandleTypeName(int newxpos, Key key) { static int xpos = 0, ypos = 2; + int font_width = getFontWidth(FONT_DEFAULT_BIG); + int name_width = getFontWidth(FONT(FS_BIG, FC_GREEN)) * strlen("Name:"); + int startx = SX + 32 + name_width; + int starty = SY + ypos * 32; if (newxpos) { xpos = newxpos; - DrawText(SX + 6 * 32, SY + ypos * 32, setup.player_name, - FS_BIG, FC_YELLOW); - drawCursorXY(xpos + 6, ypos - 2, IMG_BALL_RED); + + DrawText(startx, starty, setup.player_name, FONT_DEFAULT_BIG); + DrawText(startx + xpos * font_width, starty, "_", FONT_DEFAULT_BIG); return; } @@ -1266,22 +1279,20 @@ void HandleTypeName(int newxpos, Key key) setup.player_name[xpos + 1] = 0; xpos++; - DrawText(SX + 6 * 32, SY + ypos * 32, setup.player_name, - FS_BIG, FC_YELLOW); - drawCursorXY(xpos + 6, ypos - 2, IMG_BALL_RED); + DrawText(startx, starty, setup.player_name, FONT_DEFAULT_BIG); + DrawText(startx + xpos * font_width, starty, "_", FONT_DEFAULT_BIG); } else if ((key == KSYM_Delete || key == KSYM_BackSpace) && xpos > 0) { xpos--; setup.player_name[xpos] = 0; - DrawBackground(SX + (xpos + 6) * 32, SY + ypos * 32, 2 * TILEX, TILEY); - drawCursorXY(xpos + 6, ypos - 2, IMG_BALL_RED); + DrawText(startx + xpos * font_width, starty, "_ ", FONT_DEFAULT_BIG); } else if (key == KSYM_Return && xpos > 0) { - DrawText(SX + 6 * 32, SY + ypos * 32, setup.player_name, FS_BIG, FC_RED); - DrawBackground(SX + (xpos + 6) * 32, SY + ypos * 32, TILEX, TILEY); + DrawText(startx, starty, setup.player_name, FONT(FS_BIG, FC_RED)); + DrawText(startx + xpos * font_width, starty, " ", FONT_DEFAULT_BIG); SaveSetup(); game_status = MAINMENU; @@ -1339,8 +1350,8 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, ti->type == TREE_TYPE_SOUNDS_DIR ? "Custom Sounds" : ti->type == TREE_TYPE_MUSIC_DIR ? "Custom Music" : ""); - DrawText(SX + offset, SY + offset, title_string, FS_BIG, - (ti->type == TREE_TYPE_LEVEL_DIR ? FC_GREEN : FC_YELLOW)); + DrawText(SX + offset, SY + offset, title_string, FONT(FS_BIG, + (ti->type == TREE_TYPE_LEVEL_DIR ? FC_GREEN : FC_YELLOW))); for(i=0; iname , max_buffer_len); buffer[max_buffer_len] = '\0'; - DrawText(SX + 32, SY + ypos * 32, buffer, FS_MEDIUM, node->color); + DrawText(SX + 32, SY + ypos * 32, buffer, FONT(FS_MEDIUM, node->color)); if (node->parent_link) - initCursor(i, IMG_ARROW_BLUE_LEFT); + initCursor(i, IMG_MENU_BUTTON_LEFT); else if (node->level_group) - initCursor(i, IMG_ARROW_BLUE_RIGHT); + initCursor(i, IMG_MENU_BUTTON_RIGHT); else - initCursor(i, IMG_BALL_BLUE); + initCursor(i, IMG_MENU_BUTTON); } if (first_entry > 0) @@ -1369,7 +1380,7 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, int ypos = 1; DrawBackground(SX, SY + ypos * 32, TILEX, TILEY); - DrawGraphicThruMask(0, ypos, IMG_ARROW_BLUE_UP, 0); + DrawGraphicThruMask(0, ypos, IMG_MENU_BUTTON_UP, 0); } if (first_entry + num_page_entries < num_entries) @@ -1377,7 +1388,7 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, int ypos = MAX_MENU_ENTRIES_ON_SCREEN + 1; DrawBackground(SX, SY + ypos * 32, TILEX, TILEY); - DrawGraphicThruMask(0, ypos, IMG_ARROW_BLUE_DOWN, 0); + DrawGraphicThruMask(0, ypos, IMG_MENU_BUTTON_DOWN, 0); } } @@ -1395,11 +1406,13 @@ static void drawChooseTreeInfo(int entry_pos, TreeInfo *ti) DrawBackground(SX + 32, SY + 32, SXSIZE - 64, 32); if (node->parent_link) - DrawTextFCentered(40, FC_RED, "leave group \"%s\"", node->class_desc); + DrawTextFCentered(40, FONT(FS_SMALL, FC_RED), "leave group \"%s\"", + node->class_desc); else if (node->level_group) - DrawTextFCentered(40, FC_RED, "enter group \"%s\"", node->class_desc); + DrawTextFCentered(40, FONT(FS_SMALL, FC_RED), "enter group \"%s\"", + node->class_desc); else if (ti->type == TREE_TYPE_LEVEL_DIR) - DrawTextFCentered(40, FC_RED, "%3d levels (%s)", + DrawTextFCentered(40, FONT(FS_SMALL, FC_RED), "%3d levels (%s)", node->levels, node->class_desc); /* let BackToFront() redraw only what is needed */ @@ -1611,7 +1624,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, void DrawChooseLevel() { - SetMainBackgroundImage(IMG_BACKGROUND_LEVEL_SERIES); + SetMainBackgroundImage(IMG_BACKGROUND_LEVELS); DrawChooseTree(&leveldir_current); } @@ -1646,11 +1659,12 @@ static void drawHallOfFameList(int first_entry, int highlight_position) { int i; - SetMainBackgroundImage(IMG_BACKGROUND_HALL_OF_FAME); + SetMainBackgroundImage(IMG_BACKGROUND_SCORES); ClearWindow(); - DrawText(SX + 80, SY + 8, "Hall Of Fame", FS_BIG, FC_YELLOW); - DrawTextFCentered(46, FC_RED, "HighScores of Level %d", level_nr); + DrawText(SX + 80, SY + 8, "Hall Of Fame", FONT_DEFAULT_BIG); + DrawTextFCentered(46, FONT(FS_SMALL, FC_RED), "HighScores of Level %d", + level_nr); for(i=0; i 3 ? i-3 : 0); DrawText(SX + 3*32, SY + ypos*32, - " ", FS_BIG, FC_YELLOW); + " ", FONT_DEFAULT_BIG); DrawText(SX + 3*32, SY + ypos*32, (setup.input[player_nr].use_joystick ? custom[i].text : - getKeyNameFromKey(*custom[i].key)), - FS_BIG, FC_YELLOW); + getKeyNameFromKey(*custom[i].key)), FONT_DEFAULT_BIG); } } @@ -2498,19 +2515,20 @@ void CustomizeKeyboard(int player_nr) custom_key = setup.input[player_nr].key; ClearWindow(); - DrawText(SX + 16, SY + 16, "Keyboard Input", FS_BIG, FC_YELLOW); + DrawText(SX + 16, SY + 16, "Keyboard Input", FONT_DEFAULT_BIG); BackToFront(); InitAnimation(); step_nr = 0; DrawText(SX, SY + (2+2*step_nr)*32, - customize_step[step_nr].text, FS_BIG, FC_RED); + customize_step[step_nr].text, + FONT(FS_BIG, FC_RED)); DrawText(SX, SY + (2+2*step_nr+1)*32, - "Key:", FS_BIG, FC_RED); + "Key:", FONT(FS_BIG, FC_RED)); DrawText(SX + 4*32, SY + (2+2*step_nr+1)*32, getKeyNameFromKey(*customize_step[step_nr].key), - FS_BIG, FC_BLUE); + FONT(FS_BIG, FC_BLUE)); while(!finished) { @@ -2550,33 +2568,33 @@ void CustomizeKeyboard(int player_nr) /* got new key binding */ *customize_step[step_nr].key = key; DrawText(SX + 4*32, SY + (2+2*step_nr+1)*32, - " ", FS_BIG, FC_YELLOW); + " ", FONT_DEFAULT_BIG); DrawText(SX + 4*32, SY + (2+2*step_nr+1)*32, - getKeyNameFromKey(key), FS_BIG, FC_YELLOW); + getKeyNameFromKey(key), FONT_DEFAULT_BIG); step_nr++; /* un-highlight last query */ DrawText(SX, SY+(2+2*(step_nr-1))*32, - customize_step[step_nr-1].text, FS_BIG, FC_GREEN); + customize_step[step_nr-1].text, FONT(FS_BIG, FC_GREEN)); DrawText(SX, SY+(2+2*(step_nr-1)+1)*32, - "Key:", FS_BIG, FC_GREEN); + "Key:", FONT(FS_BIG, FC_GREEN)); /* press 'Enter' to leave */ if (step_nr == 6) { DrawText(SX + 16, SY + 15*32+16, - "Press Enter", FS_BIG, FC_YELLOW); + "Press Enter", FONT_DEFAULT_BIG); break; } /* query next key binding */ DrawText(SX, SY+(2+2*step_nr)*32, - customize_step[step_nr].text, FS_BIG, FC_RED); + customize_step[step_nr].text, FONT(FS_BIG, FC_RED)); DrawText(SX, SY+(2+2*step_nr+1)*32, - "Key:", FS_BIG, FC_RED); + "Key:", FONT(FS_BIG, FC_RED)); DrawText(SX + 4*32, SY+(2+2*step_nr+1)*32, getKeyNameFromKey(*customize_step[step_nr].key), - FS_BIG, FC_BLUE); + FONT(FS_BIG, FC_BLUE)); } break; @@ -2628,22 +2646,22 @@ static boolean CalibrateJoystickMain(int player_nr) ClearWindow(); - for(y=0; y<3; y++) + for(y=0; y < 3; y++) { - for(x=0; x<3; x++) + for(x=0; x < 3; x++) { + DrawGraphic(xpos + x - 1, ypos + y - 1, IMG_MENU_CALIBRATE_BLUE, 0); check[x][y] = FALSE; - DrawGraphic(xpos + x - 1, ypos + y - 1, IMG_BALL_BLUE, 0); } } - DrawText(SX, SY + 6 * 32, " ROTATE JOYSTICK ", FS_BIG, FC_YELLOW); - DrawText(SX, SY + 7 * 32, "IN ALL DIRECTIONS", FS_BIG, FC_YELLOW); - DrawText(SX + 16, SY + 9 * 32, " IF ALL BALLS ", FS_BIG, FC_YELLOW); - DrawText(SX, SY + 10 * 32, " ARE YELLOW, ", FS_BIG, FC_YELLOW); - DrawText(SX, SY + 11 * 32, " CENTER JOYSTICK ", FS_BIG, FC_YELLOW); - DrawText(SX, SY + 12 * 32, " AND ", FS_BIG, FC_YELLOW); - DrawText(SX, SY + 13 * 32, "PRESS ANY BUTTON!", FS_BIG, FC_YELLOW); + DrawText(SX, SY + 6 * 32, " ROTATE JOYSTICK ", FONT(FS_BIG,FC_YELLOW)); + DrawText(SX, SY + 7 * 32, "IN ALL DIRECTIONS", FONT(FS_BIG,FC_YELLOW)); + DrawText(SX + 16, SY + 9 * 32, " IF ALL BALLS ", FONT(FS_BIG,FC_YELLOW)); + DrawText(SX, SY + 10 * 32, " ARE YELLOW, ", FONT(FS_BIG,FC_YELLOW)); + DrawText(SX, SY + 11 * 32, " CENTER JOYSTICK ", FONT(FS_BIG,FC_YELLOW)); + DrawText(SX, SY + 12 * 32, " AND ", FONT(FS_BIG,FC_YELLOW)); + DrawText(SX, SY + 13 * 32, "PRESS ANY BUTTON!", FONT(FS_BIG,FC_YELLOW)); joy_value = Joystick(player_nr); last_x = (joy_value & JOY_LEFT ? -1 : joy_value & JOY_RIGHT ? +1 : 0); @@ -2656,7 +2674,7 @@ static boolean CalibrateJoystickMain(int player_nr) new_joystick_xmiddle = joy_x; new_joystick_ymiddle = joy_y; - DrawGraphic(xpos + last_x, ypos + last_y, IMG_BALL_RED, 0); + DrawGraphic(xpos + last_x, ypos + last_y, IMG_MENU_CALIBRATE_RED, 0); BackToFront(); while(Joystick(player_nr) & JOY_BUTTON); /* wait for released button */ @@ -2726,8 +2744,8 @@ static boolean CalibrateJoystickMain(int player_nr) if (x != last_x || y != last_y) { - DrawGraphic(xpos + last_x, ypos + last_y, IMG_BALL_YELLOW, 0); - DrawGraphic(xpos + x, ypos + y, IMG_BALL_RED, 0); + DrawGraphic(xpos + last_x, ypos + last_y, IMG_MENU_CALIBRATE_YELLOW, 0); + DrawGraphic(xpos + x, ypos + y, IMG_MENU_CALIBRATE_RED, 0); last_x = x; last_y = y; @@ -2794,8 +2812,8 @@ void CalibrateJoystick(int player_nr) { ClearWindow(); - DrawText(SX + 16, SY + 6*32, " JOYSTICK NOT ", FS_BIG, FC_YELLOW); - DrawText(SX, SY + 7*32, " AVAILABLE ", FS_BIG, FC_YELLOW); + DrawText(SX + 16, SY + 6*32, " JOYSTICK NOT ", FONT(FS_BIG,FC_YELLOW)); + DrawText(SX, SY + 7*32, " AVAILABLE ", FONT(FS_BIG,FC_YELLOW)); BackToFront(); Delay(2000); /* show error message for two seconds */ } @@ -2875,13 +2893,13 @@ static struct } scrollbutton_info[NUM_SCREEN_SCROLLBUTTONS] = { { - IMG_ARROW_BLUE_UP, IMG_ARROW_RED_UP, + IMG_MENU_BUTTON_UP, IMG_MENU_BUTTON_UP_ACTIVE, SC_SCROLL_UP_XPOS, SC_SCROLL_UP_YPOS, SCREEN_CTRL_ID_SCROLL_UP, "scroll up" }, { - IMG_ARROW_BLUE_DOWN, IMG_ARROW_RED_DOWN, + IMG_MENU_BUTTON_DOWN, IMG_MENU_BUTTON_DOWN_ACTIVE, SC_SCROLL_DOWN_XPOS, SC_SCROLL_DOWN_YPOS, SCREEN_CTRL_ID_SCROLL_DOWN, "scroll down" @@ -2906,7 +2924,7 @@ static struct #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) &scrollbar_bitmap[0], &scrollbar_bitmap[1], #else - IMG_SCROLLBAR_BLUE, IMG_SCROLLBAR_RED, + IMG_MENU_SCROLLBAR, IMG_SCROLLBAR_RED, #endif SX + SC_SCROLL_VERTICAL_XPOS, SY + SC_SCROLL_VERTICAL_YPOS, SC_SCROLL_VERTICAL_XSIZE, SC_SCROLL_VERTICAL_YSIZE, @@ -3043,20 +3061,20 @@ void CreateScreenGadgets() #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) int i; - for (i=0; i<4; i++) + for (i=0; i<2; i++) { scrollbar_bitmap[i] = CreateBitmap(TILEX, TILEY, DEFAULT_DEPTH); /* copy pointers to clip mask and GC */ scrollbar_bitmap[i]->clip_mask = - graphic_info[IMG_SCROLLBAR_BLUE + i].clip_mask; + graphic_info[IMG_MENU_SCROLLBAR + i].clip_mask; scrollbar_bitmap[i]->stored_clip_gc = - graphic_info[IMG_SCROLLBAR_BLUE + i].clip_gc; + graphic_info[IMG_MENU_SCROLLBAR + i].clip_gc; - BlitBitmap(graphic_info[IMG_SCROLLBAR_BLUE + i].bitmap, + BlitBitmap(graphic_info[IMG_MENU_SCROLLBAR + i].bitmap, scrollbar_bitmap[i], - graphic_info[IMG_SCROLLBAR_BLUE + i].src_x, - graphic_info[IMG_SCROLLBAR_BLUE + i].src_y, + graphic_info[IMG_MENU_SCROLLBAR + i].src_x, + graphic_info[IMG_MENU_SCROLLBAR + i].src_y, TILEX, TILEY, 0, 0); } #endif diff --git a/src/tape.c b/src/tape.c index 8d1b6952..60d49c8a 100644 --- a/src/tape.c +++ b/src/tape.c @@ -239,12 +239,12 @@ void DrawVideoDisplay(unsigned long state, unsigned long value) int monat = (value/100) % 100; int jahr = (value/10000); - DrawText(VX+VIDEO_DATE_XPOS,VY+VIDEO_DATE_YPOS, - int2str(tag,2),FS_SMALL,FC_SPECIAL1); - DrawText(VX+VIDEO_DATE_XPOS+27,VY+VIDEO_DATE_YPOS, - monatsname[monat],FS_SMALL,FC_SPECIAL1); - DrawText(VX+VIDEO_DATE_XPOS+64,VY+VIDEO_DATE_YPOS, - int2str(jahr,2),FS_SMALL,FC_SPECIAL1); + DrawText(VX + VIDEO_DATE_XPOS, VY + VIDEO_DATE_YPOS, + int2str(tag, 2), FONT_SPECIAL_TAPE); + DrawText(VX + VIDEO_DATE_XPOS + 27, VY + VIDEO_DATE_YPOS, + monatsname[monat], FONT_SPECIAL_TAPE); + DrawText(VX + VIDEO_DATE_XPOS + 64, VY + VIDEO_DATE_YPOS, + int2str(jahr, 2), FONT_SPECIAL_TAPE); } if (state & VIDEO_STATE_TIME_ON) @@ -252,10 +252,10 @@ void DrawVideoDisplay(unsigned long state, unsigned long value) int min = value / 60; int sec = value % 60; - DrawText(VX+VIDEO_TIME_XPOS,VY+VIDEO_TIME_YPOS, - int2str(min,2),FS_SMALL,FC_SPECIAL1); - DrawText(VX+VIDEO_TIME_XPOS+27,VY+VIDEO_TIME_YPOS, - int2str(sec,2),FS_SMALL,FC_SPECIAL1); + DrawText(VX + VIDEO_TIME_XPOS, VY + VIDEO_TIME_YPOS, + int2str(min, 2), FONT_SPECIAL_TAPE); + DrawText(VX + VIDEO_TIME_XPOS + 27, VY + VIDEO_TIME_YPOS, + int2str(sec, 2), FONT_SPECIAL_TAPE); } if (state & VIDEO_STATE_DATE) diff --git a/src/tools.c b/src/tools.c index 5569bce9..8ed2e29b 100644 --- a/src/tools.c +++ b/src/tools.c @@ -254,7 +254,7 @@ void BackToFront() MICROLEV_XPOS, MICROLEV_YPOS, MICROLEV_XSIZE, MICROLEV_YSIZE, MICROLEV_XPOS, MICROLEV_YPOS); BlitBitmap(backbuffer, window, - SX, MICROLABEL_YPOS, SXSIZE, FONT4_YSIZE, + SX, MICROLABEL_YPOS, SXSIZE, getFontHeight(FONT_SPECIAL_GAME), SX, MICROLABEL_YPOS); redraw_mask &= ~REDRAW_MICROLEVEL; } @@ -279,7 +279,7 @@ void BackToFront() info1[0] = '\0'; sprintf(text, "%.1f fps%s", global.frames_per_second, info1); - DrawTextExt(window, SX, SY, text, FS_SMALL, FC_YELLOW, FONT_OPAQUE); + DrawTextExt(window, SX, SY, text, FONT_DEFAULT_SMALL, FONT_OPAQUE); } FlushDisplay(); @@ -367,7 +367,7 @@ void SetMainBackgroundImage(int graphic) SetMainBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL : graphic_info[graphic].bitmap ? graphic_info[graphic].bitmap : - graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); + graphic_info[IMG_BACKGROUND].bitmap); } void SetDoorBackgroundImage(int graphic) @@ -375,7 +375,7 @@ void SetDoorBackgroundImage(int graphic) SetDoorBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL : graphic_info[graphic].bitmap ? graphic_info[graphic].bitmap : - graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); + graphic_info[IMG_BACKGROUND].bitmap); } void DrawBackground(int dest_x, int dest_y, int width, int height) @@ -1621,13 +1621,12 @@ static void DrawMicroLevelExt(int xpos, int ypos, int from_x, int from_y) #define MICROLABEL_IMPORTED_FROM 4 #define MICROLABEL_LEVEL_IMPORT_INFO 5 -#define MAX_MICROLABEL_SIZE (SXSIZE / FONT4_XSIZE) - static void DrawMicroLevelLabelExt(int mode) { - char label_text[MAX_MICROLABEL_SIZE + 1]; + char label_text[MAX_OUTPUT_LINESIZE + 1]; + int max_len_label_text = SXSIZE / getFontWidth(FONT_SPECIAL_GAME); - DrawBackground(SX, MICROLABEL_YPOS, SXSIZE, FONT4_YSIZE); + DrawBackground(SX, MICROLABEL_YPOS, SXSIZE,getFontHeight(FONT_SPECIAL_GAME)); strncpy(label_text, (mode == MICROLABEL_LEVEL_NAME ? level.name : mode == MICROLABEL_CREATED_BY ? "created by" : @@ -1635,15 +1634,16 @@ static void DrawMicroLevelLabelExt(int mode) mode == MICROLABEL_IMPORTED_FROM ? "imported from" : mode == MICROLABEL_LEVEL_IMPORT_INFO ? leveldir_current->imported_from : ""), - MAX_MICROLABEL_SIZE); - label_text[MAX_MICROLABEL_SIZE] = '\0'; + max_len_label_text); + label_text[max_len_label_text] = '\0'; if (strlen(label_text) > 0) { - int lxpos = SX + (SXSIZE - strlen(label_text) * FONT4_XSIZE) / 2; + int text_width = strlen(label_text) * getFontWidth(FONT_SPECIAL_GAME); + int lxpos = SX + (SXSIZE - text_width) / 2; int lypos = MICROLABEL_YPOS; - DrawText(lxpos, lypos, label_text, FS_SMALL, FC_SPECIAL2); + DrawText(lxpos, lypos, label_text, FONT_SPECIAL_GAME); } redraw_mask |= REDRAW_MICROLEVEL; @@ -1811,7 +1811,7 @@ boolean Request(char *text, unsigned int req_state) text_line[tl] = 0; DrawText(DX + 50 - (tl * 14)/2, DY + 8 + ty * 16, - text_line, FS_SMALL, FC_YELLOW); + text_line, FONT_DEFAULT_SMALL); text += tl + (tc == ' ' ? 1 : 0); }