aboutsummaryrefslogtreecommitdiff
path: root/backends/morphos/morphos.cpp
diff options
context:
space:
mode:
authorRuediger Hanke2003-07-22 22:37:37 +0000
committerRuediger Hanke2003-07-22 22:37:37 +0000
commit77d50433be9ca21dde3d62ecbe7c6e0bebc341ac (patch)
tree9ba86f0937ec7c43c28f2b9340c8108eec5c6a8e /backends/morphos/morphos.cpp
parentb43125cd36c0c78c2ea352c683be77b96998feaf (diff)
downloadscummvm-rg350-77d50433be9ca21dde3d62ecbe7c6e0bebc341ac.tar.gz
scummvm-rg350-77d50433be9ca21dde3d62ecbe7c6e0bebc341ac.tar.bz2
scummvm-rg350-77d50433be9ca21dde3d62ecbe7c6e0bebc341ac.zip
Some MorphOS port fixes
svn-id: r9138
Diffstat (limited to 'backends/morphos/morphos.cpp')
-rw-r--r--backends/morphos/morphos.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp
index 04def0ebe0..b8d6b0d963 100644
--- a/backends/morphos/morphos.cpp
+++ b/backends/morphos/morphos.cpp
@@ -213,8 +213,11 @@ OSystem_MorphOS::~OSystem_MorphOS()
if (ScummMusicThread)
{
- Signal((Task *) ScummMusicThread, SIGBREAKF_CTRL_C);
- ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */
+ if (!AttemptSemaphore(&ScummMusicThreadRunning))
+ {
+ Signal((Task *) ScummMusicThread, SIGBREAKF_CTRL_C);
+ ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */
+ }
ReleaseSemaphore(&ScummMusicThreadRunning);
}
@@ -1096,8 +1099,9 @@ void OSystem_MorphOS::move_screen(int dx, int dy, int height) {
} else if (dy < 0) {
// move up
// copy from top to bottom
+ dy = -dy;
for (int y = dy; y < height; y++)
- copy_rect((byte *)ScummBuffer + ScummBufferWidth * (y - dy), ScummBufferWidth, 0, y, ScummBufferWidth, 1);
+ copy_rect((byte *)ScummBuffer + ScummBufferWidth * y, ScummBufferWidth, 0, y - dy, ScummBufferWidth, 1);
}
// horizontal movement
@@ -1109,8 +1113,9 @@ void OSystem_MorphOS::move_screen(int dx, int dy, int height) {
} else if (dx < 0) {
// move left
// copy from left to right
+ dx = -dx;
for (int x = dx; x < ScummBufferWidth; x++)
- copy_rect((byte *)ScummBuffer + x - dx, ScummBufferWidth, x, 0, 1, height);
+ copy_rect((byte *)ScummBuffer + x, ScummBufferWidth, x, 0, 1, height);
}
}