BADA: Strip trailing whitespace

This commit is contained in:
Sven Hesse 2011-08-22 09:46:30 +02:00
parent b406ba5884
commit 58ab4cdab7
15 changed files with 93 additions and 93 deletions

View file

@ -41,7 +41,7 @@ Build instructions:
for instructions on how to obtain these modules
3.1 For Target-Release configure ogg and mad with:
./configure --host=arm-samsung-nucleuseabi --disable-shared
when building vorbis and flac:
@ -73,13 +73,13 @@ Build instructions:
5. Build the front end application using BADA-Ide:
Copy the scummvm/dists/bada folder into a clean directory
outside of the scummvm package. Start the BADA IDE then
Copy the scummvm/dists/bada folder into a clean directory
outside of the scummvm package. Start the BADA IDE then
choose this folder as the eclipse workspace. Click
Project / Build.
Links:
A short turorial on implementing OpenGL ES 1.1 in BADA:
http://forums.badadev.com/viewtopic.php?f=7&t=208
http://forums.badadev.com/viewtopic.php?f=7&t=208

View file

@ -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;

View file

@ -37,7 +37,7 @@ public:
~BadaScummVM();
static Osp::App::Application *createInstance(void);
bool OnAppInitializing(Osp::App::AppRegistry &appRegistry);
bool OnAppTerminating(Osp::App::AppRegistry &appRegistry, bool forcedTermination = false);
void OnForeground(void);

View file

@ -36,7 +36,7 @@
// sound level pre-sets
const int levels[] = {0, 1, 10, 45, 70, 99};
AudioThread::AudioThread() :
AudioThread::AudioThread() :
_mixer(0),
_timer(0),
_audioOut(0),
@ -254,7 +254,7 @@ void AudioThread::OnTimerExpired(Timer &timer) {
if (_ready && _playing == -1) {
OnAudioOutBufferEndReached(*_audioOut);
}
_timer->Start(_interval);
}

View file

