From 7d07216e7f18ff03a650f53e0bfb372b07782ca2 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 13 Jun 2010 23:43:04 +0200 Subject: [PATCH] rnd-20100613-1-src * added tape button graphics and screen positions to graphics config --- ChangeLog | 3 + src/conf_gfx.c | 52 +++++++++++ src/conf_gfx.h | 246 +++++++++++++++++++++++++------------------------ src/conf_var.c | 40 ++++++++ src/conftime.h | 2 +- src/init.c | 6 ++ src/main.h | 11 ++- src/tape.c | 59 ++++++++++++ src/tape.h | 11 +++ 9 files changed, 308 insertions(+), 122 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0775a76e..b62b85c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2010-06-13 + * added tape button graphics and screen positions to graphics config + 2010-06-09 * improved single step mode in R'n'D, EM and SP engines diff --git a/src/conf_gfx.c b/src/conf_gfx.c index f8a5ae3f..9755a6dd 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -69,6 +69,10 @@ struct ConfigTypeInfo image_config_suffix[] = { ".sort_priority", ARG_UNDEFINED, TYPE_INTEGER }, { ".class", ARG_UNDEFINED, TYPE_STRING }, { ".style", ARG_UNDEFINED, TYPE_STRING }, + { ".active_xoffset", "0", TYPE_INTEGER }, + { ".active_yoffset", "0", TYPE_INTEGER }, + { ".pressed_xoffset", "0", TYPE_INTEGER }, + { ".pressed_yoffset", "0", TYPE_INTEGER }, { NULL, NULL, 0 } }; @@ -4692,6 +4696,43 @@ struct ConfigInfo image_config[] = { "menu.scrollbar.active.ypos", "10" }, { "menu.scrollbar.active.frames", "1" }, + { "tape.button.gfx.eject", "RocksDoor.pcx" }, + { "tape.button.gfx.eject.x", "305" }, + { "tape.button.gfx.eject.y", "357" }, + { "tape.button.gfx.eject.width", "18" }, + { "tape.button.gfx.eject.height", "18" }, + { "tape.button.gfx.eject.pressed_xoffset", "-100" }, + { "tape.button.gfx.extra", "RocksDoor.pcx" }, + { "tape.button.gfx.extra.x", "505" }, + { "tape.button.gfx.extra.y", "357" }, + { "tape.button.gfx.extra.width", "18" }, + { "tape.button.gfx.extra.height", "18" }, + { "tape.button.gfx.extra.pressed_xoffset", "-100" }, + { "tape.button.gfx.stop", "RocksDoor.pcx" }, + { "tape.button.gfx.stop.x", "323" }, + { "tape.button.gfx.stop.y", "357" }, + { "tape.button.gfx.stop.width", "18" }, + { "tape.button.gfx.stop.height", "18" }, + { "tape.button.gfx.stop.pressed_xoffset", "-100" }, + { "tape.button.gfx.pause", "RocksDoor.pcx" }, + { "tape.button.gfx.pause.x", "341" }, + { "tape.button.gfx.pause.y", "357" }, + { "tape.button.gfx.pause.width", "18" }, + { "tape.button.gfx.pause.height", "18" }, + { "tape.button.gfx.pause.pressed_xoffset", "-100" }, + { "tape.button.gfx.record", "RocksDoor.pcx" }, + { "tape.button.gfx.record.x", "359" }, + { "tape.button.gfx.record.y", "357" }, + { "tape.button.gfx.record.width", "18" }, + { "tape.button.gfx.record.height", "18" }, + { "tape.button.gfx.record.pressed_xoffset", "-100" }, + { "tape.button.gfx.play", "RocksDoor.pcx" }, + { "tape.button.gfx.play.x", "377" }, + { "tape.button.gfx.play.y", "357" }, + { "tape.button.gfx.play.width", "18" }, + { "tape.button.gfx.play.height", "18" }, + { "tape.button.gfx.play.pressed_xoffset", "-100" }, + { "font.initial_1", "RocksFontSmall.pcx" }, { "font.initial_1.x", "0" }, { "font.initial_1.y", "0" }, @@ -6396,6 +6437,17 @@ struct ConfigInfo image_config[] = { "game.button.sound_simple.x", "65" }, { "game.button.sound_simple.y", "245" }, + { "tape.button.eject.x", "5" }, + { "tape.button.eject.y", "77" }, + { "tape.button.stop.x", "23" }, + { "tape.button.stop.y", "77" }, + { "tape.button.pause.x", "41" }, + { "tape.button.pause.y", "77" }, + { "tape.button.record.x", "59" }, + { "tape.button.record.y", "77" }, + { "tape.button.play.x", "77" }, + { "tape.button.play.y", "77" }, + { "game.forced_scroll_delay_value", "-1" }, { "game.use_native_emc_graphics_engine", "false" }, { "game.use_native_sp_graphics_engine", "true" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index a8557b04..03a32f7d 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1699,126 +1699,132 @@ #define IMG_MENU_BUTTON_QUIT_ACTIVE 1678 #define IMG_MENU_SCROLLBAR 1679 #define IMG_MENU_SCROLLBAR_ACTIVE 1680 -#define IMG_FONT_INITIAL_1 1681 -#define IMG_FONT_INITIAL_2 1682 -#define IMG_FONT_INITIAL_3 1683 -#define IMG_FONT_INITIAL_4 1684 -#define IMG_FONT_TITLE_1 1685 -#define IMG_FONT_TITLE_2 1686 -#define IMG_FONT_TITLE_2_SETUP 1687 -#define IMG_FONT_MENU_1 1688 -#define IMG_FONT_MENU_1_ACTIVE 1689 -#define IMG_FONT_MENU_2 1690 -#define IMG_FONT_MENU_2_ACTIVE 1691 -#define IMG_FONT_TEXT_1 1692 -#define IMG_FONT_TEXT_1_MAIN 1693 -#define IMG_FONT_TEXT_1_LEVELS 1694 -#define IMG_FONT_TEXT_1_SETUP 1695 -#define IMG_FONT_TEXT_1_PREVIEW 1696 -#define IMG_FONT_TEXT_1_SCORES 1697 -#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1698 -#define IMG_FONT_TEXT_1_PANEL 1699 -#define IMG_FONT_TEXT_1_DOOR 1700 -#define IMG_FONT_TEXT_2 1701 -#define IMG_FONT_TEXT_2_MAIN 1702 -#define IMG_FONT_TEXT_2_LEVELS 1703 -#define IMG_FONT_TEXT_2_SETUP 1704 -#define IMG_FONT_TEXT_2_PREVIEW 1705 -#define IMG_FONT_TEXT_2_SCORES 1706 -#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1707 -#define IMG_FONT_TEXT_3 1708 -#define IMG_FONT_TEXT_3_LEVELS 1709 -#define IMG_FONT_TEXT_3_SETUP 1710 -#define IMG_FONT_TEXT_3_PREVIEW 1711 -#define IMG_FONT_TEXT_3_SCORES 1712 -#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1713 -#define IMG_FONT_TEXT_4 1714 -#define IMG_FONT_TEXT_4_MAIN 1715 -#define IMG_FONT_TEXT_4_LEVELS 1716 -#define IMG_FONT_TEXT_4_SETUP 1717 -#define IMG_FONT_TEXT_4_SCORES 1718 -#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1719 -#define IMG_FONT_ENVELOPE_1 1720 -#define IMG_FONT_ENVELOPE_2 1721 -#define IMG_FONT_ENVELOPE_3 1722 -#define IMG_FONT_ENVELOPE_4 1723 -#define IMG_FONT_INPUT_1 1724 -#define IMG_FONT_INPUT_1_MAIN 1725 -#define IMG_FONT_INPUT_1_ACTIVE 1726 -#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1727 -#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1728 -#define IMG_FONT_INPUT_2 1729 -#define IMG_FONT_INPUT_2_ACTIVE 1730 -#define IMG_FONT_OPTION_OFF 1731 -#define IMG_FONT_OPTION_ON 1732 -#define IMG_FONT_VALUE_1 1733 -#define IMG_FONT_VALUE_2 1734 -#define IMG_FONT_VALUE_OLD 1735 -#define IMG_FONT_LEVEL_NUMBER 1736 -#define IMG_FONT_LEVEL_NUMBER_ACTIVE 1737 -#define IMG_FONT_TAPE_RECORDER 1738 -#define IMG_FONT_GAME_INFO 1739 -#define IMG_FONT_INFO_ELEMENTS 1740 -#define IMG_FONT_INFO_LEVELSET 1741 -#define IMG_GLOBAL_BORDER 1742 -#define IMG_GLOBAL_DOOR 1743 -#define IMG_GLOBAL_BUSY 1744 -#define IMG_EDITOR_ELEMENT_BORDER 1745 -#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1746 -#define IMG_EDITOR_CASCADE_LIST 1747 -#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1748 -#define IMG_BACKGROUND 1749 -#define IMG_BACKGROUND_TITLE_INITIAL 1750 -#define IMG_BACKGROUND_TITLE 1751 -#define IMG_BACKGROUND_MAIN 1752 -#define IMG_BACKGROUND_LEVELS 1753 -#define IMG_BACKGROUND_SCORES 1754 -#define IMG_BACKGROUND_EDITOR 1755 -#define IMG_BACKGROUND_INFO 1756 -#define IMG_BACKGROUND_INFO_ELEMENTS 1757 -#define IMG_BACKGROUND_INFO_MUSIC 1758 -#define IMG_BACKGROUND_INFO_CREDITS 1759 -#define IMG_BACKGROUND_INFO_PROGRAM 1760 -#define IMG_BACKGROUND_INFO_VERSION 1761 -#define IMG_BACKGROUND_INFO_LEVELSET 1762 -#define IMG_BACKGROUND_SETUP 1763 -#define IMG_BACKGROUND_PLAYING 1764 -#define IMG_BACKGROUND_DOOR 1765 -#define IMG_BACKGROUND_TITLESCREEN_INITIAL_1 1766 -#define IMG_BACKGROUND_TITLESCREEN_INITIAL_2 1767 -#define IMG_BACKGROUND_TITLESCREEN_INITIAL_3 1768 -#define IMG_BACKGROUND_TITLESCREEN_INITIAL_4 1769 -#define IMG_BACKGROUND_TITLESCREEN_INITIAL_5 1770 -#define IMG_BACKGROUND_TITLESCREEN_1 1771 -#define IMG_BACKGROUND_TITLESCREEN_2 1772 -#define IMG_BACKGROUND_TITLESCREEN_3 1773 -#define IMG_BACKGROUND_TITLESCREEN_4 1774 -#define IMG_BACKGROUND_TITLESCREEN_5 1775 -#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 1776 -#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_2 1777 -#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_3 1778 -#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_4 1779 -#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_5 1780 -#define IMG_BACKGROUND_TITLEMESSAGE_1 1781 -#define IMG_BACKGROUND_TITLEMESSAGE_2 1782 -#define IMG_BACKGROUND_TITLEMESSAGE_3 1783 -#define IMG_BACKGROUND_TITLEMESSAGE_4 1784 -#define IMG_BACKGROUND_TITLEMESSAGE_5 1785 -#define IMG_BACKGROUND_ENVELOPE_1 1786 -#define IMG_BACKGROUND_ENVELOPE_2 1787 -#define IMG_BACKGROUND_ENVELOPE_3 1788 -#define IMG_BACKGROUND_ENVELOPE_4 1789 -#define IMG_TITLESCREEN_INITIAL_1 1790 -#define IMG_TITLESCREEN_INITIAL_2 1791 -#define IMG_TITLESCREEN_INITIAL_3 1792 -#define IMG_TITLESCREEN_INITIAL_4 1793 -#define IMG_TITLESCREEN_INITIAL_5 1794 -#define IMG_TITLESCREEN_1 1795 -#define IMG_TITLESCREEN_2 1796 -#define IMG_TITLESCREEN_3 1797 -#define IMG_TITLESCREEN_4 1798 -#define IMG_TITLESCREEN_5 1799 +#define IMG_TAPE_BUTTON_GFX_EJECT 1681 +#define IMG_TAPE_BUTTON_GFX_EXTRA 1682 +#define IMG_TAPE_BUTTON_GFX_STOP 1683 +#define IMG_TAPE_BUTTON_GFX_PAUSE 1684 +#define IMG_TAPE_BUTTON_GFX_RECORD 1685 +#define IMG_TAPE_BUTTON_GFX_PLAY 1686 +#define IMG_FONT_INITIAL_1 1687 +#define IMG_FONT_INITIAL_2 1688 +#define IMG_FONT_INITIAL_3 1689 +#define IMG_FONT_INITIAL_4 1690 +#define IMG_FONT_TITLE_1 1691 +#define IMG_FONT_TITLE_2 1692 +#define IMG_FONT_TITLE_2_SETUP 1693 +#define IMG_FONT_MENU_1 1694 +#define IMG_FONT_MENU_1_ACTIVE 1695 +#define IMG_FONT_MENU_2 1696 +#define IMG_FONT_MENU_2_ACTIVE 1697 +#define IMG_FONT_TEXT_1 1698 +#define IMG_FONT_TEXT_1_MAIN 1699 +#define IMG_FONT_TEXT_1_LEVELS 1700 +#define IMG_FONT_TEXT_1_SETUP 1701 +#define IMG_FONT_TEXT_1_PREVIEW 1702 +#define IMG_FONT_TEXT_1_SCORES 1703 +#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1704 +#define IMG_FONT_TEXT_1_PANEL 1705 +#define IMG_FONT_TEXT_1_DOOR 1706 +#define IMG_FONT_TEXT_2 1707 +#define IMG_FONT_TEXT_2_MAIN 1708 +#define IMG_FONT_TEXT_2_LEVELS 1709 +#define IMG_FONT_TEXT_2_SETUP 1710 +#define IMG_FONT_TEXT_2_PREVIEW 1711 +#define IMG_FONT_TEXT_2_SCORES 1712 +#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1713 +#define IMG_FONT_TEXT_3 1714 +#define IMG_FONT_TEXT_3_LEVELS 1715 +#define IMG_FONT_TEXT_3_SETUP 1716 +#define IMG_FONT_TEXT_3_PREVIEW 1717 +#define IMG_FONT_TEXT_3_SCORES 1718 +#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1719 +#define IMG_FONT_TEXT_4 1720 +#define IMG_FONT_TEXT_4_MAIN 1721 +#define IMG_FONT_TEXT_4_LEVELS 1722 +#define IMG_FONT_TEXT_4_SETUP 1723 +#define IMG_FONT_TEXT_4_SCORES 1724 +#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1725 +#define IMG_FONT_ENVELOPE_1 1726 +#define IMG_FONT_ENVELOPE_2 1727 +#define IMG_FONT_ENVELOPE_3 1728 +#define IMG_FONT_ENVELOPE_4 1729 +#define IMG_FONT_INPUT_1 1730 +#define IMG_FONT_INPUT_1_MAIN 1731 +#define IMG_FONT_INPUT_1_ACTIVE 1732 +#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1733 +#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1734 +#define IMG_FONT_INPUT_2 1735 +#define IMG_FONT_INPUT_2_ACTIVE 1736 +#define IMG_FONT_OPTION_OFF 1737 +#define IMG_FONT_OPTION_ON 1738 +#define IMG_FONT_VALUE_1 1739 +#define IMG_FONT_VALUE_2 1740 +#define IMG_FONT_VALUE_OLD 1741 +#define IMG_FONT_LEVEL_NUMBER 1742 +#define IMG_FONT_LEVEL_NUMBER_ACTIVE 1743 +#define IMG_FONT_TAPE_RECORDER 1744 +#define IMG_FONT_GAME_INFO 1745 +#define IMG_FONT_INFO_ELEMENTS 1746 +#define IMG_FONT_INFO_LEVELSET 1747 +#define IMG_GLOBAL_BORDER 1748 +#define IMG_GLOBAL_DOOR 1749 +#define IMG_GLOBAL_BUSY 1750 +#define IMG_EDITOR_ELEMENT_BORDER 1751 +#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1752 +#define IMG_EDITOR_CASCADE_LIST 1753 +#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1754 +#define IMG_BACKGROUND 1755 +#define IMG_BACKGROUND_TITLE_INITIAL 1756 +#define IMG_BACKGROUND_TITLE 1757 +#define IMG_BACKGROUND_MAIN 1758 +#define IMG_BACKGROUND_LEVELS 1759 +#define IMG_BACKGROUND_SCORES 1760 +#define IMG_BACKGROUND_EDITOR 1761 +#define IMG_BACKGROUND_INFO 1762 +#define IMG_BACKGROUND_INFO_ELEMENTS 1763 +#define IMG_BACKGROUND_INFO_MUSIC 1764 +#define IMG_BACKGROUND_INFO_CREDITS 1765 +#define IMG_BACKGROUND_INFO_PROGRAM 1766 +#define IMG_BACKGROUND_INFO_VERSION 1767 +#define IMG_BACKGROUND_INFO_LEVELSET 1768 +#define IMG_BACKGROUND_SETUP 1769 +#define IMG_BACKGROUND_PLAYING 1770 +#define IMG_BACKGROUND_DOOR 1771 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_1 1772 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_2 1773 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_3 1774 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_4 1775 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_5 1776 +#define IMG_BACKGROUND_TITLESCREEN_1 1777 +#define IMG_BACKGROUND_TITLESCREEN_2 1778 +#define IMG_BACKGROUND_TITLESCREEN_3 1779 +#define IMG_BACKGROUND_TITLESCREEN_4 1780 +#define IMG_BACKGROUND_TITLESCREEN_5 1781 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 1782 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_2 1783 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_3 1784 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_4 1785 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_5 1786 +#define IMG_BACKGROUND_TITLEMESSAGE_1 1787 +#define IMG_BACKGROUND_TITLEMESSAGE_2 1788 +#define IMG_BACKGROUND_TITLEMESSAGE_3 1789 +#define IMG_BACKGROUND_TITLEMESSAGE_4 1790 +#define IMG_BACKGROUND_TITLEMESSAGE_5 1791 +#define IMG_BACKGROUND_ENVELOPE_1 1792 +#define IMG_BACKGROUND_ENVELOPE_2 1793 +#define IMG_BACKGROUND_ENVELOPE_3 1794 +#define IMG_BACKGROUND_ENVELOPE_4 1795 +#define IMG_TITLESCREEN_INITIAL_1 1796 +#define IMG_TITLESCREEN_INITIAL_2 1797 +#define IMG_TITLESCREEN_INITIAL_3 1798 +#define IMG_TITLESCREEN_INITIAL_4 1799 +#define IMG_TITLESCREEN_INITIAL_5 1800 +#define IMG_TITLESCREEN_1 1801 +#define IMG_TITLESCREEN_2 1802 +#define IMG_TITLESCREEN_3 1803 +#define IMG_TITLESCREEN_4 1804 +#define IMG_TITLESCREEN_5 1805 -#define NUM_IMAGE_FILES 1800 +#define NUM_IMAGE_FILES 1806 #endif /* CONF_GFX_H */ diff --git a/src/conf_var.c b/src/conf_var.c index e12f0015..3739d0de 100644 --- a/src/conf_var.c +++ b/src/conf_var.c @@ -5060,6 +5060,46 @@ struct TokenIntPtrInfo image_config_vars[] = "game.button.sound_simple.y", &game.button.sound_simple.y }, + { + "tape.button.eject.x", + &tape.button.eject.x + }, + { + "tape.button.eject.y", + &tape.button.eject.y + }, + { + "tape.button.stop.x", + &tape.button.stop.x + }, + { + "tape.button.stop.y", + &tape.button.stop.y + }, + { + "tape.button.pause.x", + &tape.button.pause.x + }, + { + "tape.button.pause.y", + &tape.button.pause.y + }, + { + "tape.button.record.x", + &tape.button.record.x + }, + { + "tape.button.record.y", + &tape.button.record.y + }, + { + "tape.button.play.x", + &tape.button.play.x + }, + { + "tape.button.play.y", + &tape.button.play.y + }, { "game.forced_scroll_delay_value", &game.forced_scroll_delay_value diff --git a/src/conftime.h b/src/conftime.h index 923496aa..869d0587 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-06-09 23:36" +#define COMPILE_DATE_STRING "2010-06-13 23:40" diff --git a/src/init.c b/src/init.c index 5e5301c7..526154ea 100644 --- a/src/init.c +++ b/src/init.c @@ -1501,6 +1501,12 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->class = parameter[GFX_ARG_CLASS]; if (parameter[GFX_ARG_STYLE] != ARG_UNDEFINED_VALUE) g->style = parameter[GFX_ARG_STYLE]; + + /* this is only used for drawing menu buttons and text */ + g->active_xoffset = parameter[GFX_ARG_ACTIVE_XOFFSET]; + g->active_yoffset = parameter[GFX_ARG_ACTIVE_YOFFSET]; + g->pressed_xoffset = parameter[GFX_ARG_PRESSED_XOFFSET]; + g->pressed_yoffset = parameter[GFX_ARG_PRESSED_YOFFSET]; } static void set_graphic_parameters(int graphic) diff --git a/src/main.h b/src/main.h index 6d1f1717..088842a0 100644 --- a/src/main.h +++ b/src/main.h @@ -1914,8 +1914,12 @@ #define GFX_ARG_SORT_PRIORITY 45 #define GFX_ARG_CLASS 46 #define GFX_ARG_STYLE 47 +#define GFX_ARG_ACTIVE_XOFFSET 48 +#define GFX_ARG_ACTIVE_YOFFSET 49 +#define GFX_ARG_PRESSED_XOFFSET 50 +#define GFX_ARG_PRESSED_YOFFSET 51 -#define NUM_GFX_ARGS 48 +#define NUM_GFX_ARGS 52 /* values for sound configuration suffixes */ @@ -2716,6 +2720,11 @@ struct GraphicInfo int class; int style; + int active_xoffset; + int active_yoffset; + int pressed_xoffset; + int pressed_yoffset; + boolean use_image_size; /* use image size as default width and height */ #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) diff --git a/src/tape.c b/src/tape.c index 5c90cb41..116f11cf 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1212,38 +1212,73 @@ void AutoPlayTape() static struct { +#if 1 + struct Rect *tbi; + int graphic; +#else int x, y; +#endif int gadget_id; char *infotext; } tapebutton_info[NUM_TAPE_BUTTONS] = { { +#if 1 + &tape.button.eject, + IMG_TAPE_BUTTON_GFX_EJECT, +#else TAPE_BUTTON_EJECT_XPOS, TAPE_BUTTON_YPOS, +#endif TAPE_CTRL_ID_EJECT, "eject tape" }, { +#if 1 + &tape.button.eject, /* (same position as "eject" button) */ + IMG_TAPE_BUTTON_GFX_EXTRA, +#else TAPE_BUTTON_EXTRA_XPOS, TAPE_BUTTON_YPOS, +#endif TAPE_CTRL_ID_EXTRA, "extra functions" }, { +#if 1 + &tape.button.stop, + IMG_TAPE_BUTTON_GFX_STOP, +#else TAPE_BUTTON_STOP_XPOS, TAPE_BUTTON_YPOS, +#endif TAPE_CTRL_ID_STOP, "stop tape" }, { +#if 1 + &tape.button.pause, + IMG_TAPE_BUTTON_GFX_PAUSE, +#else TAPE_BUTTON_PAUSE_XPOS, TAPE_BUTTON_YPOS, +#endif TAPE_CTRL_ID_PAUSE, "pause tape" }, { +#if 1 + &tape.button.record, + IMG_TAPE_BUTTON_GFX_RECORD, +#else TAPE_BUTTON_RECORD_XPOS, TAPE_BUTTON_YPOS, +#endif TAPE_CTRL_ID_RECORD, "record tape" }, { +#if 1 + &tape.button.play, + IMG_TAPE_BUTTON_GFX_PLAY, +#else TAPE_BUTTON_PLAY_XPOS, TAPE_BUTTON_YPOS, +#endif TAPE_CTRL_ID_PLAY, "play tape" } @@ -1255,12 +1290,30 @@ void CreateTapeButtons() for (i = 0; i < NUM_TAPE_BUTTONS; i++) { +#if 1 + // struct TapeButtonInfo *tbi = tapebutton_info[i].tbi; + int graphic = tapebutton_info[i].graphic; + Bitmap *gd_bitmap = graphic_info[graphic].bitmap; +#else Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap; +#endif struct GadgetInfo *gi; int gd_xoffset, gd_yoffset; +#if 1 + int gd_x1, gd_x2, gd_y1, gd_y2; +#else int gd_x1, gd_x2, gd_y; +#endif int id = i; +#if 1 + gd_x1 = graphic_info[graphic].src_x; + gd_y1 = graphic_info[graphic].src_y; + gd_x2 = gd_x1 + graphic_info[graphic].pressed_xoffset; + gd_y2 = gd_y1 + graphic_info[graphic].pressed_yoffset; + gd_xoffset = tapebutton_info[i].tbi->x; + gd_yoffset = tapebutton_info[i].tbi->y; +#else gd_xoffset = tapebutton_info[i].x; gd_yoffset = tapebutton_info[i].y; gd_x1 = DOOR_GFX_PAGEX4 + gd_xoffset; @@ -1272,6 +1325,7 @@ void CreateTapeButtons() gd_x1 = DOOR_GFX_PAGEX6 + gd_xoffset; gd_x2 = DOOR_GFX_PAGEX5 + gd_xoffset; } +#endif gi = CreateGadget(GDI_CUSTOM_ID, id, GDI_INFO_TEXT, tapebutton_info[i].infotext, @@ -1281,8 +1335,13 @@ void CreateTapeButtons() GDI_HEIGHT, TAPE_BUTTON_YSIZE, GDI_TYPE, GD_TYPE_NORMAL_BUTTON, GDI_STATE, GD_BUTTON_UNPRESSED, +#if 1 + GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y1, + GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y2, +#else GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y, GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y, +#endif GDI_DIRECT_DRAW, FALSE, GDI_EVENT_MASK, GD_EVENT_RELEASED, GDI_CALLBACK_ACTION, HandleTapeButtons, diff --git a/src/tape.h b/src/tape.h index cafa235d..396d298c 100644 --- a/src/tape.h +++ b/src/tape.h @@ -93,6 +93,15 @@ #define VIDEO_DISPLAY_SYMBOL_ONLY -2 +struct TapeButtonInfo +{ + struct Rect eject; + struct Rect stop; + struct Rect pause; + struct Rect record; + struct Rect play; +}; + struct TapeInfo { int file_version; /* file format version the tape is stored with */ @@ -128,6 +137,8 @@ struct TapeInfo byte delay; } pos[MAX_TAPE_LEN]; + struct TapeButtonInfo button; + boolean no_valid_file; /* set when tape file missing or invalid */ }; -- 2.34.1