aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/events/openpandora/op-events.cpp20
-rw-r--r--backends/graphics/openpandora/op-graphics.h2
-rw-r--r--backends/platform/openpandora/op-backend.cpp112
-rw-r--r--backends/platform/openpandora/op-main.cpp2
-rw-r--r--backends/platform/openpandora/op-options.cpp8
-rw-r--r--backends/platform/openpandora/op-options.h2
-rw-r--r--backends/platform/openpandora/op-sdl.h2
7 files changed, 73 insertions, 75 deletions
diff --git a/backends/events/openpandora/op-events.cpp b/backends/events/openpandora/op-events.cpp
index 56915f96fe..c1d6362fcb 100644
--- a/backends/events/openpandora/op-events.cpp
+++ b/backends/events/openpandora/op-events.cpp
@@ -38,23 +38,23 @@
#include "common/events.h"
/* Quick default button states for modifiers. */
-int BUTTON_STATE_L = false;
+int BUTTON_STATE_L = false;
enum {
/* Touchscreen TapMode */
- TAPMODE_LEFT = 0,
- TAPMODE_RIGHT = 1,
- TAPMODE_HOVER = 2
+ TAPMODE_LEFT = 0,
+ TAPMODE_RIGHT = 1,
+ TAPMODE_HOVER = 2
};
OPEventSource::OPEventSource()
- : _buttonStateL(false){
+ : _buttonStateL(false) {
}
/* Custom handleMouseButtonDown/handleMouseButtonUp to deal with 'Tap Mode' for the touchscreen */
bool OPEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
- if (ev.button.button == SDL_BUTTON_LEFT){
+ if (ev.button.button == SDL_BUTTON_LEFT) {
if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */
event.type = Common::EVENT_RBUTTONDOWN;
else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
@@ -65,8 +65,7 @@ bool OPEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
else
event.type = Common::EVENT_LBUTTONDOWN; /* For normal mice etc. */
- }
- else if (ev.button.button == SDL_BUTTON_RIGHT)
+ } else if (ev.button.button == SDL_BUTTON_RIGHT)
event.type = Common::EVENT_RBUTTONDOWN;
#if defined(SDL_BUTTON_WHEELUP) && defined(SDL_BUTTON_WHEELDOWN)
else if (ev.button.button == SDL_BUTTON_WHEELUP)
@@ -87,7 +86,7 @@ bool OPEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
}
bool OPEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
- if (ev.button.button == SDL_BUTTON_LEFT){
+ if (ev.button.button == SDL_BUTTON_LEFT) {
if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */
event.type = Common::EVENT_RBUTTONUP;
else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
@@ -98,8 +97,7 @@ bool OPEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
else
event.type = Common::EVENT_LBUTTONUP; /* For normal mice etc. */
- }
- else if (ev.button.button == SDL_BUTTON_RIGHT)
+ } else if (ev.button.button == SDL_BUTTON_RIGHT)
event.type = Common::EVENT_RBUTTONUP;
#if defined(SDL_BUTTON_MIDDLE)
else if (ev.button.button == SDL_BUTTON_MIDDLE)
diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h
index ed26df7475..0b3eeae8ec 100644
--- a/backends/graphics/openpandora/op-graphics.h
+++ b/backends/graphics/openpandora/op-graphics.h
@@ -24,7 +24,7 @@
#define BACKENDS_GRAPHICS_OP_H
#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-#include "graphics/scaler/aspect.h" // for aspect2Real
+#include "graphics/scaler/aspect.h" // for aspect2Real
#include "graphics/scaler/downscaler.h"
enum {
diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp
index 5231e9790d..dcec387f97 100644
--- a/backends/platform/openpandora/op-backend.cpp
+++ b/backends/platform/openpandora/op-backend.cpp
@@ -49,7 +49,7 @@
#include <limits.h>
#include <errno.h>
#include <sys/stat.h>
-#include <time.h> // for getTimeAndDate()
+#include <time.h> // for getTimeAndDate()
/* Dump console info to files. */
#define DUMP_STDOUT
@@ -97,7 +97,7 @@ void OSystem_OP::initBackend() {
// if (_mixer == 0) {
// _mixerManager = new DoubleBufferSDLMixerManager();
- // Setup and start mixer
+ // Setup and start mixer
// _mixerManager->init();
// }
@@ -123,49 +123,49 @@ void OSystem_OP::initBackend() {
_savefileManager = new DefaultSaveFileManager(savePath);
- #ifdef DUMP_STDOUT
- // The OpenPandora has a serial console on the EXT connection but most users do not use this so we
- // output all our STDOUT and STDERR to files for debug purposes.
- char STDOUT_FILE[PATH_MAX+1];
- char STDERR_FILE[PATH_MAX+1];
-
- strcpy(STDOUT_FILE, workDirName);
- strcpy(STDERR_FILE, workDirName);
- strcat(STDOUT_FILE, "/scummvm.stdout.txt");
- strcat(STDERR_FILE, "/scummvm.stderr.txt");
-
- // Flush the output in case anything is queued
- fclose(stdout);
- fclose(stderr);
-
- // Redirect standard input and standard output
- FILE *newfp = freopen(STDOUT_FILE, "w", stdout);
- if (newfp == NULL) {
- #if !defined(stdout)
- stdout = fopen(STDOUT_FILE, "w");
- #else
- newfp = fopen(STDOUT_FILE, "w");
- if (newfp) {
- *stdout = *newfp;
- }
- #endif
+#ifdef DUMP_STDOUT
+ // The OpenPandora has a serial console on the EXT connection but most users do not use this so we
+ // output all our STDOUT and STDERR to files for debug purposes.
+ char STDOUT_FILE[PATH_MAX+1];
+ char STDERR_FILE[PATH_MAX+1];
+
+ strcpy(STDOUT_FILE, workDirName);
+ strcpy(STDERR_FILE, workDirName);
+ strcat(STDOUT_FILE, "/scummvm.stdout.txt");
+ strcat(STDERR_FILE, "/scummvm.stderr.txt");
+
+ // Flush the output in case anything is queued
+ fclose(stdout);
+ fclose(stderr);
+
+ // Redirect standard input and standard output
+ FILE *newfp = freopen(STDOUT_FILE, "w", stdout);
+ if (newfp == NULL) {
+#if !defined(stdout)
+ stdout = fopen(STDOUT_FILE, "w");
+#else
+ newfp = fopen(STDOUT_FILE, "w");
+ if (newfp) {
+ *stdout = *newfp;
}
+#endif
+ }
- newfp = freopen(STDERR_FILE, "w", stderr);
- if (newfp == NULL) {
- #if !defined(stderr)
- stderr = fopen(STDERR_FILE, "w");
- #else
- newfp = fopen(STDERR_FILE, "w");
- if (newfp) {
- *stderr = *newfp;
- }
- #endif
+ newfp = freopen(STDERR_FILE, "w", stderr);
+ if (newfp == NULL) {
+#if !defined(stderr)
+ stderr = fopen(STDERR_FILE, "w");
+#else
+ newfp = fopen(STDERR_FILE, "w");
+ if (newfp) {
+ *stderr = *newfp;
}
+#endif
+ }
- setbuf(stderr, NULL);
- printf("%s\n", "Debug: STDOUT and STDERR redirected to text files.");
- #endif /* DUMP_STDOUT */
+ setbuf(stderr, NULL);
+ printf("%s\n", "Debug: STDOUT and STDERR redirected to text files.");
+#endif /* DUMP_STDOUT */
/* Trigger autosave every 4 minutes. */
ConfMan.registerDefault("autosave_period", 4 * 60);
@@ -187,7 +187,7 @@ void OSystem_OP::initBackend() {
_inited = true;
}
- // enable joystick
+// enable joystick
// if (joystick_num > -1 && SDL_NumJoysticks() > 0) {
// printf("Using joystick: %s\n", SDL_JoystickName(0));
// _joystick = SDL_JoystickOpen(joystick_num);
@@ -195,13 +195,13 @@ void OSystem_OP::initBackend() {
//
// setupMixer();
- // Note: We could implement a custom SDLTimerManager by using
- // SDL_AddTimer. That might yield better timer resolution, but it would
- // also change the semantics of a timer: Right now, ScummVM timers
- // *never* run in parallel, due to the way they are implemented. If we
- // switched to SDL_AddTimer, each timer might run in a separate thread.
- // However, not all our code is prepared for that, so we can't just
- // switch. Still, it's a potential future change to keep in mind.
+// Note: We could implement a custom SDLTimerManager by using
+// SDL_AddTimer. That might yield better timer resolution, but it would
+// also change the semantics of a timer: Right now, ScummVM timers
+// *never* run in parallel, due to the way they are implemented. If we
+// switched to SDL_AddTimer, each timer might run in a separate thread.
+// However, not all our code is prepared for that, so we can't just
+// switch. Still, it's a potential future change to keep in mind.
// _timer = new DefaultTimerManager();
// _timerID = SDL_AddTimer(10, &timer_handler, _timer);
@@ -217,9 +217,9 @@ void OSystem_OP::initSDL() {
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
- uint8_t hiddenCursorData = 0;
+ uint8_t hiddenCursorData = 0;
- hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
+ hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
/* On the OpenPandora we need to work around an SDL assumption that
returns relative mouse coordinates when you get to the screen
@@ -277,11 +277,11 @@ void OSystem_OP::quit() {
SDL_FreeCursor(hiddenCursor);
- #ifdef DUMP_STDOUT
- printf("%s\n", "Debug: STDOUT and STDERR text files closed.");
- fclose(stdout);
- fclose(stderr);
- #endif /* DUMP_STDOUT */
+#ifdef DUMP_STDOUT
+ printf("%s\n", "Debug: STDOUT and STDERR text files closed.");
+ fclose(stdout);
+ fclose(stderr);
+#endif /* DUMP_STDOUT */
OSystem_POSIX::quit();
}
diff --git a/backends/platform/openpandora/op-main.cpp b/backends/platform/openpandora/op-main.cpp
index bb359e7204..ebe018f570 100644
--- a/backends/platform/openpandora/op-main.cpp
+++ b/backends/platform/openpandora/op-main.cpp
@@ -43,7 +43,7 @@ int main(int argc, char *argv[]) {
int res = scummvm_main(argc, argv);
// Free OSystem
- delete (OSystem_OP *)g_system;
+ delete(OSystem_OP *)g_system;
return res;
}
diff --git a/backends/platform/openpandora/op-options.cpp b/backends/platform/openpandora/op-options.cpp
index c60ba58cc7..58f0fb7188 100644
--- a/backends/platform/openpandora/op-options.cpp
+++ b/backends/platform/openpandora/op-options.cpp
@@ -31,9 +31,9 @@ namespace OP {
enum {
/* Touchscreen TapMode */
- TAPMODE_LEFT = 0,
- TAPMODE_RIGHT = 1,
- TAPMODE_HOVER = 2
+ TAPMODE_LEFT = 0,
+ TAPMODE_RIGHT = 1,
+ TAPMODE_HOVER = 2
};
int tapmodeLevel = TAPMODE_LEFT;
@@ -47,7 +47,7 @@ void ToggleTapMode() {
tapmodeLevel = TAPMODE_LEFT;
} else {
tapmodeLevel = TAPMODE_LEFT;
- }
+ }
}
} /* namespace OP */
diff --git a/backends/platform/openpandora/op-options.h b/backends/platform/openpandora/op-options.h
index ebc83ca00c..919d217f4b 100644
--- a/backends/platform/openpandora/op-options.h
+++ b/backends/platform/openpandora/op-options.h
@@ -32,7 +32,7 @@ namespace OP {
extern int tapmodeLevel;
-extern void ToggleTapMode();
+extern void ToggleTapMode();
} /* namespace OP */
diff --git a/backends/platform/openpandora/op-sdl.h b/backends/platform/openpandora/op-sdl.h
index d493c3957c..8cccbb5f86 100644
--- a/backends/platform/openpandora/op-sdl.h
+++ b/backends/platform/openpandora/op-sdl.h
@@ -34,7 +34,7 @@
//#define MIXER_DOUBLE_BUFFERING 1
#ifndef PATH_MAX
- #define PATH_MAX 255
+#define PATH_MAX 255
#endif
class OSystem_OP : public OSystem_POSIX {