aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/bada
diff options
context:
space:
mode:
authorChris Warren-Smith2011-10-17 22:35:48 +1000
committerChris Warren-Smith2011-10-18 23:22:25 +1000
commited07b99b22c2cf092f207dc15b26801c502534ac (patch)
treed9da48b5e0385d36c09aac398bc8306d7c5a63e1 /backends/platform/bada
parentca7bc7184652be9673045f5d810ec4bd310c120c (diff)
downloadscummvm-rg350-ed07b99b22c2cf092f207dc15b26801c502534ac.tar.gz
scummvm-rg350-ed07b99b22c2cf092f207dc15b26801c502534ac.tar.bz2
scummvm-rg350-ed07b99b22c2cf092f207dc15b26801c502534ac.zip
BADA: Misc changes merged from appstore release
Diffstat (limited to 'backends/platform/bada')
-rw-r--r--backends/platform/bada/README.TXT7
-rw-r--r--backends/platform/bada/application.cpp14
-rw-r--r--backends/platform/bada/audio.cpp4
-rw-r--r--backends/platform/bada/form.cpp108
-rw-r--r--backends/platform/bada/form.h8
-rw-r--r--backends/platform/bada/fs.cpp5
-rw-r--r--backends/platform/bada/graphics.cpp54
-rw-r--r--backends/platform/bada/graphics.h1
-rw-r--r--backends/platform/bada/sscanf.cpp49
-rw-r--r--backends/platform/bada/system.cpp29
-rw-r--r--backends/platform/bada/system.h5
11 files changed, 138 insertions, 146 deletions
diff --git a/backends/platform/bada/README.TXT b/backends/platform/bada/README.TXT
index ca6f8f245a..c4a04d5450 100644
--- a/backends/platform/bada/README.TXT
+++ b/backends/platform/bada/README.TXT
@@ -83,3 +83,10 @@ Links:
A short turorial on implementing OpenGL ES 1.1 in BADA:
http://forums.badadev.com/viewtopic.php?f=7&t=208
+HelvB14 font files:
+ http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
+ http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts-75dpi100dpi.tar.gz
+
+ Then run the following command:
+ $ ./ucs2any.pl 100dpi/helvB14.bdf MAPPINGS/8859-1.TXT iso8859-1 \
+ MAPPINGS/8859-2.TXT iso8859-2 MAPPINGS/8859-3.TXT iso8859-3
diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp
index a287fa6352..bf585d2782 100644
--- a/backends/platform/bada/application.cpp
+++ b/backends/platform/bada/application.cpp
@@ -99,11 +99,13 @@ void BadaScummVM::OnLowMemory(void) {
}
void BadaScummVM::pauseGame(bool pause) {
- if (pause && _appForm && g_engine && !g_engine->isPaused()) {
- _appForm->pushKey(Common::KEYCODE_SPACE);
- }
-
- if (g_system) {
- ((BadaSystem *)g_system)->setMute(pause);
+ if (_appForm) {
+ if (pause && g_engine && !g_engine->isPaused()) {
+ _appForm->pushKey(Common::KEYCODE_SPACE);
+ }
+
+ if (g_system) {
+ ((BadaSystem *)g_system)->setMute(pause);
+ }
}
}
diff --git a/backends/platform/bada/audio.cpp b/backends/platform/bada/audio.cpp
index cfa6418e08..b868e91357 100644
--- a/backends/platform/bada/audio.cpp
+++ b/backends/platform/bada/audio.cpp
@@ -74,7 +74,7 @@ bool AudioThread::isSilentMode() {
}
void AudioThread::setMute(bool on) {
- if (_audioOut && !isSilentMode()) {
+ if (_audioOut && _timer) {
_muted = on;
if (on) {
_timer->Cancel();
@@ -88,7 +88,7 @@ int AudioThread::setVolume(bool up, bool minMax) {
int level = -1;
int numLevels = sizeof(levels) / sizeof(levels[0]);
- if (_audioOut && !isSilentMode()) {
+ if (_audioOut) {
int volume = _audioOut->GetVolume();
if (minMax) {
level = up ? numLevels - 1 : 0;
diff --git a/backends/platform/bada/form.cpp b/backends/platform/bada/form.cpp
index 6163053c96..dfa72bce08 100644
--- a/backends/platform/bada/form.cpp
+++ b/backends/platform/bada/form.cpp
@@ -49,9 +49,9 @@ using namespace Osp::Ui::Controls;
//
BadaAppForm::BadaAppForm() :
_gameThread(0),
- _state(InitState),
- _buttonState(LeftButton),
- _shortcut(SetVolume) {
+ _state(kInitState),
+ _buttonState(kLeftButton),
+ _shortcut(kSetVolume) {
_eventQueueLock = new Mutex();
_eventQueueLock->Create();
}
@@ -99,11 +99,11 @@ result BadaAppForm::Construct() {
BadaAppForm::~BadaAppForm() {
logEntered();
- if (_gameThread && _state != ErrorState) {
+ if (_gameThread && _state != kErrorState) {
terminate();
_gameThread->Stop();
- if (_state != ErrorState) {
+ if (_state != kErrorState) {
_gameThread->Join();
}
@@ -123,7 +123,7 @@ BadaAppForm::~BadaAppForm() {
// abort the game thread
//
void BadaAppForm::terminate() {
- if (_state == ActiveState) {
+ if (_state == kActiveState) {
((BadaSystem *)g_system)->setMute(true);
_eventQueueLock->Acquire();
@@ -131,25 +131,25 @@ void BadaAppForm::terminate() {
Common::Event e;
e.type = Common::EVENT_QUIT;
_eventQueue.push(e);
- _state = ClosingState;
+ _state = kClosingState;
_eventQueueLock->Release();
// block while thread ends
AppLog("waiting for shutdown");
- for (int i = 0; i < EXIT_SLEEP_STEP && _state == ClosingState; i++) {
+ for (int i = 0; i < EXIT_SLEEP_STEP && _state == kClosingState; i++) {
Thread::Sleep(EXIT_SLEEP);
}
- if (_state == ClosingState) {
+ if (_state == kClosingState) {
// failed to terminate - Join() will freeze
- _state = ErrorState;
+ _state = kErrorState;
}
}
}
void BadaAppForm::exitSystem() {
- _state = ErrorState;
+ _state = kErrorState;
if (_gameThread) {
_gameThread->Stop();
@@ -200,8 +200,7 @@ bool BadaAppForm::pollEvent(Common::Event &event) {
return result;
}
-void BadaAppForm::pushEvent(Common::EventType type,
- const Point &currentPosition) {
+void BadaAppForm::pushEvent(Common::EventType type, const Point &currentPosition) {
BadaSystem *system = (BadaSystem *)g_system;
BadaGraphicsManager *graphics = system->getGraphics();
if (graphics) {
@@ -248,8 +247,8 @@ void BadaAppForm::pushKey(Common::KeyCode keycode) {
void BadaAppForm::OnOrientationChanged(const Control &source,
OrientationStatus orientationStatus) {
logEntered();
- if (_state == InitState) {
- _state = ActiveState;
+ if (_state == kInitState) {
+ _state = kActiveState;
_gameThread->Start();
}
}
@@ -257,30 +256,30 @@ void BadaAppForm::OnOrientationChanged(const Control &source,
Object *BadaAppForm::Run(void) {
scummvm_main(0, 0);
- if (_state == ActiveState) {
+ if (_state == kActiveState) {
Application::GetInstance()->SendUserEvent(USER_MESSAGE_EXIT, NULL);
}
- _state = DoneState;
+ _state = kDoneState;
return NULL;
}
void BadaAppForm::setButtonShortcut() {
switch (_buttonState) {
- case LeftButton:
+ case kLeftButton:
g_system->displayMessageOnOSD(_("Right Click Once"));
- _buttonState = RightButtonOnce;
+ _buttonState = kRightButtonOnce;
break;
- case RightButtonOnce:
+ case kRightButtonOnce:
g_system->displayMessageOnOSD(_("Right Click"));
- _buttonState = RightButton;
+ _buttonState = kRightButton;
break;
- case RightButton:
+ case kRightButton:
g_system->displayMessageOnOSD(_("Move Only"));
- _buttonState = MoveOnly;
+ _buttonState = kMoveOnly;
break;
- case MoveOnly:
+ case kMoveOnly:
g_system->displayMessageOnOSD(_("Left Click"));
- _buttonState = LeftButton;
+ _buttonState = kLeftButton;
break;
}
}
@@ -288,27 +287,27 @@ void BadaAppForm::setButtonShortcut() {
void BadaAppForm::setShortcut() {
// cycle to the next shortcut
switch (_shortcut) {
- case ControlMouse:
+ case kControlMouse:
g_system->displayMessageOnOSD(_("Escape Key"));
- _shortcut = EscapeKey;
+ _shortcut = kEscapeKey;
break;
- case EscapeKey:
+ case kEscapeKey:
g_system->displayMessageOnOSD(_("Game Menu"));
- _shortcut = GameMenu;
+ _shortcut = kGameMenu;
break;
- case GameMenu:
+ case kGameMenu:
g_system->displayMessageOnOSD(_("Show Keypad"));
- _shortcut = ShowKeypad;
+ _shortcut = kShowKeypad;
break;
- case SetVolume:
+ case kSetVolume:
// fallthru
- case ShowKeypad:
+ case kShowKeypad:
g_system->displayMessageOnOSD(_("Control Mouse"));
- _shortcut = ControlMouse;
+ _shortcut = kControlMouse;
break;
}
}
@@ -330,17 +329,17 @@ void BadaAppForm::setVolume(bool up, bool minMax) {
void BadaAppForm::showKeypad() {
// display the soft keyboard
- _buttonState = LeftButton;
+ _buttonState = kLeftButton;
pushKey(Common::KEYCODE_F7);
}
void BadaAppForm::OnTouchDoublePressed(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
- if (_buttonState != MoveOnly) {
- pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
+ if (_buttonState != kMoveOnly) {
+ pushEvent(_buttonState == kLeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
currentPosition);
- pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
+ pushEvent(_buttonState == kLeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
currentPosition);
}
}
@@ -358,7 +357,7 @@ void BadaAppForm::OnTouchFocusOut(const Control &source,
void BadaAppForm::OnTouchLongPressed(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
- if (_buttonState != LeftButton) {
+ if (_buttonState != kLeftButton) {
pushKey(Common::KEYCODE_RETURN);
}
}
@@ -372,8 +371,8 @@ void BadaAppForm::OnTouchMoved(const Control &source,
void BadaAppForm::OnTouchPressed(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
- if (_buttonState != MoveOnly) {
- pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
+ if (_buttonState != kMoveOnly) {
+ pushEvent(_buttonState == kLeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
currentPosition);
}
}
@@ -381,11 +380,11 @@ void BadaAppForm::OnTouchPressed(const Control &source,
void BadaAppForm::OnTouchReleased(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
- if (_buttonState != MoveOnly) {
- pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONUP : Common::EVENT_RBUTTONUP,
+ if (_buttonState != kMoveOnly) {
+ pushEvent(_buttonState == kLeftButton ? Common::EVENT_LBUTTONUP : Common::EVENT_RBUTTONUP,
currentPosition);
- if (_buttonState == RightButtonOnce) {
- _buttonState = LeftButton;
+ if (_buttonState == kRightButtonOnce) {
+ _buttonState = kLeftButton;
}
// flick to skip dialog
if (touchInfo.IsFlicked()) {
@@ -398,17 +397,17 @@ void BadaAppForm::OnKeyLongPressed(const Control &source, KeyCode keyCode) {
logEntered();
switch (keyCode) {
case KEY_SIDE_UP:
- _shortcut = SetVolume;
+ _shortcut = kSetVolume;
setVolume(true, true);
return;
case KEY_SIDE_DOWN:
- _shortcut = SetVolume;
+ _shortcut = kSetVolume;
setVolume(false, true);
return;
case KEY_CAMERA:
- _shortcut = ShowKeypad;
+ _shortcut = kShowKeypad;
showKeypad();
return;
@@ -420,8 +419,8 @@ void BadaAppForm::OnKeyLongPressed(const Control &source, KeyCode keyCode) {
void BadaAppForm::OnKeyPressed(const Control &source, KeyCode keyCode) {
switch (keyCode) {
case KEY_SIDE_UP:
- if (_shortcut != SetVolume) {
- _shortcut = SetVolume;
+ if (_shortcut != kSetVolume) {
+ _shortcut = kSetVolume;
} else {
setVolume(true, false);
}
@@ -429,19 +428,20 @@ void BadaAppForm::OnKeyPressed(const Control &source, KeyCode keyCode) {
case KEY_SIDE_DOWN:
switch (_shortcut) {
- case ControlMouse:
+ case kControlMouse:
setButtonShortcut();
break;
- case EscapeKey:
+ case kEscapeKey:
pushKey(Common::KEYCODE_ESCAPE);
break;
- case GameMenu:
+ case kGameMenu:
+ _buttonState = kLeftButton;
pushKey(Common::KEYCODE_F5);
break;
- case ShowKeypad:
+ case kShowKeypad:
showKeypad();
break;
diff --git a/backends/platform/bada/form.h b/backends/platform/bada/form.h
index 09ce941a7b..3340e2216b 100644
--- a/backends/platform/bada/form.h
+++ b/backends/platform/bada/form.h
@@ -50,7 +50,7 @@ public:
result Construct();
bool pollEvent(Common::Event &event);
- bool isClosing() { return _state == ClosingState; }
+ bool isClosing() { return _state == kClosingState; }
void pushKey(Common::KeyCode keycode);
void exitSystem();
@@ -100,9 +100,9 @@ private:
Osp::Base::Runtime::Thread *_gameThread;
Osp::Base::Runtime::Mutex *_eventQueueLock;
Common::Queue<Common::Event> _eventQueue;
- enum {InitState, ActiveState, ClosingState, DoneState, ErrorState} _state;
- enum {LeftButton, RightButtonOnce, RightButton, MoveOnly} _buttonState;
- enum {ControlMouse, EscapeKey, GameMenu, ShowKeypad, SetVolume} _shortcut;
+ enum { kInitState, kActiveState, kClosingState, kDoneState, kErrorState } _state;
+ enum { kLeftButton, kRightButtonOnce, kRightButton, kMoveOnly } _buttonState;
+ enum { kControlMouse, kEscapeKey, kGameMenu, kShowKeypad, kSetVolume } _shortcut;
};
#endif
diff --git a/backends/platform/bada/fs.cpp b/backends/platform/bada/fs.cpp
index 8e3c4f0f7c..0ae0cde43d 100644
--- a/backends/platform/bada/fs.cpp
+++ b/backends/platform/bada/fs.cpp
@@ -345,7 +345,7 @@ bool BadaFilesystemNode::getChildren(AbstractFSList &myList,
// open directory
if (IsFailed(pDir->Construct(_unicodePath))) {
- AppLog("Failed to open directory");
+ AppLog("Failed to open directory: %S", _unicodePath.GetPointer());
} else {
// read all directory entries
pDirEnum = pDir->ReadN();
@@ -365,8 +365,7 @@ bool BadaFilesystemNode::getChildren(AbstractFSList &myList,
}
// skip '.' and '..' to avoid cycles
- if ((fileName[0] == '.' && fileName[1] == 0) ||
- (fileName[0] == '.' && fileName[1] == '.')) {
+ if (fileName == L"." || fileName == L"..") {
continue;
}
diff --git a/backends/platform/bada/graphics.cpp b/backends/platform/bada/graphics.cpp
index 4ab90a633f..bd65c597c6 100644
--- a/backends/platform/bada/graphics.cpp
+++ b/backends/platform/bada/graphics.cpp
@@ -38,7 +38,6 @@ BadaGraphicsManager::BadaGraphicsManager(BadaAppForm *appForm) :
_initState(true) {
assert(appForm != NULL);
_videoMode.fullscreen = true;
- _videoMode.antialiasing = true;
}
const Graphics::Font *BadaGraphicsManager::getFontOSD() {
@@ -195,7 +194,6 @@ void BadaGraphicsManager::loadTextures() {
// prevent image skew in some games, see:
// http://www.opengl.org/resources/features/KilgardTechniques/oglpitfall
- // note: this did not solve the pixel border problem in refreshGameScreen()
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
}
@@ -234,58 +232,6 @@ void BadaGraphicsManager::unloadGFXMode() {
logLeaving();
}
-void BadaGraphicsManager::refreshGameScreen() {
- if (_screenNeedsRedraw)
- _screenDirtyRect = Common::Rect(0, 0, _screenData.w, _screenData.h);
-
- int x = _screenDirtyRect.left;
- int y = _screenDirtyRect.top;
- int w = _screenDirtyRect.width();
- int h = _screenDirtyRect.height();
-
- if (_screenData.format.bytesPerPixel == 1) {
- // Create a temporary RGB888 surface
- int sw = w;
- int sh = h;
-
- if (_videoMode.screenWidth == w && _videoMode.screenHeight == h) {
- // The extra border prevents random pixels from appearing in the right and bottom
- // screen column/row. Not sure whether this should be applied to opengl-graphics.cpp
- sw = w + 1;
- sh = h + 1;
- }
-
- byte *surface = new byte[sw * sh * 3];
-
- // Convert the paletted buffer to RGB888
- const byte *src = (byte *)_screenData.pixels + y * _screenData.pitch;
- src += x * _screenData.format.bytesPerPixel;
- byte *dst = surface;
- for (int i = 0; i < h; i++) {
- for (int j = 0; j < w; j++) {
- dst[0] = _gamePalette[src[j] * 3];
- dst[1] = _gamePalette[src[j] * 3 + 1];
- dst[2] = _gamePalette[src[j] * 3 + 2];
- dst += 3;
- }
- src += _screenData.pitch;
- }
-
- // Update the texture
- _gameTexture->updateBuffer(surface, w * 3, x, y, sw, sh);
-
- // Free the temp surface
- delete[] surface;
- } else {
- // Update the texture
- _gameTexture->updateBuffer((byte *)_screenData.pixels + y * _screenData.pitch +
- x * _screenData.format.bytesPerPixel, _screenData.pitch, x, y, w, h);
- }
-
- _screenNeedsRedraw = false;
- _screenDirtyRect = Common::Rect();
-}
-
// display a simple splash screen until launcher is ready
void BadaGraphicsManager::showSplash() {
Canvas canvas;
diff --git a/backends/platform/bada/graphics.h b/backends/platform/bada/graphics.h
index 5e49419979..b2aaca43bc 100644
--- a/backends/platform/bada/graphics.h
+++ b/backends/platform/bada/graphics.h
@@ -57,7 +57,6 @@ private:
bool loadGFXMode();
void loadTextures();
void unloadGFXMode();
- void refreshGameScreen();
void setInternalMousePosition(int x, int y) {}
void showSplash();
diff --git a/backends/platform/bada/sscanf.cpp b/backends/platform/bada/sscanf.cpp
index 4ef964b47e..b5e5b88cb5 100644
--- a/backends/platform/bada/sscanf.cpp
+++ b/backends/platform/bada/sscanf.cpp
@@ -31,17 +31,32 @@
//
bool scanInt(const char **in, va_list *ap, int max) {
- while (**in && (**in == ' ' || **in == '0')) {
+ // skip leading space characters
+ while (**in && **in == ' ') {
+ (*in)++;
+ }
+
+ // number optionally preceeded with a + or - sign.
+ bool negate = false;
+ if (**in == '-') {
+ (*in)++;
+ negate = true;
+ }
+
+ if (**in == '+') {
(*in)++;
}
int *arg = va_arg(*ap, int*);
char *end;
- long n = strtol(*in, &end, 0);
+ long n = strtol(*in, &end, 10);
+ if (negate) {
+ n = -n;
+ }
bool err = false;
if (end == *in || (max > 0 && (end - *in) > max)) {
- err = true;
+ err = true;
} else {
*arg = (int)n;
*in = end;
@@ -162,21 +177,37 @@ extern "C" int simple_sscanf(const char *input, const char *format, ...) {
#if defined(TEST)
int main(int argc, char *pArgv[]) {
- int x,y,h;
+ int x,y,xx,yy,h;
char buffer[100];
unsigned u;
char c;
strcpy(buffer, "hello");
char *b = buffer;
- // strcpy(buffer, "in the buffer something");
- if (simple_sscanf("CAT 123x-10 0x100 FONT large 1 enough\n 123456.AUD $",
- "CAT %dx%d %x FONT %[^\n] %06u.AUD %c",
- &x, &y, &h, b, &u, &c) != 6) {
+ if (simple_sscanf("BBX 00009 -1 +10 000",
+ "BBX %d %d %d %d",
+ &x, &y, &xx, &yy) != 4) {
+ printf("Failed\n");
+ } else {
+ printf("Success %d %d %d %d\n", x, y, xx, yy);
+ }
+
+ if (simple_sscanf("CAT 123x-10 0x100h 123456.AUD $ ",
+ "CAT %dx%d %xh %06u.AUD %c",
+ &x, &y, &h, &u, &c) != 5) {
+ printf("Failed\n");
+ } else {
+ printf("Success %d %d %d %d '%c' \n", x, y, h, u, c);
+ }
+
+ if (simple_sscanf("COPYRIGHT \"Copyright (c) 1984, 1987 Foo Systems Incorporated",
+ "COPYRIGHT \"%[^\"]",
+ b) != 1) {
printf("Failed\n");
} else {
- printf("Success %d %d %d %s %d '%c'\n", x, y, h, buffer, u, c);
+ printf("Success %s\n", buffer);
}
+
return 0;
}
#endif
diff --git a/backends/platform/bada/system.cpp b/backends/platform/bada/system.cpp
index 37d7028687..d284688068 100644
--- a/backends/platform/bada/system.cpp
+++ b/backends/platform/bada/system.cpp
@@ -45,6 +45,7 @@ using namespace Osp::Base::Runtime;
using namespace Osp::Ui::Controls;
#define DEFAULT_CONFIG_FILE "/Home/scummvm.ini"
+#define RESOURCE_PATH "/Res"
#define MUTEX_BUFFER_SIZE 5
//
@@ -152,17 +153,17 @@ OSystem::MutexRef BadaMutexManager::createMutex() {
}
void BadaMutexManager::lockMutex(OSystem::MutexRef mutex) {
- Mutex *m = (Mutex*)mutex;
+ Mutex *m = (Mutex *)mutex;
m->Acquire();
}
void BadaMutexManager::unlockMutex(OSystem::MutexRef mutex) {
- Mutex *m = (Mutex*)mutex;
+ Mutex *m = (Mutex *)mutex;
m->Release();
}
void BadaMutexManager::deleteMutex(OSystem::MutexRef mutex) {
- Mutex *m = (Mutex*)mutex;
+ Mutex *m = (Mutex *)mutex;
for (int i = 0; i < MUTEX_BUFFER_SIZE; i++) {
if (buffer[i] == m) {
@@ -245,7 +246,7 @@ result BadaSystem::initModules() {
return E_OUT_OF_MEMORY;
}
- _graphicsManager = (GraphicsManager*) new BadaGraphicsManager(_appForm);
+ _graphicsManager = (GraphicsManager *)new BadaGraphicsManager(_appForm);
if (!_graphicsManager) {
return E_OUT_OF_MEMORY;
}
@@ -266,7 +267,7 @@ result BadaSystem::initModules() {
return E_OUT_OF_MEMORY;
}
- _audiocdManager = (AudioCDManager*) new DefaultAudioCDManager();
+ _audiocdManager = (AudioCDManager *)new DefaultAudioCDManager();
if (!_audiocdManager) {
return E_OUT_OF_MEMORY;
}
@@ -283,9 +284,6 @@ result BadaSystem::initModules() {
void BadaSystem::initBackend() {
logEntered();
- // allow translations and game .DAT files to be found
- ConfMan.set("extrapath", "/Res");
-
// use the mobile device theme
ConfMan.set("gui_theme", "/Res/scummmobile");
@@ -304,7 +302,7 @@ void BadaSystem::initBackend() {
}
ConfMan.registerDefault("fullscreen", true);
- ConfMan.registerDefault("aspect_ratio", true);
+ ConfMan.registerDefault("aspect_ratio", false);
ConfMan.setBool("confirm_exit", false);
Osp::System::SystemTime::GetTicks(_epoch);
@@ -317,7 +315,7 @@ void BadaSystem::initBackend() {
// replace kBigGUIFont using the large font from the scummmobile theme
Common::File fontFile;
- Common::String fileName = "/Res/scummmobile/helvB14-ASCII.fcc";
+ Common::String fileName = "/Res/scummmobile/helvB14-iso-8859-1.fcc";
BadaFilesystemNode file(fileName);
if (file.exists()) {
Common::SeekableReadStream *stream = file.createReadStream();
@@ -335,6 +333,11 @@ void BadaSystem::initBackend() {
logLeaving();
}
+void BadaSystem::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
+ // allow translations.dat and game .DAT files to be found
+ s.addDirectory(RESOURCE_PATH, RESOURCE_PATH, priority);
+}
+
void BadaSystem::destroyBackend() {
closeAudio();
@@ -446,8 +449,12 @@ void BadaSystem::closeGraphics() {
}
void BadaSystem::setMute(bool on) {
+ // only change mute after eventManager init() has completed
if (_audioThread) {
- _audioThread->setMute(on);
+ BadaGraphicsManager *graphics = getGraphics();
+ if (graphics && graphics->isReady()) {
+ _audioThread->setMute(on);
+ }
}
}
diff --git a/backends/platform/bada/system.h b/backends/platform/bada/system.h
index a091f952e5..c28686cb3d 100644
--- a/backends/platform/bada/system.h
+++ b/backends/platform/bada/system.h
@@ -74,7 +74,7 @@ public:
bool isClosing() { return _appForm->isClosing(); }
BadaGraphicsManager *getGraphics() {
- return (BadaGraphicsManager*)_graphicsManager;
+ return (BadaGraphicsManager *)_graphicsManager;
}
private:
@@ -88,8 +88,9 @@ private:
void getTimeAndDate(TimeDate &t) const;
void fatalError();
void logMessage(LogMessageType::Type type, const char *message);
+ void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);
- Common::EventSource *getDefaultEventSource() {return this;}
+ Common::EventSource *getDefaultEventSource() { return this; }
Common::SeekableReadStream *createConfigReadStream();
Common::WriteStream *createConfigWriteStream();