@ -42,7 +42,7 @@ using namespace Osp::Io;
#define NUM_AUDIO_BUFFERS 2
class AudioThread: public Osp::Media::IAudioOutEventListener,
public Osp::Base::Runtime::ITimerEventListener,
public Osp::Base::Runtime::ITimerEventListener,
public Osp::Base::Runtime::Thread {
public:
AudioThread(void);
@ -60,7 +60,7 @@ public:
void OnAudioOutReleased(Osp::Media::AudioOut &src);
void OnAudioOutBufferEndReached(Osp::Media::AudioOut &src);
void OnTimerExpired(Timer &timer);
private:
Audio::MixerImpl *_mixer;
Osp::Base::Runtime::Timer *_timer;

View file

@ -1,5 +1,5 @@
# Bada specific modules are built under eclipse
$(EXECUTABLE): $(OBJS)
rm -f $@
rm -f $@
ar Tru $@ $(OBJS)

View file

@ -39,7 +39,7 @@ using namespace Osp::Ui::Controls;
// cursor to be positioned at the top of the screen
#define MIN_TOUCH_Y 10
// block for up to 2.5 seconds during shutdown to
// block for up to 2.5 seconds during shutdown to
// allow the game thread to exit gracefully.
#define EXIT_SLEEP_STEP 10
#define EXIT_SLEEP 250
@ -47,8 +47,8 @@ using namespace Osp::Ui::Controls;
//
// BadaAppForm
//
BadaAppForm::BadaAppForm() :
_gameThread(0),
BadaAppForm::BadaAppForm() :
_gameThread(0),
_state(InitState),
_buttonState(LeftButton),
_shortcut(SetVolume) {
@ -67,7 +67,7 @@ result BadaAppForm::Construct() {
badaSystem = new BadaSystem(this);
r = badaSystem != NULL ? E_SUCCESS : E_OUT_OF_MEMORY;
if (!IsFailed(r)) {
r = badaSystem->Construct();
}
@ -105,7 +105,7 @@ BadaAppForm::~BadaAppForm() {
_gameThread->Stop();
if (_state != ErrorState) {
_gameThread->Join();
}
}
delete _gameThread;
_gameThread = NULL;
@ -205,13 +205,13 @@ void BadaAppForm::pushEvent(Common::EventType type,
BadaSystem *system = (BadaSystem *)g_system;
BadaGraphicsManager *graphics = system->getGraphics();
if (graphics) {
// graphics could be NULL at startup or when
// graphics could be NULL at startup or when
// displaying the system error screen
Common::Event e;
e.type = type;
e.mouse.x = currentPosition.x;
e.mouse.y = currentPosition.y > MIN_TOUCH_Y ? currentPosition.y : 1;
bool moved = graphics->moveMouse(e.mouse.x, e.mouse.y);
_eventQueueLock->Acquire();
@ -245,7 +245,7 @@ void BadaAppForm::pushKey(Common::KeyCode keycode) {
_eventQueueLock->Release();
}
void BadaAppForm::OnOrientationChanged(const Control &source,
void BadaAppForm::OnOrientationChanged(const Control &source,
OrientationStatus orientationStatus) {
logEntered();
if (_state == InitState) {
@ -334,8 +334,8 @@ void BadaAppForm::showKeypad() {
pushKey(Common::KEYCODE_F7);
}
void BadaAppForm::OnTouchDoublePressed(const Control &source,
const Point &currentPosition,
void BadaAppForm::OnTouchDoublePressed(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
if (_buttonState != MoveOnly) {
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
@ -345,32 +345,32 @@ void BadaAppForm::OnTouchDoublePressed(const Control &source,
}
}
void BadaAppForm::OnTouchFocusIn(const Control &source,
const Point &currentPosition,
void BadaAppForm::OnTouchFocusIn(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
}
void BadaAppForm::OnTouchFocusOut(const Control &source,
const Point &currentPosition,
void BadaAppForm::OnTouchFocusOut(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
}
void BadaAppForm::OnTouchLongPressed(const Control &source,
const Point &currentPosition,
void BadaAppForm::OnTouchLongPressed(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
if (_buttonState != LeftButton) {
pushKey(Common::KEYCODE_RETURN);
}
}
void BadaAppForm::OnTouchMoved(const Control &source,
const Point &currentPosition,
void BadaAppForm::OnTouchMoved(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
pushEvent(Common::EVENT_MOUSEMOVE, currentPosition);
}
void BadaAppForm::OnTouchPressed(const Control &source,
const Point &currentPosition,
void BadaAppForm::OnTouchPressed(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
if (_buttonState != MoveOnly) {
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
@ -378,8 +378,8 @@ void BadaAppForm::OnTouchPressed(const Control &source,
}
}
void BadaAppForm::OnTouchReleased(const Control &source,
const Point &currentPosition,
void BadaAppForm::OnTouchReleased(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
if (_buttonState != MoveOnly) {
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONUP : Common::EVENT_RBUTTONUP,
@ -434,7 +434,7 @@ void BadaAppForm::OnKeyPressed(const Control &source, KeyCode keyCode) {
break;
case EscapeKey:
pushKey(Common::KEYCODE_ESCAPE);
pushKey(Common::KEYCODE_ESCAPE);
break;
case GameMenu:
@ -446,7 +446,7 @@ void BadaAppForm::OnKeyPressed(const Control &source, KeyCode keyCode) {
break;
default:
setVolume(false, false);
setVolume(false, false);
break;
}
break;

View file

@ -58,34 +58,34 @@ private:
Object *Run();
result OnInitializing(void);
result OnDraw(void);
void OnOrientationChanged(const Osp::Ui::Control &source,
void OnOrientationChanged(const Osp::Ui::Control &source,
Osp::Ui::OrientationStatus orientationStatus);
void OnTouchDoublePressed(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
void OnTouchDoublePressed(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
const Osp::Ui::TouchEventInfo &touchInfo);
void OnTouchFocusIn(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
void OnTouchFocusIn(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
const Osp::Ui::TouchEventInfo &touchInfo);
void OnTouchFocusOut(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
void OnTouchFocusOut(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
const Osp::Ui::TouchEventInfo &touchInfo);
void OnTouchLongPressed(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
void OnTouchLongPressed(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
const Osp::Ui::TouchEventInfo &touchInfo);
void OnTouchMoved(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
void OnTouchMoved(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
const Osp::Ui::TouchEventInfo &touchInfo);
void OnTouchPressed(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
void OnTouchPressed(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
const Osp::Ui::TouchEventInfo &touchInfo);
void OnTouchReleased(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
void OnTouchReleased(const Osp::Ui::Control &source,
const Osp::Graphics::Point &currentPosition,
const Osp::Ui::TouchEventInfo &touchInfo);
void OnKeyLongPressed(const Osp::Ui::Control &source,
void OnKeyLongPressed(const Osp::Ui::Control &source,
Osp::Ui::KeyCode keyCode);
void OnKeyPressed(const Osp::Ui::Control &source,
void OnKeyPressed(const Osp::Ui::Control &source,
Osp::Ui::KeyCode keyCode);
void OnKeyReleased(const Osp::Ui::Control &source,
void OnKeyReleased(const Osp::Ui::Control &source,
Osp::Ui::KeyCode keyCode);
void pushEvent(Common::EventType type,

View file

@ -35,7 +35,7 @@
#define PATH_MEDIA "/Media"
#define PATH_CARD "/Storagecard"
#define PATH_CARD_MEDIA "/Storagecard/Media"
//
// BadaFileStream
//
@ -68,7 +68,7 @@ private:
File *file;
};
BadaFileStream::BadaFileStream(File *ioFile, bool writeMode) :
BadaFileStream::BadaFileStream(File *ioFile, bool writeMode) :
bufferIndex(0),
bufferLength(0),
writeMode(writeMode),
@ -178,7 +178,7 @@ uint32 BadaFileStream::read(void *ptr, uint32 len) {
memcpy((byte*)ptr, &buffer[bufferIndex], available);
uint32 remaining = len - available;
result = available;
if (remaining) {
result += file->Read(((byte*)ptr) + available, remaining);
}
@ -231,7 +231,7 @@ BadaFileStream *BadaFileStream::makeFromPath(const String &path, bool writeMode)
if (r == E_SUCCESS) {
return new BadaFileStream(ioFile, writeMode);
}
AppLog("Failed to open file");
delete ioFile;
return 0;
@ -244,7 +244,7 @@ Common::String fromString(const Osp::Base::String &in) {
ByteBuffer *buf = StringUtil::StringToUtf8N(in);
Common::String result((const char*)buf->GetPointer());
delete buf;
return result;
}
@ -300,8 +300,8 @@ bool BadaFilesystemNode::isDirectory() const {
bool BadaFilesystemNode::isWritable() const {
bool result = (_isValid && !_isVirtualDir && !_attr.IsDirectory() && !_attr.IsReadOnly());
if (_path == PATH_HOME ||
_path == PATH_HOME_EXT ||
if (_path == PATH_HOME ||
_path == PATH_HOME_EXT ||
_path == PATH_HOME_SHARE ||
_path == PATH_HOME_SHARE2) {
result = true;
@ -338,11 +338,11 @@ bool BadaFilesystemNode::getChildren(AbstractFSList &myList,
myList.push_back(new BadaFilesystemNode(PATH_HOME_SHARE2));
}
}
if (!result) {
DirEnumerator *pDirEnum = 0;
Directory *pDir = new Directory();
// open directory
if (IsFailed(pDir->Construct(_unicodePath))) {
AppLog("Failed to open directory");
@ -352,24 +352,24 @@ bool BadaFilesystemNode::getChildren(AbstractFSList &myList,
if (pDirEnum) {
result = true;
}
// loop through all directory entries
while (pDirEnum && pDirEnum->MoveNext() == E_SUCCESS) {
DirEntry dirEntry = pDirEnum->GetCurrentDirEntry();
// skip 'invisible' files if necessary
Osp::Base::String fileName = dirEntry.GetName();
if (fileName[0] == '.' && !hidden) {
continue;
}
// skip '.' and '..' to avoid cycles
if ((fileName[0] == '.' && fileName[1] == 0) ||
(fileName[0] == '.' && fileName[1] == '.')) {
continue;
}
// Honor the chosen mode
if ((mode == Common::FSNode::kListFilesOnly && dirEntry.IsDirectory()) ||
(mode == Common::FSNode::kListDirectoriesOnly && !dirEntry.IsDirectory())) {
@ -378,12 +378,12 @@ bool BadaFilesystemNode::getChildren(AbstractFSList &myList,
myList.push_back(new BadaFilesystemNode(_path, fromString(fileName)));
}
}
// cleanup
if (pDirEnum) {
delete pDirEnum;
}
// close the opened directory
if (pDir) {
delete pDir;

View file

@ -75,7 +75,7 @@ Common::List<Graphics::PixelFormat> BadaGraphicsManager::getSupportedFormats() c
}
bool BadaGraphicsManager::hasFeature(OSystem::Feature f) {
bool result = (f == OSystem::kFeatureFullscreenMode ||
bool result = (f == OSystem::kFeatureFullscreenMode ||
f == OSystem::kFeatureVirtualKeyboard ||
OpenGLGraphicsManager::hasFeature(f));
return result;
@ -111,7 +111,7 @@ bool BadaGraphicsManager::loadEgl() {
};
EGLint eglContextList[] = {
EGL_CONTEXT_CLIENT_VERSION, 1,
EGL_CONTEXT_CLIENT_VERSION, 1,
EGL_NONE
};
@ -126,14 +126,14 @@ bool BadaGraphicsManager::loadEgl() {
systemError("eglGetDisplay() failed");
return false;
}
if (EGL_FALSE == eglInitialize(_eglDisplay, NULL, NULL) ||
if (EGL_FALSE == eglInitialize(_eglDisplay, NULL, NULL) ||
EGL_SUCCESS != eglGetError()) {
systemError("eglInitialize() failed");
return false;
}
if (EGL_FALSE == eglChooseConfig(_eglDisplay, eglConfigList,
if (EGL_FALSE == eglChooseConfig(_eglDisplay, eglConfigList,
&_eglConfig, 1, &numConfigs) ||
EGL_SUCCESS != eglGetError()) {
systemError("eglChooseConfig() failed");
@ -145,14 +145,14 @@ bool BadaGraphicsManager::loadEgl() {
return false;
}
_eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
_eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
(EGLNativeWindowType)_appForm, NULL);
if (EGL_NO_SURFACE == _eglSurface || EGL_SUCCESS != eglGetError()) {
systemError("eglCreateWindowSurface() failed. EGL_NO_SURFACE");
return false;
}
_eglContext = eglCreateContext(_eglDisplay, _eglConfig,
_eglContext = eglCreateContext(_eglDisplay, _eglConfig,
EGL_NO_CONTEXT, eglContextList);
if (EGL_NO_CONTEXT == _eglContext ||
EGL_SUCCESS != eglGetError()) {
@ -227,7 +227,7 @@ void BadaGraphicsManager::unloadGFXMode() {
eglTerminate(_eglDisplay);
_eglDisplay = EGL_NO_DISPLAY;
}
_eglConfig = NULL;
OpenGLGraphicsManager::unloadGFXMode();
@ -292,7 +292,7 @@ void BadaGraphicsManager::showSplash() {
canvas.Construct();
canvas.SetBackgroundColor(Color::COLOR_BLACK);
canvas.Clear();
int x = _videoMode.hardwareWidth / 3;
int y = _videoMode.hardwareHeight / 3;
@ -309,7 +309,7 @@ void BadaGraphicsManager::showSplash() {
canvas.SetForegroundColor(Color::COLOR_WHITE);
canvas.DrawText(Point(x + 70, y + 50), L"Loading ...");
delete pFont;
canvas.Show();
}

View file

@ -41,7 +41,7 @@ C_LINKAGE_BEGIN
int __errno; // for overridden method in saves/default/default-saves.cpp
void __assert_func(const char *file, int line,
void __assert_func(const char *file, int line,
const char *func, const char *err) {
char buffer[BUF_SIZE];
snprintf(buffer, sizeof(buffer), "%s %d %s %s", file, line, func, err);

View file

@ -37,7 +37,7 @@
#include <ctype.h> // causes a link error when building c programs
#define C_LINKAGE_BEGIN extern "C" {
#define C_LINKAGE_END }
#else
#else
#define C_LINKAGE_BEGIN
#define C_LINKAGE_END
#endif
@ -50,7 +50,7 @@ C_LINKAGE_BEGIN
#define fseeko fseek
#define ftello ftell
// overcome use of fprintf since bada/newlib (1.2) does not
// overcome use of fprintf since bada/newlib (1.2) does not
// support stderr/stdout (undefined reference to `_impure_ptr').
void stderr_fprintf(void*, const char *format, ...);

View file

@ -155,7 +155,7 @@ extern "C" int simple_sscanf(const char *input, const char *format, ...) {
break;
}
}
va_end(ap);
return result;
}
@ -171,7 +171,7 @@ int main(int argc, char *pArgv[]) {
// 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",
"CAT %dx%d %x FONT %[^\n] %06u.AUD %c",
&x, &y, &h, b, &u, &c) != 6) {
printf("Failed\n");
} else {

View file

@ -96,7 +96,7 @@ bool BadaSaveFileManager::removeSavefile(const Common::String &filename) {
return true;
case E_ILLEGAL_ACCESS:
setError(Common::kWritePermissionDenied, "Search or write permission denied: " +
setError(Common::kWritePermissionDenied, "Search or write permission denied: " +
file.getName());
break;
@ -206,9 +206,9 @@ int BadaEventManager::shouldQuit() const {
//
// BadaSystem
//
BadaSystem::BadaSystem(BadaAppForm *appForm) :
BadaSystem::BadaSystem(BadaAppForm *appForm) :
_appForm(appForm),
_audioThread(0),
_audioThread(0),
_epoch(0) {
}
@ -251,7 +251,7 @@ result BadaSystem::initModules() {
}
// depends on _graphicsManager when ENABLE_VKEYBD enabled
_eventManager = new BadaEventManager(this);
_eventManager = new BadaEventManager(this);
if (!_eventManager) {
return E_OUT_OF_MEMORY;
}

View file

@ -58,7 +58,7 @@ void systemError(const char *message);
//
// BadaSystem
//
class BadaSystem : public ModularBackend,
class BadaSystem : public ModularBackend,
Common::EventSource {
public:
BadaSystem(BadaAppForm *appForm);
@ -92,7 +92,7 @@ private:
Common::EventSource *getDefaultEventSource() {return this;}
Common::SeekableReadStream *createConfigReadStream();
Common::WriteStream *createConfigWriteStream();
BadaAppForm *_appForm;
AudioThread *_audioThread;
long long _epoch;