mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
games/xu4: Updated for version 1.3.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
886084e3f7
commit
b6241c626e
3 changed files with 6 additions and 695 deletions
|
@ -1,681 +0,0 @@
|
|||
diff -Naur xu4-1.2.1/src/intro.cpp u4-1.2.1/src/intro.cpp
|
||||
--- xu4-1.2.1/src/intro.cpp 2022-12-28 11:16:16.000000000 -0500
|
||||
+++ u4-1.2.1/src/intro.cpp 2022-12-12 17:42:19.000000000 -0500
|
||||
@@ -48,8 +48,6 @@
|
||||
#define GYP_SEGUE1 13
|
||||
#define GYP_SEGUE2 14
|
||||
|
||||
-#define INTRO_CON IntroController* ic = xu4.intro
|
||||
-
|
||||
#ifndef GPU_RENDER
|
||||
class IntroObjectState {
|
||||
public:
|
||||
@@ -59,6 +57,9 @@
|
||||
};
|
||||
#endif
|
||||
|
||||
+/* temporary place-holder for settings changes */
|
||||
+SettingsData settingsChanged;
|
||||
+
|
||||
const int IntroBinData::INTRO_TEXT_OFFSET = 17445 - 1; // (start at zero)
|
||||
const int IntroBinData::INTRO_MAP_OFFSET = 30339;
|
||||
const int IntroBinData::INTRO_FIXUPDATA_OFFSET = 29806;
|
||||
@@ -167,93 +168,20 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
-//----------------------------------------------------------------------------
|
||||
-
|
||||
-struct SettingsMenus {
|
||||
- static void menusNotice(int, void*, void*);
|
||||
-
|
||||
- SettingsMenus();
|
||||
-
|
||||
- void showMenu(Menu *menu);
|
||||
- void drawMenu();
|
||||
- void dispatchMenu(const MenuEvent* event);
|
||||
- void saveSettings();
|
||||
- void updateConfMenu(int);
|
||||
- void updateVideoMenu(int);
|
||||
- void updateSoundMenu(int);
|
||||
-
|
||||
- enum MenuConstants {
|
||||
- MI_CONF_VIDEO,
|
||||
- MI_CONF_SOUND,
|
||||
- MI_CONF_INPUT,
|
||||
- MI_CONF_SPEED,
|
||||
- MI_CONF_GAMEPLAY,
|
||||
- MI_CONF_INTERFACE,
|
||||
- MI_CONF_01,
|
||||
- MI_VIDEO_CONF_GFX,
|
||||
- MI_VIDEO_02,
|
||||
- MI_VIDEO_03,
|
||||
- MI_VIDEO_04,
|
||||
- MI_VIDEO_05,
|
||||
- MI_VIDEO_06,
|
||||
- MI_VIDEO_07,
|
||||
- MI_VIDEO_08,
|
||||
- MI_GFX_TILE_TRANSPARENCY,
|
||||
- MI_GFX_TILE_TRANSPARENCY_SHADOW_SIZE,
|
||||
- MI_GFX_TILE_TRANSPARENCY_SHADOW_OPACITY,
|
||||
- MI_GFX_RETURN,
|
||||
- MI_SOUND_01,
|
||||
- MI_SOUND_02,
|
||||
- MI_SOUND_03,
|
||||
- MI_INPUT_01,
|
||||
- MI_INPUT_02,
|
||||
- MI_INPUT_03,
|
||||
- MI_SPEED_01,
|
||||
- MI_SPEED_02,
|
||||
- MI_SPEED_03,
|
||||
- MI_SPEED_04,
|
||||
- MI_SPEED_05,
|
||||
- MI_SPEED_06,
|
||||
- MI_SPEED_07,
|
||||
- MI_GAMEPLAY_01,
|
||||
- MI_GAMEPLAY_02,
|
||||
- MI_GAMEPLAY_03,
|
||||
- MI_GAMEPLAY_04,
|
||||
- MI_GAMEPLAY_05,
|
||||
- MI_GAMEPLAY_06,
|
||||
- MI_INTERFACE_01,
|
||||
- MI_INTERFACE_02,
|
||||
- MI_INTERFACE_03,
|
||||
- MI_INTERFACE_04,
|
||||
- MI_INTERFACE_05,
|
||||
- MI_INTERFACE_06,
|
||||
- USE_SETTINGS = 0xFE,
|
||||
- CANCEL = 0xFF
|
||||
- };
|
||||
-
|
||||
- Menu mainMenu;
|
||||
- Menu confMenu;
|
||||
- Menu videoMenu;
|
||||
- Menu gfxMenu;
|
||||
- Menu soundMenu;
|
||||
- Menu inputMenu;
|
||||
- Menu speedMenu;
|
||||
- Menu gameplayMenu;
|
||||
- Menu interfaceMenu;
|
||||
-
|
||||
- Menu* active;
|
||||
- TextView extendedMenuArea;
|
||||
- int listenerId;
|
||||
-
|
||||
- /* temporary place-holder for settings changes */
|
||||
- SettingsData settingsChanged;
|
||||
-};
|
||||
-
|
||||
-SettingsMenus::SettingsMenus() :
|
||||
- extendedMenuArea(2 * CHAR_WIDTH, 10 * CHAR_HEIGHT, 36, 13)
|
||||
+IntroController::IntroController() :
|
||||
+ Controller(1),
|
||||
+ backgroundArea(),
|
||||
+ menuArea(1 * CHAR_WIDTH, 13 * CHAR_HEIGHT, 38, 11),
|
||||
+ extendedMenuArea(2 * CHAR_WIDTH, 10 * CHAR_HEIGHT, 36, 13),
|
||||
+ questionArea(INTRO_TEXT_X * CHAR_WIDTH, INTRO_TEXT_Y * CHAR_HEIGHT, INTRO_TEXT_WIDTH, INTRO_TEXT_HEIGHT),
|
||||
+ mapArea(BORDER_WIDTH, (TILE_HEIGHT * 6) + BORDER_HEIGHT, INTRO_MAP_WIDTH, INTRO_MAP_HEIGHT),
|
||||
+ binData(NULL),
|
||||
+ titles(), // element list
|
||||
+ title(titles.begin()), // element iterator
|
||||
+ bSkipTitles(false),
|
||||
+ egaGraphics(true)
|
||||
{
|
||||
- active = &confMenu;
|
||||
-
|
||||
+ // initialize menus
|
||||
confMenu.setTitle("XU4 Configuration:", 0, 0);
|
||||
confMenu.add(MI_CONF_VIDEO, "\010 Video Options", 2, 2,/*'v'*/ 2);
|
||||
confMenu.add(MI_CONF_SOUND, "\010 Sound Options", 2, 3,/*'s'*/ 2);
|
||||
@@ -267,8 +195,8 @@
|
||||
confMenu.setClosesMenu(CANCEL);
|
||||
|
||||
/* set the default visibility of the two enhancement menus */
|
||||
- confMenu.itemOfId(MI_CONF_GAMEPLAY)->setVisible(xu4.settings->enhancements);
|
||||
- confMenu.itemOfId(MI_CONF_INTERFACE)->setVisible(xu4.settings->enhancements);
|
||||
+ confMenu.getItemById(MI_CONF_GAMEPLAY)->setVisible(xu4.settings->enhancements);
|
||||
+ confMenu.getItemById(MI_CONF_INTERFACE)->setVisible(xu4.settings->enhancements);
|
||||
|
||||
videoMenu.setTitle("Video Options:", 0, 0);
|
||||
videoMenu.add(MI_VIDEO_CONF_GFX, "\010 Game Graphics Options", 2, 2,/*'g'*/ 2);
|
||||
@@ -306,7 +234,7 @@
|
||||
inputMenu.setTitle("Keyboard Options:", 0, 0);
|
||||
inputMenu.add(MI_INPUT_01, new IntMenuItem("Repeat Delay %4d msec", 2, 2,/*'d'*/ 7, &settingsChanged.keydelay, 100, MAX_KEY_DELAY, 100));
|
||||
inputMenu.add(MI_INPUT_02, new IntMenuItem("Repeat Interval %4d msec", 2, 3,/*'i'*/ 7, &settingsChanged.keyinterval, 10, MAX_KEY_INTERVAL, 10));
|
||||
- /* "Mouse Options:" is drawn in dispatchMenu() */
|
||||
+ /* "Mouse Options:" is drawn in the updateInputMenu() function */
|
||||
inputMenu.add(MI_INPUT_03, new BoolMenuItem("Mouse %s", 2, 7,/*'m'*/ 0, &settingsChanged.mouseOptions.enabled));
|
||||
inputMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
|
||||
inputMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
|
||||
@@ -357,198 +285,7 @@
|
||||
interfaceMenu.setClosesMenu(CANCEL);
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Set the active menu.
|
||||
- */
|
||||
-void SettingsMenus::showMenu(Menu *menu)
|
||||
-{
|
||||
- active = menu;
|
||||
- menu->reset();
|
||||
-}
|
||||
-
|
||||
-void SettingsMenus::drawMenu()
|
||||
-{
|
||||
- // draw the extended background for all option screens
|
||||
- // beasties are always visible on the menus
|
||||
- INTRO_CON;
|
||||
- ic->backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
- ic->backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
- ic->drawBeasties();
|
||||
-
|
||||
- active->show(&extendedMenuArea);
|
||||
-
|
||||
- // after drawing the menu, extra menu text can be added here
|
||||
- if (active == &inputMenu)
|
||||
- extendedMenuArea.textAt(0, 5, "Mouse Options:");
|
||||
- else if (active == &interfaceMenu)
|
||||
- extendedMenuArea.textAt(2, 3, " (Open, Jimmy, etc.)");
|
||||
-
|
||||
- screenUploadToGPU();
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
- * Update the screen when an observed menu is reset or has an item
|
||||
- * activated.
|
||||
- */
|
||||
-void SettingsMenus::menusNotice(int sender, void* eventData, void* user) {
|
||||
- ((SettingsMenus*) user)->dispatchMenu((MenuEvent*) eventData);
|
||||
-}
|
||||
-
|
||||
-void SettingsMenus::saveSettings() {
|
||||
- xu4.settings->setData(settingsChanged);
|
||||
- xu4.settings->write();
|
||||
-}
|
||||
-
|
||||
-void SettingsMenus::dispatchMenu(const MenuEvent* event)
|
||||
-{
|
||||
- const Menu* menu = event->menu;
|
||||
-
|
||||
- //printf("KR menu %d\n", event->type);
|
||||
-
|
||||
- if (event->type == MenuEvent::ACTIVATE ||
|
||||
- event->type == MenuEvent::INCREMENT ||
|
||||
- event->type == MenuEvent::DECREMENT)
|
||||
- {
|
||||
- int itemId = event->item->getId();
|
||||
-
|
||||
- if (menu == &confMenu) {
|
||||
- updateConfMenu(itemId);
|
||||
- }
|
||||
- else if (menu == &videoMenu) {
|
||||
- updateVideoMenu(itemId);
|
||||
- }
|
||||
- else if (menu == &gfxMenu) {
|
||||
- if(itemId == MI_GFX_RETURN)
|
||||
- showMenu(&videoMenu);
|
||||
- }
|
||||
- else if (menu == &soundMenu) {
|
||||
- updateSoundMenu(itemId);
|
||||
- }
|
||||
- else if (menu == &inputMenu) {
|
||||
- if (itemId == USE_SETTINGS) {
|
||||
- saveSettings();
|
||||
- screenShowMouseCursor(xu4.settings->mouseOptions.enabled);
|
||||
- }
|
||||
- }
|
||||
- else if (menu == &speedMenu) {
|
||||
- if (itemId == USE_SETTINGS) {
|
||||
- saveSettings();
|
||||
-
|
||||
- // re-initialize events
|
||||
- xu4.eventHandler->setTimerInterval(1000 / xu4.settings->gameCyclesPerSecond);
|
||||
- }
|
||||
- }
|
||||
- else if (menu == &gameplayMenu ||
|
||||
- menu == &interfaceMenu) {
|
||||
- if (itemId == USE_SETTINGS)
|
||||
- saveSettings();
|
||||
- }
|
||||
-
|
||||
- if (itemId == CANCEL)
|
||||
- settingsChanged = *xu4.settings; // discard settings
|
||||
- }
|
||||
-
|
||||
- drawMenu();
|
||||
-}
|
||||
-
|
||||
-void SettingsMenus::updateConfMenu(int itemId) {
|
||||
- // show or hide game enhancement options if enhancements are enabled/disabled
|
||||
- confMenu.itemOfId(MI_CONF_GAMEPLAY)->setVisible(settingsChanged.enhancements);
|
||||
- confMenu.itemOfId(MI_CONF_INTERFACE)->setVisible(settingsChanged.enhancements);
|
||||
-
|
||||
- saveSettings();
|
||||
-
|
||||
- switch(itemId) {
|
||||
- case MI_CONF_VIDEO:
|
||||
- showMenu(&videoMenu);
|
||||
- break;
|
||||
- case MI_VIDEO_CONF_GFX:
|
||||
- showMenu(&gfxMenu);
|
||||
- break;
|
||||
- case MI_CONF_SOUND:
|
||||
- showMenu(&soundMenu);
|
||||
- break;
|
||||
- case MI_CONF_INPUT:
|
||||
- showMenu(&inputMenu);
|
||||
- break;
|
||||
- case MI_CONF_SPEED:
|
||||
- showMenu(&speedMenu);
|
||||
- break;
|
||||
- case MI_CONF_GAMEPLAY:
|
||||
- showMenu(&gameplayMenu);
|
||||
- break;
|
||||
- case MI_CONF_INTERFACE:
|
||||
- showMenu(&interfaceMenu);
|
||||
- break;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-void SettingsMenus::updateVideoMenu(int itemId) {
|
||||
- switch(itemId) {
|
||||
- case USE_SETTINGS:
|
||||
- /* save settings (if necessary) */
|
||||
- if (*xu4.settings != settingsChanged) {
|
||||
- saveSettings();
|
||||
-
|
||||
- /* FIXME: resize images, etc. */
|
||||
- INTRO_CON;
|
||||
- ic->deleteIntro(); // delete intro stuff
|
||||
- screenReInit();
|
||||
- ic->init(); // re-fix the backgrounds and scale images, etc.
|
||||
-
|
||||
- // go back to menu mode
|
||||
- ic->mode = IntroController::INTRO_MENU;
|
||||
- }
|
||||
- break;
|
||||
- case MI_VIDEO_CONF_GFX:
|
||||
- showMenu(&gfxMenu);
|
||||
- break;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-void SettingsMenus::updateSoundMenu(int itemId) {
|
||||
- switch(itemId) {
|
||||
- case MI_SOUND_01:
|
||||
- musicSetVolume(settingsChanged.musicVol);
|
||||
- break;
|
||||
- case MI_SOUND_02:
|
||||
- soundSetVolume(settingsChanged.soundVol);
|
||||
- soundPlay(SOUND_FLEE);
|
||||
- break;
|
||||
- case USE_SETTINGS:
|
||||
- saveSettings();
|
||||
- {
|
||||
- INTRO_CON;
|
||||
- musicPlay(ic->introMusic);
|
||||
- }
|
||||
- break;
|
||||
- case CANCEL:
|
||||
- musicSetVolume(xu4.settings->musicVol);
|
||||
- soundSetVolume(xu4.settings->soundVol);
|
||||
- break;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-//----------------------------------------------------------------------------
|
||||
-
|
||||
-IntroController::IntroController() :
|
||||
- Controller(1),
|
||||
- backgroundArea(),
|
||||
- menuArea(1 * CHAR_WIDTH, 13 * CHAR_HEIGHT, 38, 11),
|
||||
- questionArea(INTRO_TEXT_X * CHAR_WIDTH, INTRO_TEXT_Y * CHAR_HEIGHT, INTRO_TEXT_WIDTH, INTRO_TEXT_HEIGHT),
|
||||
- mapArea(BORDER_WIDTH, (TILE_HEIGHT * 6) + BORDER_HEIGHT, INTRO_MAP_WIDTH, INTRO_MAP_HEIGHT),
|
||||
- menus(NULL),
|
||||
- binData(NULL),
|
||||
- titles(), // element list
|
||||
- title(titles.begin()), // element iterator
|
||||
- bSkipTitles(false),
|
||||
- egaGraphics(true)
|
||||
-{
|
||||
-}
|
||||
-
|
||||
IntroController::~IntroController() {
|
||||
- delete menus;
|
||||
-
|
||||
for (unsigned i=0; i < titles.size(); i++) {
|
||||
delete titles[i].srcImage;
|
||||
delete titles[i].destImage;
|
||||
@@ -558,10 +295,12 @@
|
||||
bool IntroController::present() {
|
||||
init();
|
||||
preloadMap();
|
||||
+ listenerId = gs_listen(1<<SENDER_MENU, introNotice, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
void IntroController::conclude() {
|
||||
+ gs_unplug(listenerId);
|
||||
deleteIntro();
|
||||
}
|
||||
|
||||
@@ -637,8 +376,7 @@
|
||||
|
||||
backgroundArea.reinit();
|
||||
menuArea.reinit();
|
||||
- if (menus)
|
||||
- menus->extendedMenuArea.reinit();
|
||||
+ extendedMenuArea.reinit();
|
||||
questionArea.reinit();
|
||||
mapArea.reinit();
|
||||
|
||||
@@ -714,17 +452,10 @@
|
||||
MAP_ENABLE;
|
||||
break;
|
||||
case 'c': {
|
||||
- if (! menus)
|
||||
- menus = new SettingsMenus;
|
||||
-
|
||||
// Make a copy of our settings so we can change them
|
||||
- menus->settingsChanged = *xu4.settings;
|
||||
+ settingsChanged = *xu4.settings;
|
||||
screenHideCursor();
|
||||
- menus->listenerId = gs_listen(1<<SENDER_MENU, menus->menusNotice,
|
||||
- menus);
|
||||
- menus->showMenu(&menus->confMenu);
|
||||
- runMenu(&menus->confMenu, &menus->extendedMenuArea, true);
|
||||
- gs_unplug(menus->listenerId);
|
||||
+ runMenu(&confMenu, &extendedMenuArea, true);
|
||||
screenShowCursor();
|
||||
updateScreen();
|
||||
break;
|
||||
@@ -1489,6 +1220,289 @@
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Update the screen when an observed menu is reset or has an item
|
||||
+ * activated.
|
||||
+ * TODO, reduce duped code.
|
||||
+ */
|
||||
+void IntroController::introNotice(int sender, void* eventData, void* user) {
|
||||
+ MenuEvent* event = (MenuEvent*) eventData;
|
||||
+ ((IntroController*) user)->dispatchMenu(event->menu, *event);
|
||||
+}
|
||||
+
|
||||
+void IntroController::dispatchMenu(const Menu *menu, MenuEvent &event) {
|
||||
+ if (menu == &confMenu)
|
||||
+ updateConfMenu(event);
|
||||
+ else if (menu == &videoMenu)
|
||||
+ updateVideoMenu(event);
|
||||
+ else if (menu == &gfxMenu)
|
||||
+ updateGfxMenu(event);
|
||||
+ else if (menu == &soundMenu)
|
||||
+ updateSoundMenu(event);
|
||||
+ else if (menu == &inputMenu)
|
||||
+ updateInputMenu(event);
|
||||
+ else if (menu == &speedMenu)
|
||||
+ updateSpeedMenu(event);
|
||||
+ else if (menu == &gameplayMenu)
|
||||
+ updateGameplayMenu(event);
|
||||
+ else if (menu == &interfaceMenu)
|
||||
+ updateInterfaceMenu(event);
|
||||
+
|
||||
+ // beasties are always visible on the menus
|
||||
+ drawBeasties();
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateConfMenu(MenuEvent &event) {
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+ // show or hide game enhancement options if enhancements are enabled/disabled
|
||||
+ confMenu.getItemById(MI_CONF_GAMEPLAY)->setVisible(settingsChanged.enhancements);
|
||||
+ confMenu.getItemById(MI_CONF_INTERFACE)->setVisible(settingsChanged.enhancements);
|
||||
+
|
||||
+ // save settings
|
||||
+ xu4.settings->setData(settingsChanged);
|
||||
+ xu4.settings->write();
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case MI_CONF_VIDEO:
|
||||
+ runMenu(&videoMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case MI_VIDEO_CONF_GFX:
|
||||
+ runMenu(&gfxMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case MI_CONF_SOUND:
|
||||
+ runMenu(&soundMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case MI_CONF_INPUT:
|
||||
+ runMenu(&inputMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case MI_CONF_SPEED:
|
||||
+ runMenu(&speedMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case MI_CONF_GAMEPLAY:
|
||||
+ runMenu(&gameplayMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case MI_CONF_INTERFACE:
|
||||
+ runMenu(&interfaceMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case CANCEL:
|
||||
+ // discard settings
|
||||
+ settingsChanged = *xu4.settings;
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateVideoMenu(MenuEvent &event) {
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case USE_SETTINGS:
|
||||
+ /* save settings (if necessary) */
|
||||
+ if (*xu4.settings != settingsChanged) {
|
||||
+ xu4.settings->setData(settingsChanged);
|
||||
+ xu4.settings->write();
|
||||
+
|
||||
+ /* FIXME: resize images, etc. */
|
||||
+ deleteIntro(); // delete intro stuff
|
||||
+ screenReInit();
|
||||
+ init(); // re-fix the backgrounds and scale images, etc.
|
||||
+
|
||||
+ // go back to menu mode
|
||||
+ mode = INTRO_MENU;
|
||||
+ }
|
||||
+ break;
|
||||
+ case MI_VIDEO_CONF_GFX:
|
||||
+ runMenu(&gfxMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ case CANCEL:
|
||||
+ // discard settings
|
||||
+ settingsChanged = *xu4.settings;
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateGfxMenu(MenuEvent &event)
|
||||
+{
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case MI_GFX_RETURN:
|
||||
+ runMenu(&videoMenu, &extendedMenuArea, true);
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateSoundMenu(MenuEvent &event) {
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case MI_SOUND_01:
|
||||
+ musicSetVolume(settingsChanged.musicVol);
|
||||
+ break;
|
||||
+ case MI_SOUND_02:
|
||||
+ soundSetVolume(settingsChanged.soundVol);
|
||||
+ soundPlay(SOUND_FLEE);
|
||||
+ break;
|
||||
+ case USE_SETTINGS:
|
||||
+ // save settings
|
||||
+ xu4.settings->setData(settingsChanged);
|
||||
+ xu4.settings->write();
|
||||
+ musicPlay(introMusic);
|
||||
+ break;
|
||||
+ case CANCEL:
|
||||
+ musicSetVolume(xu4.settings->musicVol);
|
||||
+ soundSetVolume(xu4.settings->soundVol);
|
||||
+ // discard settings
|
||||
+ settingsChanged = *xu4.settings;
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateInputMenu(MenuEvent &event) {
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case USE_SETTINGS:
|
||||
+ // save settings
|
||||
+ xu4.settings->setData(settingsChanged);
|
||||
+ xu4.settings->write();
|
||||
+
|
||||
+ // re-initialize keyboard
|
||||
+ EventHandler::setKeyRepeat(settingsChanged.keydelay, settingsChanged.keyinterval);
|
||||
+#ifndef IOS
|
||||
+ screenShowMouseCursor(xu4.settings->mouseOptions.enabled);
|
||||
+#endif
|
||||
+ break;
|
||||
+ case CANCEL:
|
||||
+ // discard settings
|
||||
+ settingsChanged = *xu4.settings;
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+
|
||||
+ // after drawing the menu, extra menu text can be added here
|
||||
+ extendedMenuArea.textAt(0, 5, "Mouse Options:");
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateSpeedMenu(MenuEvent &event) {
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case USE_SETTINGS:
|
||||
+ // save settings
|
||||
+ xu4.settings->setData(settingsChanged);
|
||||
+ xu4.settings->write();
|
||||
+
|
||||
+ // re-initialize events
|
||||
+ xu4.eventHandler->setTimerInterval(1000 /
|
||||
+ xu4.settings->gameCyclesPerSecond);
|
||||
+ break;
|
||||
+ case CANCEL:
|
||||
+ // discard settings
|
||||
+ settingsChanged = *xu4.settings;
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateGameplayMenu(MenuEvent &event) {
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case USE_SETTINGS:
|
||||
+ // save settings
|
||||
+ xu4.settings->setData(settingsChanged);
|
||||
+ xu4.settings->write();
|
||||
+ break;
|
||||
+ case CANCEL:
|
||||
+ // discard settings
|
||||
+ settingsChanged = *xu4.settings;
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+}
|
||||
+
|
||||
+void IntroController::updateInterfaceMenu(MenuEvent &event) {
|
||||
+ if (event.type == MenuEvent::ACTIVATE ||
|
||||
+ event.type == MenuEvent::INCREMENT ||
|
||||
+ event.type == MenuEvent::DECREMENT) {
|
||||
+
|
||||
+ switch(event.item->getId()) {
|
||||
+ case USE_SETTINGS:
|
||||
+ // save settings
|
||||
+ xu4.settings->setData(settingsChanged);
|
||||
+ xu4.settings->write();
|
||||
+ break;
|
||||
+ case CANCEL:
|
||||
+ // discard settings
|
||||
+ settingsChanged = *xu4.settings;
|
||||
+ break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // draw the extended background for all option screens
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_TOP, 0, 0);
|
||||
+ backgroundArea.draw(BKGD_OPTIONS_BTM, 0, 120);
|
||||
+
|
||||
+ // after drawing the menu, extra menu text can be added here
|
||||
+ extendedMenuArea.textAt(2, 3, " (Open, Jimmy, etc.)");
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* Initializes the question tree. The tree starts off with the first
|
||||
* eight entries set to the numbers 0-7 in a random order.
|
||||
*/
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
||||
|
||||
# 20230712 bkw: update for v1.3.
|
||||
|
||||
# 20230112 bkw: update for v1.2.1, after ~9 years there's a release!
|
||||
# - no more disable_alt_x.diff, it works properly now.
|
||||
# - always include the upgrade (u4upgrad.zip), since upstream does.
|
||||
|
@ -27,7 +29,7 @@
|
|||
cd $(dirname $0) ; CWD=$(pwd)
|
||||
|
||||
PRGNAM=xu4
|
||||
VERSION=${VERSION:-1.2.1}
|
||||
VERSION=${VERSION:-1.3}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
PKGTYPE=${PKGTYPE:-tgz}
|
||||
|
@ -52,16 +54,12 @@ OUTPUT=${OUTPUT:-/tmp}
|
|||
# LIBDIRSUFFIX isn't actually used for 1.2.1
|
||||
if [ "$ARCH" = "i586" ]; then
|
||||
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
@ -79,12 +77,6 @@ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|||
# If we didn't supply this file, 'make install' would try to download it.
|
||||
cat $CWD/u4upgrad.zip > u4upgrad.zip
|
||||
|
||||
# The xu4 source on the homepage (sourceforge) is missing a commit
|
||||
# that's in the 1.2.1 tag on github, which makes it fail to compile.
|
||||
# I could use the github source, but it doesn't include src/glv.
|
||||
# Easier to just apply the github commit to the sf tarball.
|
||||
patch -p1 < $CWD/really_1.2.1.diff
|
||||
|
||||
# Fix path to "profiles/" dir used by -p option. Patch makes it use
|
||||
# ~/.config/xu4/profiles/ rather than ./profiles off the current dir.
|
||||
patch -p1 < $CWD/profile_path.diff
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
PRGNAM="xu4"
|
||||
VERSION="1.2.1"
|
||||
VERSION="1.3"
|
||||
HOMEPAGE="https://xu4.sourceforge.net/"
|
||||
DOWNLOAD="https://downloads.sourceforge.net/project/xu4/xu4/1.2/xu4-1.2.1.tar.gz \
|
||||
DOWNLOAD="https://downloads.sourceforge.net/project/xu4/xu4/1.3/xu4-1.3.tar.gz \
|
||||
https://web.archive.org/web/20091209235819/http://www.thatfleminggent.com/ultima/ultima4.zip \
|
||||
https://downloads.sourceforge.net/project/xu4/Ultima%204%20VGA%20Upgrade/1.3/u4upgrad.zip"
|
||||
MD5SUM="53a4d180a0ff5d7b123b1c070965269c \
|
||||
MD5SUM="4f853f18029b6bcb7022525e0831d68a \
|
||||
f2006a5dbf175571912ef2594b6eb900 \
|
||||
4ce9c9cd9dab111275e0ebfde7a482c4"
|
||||
DOWNLOAD_x86_64=""
|
||||
|
|
Loading…
Reference in a new issue