aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorChristopher Page2008-08-04 22:34:07 +0000
committerChristopher Page2008-08-04 22:34:07 +0000
commit4198ee962399305a4a158b1f43224c00e2e04a1b (patch)
treeeea375b5cb471509df2e2c5d9123d963a62403c6 /backends/platform
parenta51f45407659bba43254b466d20b6af2e8f17ffd (diff)
parent4f5479ee744ac6b419cdf7ec1e96fbf7c83d36ef (diff)
downloadscummvm-rg350-4198ee962399305a4a158b1f43224c00e2e04a1b.tar.gz
scummvm-rg350-4198ee962399305a4a158b1f43224c00e2e04a1b.tar.bz2
scummvm-rg350-4198ee962399305a4a158b1f43224c00e2e04a1b.zip
Merged revisions 33188-33189,33191-33193,33196,33198,33202-33203,33206,33210,33212,33218-33220,33222,33224-33226,33229-33243,33246,33248-33250,33252,33258-33261,33263,33266,33270,33272-33283,33285,33287-33290,33295-33298,33321,33325-33330,33332-33335,33337-33340,33342,33345,33347,33349-33350,33352-33357,33359-33367,33369-33371,33373,33375-33377,33379-33380,33383-33385,33387-33389,33392-33394,33400-33402,33404-33405,33407-33410,33412-33416,33418-33419,33425-33427,33432,33436-33438,33444,33446,33452-33453,33455-33459,33463-33464,33466-33471,33473-33474,33478,33490,33492,33495-33496,33509-33512,33518-33519,33522-33527,33529-33530,33537,33541,33544,33546,33550,33552-33554,33556,33558,33561-33562,33565,33568,33570,33574,33576,33578-33581,33584-33587,33590,33596,33604-33611,33614-33615,33617-33618,33620-33621 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk svn-id: r33624
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/PalmOS/Src/be_base.cpp5
-rw-r--r--backends/platform/gp2x/gp2x.cpp2
-rw-r--r--backends/platform/iphone/blit_arm.s156
-rw-r--r--backends/platform/iphone/iphone_keyboard.h6
-rw-r--r--backends/platform/iphone/iphone_keyboard.m16
-rw-r--r--backends/platform/iphone/iphone_main.m18
-rw-r--r--backends/platform/iphone/iphone_video.h5
-rw-r--r--backends/platform/iphone/iphone_video.m99
-rw-r--r--backends/platform/iphone/osys_iphone.cpp98
-rw-r--r--backends/platform/iphone/osys_iphone.h11
-rw-r--r--backends/platform/sdl/sdl.cpp108
-rw-r--r--backends/platform/sdl/sdl.h3
-rw-r--r--backends/platform/symbian/BuildPackageUpload_LocalSettings.pl31
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in2
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in2
-rw-r--r--backends/platform/symbian/src/SymbianActions.cpp4
-rw-r--r--backends/platform/symbian/src/SymbianOS.cpp49
-rw-r--r--backends/platform/symbian/src/SymbianOS.h3
-rw-r--r--backends/platform/symbian/src/main_features.inl39
-rw-r--r--backends/platform/symbian/src/portdefs.h1
20 files changed, 419 insertions, 239 deletions
diff --git a/backends/platform/PalmOS/Src/be_base.cpp b/backends/platform/PalmOS/Src/be_base.cpp
index afb3f15bae..32e68bde9f 100644
--- a/backends/platform/PalmOS/Src/be_base.cpp
+++ b/backends/platform/PalmOS/Src/be_base.cpp
@@ -30,6 +30,9 @@
#include "backends/timer/default/default-timer.h"
#include "sound/mixer.h"
+#define DEFAULT_SAVE_PATH "/PALM/Programs/ScummVM/Saved"
+
+
OSystem_PalmBase::OSystem_PalmBase() {
_overlayVisible = false;
@@ -100,7 +103,7 @@ void OSystem_PalmBase::initBackend() {
// Create the savefile manager, if none exists yet (we check for this to
// allow subclasses to provide their own).
if (_saveMgr == 0) {
- _saveMgr = new DefaultSaveFileManager();
+ _saveMgr = new DefaultSaveFileManager(DEFAULT_SAVE_PATH);
}
// Create and hook up the mixer, if none exists yet (we check for this to
diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp
index c138f6c54d..e5f062ed35 100644
--- a/backends/platform/gp2x/gp2x.cpp
+++ b/backends/platform/gp2x/gp2x.cpp
@@ -219,7 +219,7 @@ void OSystem_GP2X::initBackend() {
// Create the savefile manager, if none exists yet (we check for this to
// allow subclasses to provide their own).
if (_savefile == 0) {
- _savefile = new DefaultSaveFileManager();
+ _savefile = new DefaultSaveFileManager(savePath);
}
// Create and hook up the mixer, if none exists yet (we check for this to
diff --git a/backends/platform/iphone/blit_arm.s b/backends/platform/iphone/blit_arm.s
index ae31fdcce4..417f3741cf 100644
--- a/backends/platform/iphone/blit_arm.s
+++ b/backends/platform/iphone/blit_arm.s
@@ -36,47 +36,47 @@ _blitLandscapeScreenRect16bpp:
@ r3 = h
@ <> = _screenWidth
@ <> = _screenHeight
- MOV r12,r13
- STMFD r13!,{r4-r11,r14}
- LDMFD r12,{r12,r14} @ r12 = _screenWidth
+ mov r12,r13
+ stmfd r13!,{r4-r11,r14}
+ ldmfd r12,{r12,r14} @ r12 = _screenWidth
@ r14 = _screenHeight
- ADD r14,r14,r3 @ r14 = _screenHeight + h
- MVN r11,#0
- MLA r11,r3,r12,r11 @ r11= _screenWidth*h-1
- ADD r12,r12,r12
+ add r14,r14,r3 @ r14 = _screenHeight + h
+ mvn r11,#0
+ mla r11,r3,r12,r11 @ r11= _screenWidth*h-1
+ add r12,r12,r12
xloop:
- SUBS r4,r3,#5 @ r4 = y = h
- BLE thin
+ subs r4,r3,#5 @ r4 = y = h
+ ble thin
yloop:
- LDRH r5, [r1],r12 @ r5 = *src src += _screenWidth
- LDRH r6, [r1],r12 @ r6 = *src src += _screenWidth
- LDRH r7, [r1],r12 @ r7 = *src src += _screenWidth
- LDRH r8, [r1],r12 @ r8 = *src src += _screenWidth
- LDRH r9, [r1],r12 @ r9 = *src src += _screenWidth
- LDRH r10,[r1],r12 @ r10= *src src += _screenWidth
- SUBS r4,r4,#6
- STRH r5, [r0],#2 @ *dst++ = r5
- STRH r6, [r0],#2 @ *dst++ = r6
- STRH r7, [r0],#2 @ *dst++ = r7
- STRH r8, [r0],#2 @ *dst++ = r8
- STRH r9, [r0],#2 @ *dst++ = r9
- STRH r10,[r0],#2 @ *dst++ = r10
- BGT yloop
+ ldrh r5, [r1],r12 @ r5 = *src src += _screenWidth
+ ldrh r6, [r1],r12 @ r6 = *src src += _screenWidth
+ ldrh r7, [r1],r12 @ r7 = *src src += _screenWidth
+ ldrh r8, [r1],r12 @ r8 = *src src += _screenWidth
+ ldrh r9, [r1],r12 @ r9 = *src src += _screenWidth
+ ldrh r10,[r1],r12 @ r10= *src src += _screenWidth
+ subs r4,r4,#6
+ strh r5, [r0],#2 @ *dst++ = r5
+ strh r6, [r0],#2 @ *dst++ = r6
+ strh r7, [r0],#2 @ *dst++ = r7
+ strh r8, [r0],#2 @ *dst++ = r8
+ strh r9, [r0],#2 @ *dst++ = r9
+ strh r10,[r0],#2 @ *dst++ = r10
+ bgt yloop
thin:
- ADDS r4,r4,#5
- BEQ lineend
+ adds r4,r4,#5
+ beq lineend
thin_loop:
- LDRH r5,[r1],r12 @ r5 = *src src += _screenWidth
- SUBS r4,r4,#1
- STRH r5,[r0],#2 @ *dst++ = r5
- BGT thin_loop
+ ldrh r5,[r1],r12 @ r5 = *src src += _screenWidth
+ subs r4,r4,#1
+ strh r5,[r0],#2 @ *dst++ = r5
+ bgt thin_loop
lineend:
- SUB r0,r0,r14,LSL #1 @ dst -= _screenHeight + h
- SUB r1,r1,r11,LSL #1 @ src += 1-_screenWidth*h
- SUBS r2,r2,#1
- BGT xloop
+ sub r0,r0,r14,LSL #1 @ dst -= _screenHeight + h
+ sub r1,r1,r11,LSL #1 @ src += 1-_screenWidth*h
+ subs r2,r2,#1
+ bgt xloop
- LDMFD r13!,{r4-r11,PC}
+ ldmfd r13!,{r4-r11,PC}
_blitLandscapeScreenRect8bpp:
@ r0 = dst
@@ -86,55 +86,55 @@ _blitLandscapeScreenRect8bpp:
@ <> = _palette
@ <> = _screenWidth
@ <> = _screenHeight
- MOV r12,r13
- STMFD r13!,{r4-r11,r14}
- LDMFD r12,{r11,r12,r14} @ r11 = _palette
+ mov r12,r13
+ stmfd r13!,{r4-r11,r14}
+ ldmfd r12,{r11,r12,r14} @ r11 = _palette
@ r12 = _screenWidth
@ r14 = _screenHeight
- ADD r14,r14,r3 @ r14 = _screenHeight + h
- MVN r6,#0
- MLA r6,r3,r12,r6 @ r6 = _screenWidth*h-1
+ add r14,r14,r3 @ r14 = _screenHeight + h
+ mvn r6,#0
+ mla r6,r3,r12,r6 @ r6 = _screenWidth*h-1
xloop8:
- MOV r4,r3 @ r4 = y = h
- SUBS r4,r3,#4 @ r4 = y = h
- BLE thin8
+ mov r4,r3 @ r4 = y = h
+ subs r4,r3,#4 @ r4 = y = h
+ ble thin8
yloop8:
- LDRB r5, [r1],r12 @ r5 = *src src += _screenWidth
- LDRB r7, [r1],r12 @ r7 = *src src += _screenWidth
- LDRB r8, [r1],r12 @ r8 = *src src += _screenWidth
- LDRB r9, [r1],r12 @ r9 = *src src += _screenWidth
- LDRB r10,[r1],r12 @ r10= *src src += _screenWidth
- ADD r5, r5, r5
- ADD r7, r7, r7
- ADD r8, r8, r8
- ADD r9, r9, r9
- ADD r10,r10,r10
- LDRH r5, [r11,r5]
- LDRH r7, [r11,r7]
- LDRH r8, [r11,r8]
- LDRH r9, [r11,r9]
- LDRH r10,[r11,r10]
- SUBS r4,r4,#5
- STRH r5, [r0],#2 @ *dst++ = r5
- STRH r7, [r0],#2 @ *dst++ = r7
- STRH r8, [r0],#2 @ *dst++ = r8
- STRH r9, [r0],#2 @ *dst++ = r9
- STRH r10,[r0],#2 @ *dst++ = r10
- BGT yloop8
+ ldrb r5, [r1],r12 @ r5 = *src src += _screenWidth
+ ldrb r7, [r1],r12 @ r7 = *src src += _screenWidth
+ ldrb r8, [r1],r12 @ r8 = *src src += _screenWidth
+ ldrb r9, [r1],r12 @ r9 = *src src += _screenWidth
+ ldrb r10,[r1],r12 @ r10= *src src += _screenWidth
+ add r5, r5, r5
+ add r7, r7, r7
+ add r8, r8, r8
+ add r9, r9, r9
+ add r10,r10,r10
+ ldrh r5, [r11,r5]
+ ldrh r7, [r11,r7]
+ ldrh r8, [r11,r8]
+ ldrh r9, [r11,r9]
+ ldrh r10,[r11,r10]
+ subs r4,r4,#5
+ strh r5, [r0],#2 @ *dst++ = r5
+ strh r7, [r0],#2 @ *dst++ = r7
+ strh r8, [r0],#2 @ *dst++ = r8
+ strh r9, [r0],#2 @ *dst++ = r9
+ strh r10,[r0],#2 @ *dst++ = r10
+ bgt yloop8
thin8:
- ADDS r4,r4,#4
- BEQ lineend8
+ adds r4,r4,#4
+ beq lineend8
thin_loop8:
- LDRB r5,[r1],r12 @ r5 = *src src += _screenWidth
- ADD r5,r5,r5
- LDRH r5,[r11,r5]
- SUBS r4,r4,#1
- STRH r5,[r0],#2 @ *dst++ = r5
- BGT thin_loop8
+ ldrb r5,[r1],r12 @ r5 = *src src += _screenWidth
+ add r5,r5,r5
+ ldrh r5,[r11,r5]
+ subs r4,r4,#1
+ strh r5,[r0],#2 @ *dst++ = r5
+ bgt thin_loop8
lineend8:
- SUB r0,r0,r14,LSL #1 @ dst -= _screenHeight + h
- SUB r1,r1,r6 @ src += 1-_screenWidth*h
- SUBS r2,r2,#1
- BGT xloop8
+ sub r0,r0,r14,LSL #1 @ dst -= _screenHeight + h
+ sub r1,r1,r6 @ src += 1-_screenWidth*h
+ subs r2,r2,#1
+ bgt xloop8
- LDMFD r13!,{r4-r11,PC}
+ ldmfd r13!,{r4-r11,PC}
diff --git a/backends/platform/iphone/iphone_keyboard.h b/backends/platform/iphone/iphone_keyboard.h
index 17a3836efd..6d381d561d 100644
--- a/backends/platform/iphone/iphone_keyboard.h
+++ b/backends/platform/iphone/iphone_keyboard.h
@@ -26,11 +26,7 @@
#import <UIKit/UIKit.h>
#import <UIKit/UITextView.h>
-@protocol KeyboardInputProtocol
-- (void)handleKeyPress:(unichar)c;
-@end
-
-@interface SoftKeyboard : UIKeyboard<KeyboardInputProtocol> {
+@interface SoftKeyboard : UIView {
id inputDelegate;
UITextView* inputView;
}
diff --git a/backends/platform/iphone/iphone_keyboard.m b/backends/platform/iphone/iphone_keyboard.m
index dc2d417746..bd4948e30a 100644
--- a/backends/platform/iphone/iphone_keyboard.m
+++ b/backends/platform/iphone/iphone_keyboard.m
@@ -25,19 +25,6 @@
#import "iphone_keyboard.h"
-// Override settings of the default keyboard implementation
-@implementation UIKeyboardImpl (DisableFeatures)
-
-- (BOOL)autoCapitalizationPreference {
- return false;
-}
-
-- (BOOL)autoCorrectionPreference {
- return false;
-}
-
-@end
-
@implementation TextInputHandler
- (id)initWithKeyboard:(SoftKeyboard*)keyboard; {
@@ -67,7 +54,8 @@
@implementation SoftKeyboard
- (id)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
+ //self = [super initWithFrame:frame];
+ self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)];
inputDelegate = nil;
inputView = [[TextInputHandler alloc] initWithKeyboard:self];
return self;
diff --git a/backends/platform/iphone/iphone_main.m b/backends/platform/iphone/iphone_main.m
index f7f5667bb5..b01e9f3f34 100644
--- a/backends/platform/iphone/iphone_main.m
+++ b/backends/platform/iphone/iphone_main.m
@@ -46,9 +46,14 @@ int main(int argc, char** argv) {
gArgc = argc;
gArgv = argv;
- [[NSAutoreleasePool alloc] init];
-
- return UIApplicationMain(argc, argv, [iPhoneMain class]);
+ NSAutoreleasePool *autoreleasePool = [
+ [ NSAutoreleasePool alloc ] init
+ ];
+
+ UIApplicationUseLegacyEvents(1);
+ int returnCode = UIApplicationMain(argc, argv, [iPhoneMain class]);
+ [ autoreleasePool release ];
+ return returnCode;
}
@implementation iPhoneMain
@@ -74,7 +79,10 @@ int main(int argc, char** argv) {
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// hide the status bar
[UIHardware _setStatusBarHeight:0.0f];
- [self setStatusBarMode:2 orientation:0 duration:0.0f fenceID:0];
+ //[self setStatusBarMode:2 orientation:0 duration:0.0f fenceID:0];
+
+ //[self setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
+ [self setStatusBarHidden:YES animated:YES];
_window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]];
[_window retain];
@@ -96,7 +104,7 @@ int main(int argc, char** argv) {
- (void)applicationResume:(GSEventRef)event {
[self removeApplicationBadge];
[UIHardware _setStatusBarHeight:0.0f];
- [self setStatusBarMode:2 orientation:0 duration:0.0f fenceID:0];
+ [self setStatusBarHidden:YES animated:YES];
[_view applicationResume];
}
diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h
index 615b2e5345..6e4b446926 100644
--- a/backends/platform/iphone/iphone_video.h
+++ b/backends/platform/iphone/iphone_video.h
@@ -27,12 +27,11 @@
#define _IPHONE_VIDEO__H
#import <UIKit/UIKit.h>
-#import <UIKit/UIView-Geometry.h>
#import <GraphicsServices/GraphicsServices.h>
#import <Foundation/Foundation.h>
#import <CoreSurface/CoreSurface.h>
-#import <LayerKit/LKLayer.h>
+#import <QuartzCore/QuartzCore.h>
#import "iphone_keyboard.h"
@interface iPhoneView : UIView
@@ -41,7 +40,7 @@
NSMutableArray* _events;
NSLock* _lock;
SoftKeyboard* _keyboardView;
- LKLayer* _screenLayer;
+ CALayer* _screenLayer;
int _fullWidth;
int _fullHeight;
diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m
index 6c6944045e..89f159c1d9 100644
--- a/backends/platform/iphone/iphone_video.m
+++ b/backends/platform/iphone/iphone_video.m
@@ -31,8 +31,8 @@
#import <GraphicsServices/GraphicsServices.h>
#import <Foundation/Foundation.h>
#import <CoreSurface/CoreSurface.h>
-#import <LayerKit/LKLayer.h>
#import <UIKit/UIKeyboardLayoutQWERTY.h>
+#import <QuartzCore/QuartzCore.h>
static iPhoneView *sharedInstance = nil;
static int _width = 0;
@@ -53,8 +53,8 @@ void iPhone_updateScreen() {
}
void iPhone_updateScreenRect(int x1, int y1, int x2, int y2) {
- NSRect rect = NSMakeRect(x1, y1, x2, y2);
- [sharedInstance performSelectorOnMainThread:@selector(updateScreenRect:) withObject: [NSValue valueWithRect:rect] waitUntilDone: NO];
+ //CGRect rect = CGRectMake(x1, y1, x2, y2);
+ //[sharedInstance performSelectorOnMainThread:@selector(updateScreenRect:) withObject: [NSValue valueWithRect:rect] waitUntilDone: NO];
}
void iPhone_lockSurface() {
@@ -146,9 +146,9 @@ bool getLocalMouseCoords(CGPoint *point) {
}
- (void)updateScreenRect:(id)rect {
- NSRect nsRect = [rect rectValue];
- CGRect cgRect = CGRectMake(nsRect.origin.x, nsRect.origin.y, nsRect.size.width, nsRect.size.height);
- [sharedInstance setNeedsDisplayInRect: cgRect];
+ // NSRect nsRect = [rect rectValue];
+ // CGRect cgRect = CGRectMake(nsRect.origin.x, nsRect.origin.y, nsRect.size.width, nsRect.size.height);
+ // [sharedInstance setNeedsDisplayInRect: cgRect];
}
- (void)initSurface {
@@ -178,7 +178,7 @@ bool getLocalMouseCoords(CGPoint *point) {
//printf("Surface created.\n");
CoreSurfaceBufferLock(_screenSurface, 3);
- LKLayer* screenLayer = [[LKLayer layer] retain];
+ CALayer* screenLayer = [[CALayer layer] retain];
if (_keyboardView != nil) {
[_keyboardView removeFromSuperview];
@@ -213,7 +213,7 @@ bool getLocalMouseCoords(CGPoint *point) {
_keyboardView = [[SoftKeyboard alloc] initWithFrame:keyFrame];
[_keyboardView setInputDelegate:self];
}
-
+
[self addSubview:[_keyboardView inputView]];
[self addSubview: _keyboardView];
[[_keyboardView inputView] becomeFirstResponder];
@@ -283,11 +283,13 @@ bool getLocalMouseCoords(CGPoint *point) {
}
- (void)mouseDown:(GSEvent*)event {
- struct CGPoint point = GSEventGetLocationInWindow(event);
-
+ //printf("mouseDown()\n");
+ CGRect rect = GSEventGetLocationInWindow(event);
+ CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+
if (!getLocalMouseCoords(&point))
return;
-
+
[self addEvent:
[[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:kInputMouseDown], @"type",
@@ -298,12 +300,18 @@ bool getLocalMouseCoords(CGPoint *point) {
];
}
+- (void)touchesBegan {
+ //printf("touchesBegan()\n");
+}
+
- (void)mouseUp:(GSEvent*)event {
- struct CGPoint point = GSEventGetLocationInWindow(event);
-
+ //printf("mouseUp()\n");
+ CGRect rect = GSEventGetLocationInWindow(event);
+ CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+
if (!getLocalMouseCoords(&point))
return;
-
+
[self addEvent:
[[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:kInputMouseUp], @"type",
@@ -316,11 +324,12 @@ bool getLocalMouseCoords(CGPoint *point) {
- (void)mouseDragged:(GSEvent*)event {
//printf("mouseDragged()\n");
- struct CGPoint point = GSEventGetLocationInWindow(event);
-
+ CGRect rect = GSEventGetLocationInWindow(event);
+ CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+
if (!getLocalMouseCoords(&point))
return;
-
+
[self addEvent:
[[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:kInputMouseDragged], @"type",
@@ -333,19 +342,21 @@ bool getLocalMouseCoords(CGPoint *point) {
- (void)mouseEntered:(GSEvent*)event {
//printf("mouseEntered()\n");
- // struct CGPoint point = GSEventGetLocationInWindow(event);
- //
- // if (!getLocalMouseCoords(&point))
- // return;
- //
- // [self addEvent:
- // [[NSDictionary alloc] initWithObjectsAndKeys:
- // [NSNumber numberWithInt:kInputMouseSecondToggled], @"type",
- // [NSNumber numberWithFloat:point.x], @"x",
- // [NSNumber numberWithFloat:point.y], @"y",
- // nil
- // ]
- // ];
+ CGRect rect = GSEventGetLocationInWindow(event);
+ CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+
+
+ if (!getLocalMouseCoords(&point))
+ return;
+
+ [self addEvent:
+ [[NSDictionary alloc] initWithObjectsAndKeys:
+ [NSNumber numberWithInt:kInputMouseSecondToggled], @"type",
+ [NSNumber numberWithFloat:point.x], @"x",
+ [NSNumber numberWithFloat:point.y], @"y",
+ nil
+ ]
+ ];
}
- (void)mouseExited:(GSEvent*)event {
@@ -361,19 +372,19 @@ bool getLocalMouseCoords(CGPoint *point) {
- (void)mouseMoved:(GSEvent*)event
{
//printf("mouseMoved()\n");
- struct CGPoint point = GSEventGetLocationInWindow(event);
-
- if (!getLocalMouseCoords(&point))
- return;
-
- [self addEvent:
- [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:kInputMouseSecondToggled], @"type",
- [NSNumber numberWithFloat:point.x], @"x",
- [NSNumber numberWithFloat:point.y], @"y",
- nil
- ]
- ];
+ // struct CGPoint point = GSEventGetLocationInWindow(event);
+ //
+ // if (!getLocalMouseCoords(&point))
+ // return;
+ //
+ // [self addEvent:
+ // [[NSDictionary alloc] initWithObjectsAndKeys:
+ // [NSNumber numberWithInt:kInputMouseSecondToggled], @"type",
+ // [NSNumber numberWithFloat:point.x], @"x",
+ // [NSNumber numberWithFloat:point.y], @"y",
+ // nil
+ // ]
+ // ];
}
- (void)handleKeyPress:(unichar)c {
@@ -391,7 +402,7 @@ bool getLocalMouseCoords(CGPoint *point) {
return TRUE;
}
-- (int)swipe:(UIViewSwipeDirection)num withEvent:(GSEvent*)event {
+- (int)swipe:(int)num withEvent:(GSEvent*)event {
//printf("swipe: %i\n", num);
[self addEvent:
diff --git a/backends/platform/iphone/osys_iphone.cpp b/backends/platform/iphone/osys_iphone.cpp
index 4cb90d35b9..3d5571cf3a 100644
--- a/backends/platform/iphone/osys_iphone.cpp
+++ b/backends/platform/iphone/osys_iphone.cpp
@@ -25,8 +25,6 @@
#if defined(IPHONE_BACKEND)
-#include <CoreGraphics/CGDirectDisplay.h>
-#include <CoreSurface/CoreSurface.h>
#include <unistd.h>
#include <pthread.h>
@@ -41,10 +39,15 @@
#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"
#include "sound/mixer.h"
+#include "sound/mixer_intern.h"
#include "gui/message.h"
#include "osys_iphone.h"
#include "blit_arm.h"
+#include <sys/time.h>
+
+#include <CoreGraphics/CGDirectDisplay.h>
+#include <CoreSurface/CoreSurface.h>
const OSystem::GraphicsMode OSystem_IPHONE::s_supportedGraphicsModes[] = {
{0, 0, 0}
@@ -85,13 +88,13 @@ int OSystem_IPHONE::timerHandler(int t) {
}
void OSystem_IPHONE::initBackend() {
- _savefile = new DefaultSaveFileManager();
- _mixer = new Audio::Mixer();
+ _savefile = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH);
_timer = new DefaultTimerManager();
gettimeofday(&_startTime, NULL);
- setSoundCallback(Audio::Mixer::mixCallback, _mixer);
+ setupMixer();
+
setTimerCallback(&OSystem_IPHONE::timerHandler, 10);
OSystem::initBackend();
@@ -871,7 +874,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
suspendLoop();
break;
- case kInputKeyPressed:
+ case kInputKeyPressed: {
int keyPressed = (int)xUnit;
int ascii = keyPressed;
//printf("key: %i\n", keyPressed);
@@ -932,6 +935,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii;
_needEventRestPeriod = true;
break;
+ }
case kInputSwipe: {
Common::KeyCode keycode = Common::KEYCODE_INVALID;
@@ -1088,10 +1092,21 @@ void OSystem_IPHONE::AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBuf
AudioQueueStop(s_AudioQueue.queue, false);
}
-bool OSystem_IPHONE::setSoundCallback(SoundProc proc, void *param) {
+void OSystem_IPHONE::mixCallback(void *sys, byte *samples, int len) {
+ OSystem_IPHONE *this_ = (OSystem_IPHONE *)sys;
+ assert(this_);
+
+ if (this_->_mixer)
+ this_->_mixer->mixCallback(samples, len);
+}
+
+void OSystem_IPHONE::setupMixer() {
//printf("setSoundCallback()\n");
- s_soundCallback = proc;
- s_soundParam = param;
+ _mixer = new Audio::MixerImpl(this);
+
+ s_soundCallback = mixCallback;
+ s_soundParam = this;
+
s_AudioQueue.dataFormat.mSampleRate = AUDIO_SAMPLE_RATE;
s_AudioQueue.dataFormat.mFormatID = kAudioFormatLinearPCM;
@@ -1105,7 +1120,8 @@ bool OSystem_IPHONE::setSoundCallback(SoundProc proc, void *param) {
if (AudioQueueNewOutput(&s_AudioQueue.dataFormat, AQBufferCallback, &s_AudioQueue, 0, kCFRunLoopCommonModes, 0, &s_AudioQueue.queue)) {
printf("Couldn't set the AudioQueue callback!\n");
- return false;
+ _mixer->setReady(false);
+ return;
}
uint32 bufferBytes = s_AudioQueue.frameCount * s_AudioQueue.dataFormat.mBytesPerFrame;
@@ -1113,7 +1129,8 @@ bool OSystem_IPHONE::setSoundCallback(SoundProc proc, void *param) {
for (int i = 0; i < AUDIO_BUFFERS; i++) {
if (AudioQueueAllocateBuffer(s_AudioQueue.queue, bufferBytes, &s_AudioQueue.buffers[i])) {
printf("Error allocating AudioQueue buffer!\n");
- return false;
+ _mixer->setReady(false);
+ return;
}
AQBufferCallback(&s_AudioQueue, s_AudioQueue.queue, s_AudioQueue.buffers[i]);
@@ -1122,10 +1139,12 @@ bool OSystem_IPHONE::setSoundCallback(SoundProc proc, void *param) {
AudioQueueSetParameter(s_AudioQueue.queue, kAudioQueueParam_Volume, 1.0);
if (AudioQueueStart(s_AudioQueue.queue, NULL)) {
printf("Error starting the AudioQueue!\n");
- return false;
+ _mixer->setReady(false);
+ return;
}
-
- return true;
+
+ _mixer->setOutputRate(AUDIO_SAMPLE_RATE);
+ _mixer->setReady(true);
}
int OSystem_IPHONE::getOutputSampleRate() const {
@@ -1146,6 +1165,11 @@ void OSystem_IPHONE::setTimerCallback(TimerProc callback, int interval) {
void OSystem_IPHONE::quit() {
}
+void OSystem_IPHONE::getTimeAndDate(struct tm &t) const {
+ time_t curTime = time(0);
+ t = *localtime(&curTime);
+}
+
void OSystem_IPHONE::setWindowCaption(const char *caption) {
}
@@ -1169,17 +1193,7 @@ OSystem *OSystem_IPHONE_create() {
}
const char* OSystem_IPHONE::getConfigPath() {
- if (s_is113OrHigher)
- return SCUMMVM_PREFS_PATH;
- else
- return SCUMMVM_OLD_PREFS_PATH;
-}
-
-const char* OSystem_IPHONE::getSavePath() {
- if (s_is113OrHigher)
- return SCUMMVM_SAVE_PATH;
- else
- return SCUMMVM_OLD_SAVE_PATH;
+ return SCUMMVM_PREFS_PATH;
}
void OSystem_IPHONE::migrateApp() {
@@ -1193,7 +1207,7 @@ void OSystem_IPHONE::migrateApp() {
if (!file.exists()) {
system("mkdir " SCUMMVM_ROOT_PATH);
system("mkdir " SCUMMVM_SAVE_PATH);
-
+
// Copy over the prefs file
system("cp " SCUMMVM_OLD_PREFS_PATH " " SCUMMVM_PREFS_PATH);
@@ -1207,24 +1221,24 @@ void OSystem_IPHONE::migrateApp() {
void iphone_main(int argc, char *argv[]) {
- OSystem_IPHONE::migrateApp();
-
- // Redirect stdout and stderr if we're launching from the Springboard.
- if (argc == 2 && strcmp(argv[1], "--launchedFromSB") == 0) {
- FILE *newfp = fopen("/tmp/scummvm.log", "a");
- if (newfp != NULL) {
- fclose(stdout);
- fclose(stderr);
- *stdout = *newfp;
- *stderr = *newfp;
- setbuf(stdout, NULL);
- setbuf(stderr, NULL);
-
- //extern int gDebugLevel;
- //gDebugLevel = 10;
- }
+ //OSystem_IPHONE::migrateApp();
+
+ FILE *newfp = fopen("/var/mobile/.scummvm.log", "a");
+ if (newfp != NULL) {
+ fclose(stdout);
+ fclose(stderr);
+ *stdout = *newfp;
+ *stderr = *newfp;
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
+
+ //extern int gDebugLevel;
+ //gDebugLevel = 10;
}
+ system("mkdir " SCUMMVM_ROOT_PATH);
+ system("mkdir " SCUMMVM_SAVE_PATH);
+
g_system = OSystem_IPHONE_create();
assert(g_system);
diff --git a/backends/platform/iphone/osys_iphone.h b/backends/platform/iphone/osys_iphone.h
index a01cad480a..c058686c8c 100644
--- a/backends/platform/iphone/osys_iphone.h
+++ b/backends/platform/iphone/osys_iphone.h
@@ -29,6 +29,8 @@
#include "iphone_common.h"
#include "common/system.h"
#include "common/events.h"
+#include "sound/mixer_intern.h"
+#include "backends/fs/posix/posix-fs-factory.h"
#include <AudioToolbox/AudioQueue.h>
@@ -62,7 +64,7 @@ protected:
static bool s_is113OrHigher;
Common::SaveFileManager *_savefile;
- Audio::Mixer *_mixer;
+ Audio::MixerImpl *_mixer;
Common::TimerManager *_timer;
Graphics::Surface _framebuffer;
@@ -152,12 +154,16 @@ public:
virtual void unlockMutex(MutexRef mutex);
virtual void deleteMutex(MutexRef mutex);
- virtual bool setSoundCallback(SoundProc proc, void *param);
+ static void mixCallback(void *sys, byte *samples, int len);
+ virtual void setupMixer(void);
virtual int getOutputSampleRate() const;
virtual void setTimerCallback(TimerProc callback, int interval);
virtual void quit();
+ FilesystemFactory *getFilesystemFactory() { return &POSIXFilesystemFactory::instance(); }
+ virtual void getTimeAndDate(struct tm &t) const;
+
virtual void setWindowCaption(const char *caption);
virtual Common::SaveFileManager *getSavefileManager();
@@ -166,7 +172,6 @@ public:
static void migrateApp();
static const char* getConfigPath();
- static const char* getSavePath();
protected:
inline void addDirtyRect(int16 x1, int16 y1, int16 w, int16 h);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 76ac91c282..75bac0f536 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -26,6 +26,11 @@
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
#include "common/events.h"
+#include "common/file.h"
+#if defined(WIN32) && defined(ARRAYSIZE)
+// winnt.h defines ARRAYSIZE, but we want our own one... - this is needed before including util.h
+#undef ARRAYSIZE
+#endif
#include "common/util.h"
#include "backends/saves/default/default-saves.h"
@@ -40,6 +45,7 @@
#define SAMPLES_PER_SEC 22050
//#define SAMPLES_PER_SEC 44100
+
/*
* Include header files needed for the getFilesystemFactory() method.
*/
@@ -52,6 +58,18 @@
#endif
+#if defined(UNIX)
+#ifdef MACOSX
+#define DEFAULT_CONFIG_FILE "Library/Preferences/ScummVM Preferences"
+#else
+#define DEFAULT_CONFIG_FILE ".scummvmrc"
+#endif
+#else
+#define DEFAULT_CONFIG_FILE "scummvm.ini"
+#endif
+
+
+
static Uint32 timer_handler(Uint32 interval, void *param) {
((DefaultTimerManager *)param)->handler();
return interval;
@@ -170,6 +188,10 @@ OSystem_SDL::OSystem_SDL()
_joystick(0),
_currentShakePos(0), _newShakePos(0),
_paletteDirtyStart(0), _paletteDirtyEnd(0),
+#ifdef MIXER_DOUBLE_BUFFERING
+ _soundMutex(0), _soundCond(0), _soundThread(0),
+ _soundThreadIsRunning(false), _soundThreadShouldQuit(false),
+#endif
_savefile(0),
_mixer(0),
_timer(0),
@@ -241,6 +263,92 @@ FilesystemFactory *OSystem_SDL::getFilesystemFactory() {
#endif
}
+static Common::String getDefaultConfigFileName() {
+ char configFile[MAXPATHLEN];
+#if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
+ OSVERSIONINFO win32OsVersion;
+ ZeroMemory(&win32OsVersion, sizeof(OSVERSIONINFO));
+ win32OsVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&win32OsVersion);
+ // Check for non-9X version of Windows.
+ if (win32OsVersion.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) {
+ // Use the Application Data directory of the user profile.
+ if (win32OsVersion.dwMajorVersion >= 5) {
+ if (!GetEnvironmentVariable("APPDATA", configFile, sizeof(configFile)))
+ error("Unable to access application data directory");
+ } else {
+ if (!GetEnvironmentVariable("USERPROFILE", configFile, sizeof(configFile)))
+ error("Unable to access user profile directory");
+
+ strcat(configFile, "\\Application Data");
+ CreateDirectory(configFile, NULL);
+ }
+
+ strcat(configFile, "\\ScummVM");
+ CreateDirectory(configFile, NULL);
+ strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
+
+ if (fopen(configFile, "r") == NULL) {
+ // Check windows directory
+ char oldConfigFile[MAXPATHLEN];
+ GetWindowsDirectory(oldConfigFile, MAXPATHLEN);
+ strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE);
+ if (fopen(oldConfigFile, "r")) {
+ printf("The default location of the config file (scummvm.ini) in ScummVM has changed,\n");
+ printf("under Windows NT4/2000/XP/Vista. You may want to consider moving your config\n");
+ printf("file from the old default location:\n");
+ printf("%s\n", oldConfigFile);
+ printf("to the new default location:\n");
+ printf("%s\n\n", configFile);
+ strcpy(configFile, oldConfigFile);
+ }
+ }
+ } else {
+ // Check windows directory
+ GetWindowsDirectory(configFile, MAXPATHLEN);
+ strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
+ }
+#elif defined(UNIX)
+ // On UNIX type systems, by default we store the config file inside
+ // to the HOME directory of the user.
+ //
+ // GP2X is Linux based but Home dir can be read only so do not use
+ // it and put the config in the executable dir.
+ //
+ // On the iPhone, the home dir of the user when you launch the app
+ // from the Springboard, is /. Which we don't want.
+ const char *home = getenv("HOME");
+ if (home != NULL && strlen(home) < MAXPATHLEN)
+ snprintf(configFile, MAXPATHLEN, "%s/%s", home, DEFAULT_CONFIG_FILE);
+ else
+ strcpy(configFile, DEFAULT_CONFIG_FILE);
+#else
+ strcpy(configFile, DEFAULT_CONFIG_FILE);
+#endif
+
+ return configFile;
+}
+
+Common::SeekableReadStream *OSystem_SDL::openConfigFileForReading() {
+ Common::File *confFile = new Common::File();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
+Common::WriteStream *OSystem_SDL::openConfigFileForWriting() {
+ Common::DumpFile *confFile = new Common::DumpFile();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
void OSystem_SDL::setWindowCaption(const char *caption) {
SDL_WM_SetCaption(caption, caption);
}
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 4ad588f5f5..1c1381ec5c 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -210,6 +210,9 @@ public:
virtual Common::SaveFileManager *getSavefileManager();
virtual FilesystemFactory *getFilesystemFactory();
+ virtual Common::SeekableReadStream *openConfigFileForReading();
+ virtual Common::WriteStream *openConfigFileForWriting();
+
protected:
bool _inited;
diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
index 5d85fc03a2..12e5f8f0c4 100644
--- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
+++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
@@ -2,12 +2,11 @@
##################################################################################################################
@WorkingEngines = qw(
- scumm agos sky queen gob saga
- kyra lure agi
+ scumm agos sky queen gob saga drascula
+ kyra lure agi touche parallaction
);
@TestingEngines = qw(
- cine cruise touche parallaction
- drascula igor made m4
+ cruise igor made m4 cine
);
@BrokenEngines = qw(
sword1
@@ -29,21 +28,21 @@
);
# these are normally enabled for each variation
- $DefaultFeatures = qw(zlib tremor);
- #$DefaultFeatures = qw(zlib mad tremor);
+ #$DefaultFeatures = qw(zlib,mad);
+ $DefaultFeatures = qw(zlib,mad,tremor);
- # you can use these below for speed & clarity or override with custom settings
- $DefaultTopMacros = "
- MACRO USE_ZLIB // LIB:zlib.lib
- //MACRO USE_MAD // LIB:libmad.lib
- MACRO USE_TREMOR // LIB:libtremor.lib
- ";
+ # you can use these below for speed & clarity or override with custom settings
+ $DefaultTopMacros = "
+ MACRO USE_ZLIB // LIB:zlib.lib
+ MACRO USE_MAD // LIB:libmad.lib
+ MACRO USE_TREMOR // LIB:libtremor.lib
+ ";
- $DefaultBottomMacros = "
- MACRO DISABLE_SWORD1 // LIB:scummvm_sword1.lib
- MACRO DISABLE_SWORD2 // LIB:scummvm_sword2.lib
- ";
+ $DefaultBottomMacros = "
+ MACRO DISABLE_SWORD1 // LIB:scummvm_sword1.lib
+ MACRO DISABLE_SWORD2 // LIB:scummvm_sword2.lib
+ ";
##################################################################################################################
##
diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
index 3fea916e43..8daf76138c 100644
--- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
@@ -50,7 +50,7 @@ LANG SC
END
EPOCSTACKSIZE 80000
-EPOCHEAPSIZE 3000000 64000000
+EPOCHEAPSIZE 5000000 64000000
START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
index 0013d061ca..cf3d0c1d7b 100644
--- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
+++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
@@ -51,7 +51,7 @@ LANG SC
END
EPOCSTACKSIZE 80000
-EPOCHEAPSIZE 3000000 64000000
+EPOCHEAPSIZE 5000000 64000000
START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp
index 8fc35e9f8d..da127eaec6 100644
--- a/backends/platform/symbian/src/SymbianActions.cpp
+++ b/backends/platform/symbian/src/SymbianActions.cpp
@@ -140,6 +140,8 @@ void SymbianActions::initInstanceGame() {
bool is_touche = (gameid == "touche");
bool is_agi = (gameid == "agi");
bool is_parallaction = (gameid == "parallaction");
+ bool is_lure = (gameid == "lure");
+ bool is_feeble = (gameid == "feeble");
Actions::initInstanceGame();
@@ -175,7 +177,7 @@ void SymbianActions::initInstanceGame() {
// Skip text
if (!is_cine && !is_parallaction)
_action_enabled[ACTION_SKIP_TEXT] = true;
- if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_saga || is_kyra || is_touche)
+ if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_saga || is_kyra || is_touche || is_lure || is_feeble)
_key_action[ACTION_SKIP_TEXT].setKey(Common::KEYCODE_ESCAPE, Common::KEYCODE_ESCAPE); // Escape key
else {
_key_action[ACTION_SKIP_TEXT].setKey(SDLK_PERIOD);
diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp
index 660b0c69ed..0ce44d1704 100644
--- a/backends/platform/symbian/src/SymbianOS.cpp
+++ b/backends/platform/symbian/src/SymbianOS.cpp
@@ -30,6 +30,7 @@
#include "backends/platform/symbian/src/SymbianActions.h"
#include "common/config-manager.h"
#include "common/events.h"
+#include "common/file.h"
#include "gui/Actions.h"
#include "gui/Key.h"
#include "gui/message.h"
@@ -42,6 +43,10 @@
#define SAMPLES_PER_SEC 16000
#endif
+
+#define DEFAULT_CONFIG_FILE "scummvm.ini"
+
+
#define KInputBufferLength 128
// Symbian libc file functionality in order to provide shared file handles
struct TSymbianFileEntry {
@@ -122,6 +127,34 @@ FilesystemFactory *OSystem_SDL_Symbian::getFilesystemFactory() {
return &SymbianFilesystemFactory::instance();
}
+static Common::String getDefaultConfigFileName() {
+ char configFile[MAXPATHLEN];
+ strcpy(configFile, Symbian::GetExecutablePath());
+ strcat(configFile, DEFAULT_CONFIG_FILE);
+ return configFile;
+}
+
+Common::SeekableReadStream *OSystem_SDL_Symbian::openConfigFileForReading() {
+ Common::File *confFile = new Common::File();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
+Common::WriteStream *OSystem_SDL_Symbian::openConfigFileForWriting() {
+ Common::DumpFile *confFile = new Common::DumpFile();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
+
OSystem_SDL_Symbian::zoneDesc OSystem_SDL_Symbian::_zones[TOTAL_ZONES] = {
{ 0, 0, 320, 145 },
{ 0, 145, 150, 55 },
@@ -617,9 +650,13 @@ bool symbian_feof(FILE* handle) {
long int symbian_ftell(FILE* handle) {
TInt pos = 0;
+ TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle));
- ((TSymbianFileEntry*)(handle))->iFileHandle.Seek(ESeekCurrent, pos);
-
+ entry->iFileHandle.Seek(ESeekCurrent, pos);
+ if(entry->iInputPos != KErrNotFound)
+ {
+ pos+=(entry->iInputPos - entry->iInputBufferLen);
+ }
return pos;
}
@@ -627,6 +664,7 @@ int symbian_fseek(FILE* handle, long int offset, int whence) {
TSeek seekMode = ESeekStart;
TInt pos = offset;
+ TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle));
switch(whence) {
case SEEK_SET:
@@ -634,6 +672,9 @@ int symbian_fseek(FILE* handle, long int offset, int whence) {
break;
case SEEK_CUR:
seekMode = ESeekCurrent;
+ if(entry->iInputPos != KErrNotFound) {
+ pos+=(entry->iInputPos - entry->iInputBufferLen);
+ }
break;
case SEEK_END:
seekMode = ESeekEnd;
@@ -641,9 +682,9 @@ int symbian_fseek(FILE* handle, long int offset, int whence) {
}
- ((TSymbianFileEntry*)(handle))->iInputPos = KErrNotFound;
+ entry->iInputPos = KErrNotFound;
- return ((TSymbianFileEntry*)(handle))->iFileHandle.Seek(seekMode, pos);
+ return entry->iFileHandle.Seek(seekMode, pos);
}
void symbian_clearerr(FILE* /*handle*/) {
diff --git a/backends/platform/symbian/src/SymbianOS.h b/backends/platform/symbian/src/SymbianOS.h
index 71d24f6286..68a6fb492f 100644
--- a/backends/platform/symbian/src/SymbianOS.h
+++ b/backends/platform/symbian/src/SymbianOS.h
@@ -71,6 +71,9 @@ protected:
static void symbianMixCallback(void *s, byte *samples, int len);
virtual FilesystemFactory *getFilesystemFactory();
+
+ virtual Common::SeekableReadStream *openConfigFileForReading();
+ virtual Common::WriteStream *openConfigFileForWriting();
public:
// vibration support
#ifdef USE_VIBRA_SE_PXXX
diff --git a/backends/platform/symbian/src/main_features.inl b/backends/platform/symbian/src/main_features.inl
index f572ddb3dd..30bbbea52c 100644
--- a/backends/platform/symbian/src/main_features.inl
+++ b/backends/platform/symbian/src/main_features.inl
@@ -27,62 +27,61 @@
// we want a list of supported engines visible in the program,
// because we also release special builds with only one engine
-#ifndef DISABLE_SCUMM
+#ifdef ENABLE_SCUMM
"SCUMM "
#endif
-#ifndef DISABLE_AGOS
+#ifdef ENABLE_AGOS
"AGOS "
#endif
-#ifndef DISABLE_SKY
+#ifdef ENABLE_SKY
"Sky "
#endif
-#ifndef DISABLE_QUEEN
+#ifdef ENABLE_QUEEN
"Queen "
#endif
-#ifndef DISABLE_GOB
+#ifdef ENABLE_GOB
"Gob "
#endif
-#ifndef DISABLE_SAGA
+#ifdef ENABLE_SAGA
"Saga "
#endif
-#ifndef DISABLE_KYRA
+#ifdef ENABLE_KYRA
"Kyra "
#endif
-#ifndef DISABLE_SWORD1
+#ifdef ENABLE_SWORD1
"Sword1 "
#endif
-#ifndef DISABLE_SWORD2
+#ifdef ENABLE_SWORD2
"Sword2 "
#endif
-#ifndef DISABLE_CINE
+#ifdef ENABLE_CINE
"Cine "
#endif
-#ifndef DISABLE_LURE
+#ifdef ENABLE_LURE
"Lure "
#endif
-#ifndef DISABLE_AGI
+#ifdef ENABLE_AGI
"AGI "
#endif
-#ifndef DISABLE_TOUCHE
+#ifdef ENABLE_TOUCHE
"Touche "
#endif
-#ifndef DISABLE_DRASCULA
+#ifdef ENABLE_DRASCULA
"Drascula "
#endif
-#ifndef DISABLE_IGOR
+#ifdef ENABLE_IGOR
"Igor "
#endif
-#ifndef DISABLE_PARALLACTION
+#ifdef ENABLE_PARALLACTION
"Parallaction "
#endif
-#ifndef DISABLE_CRUISE
+#ifdef ENABLE_CRUISE
"Cruise "
#endif
-#ifndef DISABLE_MADE
+#ifdef ENABLE_MADE
"MADE "
#endif
-
-#ifndef DISABLE_M4
+#ifdef ENABLE_M4
"M4 "
#endif
diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h
index 06a4cf374c..4577824b33 100644
--- a/backends/platform/symbian/src/portdefs.h
+++ b/backends/platform/symbian/src/portdefs.h
@@ -157,5 +157,6 @@ void inline *scumm_bsearch(const void *key, const void *base, size_t nmemb, size
namespace Symbian {
extern void FatalError(const char *msg);
extern char* GetExecutablePath();
+#define DYNAMIC_MODULES 1
}
#endif