From 59739a7a0e3e4826ba7b27d5270a8d7a26b787ef Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Sun, 7 Aug 2011 21:33:32 +1000 Subject: BADA: Initial BADA port implementation --- backends/platform/bada/application.cpp | 128 +++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100755 backends/platform/bada/application.cpp (limited to 'backends/platform/bada/application.cpp') diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp new file mode 100755 index 0000000000..d5bd1572be --- /dev/null +++ b/backends/platform/bada/application.cpp @@ -0,0 +1,128 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "engines/engine.h" + +#include "backends/platform/bada/form.h" +#include "backends/platform/bada/system.h" +#include "backends/platform/bada/application.h" + +using namespace Osp::Base; +using namespace Osp::Base::Runtime; +using namespace Osp::Graphics; +using namespace Osp::Locales; +using namespace Osp::System; +using namespace Osp::App; +using namespace Osp::System; +using namespace Osp::Ui; +using namespace Osp::Ui::Controls; + +Application *BadaScummVM::createInstance() { + return new BadaScummVM(); +} + +BadaScummVM::BadaScummVM() : _appForm(0) { +} + +BadaScummVM::~BadaScummVM() { + logEntered(); + if (g_system) { + BadaSystem *system = (BadaSystem*)g_system; + system->destroyBackend(); + delete system; + g_system = 0; + } +} + +bool BadaScummVM::OnAppInitializing(AppRegistry &appRegistry) { + _appForm = systemStart(this); + return (_appForm != null); +} + +bool BadaScummVM::OnAppTerminating(AppRegistry &appRegistry, + bool forcedTermination) { + logEntered(); + return true; +} + +void BadaScummVM::OnUserEventReceivedN(RequestId requestId, + Osp::Base::Collection::IList *args) { + logEntered(); + + if (requestId == USER_MESSAGE_EXIT) { + // normal program termination + Terminate(); + } else if (requestId == USER_MESSAGE_EXIT_ERR) { + // assertion failure termination + String *message = null; + if (args) { + message = (String*) args->GetAt(0); + } + if (!message) { + message = new String("Unknown error"); + } + + MessageBox messageBox; + messageBox.Construct(L"Oops...", *message, MSGBOX_STYLE_OK); + int modalResult; + messageBox.ShowAndWait(modalResult); + Terminate(); + } +} + +void BadaScummVM::OnForeground(void) { + logEntered(); + pauseGame(false); +} + +void BadaScummVM::OnBackground(void) { + logEntered(); + pauseGame(true); +} + +void BadaScummVM::OnBatteryLevelChanged(BatteryLevel batteryLevel) { +} + +void BadaScummVM::OnLowMemory(void) { +} + +void BadaScummVM::OnScreenOn(void) { + logEntered(); +} + +void BadaScummVM::OnScreenOff(void) { + logEntered(); +} + +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); + } +} + +// +// end of application.cpp +// -- cgit v1.2.3 From 2e77b97b1984e32690ab3864af931553d5272767 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Sun, 14 Aug 2011 09:42:31 +1000 Subject: BADA: Code formatting; replace tab before else with space --- backends/platform/bada/application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/bada/application.cpp') diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp index d5bd1572be..af4e3fc6ef 100755 --- a/backends/platform/bada/application.cpp +++ b/backends/platform/bada/application.cpp @@ -71,7 +71,7 @@ void BadaScummVM::OnUserEventReceivedN(RequestId requestId, if (requestId == USER_MESSAGE_EXIT) { // normal program termination Terminate(); - } else if (requestId == USER_MESSAGE_EXIT_ERR) { + } else if (requestId == USER_MESSAGE_EXIT_ERR) { // assertion failure termination String *message = null; if (args) { -- cgit v1.2.3 From a31b74f3e98a083c8d5e20facf06d126b9504c76 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Tue, 16 Aug 2011 11:58:43 +1000 Subject: BADA: Code formatting and style changes following review --- backends/platform/bada/application.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'backends/platform/bada/application.cpp') diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp index af4e3fc6ef..bf17e66aa3 100755 --- a/backends/platform/bada/application.cpp +++ b/backends/platform/bada/application.cpp @@ -46,7 +46,7 @@ BadaScummVM::BadaScummVM() : _appForm(0) { BadaScummVM::~BadaScummVM() { logEntered(); if (g_system) { - BadaSystem *system = (BadaSystem*)g_system; + BadaSystem *system = (BadaSystem *)g_system; system->destroyBackend(); delete system; g_system = 0; @@ -55,7 +55,7 @@ BadaScummVM::~BadaScummVM() { bool BadaScummVM::OnAppInitializing(AppRegistry &appRegistry) { _appForm = systemStart(this); - return (_appForm != null); + return (_appForm != NULL); } bool BadaScummVM::OnAppTerminating(AppRegistry &appRegistry, @@ -73,9 +73,9 @@ void BadaScummVM::OnUserEventReceivedN(RequestId requestId, Terminate(); } else if (requestId == USER_MESSAGE_EXIT_ERR) { // assertion failure termination - String *message = null; + String *message = NULL; if (args) { - message = (String*) args->GetAt(0); + message = (String*)args->GetAt(0); } if (!message) { message = new String("Unknown error"); @@ -119,10 +119,6 @@ void BadaScummVM::pauseGame(bool pause) { } if (g_system) { - ((BadaSystem*)g_system)->setMute(pause); + ((BadaSystem *)g_system)->setMute(pause); } } - -// -// end of application.cpp -// -- cgit v1.2.3 From 028a67012dafc7655ae194ef05c224d979cd502f Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Tue, 16 Aug 2011 15:49:21 +1000 Subject: BADA: Cleanup unused namespace declarations --- backends/platform/bada/application.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'backends/platform/bada/application.cpp') diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp index bf17e66aa3..c66cbeeb58 100755 --- a/backends/platform/bada/application.cpp +++ b/backends/platform/bada/application.cpp @@ -26,14 +26,7 @@ #include "backends/platform/bada/system.h" #include "backends/platform/bada/application.h" -using namespace Osp::Base; -using namespace Osp::Base::Runtime; -using namespace Osp::Graphics; -using namespace Osp::Locales; using namespace Osp::System; -using namespace Osp::App; -using namespace Osp::System; -using namespace Osp::Ui; using namespace Osp::Ui::Controls; Application *BadaScummVM::createInstance() { -- cgit v1.2.3 From 5e472df21262e139d6b6a9f60d31c206c6e738bc Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Sat, 20 Aug 2011 14:19:44 +1000 Subject: BADA: Cleanup unused screen interface implementation --- backends/platform/bada/application.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'backends/platform/bada/application.cpp') diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp index c66cbeeb58..7e13006fd1 100755 --- a/backends/platform/bada/application.cpp +++ b/backends/platform/bada/application.cpp @@ -98,14 +98,6 @@ void BadaScummVM::OnBatteryLevelChanged(BatteryLevel batteryLevel) { void BadaScummVM::OnLowMemory(void) { } -void BadaScummVM::OnScreenOn(void) { - logEntered(); -} - -void BadaScummVM::OnScreenOff(void) { - logEntered(); -} - void BadaScummVM::pauseGame(bool pause) { if (pause && _appForm && g_engine && !g_engine->isPaused()) { _appForm->pushKey(Common::KEYCODE_SPACE); -- cgit v1.2.3 From 911de33e8946de479149e9dc7e16385298815b46 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 22 Aug 2011 09:45:19 +0200 Subject: BADA: Remove executable flag from files --- backends/platform/bada/application.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 backends/platform/bada/application.cpp (limited to 'backends/platform/bada/application.cpp') diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp old mode 100755 new mode 100644 -- cgit v1.2.3 From 58ab4cdab79c2f55a96f373f948d47fabded68b4 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 22 Aug 2011 09:46:30 +0200 Subject: BADA: Strip trailing whitespace --- backends/platform/bada/application.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/platform/bada/application.cpp') diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp index 7e13006fd1..a287fa6352 100644 --- a/backends/platform/bada/application.cpp +++ b/backends/platform/bada/application.cpp @@ -51,13 +51,13 @@ bool BadaScummVM::OnAppInitializing(AppRegistry &appRegistry) { return (_appForm != NULL); } -bool BadaScummVM::OnAppTerminating(AppRegistry &appRegistry, +bool BadaScummVM::OnAppTerminating(AppRegistry &appRegistry, bool forcedTermination) { logEntered(); return true; } -void BadaScummVM::OnUserEventReceivedN(RequestId requestId, +void BadaScummVM::OnUserEventReceivedN(RequestId requestId, Osp::Base::Collection::IList *args) { logEntered(); @@ -73,7 +73,7 @@ void BadaScummVM::OnUserEventReceivedN(RequestId requestId, if (!message) { message = new String("Unknown error"); } - + MessageBox messageBox; messageBox.Construct(L"Oops...", *message, MSGBOX_STYLE_OK); int modalResult; -- cgit v1.2.3