ifeq ($(CONF_HD), 1)
CPPFLAGS += -DCONF_HD=1
OBJS += platform/sdlvhildon.o
+ CONF_EXIT_BUTTON ?= 1
endif
ifeq ($(CONF_HGW), 1)
CPPFLAGS += -DCONF_HGW=1 -I/usr/include/hgw
LDLIBS += -lhgw
OBJS += platform/hgw.o
endif
+ifeq ($(CONF_EXIT_BUTTON), 1)
+ CPPFLAGS += -DCONF_EXIT_BUTTON=1
+ LDLIBS += -lSDL_image
+ OBJS += platform/sdlvexit.o
+endif
# automatic dependencies
DEPS := $(OBJS:.o=.d)
Maintainer: Javier S. Pedro <maemo@javispedro.com>
Build-Depends: debhelper (>= 5), pkg-config, maemo-version, m4, libsdl1.2-dev,
libx11-dev, x11proto-core-dev, libxsp-dev, libpopt-dev, zlib1g-dev, gnupg,
- hildon-games-wrapper-dev, libosso-dev, osso-games-startup-dev,
+ hildon-games-wrapper-dev, libosso-dev, osso-games-startup-dev, libsdl-image1.2,
libhildonfm2-dev, libosso-gnomevfs2-dev, libhildonmime-dev, maemo-optify
Standards-Version: 3.7.2
static void processMouse(unsigned int x, unsigned int y, int pressed = 0)
{
+#if CONF_EXIT_BUTTON
+ /* no fullscreen escape button, we have to simulate one! */
+ if (Config.fullscreen && x > (800 - 100) && y < 50 && pressed > 0) {
+ S9xDoAction(kActionQuit);
+ }
+#endif
if (Config.touchscreenInput) {
if (pressed < 0) {
// Button up.
{
joypads[0] = 0;
joypads[1] = 0;
+ mouse.enabled = false;
+ mouse.pressed = false;
switch (Settings.ControllerOption) {
case SNES_JOYPAD:
GUI.Width = gameWidth;
GUI.Height = gameHeight;
#endif
+#if CONF_EXIT_BUTTON
+ exitReset();
+#endif
// Safeguard
if (gameHeight > GUI.Height || gameWidth > GUI.Width)
{
if (Config.touchscreenInput) {
S9xInputScreenChanged();
- if (Config.touchscreenShow) {
- scaler->pause();
- SDL_FillRect(screen, NULL, 0);
- S9xInputScreenDraw(Settings.SixteenBit ? 2 : 1,
- screen->pixels, screen->pitch);
- SDL_Flip(screen);
- scaler->resume();
- }
+ }
+
+ if (Config.touchscreenShow) {
+ scaler->pause();
+ SDL_FillRect(screen, NULL, 0);
+ S9xInputScreenDraw(Settings.SixteenBit ? 2 : 1,
+ screen->pixels, screen->pitch);
+ SDL_Flip(screen);
+ scaler->resume();
}
}
{
scaler->finish();
+#if CONF_EXIT_BUTTON
+ if (exitRequiresDraw()) {
+ //scaler->pause();
+ exitDraw(screen);
+ SDL_Flip(screen);
+ //scaler->resume();
+ }
+#endif
+
return TRUE;
}
#endif
+#if defined(MAEMO) && MAEMO_VERSION >= 5
+extern void exitReset();
+extern bool exitRequiresDraw();
+extern void exitDraw(SDL_Surface* where);
+#endif
+
#endif
--- /dev/null
+#include <SDL.h>
+#include <SDL_image.h>
+
+#include "platform.h"
+#include "sdlv.h"
+
+#define DIE(format, ...) do { \
+ fprintf(stderr, "Died at %s:%d: ", __FILE__, __LINE__ ); \
+ fprintf(stderr, format "\n", ## __VA_ARGS__); \
+ abort(); \
+ } while (0);
+
+static SDL_Surface* buttonSrf = 0;
+static SDL_Rect buttonRect;
+
+static const unsigned long totalAnimLen = 1;
+
+static unsigned long frameCounter = 0;
+
+void exitReset()
+{
+ frameCounter = 0;
+ if (!buttonSrf) {
+ buttonSrf = IMG_Load("/usr/share/icons/hicolor/scalable/hildon/general_overlay_back.png");
+ }
+
+ buttonRect.x = GUI.Width - buttonSrf->w;
+ buttonRect.y = 0;
+ buttonRect.w = buttonSrf->w;
+ buttonRect.h = buttonSrf->h;
+}
+
+bool exitRequiresDraw()
+{
+ if (!Config.fullscreen) return false;
+ if (frameCounter > totalAnimLen) {
+ return false;
+ } else {
+ frameCounter++;
+ return true;
+ }
+
+};
+
+void exitDraw(SDL_Surface* where)
+{
+ SDL_BlitSurface(buttonSrf, 0, where, &buttonRect);
+};
+