diff --git a/stella/Makefile b/stella/Makefile index 5a5127cc9..8ca225b40 100644 --- a/stella/Makefile +++ b/stella/Makefile @@ -13,7 +13,7 @@ ## See the file "license" for information on usage and redistribution of ## this file, and for a DISCLAIMER OF ALL WARRANTIES. ## -## $Id: Makefile,v 1.20 2006-03-02 04:55:55 azaballa Exp $ +## $Id: Makefile,v 1.21 2006-03-02 13:10:53 stephena Exp $ ## ## Based on code from ScummVM - Scumm Interpreter ## Copyright (C) 2002-2004 The ScummVM project @@ -247,11 +247,11 @@ gp2x-strip: $(EXECUTABLE) # GP2X organize: groups necessary files into a gp2x folder for easy access. gp2x-organize: mkdir -p "$(srcdir)/gp2x" - mkdir -p "$(srcdir)/gp2x/docs" + mkdir -p "$(srcdir)/gp2x/docs" cp -v $(srcdir)/stella $(srcdir)/gp2x cp -v $(srcdir)/src/gp2x/stella.gpe $(srcdir)/gp2x cp -v $(srcdir)/src/emucore/stella.pro $(srcdir)/gp2x - cp -v $(srcdir)/README-GP2X.txt $(srcdir)/gp2x - cp -v -r $(srcdir)/docs/* $(srcdir)/gp2x/docs + cp -v $(srcdir)/README-GP2X.txt $(srcdir)/gp2x + cp -v -r $(srcdir)/docs/* $(srcdir)/gp2x/docs .PHONY: deb bundle test win32dist install uninstall diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 3dcf395f1..ff06500cc 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.cxx,v 1.150 2006-01-30 01:01:44 stephena Exp $ +// $Id: EventHandler.cxx,v 1.151 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #include @@ -659,31 +659,10 @@ void EventHandler::poll(uInt32 time) int button = event.jbutton.button; int state = event.jbutton.state == SDL_PRESSED ? 1 : 0; - // Account for buttons which represent diagonal movement - // We just generate two equivalent button events representing - // combined movement - switch(button) - { - case kJDirUpLeft: - handleJoyEvent(stick, kJDirUp, state); - handleJoyEvent(stick, kJDirLeft, state); - break; - case kJDirDownLeft: - handleJoyEvent(stick, kJDirDown, state); - handleJoyEvent(stick, kJDirLeft, state); - break; - case kJDirDownRight: - handleJoyEvent(stick, kJDirDown, state); - handleJoyEvent(stick, kJDirRight, state); - break; - case kJDirUpRight: - handleJoyEvent(stick, kJDirUp, state); - handleJoyEvent(stick, kJDirRight, state); - break; - default: - handleJoyEvent(stick, button, state); - break; - } + // Filter out buttons handled by OSystem + if(!myOSystem->joyButtonHandled(button)) + handleJoyEvent(stick, button, state); + break; // Regular button } diff --git a/stella/src/emucore/EventHandler.hxx b/stella/src/emucore/EventHandler.hxx index f8db9476b..6a48dd65f 100644 --- a/stella/src/emucore/EventHandler.hxx +++ b/stella/src/emucore/EventHandler.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.hxx,v 1.78 2006-01-31 17:26:56 stephena Exp $ +// $Id: EventHandler.hxx,v 1.79 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #ifndef EVENTHANDLER_HXX @@ -34,32 +34,6 @@ class DialogContainer; class EventMappingWidget; class EventStreamer; -// Used for those platforms which implement joystick directions -// as buttons instead of axis (which is a broken design IMHO) -// These are defined as constants vs. using platform-specific methods -// and variables for performance reasons -// Buttons not implemented for specific hardware are represented by numbers < 0, -// since no button can have those values (this isn't the cleanest code, but -// it *is* the fastest) -enum { - #if defined(GP2X) - kJDirUp = 0, kJDirUpLeft = 1, - kJDirLeft = 2, kJDirDownLeft = 3, - kJDirDown = 4, kJDirDownRight = 5, - kJDirRight = 6, kJDirUpRight = 7 - #elif defined(PSP) - kJDirUp = 8, kJDirUpLeft = -1, - kJDirLeft = 7, kJDirDownLeft = -2, - kJDirDown = 6, kJDirDownRight = -3, - kJDirRight = 9, kJDirUpRight = -4 - #else - kJDirUp = -1, kJDirUpLeft = -2, - kJDirLeft = -3, kJDirDownLeft = -4, - kJDirDown = -5, kJDirDownRight = -6, - kJDirRight = -7, kJDirUpRight = -8 - #endif -}; - // A wrapper around SDL hat events, so we don't drag SDL // through all the child classes enum JoyHat { @@ -133,7 +107,7 @@ struct JoyMouse { mapping can take place. @author Stephen Anthony - @version $Id: EventHandler.hxx,v 1.78 2006-01-31 17:26:56 stephena Exp $ + @version $Id: EventHandler.hxx,v 1.79 2006-03-02 13:10:53 stephena Exp $ */ class EventHandler { diff --git a/stella/src/emucore/OSystem.cxx b/stella/src/emucore/OSystem.cxx index 0855c79c4..6c6dce530 100644 --- a/stella/src/emucore/OSystem.cxx +++ b/stella/src/emucore/OSystem.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystem.cxx,v 1.61 2006-02-22 17:38:04 stephena Exp $ +// $Id: OSystem.cxx,v 1.62 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #include @@ -499,6 +499,14 @@ void OSystem::pollEvent() { } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool OSystem::joyButtonHandled(int button) +{ + // Since we don't do any platform-specific event polling, + // no button is ever handled at this level + return false; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OSystem::OSystem(const OSystem& osystem) { diff --git a/stella/src/emucore/OSystem.hxx b/stella/src/emucore/OSystem.hxx index 7a1c6ff9a..cdc8f9ba3 100644 --- a/stella/src/emucore/OSystem.hxx +++ b/stella/src/emucore/OSystem.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystem.hxx,v 1.38 2006-02-22 17:38:04 stephena Exp $ +// $Id: OSystem.hxx,v 1.39 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #ifndef OSYSTEM_HXX @@ -44,7 +44,7 @@ class CheatManager; other objects belong. @author Stephen Anthony - @version $Id: OSystem.hxx,v 1.38 2006-02-22 17:38:04 stephena Exp $ + @version $Id: OSystem.hxx,v 1.39 2006-03-02 13:10:53 stephena Exp $ */ class OSystem { @@ -357,6 +357,13 @@ class OSystem */ virtual void pollEvent(); + /** + This method answers whether the given button as already been + handled by the pollEvent() method, and as such should be ignored + in the main event handler. + */ + virtual bool joyButtonHandled(int button); + protected: /** Set the base directory for all Stella files diff --git a/stella/src/gp2x/OSystemGP2X.cxx b/stella/src/gp2x/OSystemGP2X.cxx index ba280aa40..917be5e1a 100644 --- a/stella/src/gp2x/OSystemGP2X.cxx +++ b/stella/src/gp2x/OSystemGP2X.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystemGP2X.cxx,v 1.6 2006-02-02 01:04:09 stephena Exp $ +// $Id: OSystemGP2X.cxx,v 1.7 2006-03-02 13:10:53 stephena Exp $ // Modified on 2006/01/06 by Alex Zaballa for use on GP2X //============================================================================ @@ -164,10 +164,6 @@ void OSystemGP2X::getScreenDimensions(int& width, int& height) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void OSystemGP2X::setDefaultJoymap() { -// myEventHandler->setDefaultJoyMapping(Event::JoystickZeroUp, 0, 0); // Up -// myEventHandler->setDefaultJoyMapping(Event::JoystickZeroLeft, 0, 2); // Left -// myEventHandler->setDefaultJoyMapping(Event::JoystickZeroDown, 0, 4); // Down -// myEventHandler->setDefaultJoyMapping(Event::JoystickZeroRight, 0, 6); // Right myEventHandler->setDefaultJoyMapping(Event::LauncherMode, 0, 8); // Start myEventHandler->setDefaultJoyMapping(Event::CmdMenuMode, 0, 9); // Select myEventHandler->setDefaultJoyMapping(Event::ConsoleReset, 0, 10); // L @@ -213,7 +209,6 @@ void OSystemGP2X::pollEvent() eventA0.axis = 0; eventA1.axis = 1; -#if 1 bool axisZeroChanged = false, axisOneChanged = false; axisOneChanged = axisOneChanged || myActiveEvents[kJDirUp]; @@ -268,39 +263,11 @@ void OSystemGP2X::pollEvent() if(axisZeroChanged) SDL_PushEvent((SDL_Event*)&eventA0); if(axisOneChanged) SDL_PushEvent((SDL_Event*)&eventA1); -#else - if(myCurrentEvents[kJDirUp]) // up - eventA1.value = -32768; - if(myCurrentEvents[kJDirDown]) // down - eventA1.value = 32767; - if(myCurrentEvents[kJDirLeft]) // left - eventA0.value = -32768; - if(myCurrentEvents[kJDirRight]) // right - eventA0.value = 32767; - - if(myCurrentEvents[kJDirUpLeft]) // up-left - { - eventA1.value = -16834; - eventA0.value = -16834; - } - if(myCurrentEvents[kJDirUpRight]) // up-right - { - eventA1.value = -16834; - eventA0.value = 16834; - } - if(myCurrentEvents[kJDirDownLeft]) // down-left - { - eventA1.value = 16834; - eventA0.value = -16834; - } - if(myCurrentEvents[kJDirDownRight]) // down-right - { - eventA1.value = 16834; - eventA0.value = 16834; - } - - SDL_PushEvent((SDL_Event*)&eventA0); - SDL_PushEvent((SDL_Event*)&eventA1); -#endif } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool OSystemGP2X::joyButtonHandled(int button) +{ + return (button < 8); +} diff --git a/stella/src/gp2x/OSystemGP2X.hxx b/stella/src/gp2x/OSystemGP2X.hxx index d93c7dc26..58060c7a9 100644 --- a/stella/src/gp2x/OSystemGP2X.hxx +++ b/stella/src/gp2x/OSystemGP2X.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystemGP2X.hxx,v 1.5 2006-02-02 01:04:09 stephena Exp $ +// $Id: OSystemGP2X.hxx,v 1.6 2006-03-02 13:10:53 stephena Exp $ // Modified by Alex Zaballa on 2006/01/04 for use on GP2X //============================================================================ @@ -70,6 +70,13 @@ class OSystemGP2X : public OSystem */ void pollEvent(); + /** + This method answers whether the given button as already been + handled by the pollEvent() method, and as such should be ignored + in the main event handler. + */ + bool joyButtonHandled(int button); + private: enum { kJDirUp = 0, kJDirUpLeft = 1, diff --git a/stella/src/gui/Dialog.cxx b/stella/src/gui/Dialog.cxx index f6a917531..e536bedd1 100644 --- a/stella/src/gui/Dialog.cxx +++ b/stella/src/gui/Dialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Dialog.cxx,v 1.42 2006-02-22 17:38:04 stephena Exp $ +// $Id: Dialog.cxx,v 1.43 2006-03-02 13:10:53 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -192,12 +192,6 @@ bool Dialog::wantsEvents() return _focusedWidget && _focusedWidget->wantsEvents(); } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool Dialog::wantsAllEvents() -{ - return _focusedWidget && _focusedWidget->wantsAllEvents(); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Dialog::draw() { @@ -416,11 +410,10 @@ void Dialog::handleJoyAxis(int stick, int axis, int value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Dialog::handleJoyHat(int stick, int hat, int value) +bool Dialog::handleJoyHat(int stick, int hat, int value) { // Focused widget receives joystick events - if(_focusedWidget) - _focusedWidget->handleJoyHat(stick, hat, value); + return (_focusedWidget && _focusedWidget->handleJoyHat(stick, hat, value)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/Dialog.hxx b/stella/src/gui/Dialog.hxx index 2a0aa5b2c..cb2be3017 100644 --- a/stella/src/gui/Dialog.hxx +++ b/stella/src/gui/Dialog.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Dialog.hxx,v 1.27 2006-02-22 17:38:04 stephena Exp $ +// $Id: Dialog.hxx,v 1.28 2006-03-02 13:10:53 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -36,7 +36,7 @@ class TabWidget; This is the base class for all dialog boxes. @author Stephen Anthony - @version $Id: Dialog.hxx,v 1.27 2006-02-22 17:38:04 stephena Exp $ + @version $Id: Dialog.hxx,v 1.28 2006-03-02 13:10:53 stephena Exp $ */ class Dialog : public GuiObject { @@ -82,16 +82,13 @@ class Dialog : public GuiObject virtual void handleJoyDown(int stick, int button); virtual void handleJoyUp(int stick, int button); virtual void handleJoyAxis(int stick, int axis, int value); - virtual void handleJoyHat(int stick, int hat, int value); + virtual bool handleJoyHat(int stick, int hat, int value); virtual void handleCommand(CommandSender* sender, int cmd, int data, int id); virtual void handleScreenChanged() {} - /** The dialog wants all events except those that have some special function */ + /** The dialog wants all events */ virtual bool wantsEvents(); - /** The dialog wants all events, without exception */ - virtual bool wantsAllEvents(); - Widget* findWidget(int x, int y); // Find the widget at pos x,y if any ButtonWidget* addButton(const GUI::Font& font, int x, int y, diff --git a/stella/src/gui/DialogContainer.cxx b/stella/src/gui/DialogContainer.cxx index 98f26df3c..2608939ef 100644 --- a/stella/src/gui/DialogContainer.cxx +++ b/stella/src/gui/DialogContainer.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DialogContainer.cxx,v 1.30 2006-01-09 19:30:04 stephena Exp $ +// $Id: DialogContainer.cxx,v 1.31 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #include "OSystem.hxx" @@ -277,34 +277,6 @@ void DialogContainer::handleJoyEvent(int stick, int button, uInt8 state) // Send the event to the dialog box on the top of the stack Dialog* activeDialog = myDialogStack.top(); - // Only preprocess button events if the dialog absolutely doesn't want them - if(!activeDialog->wantsAllEvents()) - { - // Some buttons act as directions. In those cases, translate them - // to axis events instead of mouse button events - int value = state > 0 ? 32767 : 0; - bool handled = true; - switch(button) - { - case kJDirUp: - handleJoyAxisEvent(stick, 1, -value); // axis 1, -value ==> UP - break; - case kJDirLeft: - handleJoyAxisEvent(stick, 0, -value); // axis 0, -value ==> LEFT - break; - case kJDirDown: - handleJoyAxisEvent(stick, 1, value); // axis 1, +value ==> DOWN - break; - case kJDirRight: - handleJoyAxisEvent(stick, 0, value); // axis 0, +value ==> RIGHT - break; - default: - handled = false; - } - if(handled) - return; - } - if(activeDialog->wantsEvents()) { if(state == 1) @@ -395,9 +367,8 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, int value) // Send the event to the dialog box on the top of the stack Dialog* activeDialog = myDialogStack.top(); - // Only preprocess hat events if the dialog absolutely doesn't want them - // Translate to axis events for movement - if(!activeDialog->wantsAllEvents()) + if(!(activeDialog->wantsEvents() && + activeDialog->handleJoyHat(stick, hat, value))) { bool handled = true; switch(value) @@ -424,9 +395,6 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, int value) if(handled) return; } - - if(activeDialog->wantsEvents()) - activeDialog->handleJoyHat(stick, hat, value); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/EventMappingWidget.cxx b/stella/src/gui/EventMappingWidget.cxx index b11c0bfee..be0e83120 100644 --- a/stella/src/gui/EventMappingWidget.cxx +++ b/stella/src/gui/EventMappingWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventMappingWidget.cxx,v 1.12 2006-02-22 17:38:04 stephena Exp $ +// $Id: EventMappingWidget.cxx,v 1.13 2006-03-02 13:10:53 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -135,7 +135,7 @@ void EventMappingWidget::startRemapping() // Make sure that this widget receives all events, // and they aren't handled anywhere else - myActionsList->setFlags(WIDGET_WANTS_EVENTS|WIDGET_WTALL_EVENTS); + myActionsList->setFlags(WIDGET_WANTS_EVENTS); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -172,7 +172,7 @@ void EventMappingWidget::stopRemapping() } // Widget is now free to process events normally - myActionsList->clearFlags(WIDGET_WANTS_EVENTS|WIDGET_WTALL_EVENTS); + myActionsList->clearFlags(WIDGET_WANTS_EVENTS); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -224,15 +224,22 @@ void EventMappingWidget::handleJoyAxis(int stick, int axis, int value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EventMappingWidget::handleJoyHat(int stick, int hat, int value) +bool EventMappingWidget::handleJoyHat(int stick, int hat, int value) { + bool result = false; + // Remap joystick hats in remap mode if(myRemapStatus && myActionSelected >= 0) { Event::Type event = EventHandler::ourActionList[ myActionSelected ].event; if(instance()->eventHandler().addJoyHatMapping(event, stick, hat, value)) + { stopRemapping(); + result = true; + } } + + return result; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/EventMappingWidget.hxx b/stella/src/gui/EventMappingWidget.hxx index e6e4ee321..86e07ba5f 100644 --- a/stella/src/gui/EventMappingWidget.hxx +++ b/stella/src/gui/EventMappingWidget.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventMappingWidget.hxx,v 1.7 2006-02-22 17:38:04 stephena Exp $ +// $Id: EventMappingWidget.hxx,v 1.8 2006-03-02 13:10:53 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -48,7 +48,7 @@ class EventMappingWidget : public Widget, public CommandSender virtual bool handleKeyDown(int ascii, int keycode, int modifiers); virtual void handleJoyDown(int stick, int button); virtual void handleJoyAxis(int stick, int axis, int value); - virtual void handleJoyHat(int stick, int hat, int value); + virtual bool handleJoyHat(int stick, int hat, int value); bool remapMode() { return myRemapStatus; } diff --git a/stella/src/gui/InputDialog.cxx b/stella/src/gui/InputDialog.cxx index 5f6724715..068dafcc4 100644 --- a/stella/src/gui/InputDialog.cxx +++ b/stella/src/gui/InputDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: InputDialog.cxx,v 1.11 2006-02-22 17:38:04 stephena Exp $ +// $Id: InputDialog.cxx,v 1.12 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #include "OSystem.hxx" @@ -246,13 +246,13 @@ void InputDialog::handleJoyAxis(int stick, int axis, int value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void InputDialog::handleJoyHat(int stick, int hat, int value) +bool InputDialog::handleJoyHat(int stick, int hat, int value) { // Remap joystick hat in remap mode, otherwise pass to listwidget if(myEventMapper->remapMode()) - myEventMapper->handleJoyHat(stick, hat, value); + return myEventMapper->handleJoyHat(stick, hat, value); else - Dialog::handleJoyHat(stick, hat, value); + return Dialog::handleJoyHat(stick, hat, value); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/InputDialog.hxx b/stella/src/gui/InputDialog.hxx index 54033aa5b..c4cd5342d 100644 --- a/stella/src/gui/InputDialog.hxx +++ b/stella/src/gui/InputDialog.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: InputDialog.hxx,v 1.6 2006-02-22 17:38:04 stephena Exp $ +// $Id: InputDialog.hxx,v 1.7 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #ifndef INPUT_DIALOG_HXX @@ -42,7 +42,7 @@ class InputDialog : public Dialog virtual void handleKeyDown(int ascii, int keycode, int modifiers); virtual void handleJoyDown(int stick, int button); virtual void handleJoyAxis(int stick, int axis, int value); - virtual void handleJoyHat(int stick, int hat, int value); + virtual bool handleJoyHat(int stick, int hat, int value); virtual void handleCommand(CommandSender* sender, int cmd, int data, int id); void loadConfig(); diff --git a/stella/src/gui/Widget.hxx b/stella/src/gui/Widget.hxx index 027a1be3f..523f81226 100644 --- a/stella/src/gui/Widget.hxx +++ b/stella/src/gui/Widget.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Widget.hxx,v 1.47 2006-02-22 17:38:04 stephena Exp $ +// $Id: Widget.hxx,v 1.48 2006-03-02 13:10:53 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -47,8 +47,7 @@ enum { WIDGET_NODRAW_FOCUS = 1 << 8, WIDGET_STICKY_FOCUS = 1 << 9, WIDGET_WANTS_TAB = 1 << 10, - WIDGET_WANTS_EVENTS = 1 << 11, - WIDGET_WTALL_EVENTS = 1 << 12 + WIDGET_WANTS_EVENTS = 1 << 11 }; enum { @@ -76,7 +75,7 @@ enum { This is the base class for all widgets. @author Stephen Anthony - @version $Id: Widget.hxx,v 1.47 2006-02-22 17:38:04 stephena Exp $ + @version $Id: Widget.hxx,v 1.48 2006-03-02 13:10:53 stephena Exp $ */ class Widget : public GuiObject { @@ -100,7 +99,7 @@ class Widget : public GuiObject virtual void handleJoyDown(int stick, int button) {} virtual void handleJoyUp(int stick, int button) {} virtual void handleJoyAxis(int stick, int axis, int value) {} - virtual void handleJoyHat(int stick, int hat, int value) {} + virtual bool handleJoyHat(int stick, int hat, int value) { return false; } void draw(); void receivedFocus(); @@ -117,11 +116,10 @@ class Widget : public GuiObject void clearFlags(int flags) { _flags &= ~flags; } int getFlags() const { return _flags; } - bool isEnabled() const { return _flags & WIDGET_ENABLED; } - bool isVisible() const { return !(_flags & WIDGET_INVISIBLE); } - bool isSticky() const { return _flags & WIDGET_STICKY_FOCUS; } - bool wantsEvents() const { return _flags & WIDGET_WANTS_EVENTS; } - bool wantsAllEvents() const { return _flags & WIDGET_WTALL_EVENTS; } + bool isEnabled() const { return _flags & WIDGET_ENABLED; } + bool isVisible() const { return !(_flags & WIDGET_INVISIBLE); } + bool isSticky() const { return _flags & WIDGET_STICKY_FOCUS; } + bool wantsEvents() const { return _flags & WIDGET_WANTS_EVENTS; } void setID(int id) { _id = id; } int getID() { return _id; } diff --git a/stella/src/psp/OSystemPSP.hxx b/stella/src/psp/OSystemPSP.hxx index 9b0bd61d3..fe0a90c36 100644 --- a/stella/src/psp/OSystemPSP.hxx +++ b/stella/src/psp/OSystemPSP.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystemPSP.hxx,v 1.3 2006-01-08 02:28:04 stephena Exp $ +// $Id: OSystemPSP.hxx,v 1.4 2006-03-02 13:10:53 stephena Exp $ //============================================================================ #ifndef OSYSTEM_PSP_HXX @@ -26,7 +26,7 @@ This class defines PSP-specific settings. @author Stephen Anthony - @version $Id: OSystemPSP.hxx,v 1.3 2006-01-08 02:28:04 stephena Exp $ + @version $Id: OSystemPSP.hxx,v 1.4 2006-03-02 13:10:53 stephena Exp $ */ class OSystemPSP : public OSystem { @@ -74,4 +74,13 @@ class OSystemPSP : public OSystem virtual void getScreenDimensions(int& width, int& height); }; +// FIXME - this doesn't even compile any more ... + +/* + kJDirUp = 8, kJDirUpLeft = -1, + kJDirLeft = 7, kJDirDownLeft = -2, + kJDirDown = 6, kJDirDownRight = -3, + kJDirRight = 9, kJDirUpRight = -4 +*/ + #endif