BADA: Strip trailing whitespace
This commit is contained in:
parent
b406ba5884
commit
58ab4cdab7
15 changed files with 93 additions and 93 deletions
|
@ -41,7 +41,7 @@ Build instructions:
|
||||||
for instructions on how to obtain these modules
|
for instructions on how to obtain these modules
|
||||||
|
|
||||||
3.1 For Target-Release configure ogg and mad with:
|
3.1 For Target-Release configure ogg and mad with:
|
||||||
|
|
||||||
./configure --host=arm-samsung-nucleuseabi --disable-shared
|
./configure --host=arm-samsung-nucleuseabi --disable-shared
|
||||||
|
|
||||||
when building vorbis and flac:
|
when building vorbis and flac:
|
||||||
|
@ -73,13 +73,13 @@ Build instructions:
|
||||||
|
|
||||||
5. Build the front end application using BADA-Ide:
|
5. Build the front end application using BADA-Ide:
|
||||||
|
|
||||||
Copy the scummvm/dists/bada folder into a clean directory
|
Copy the scummvm/dists/bada folder into a clean directory
|
||||||
outside of the scummvm package. Start the BADA IDE then
|
outside of the scummvm package. Start the BADA IDE then
|
||||||
choose this folder as the eclipse workspace. Click
|
choose this folder as the eclipse workspace. Click
|
||||||
Project / Build.
|
Project / Build.
|
||||||
|
|
||||||
Links:
|
Links:
|
||||||
|
|
||||||
A short turorial on implementing OpenGL ES 1.1 in BADA:
|
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
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,13 @@ bool BadaScummVM::OnAppInitializing(AppRegistry &appRegistry) {
|
||||||
return (_appForm != NULL);
|
return (_appForm != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BadaScummVM::OnAppTerminating(AppRegistry &appRegistry,
|
bool BadaScummVM::OnAppTerminating(AppRegistry &appRegistry,
|
||||||
bool forcedTermination) {
|
bool forcedTermination) {
|
||||||
logEntered();
|
logEntered();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BadaScummVM::OnUserEventReceivedN(RequestId requestId,
|
void BadaScummVM::OnUserEventReceivedN(RequestId requestId,
|
||||||
Osp::Base::Collection::IList *args) {
|
Osp::Base::Collection::IList *args) {
|
||||||
logEntered();
|
logEntered();
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void BadaScummVM::OnUserEventReceivedN(RequestId requestId,
|
||||||
if (!message) {
|
if (!message) {
|
||||||
message = new String("Unknown error");
|
message = new String("Unknown error");
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageBox messageBox;
|
MessageBox messageBox;
|
||||||
messageBox.Construct(L"Oops...", *message, MSGBOX_STYLE_OK);
|
messageBox.Construct(L"Oops...", *message, MSGBOX_STYLE_OK);
|
||||||
int modalResult;
|
int modalResult;
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
~BadaScummVM();
|
~BadaScummVM();
|
||||||
|
|
||||||
static Osp::App::Application *createInstance(void);
|
static Osp::App::Application *createInstance(void);
|
||||||
|
|
||||||
bool OnAppInitializing(Osp::App::AppRegistry &appRegistry);
|
bool OnAppInitializing(Osp::App::AppRegistry &appRegistry);
|
||||||
bool OnAppTerminating(Osp::App::AppRegistry &appRegistry, bool forcedTermination = false);
|
bool OnAppTerminating(Osp::App::AppRegistry &appRegistry, bool forcedTermination = false);
|
||||||
void OnForeground(void);
|
void OnForeground(void);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
// sound level pre-sets
|
// sound level pre-sets
|
||||||
const int levels[] = {0, 1, 10, 45, 70, 99};
|
const int levels[] = {0, 1, 10, 45, 70, 99};
|
||||||
|
|
||||||
AudioThread::AudioThread() :
|
AudioThread::AudioThread() :
|
||||||
_mixer(0),
|
_mixer(0),
|
||||||
_timer(0),
|
_timer(0),
|
||||||
_audioOut(0),
|
_audioOut(0),
|
||||||
|
@ -254,7 +254,7 @@ void AudioThread::OnTimerExpired(Timer &timer) {
|
||||||
if (_ready && _playing == -1) {
|
if (_ready && _playing == -1) {
|
||||||
OnAudioOutBufferEndReached(*_audioOut);
|
OnAudioOutBufferEndReached(*_audioOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
_timer->Start(_interval);
|
_timer->Start(_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ using namespace Osp::Io;
|
||||||
#define NUM_AUDIO_BUFFERS 2
|
#define NUM_AUDIO_BUFFERS 2
|
||||||
|
|
||||||
class AudioThread: public Osp::Media::IAudioOutEventListener,
|
class AudioThread: public Osp::Media::IAudioOutEventListener,
|
||||||
public Osp::Base::Runtime::ITimerEventListener,
|
public Osp::Base::Runtime::ITimerEventListener,
|
||||||
public Osp::Base::Runtime::Thread {
|
public Osp::Base::Runtime::Thread {
|
||||||
public:
|
public:
|
||||||
AudioThread(void);
|
AudioThread(void);
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
void OnAudioOutReleased(Osp::Media::AudioOut &src);
|
void OnAudioOutReleased(Osp::Media::AudioOut &src);
|
||||||
void OnAudioOutBufferEndReached(Osp::Media::AudioOut &src);
|
void OnAudioOutBufferEndReached(Osp::Media::AudioOut &src);
|
||||||
void OnTimerExpired(Timer &timer);
|
void OnTimerExpired(Timer &timer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Audio::MixerImpl *_mixer;
|
Audio::MixerImpl *_mixer;
|
||||||
Osp::Base::Runtime::Timer *_timer;
|
Osp::Base::Runtime::Timer *_timer;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Bada specific modules are built under eclipse
|
# Bada specific modules are built under eclipse
|
||||||
|
|
||||||
$(EXECUTABLE): $(OBJS)
|
$(EXECUTABLE): $(OBJS)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
ar Tru $@ $(OBJS)
|
ar Tru $@ $(OBJS)
|
||||||
|
|
|
@ -39,7 +39,7 @@ using namespace Osp::Ui::Controls;
|
||||||
// cursor to be positioned at the top of the screen
|
// cursor to be positioned at the top of the screen
|
||||||
#define MIN_TOUCH_Y 10
|
#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.
|
// allow the game thread to exit gracefully.
|
||||||
#define EXIT_SLEEP_STEP 10
|
#define EXIT_SLEEP_STEP 10
|
||||||
#define EXIT_SLEEP 250
|
#define EXIT_SLEEP 250
|
||||||
|
@ -47,8 +47,8 @@ using namespace Osp::Ui::Controls;
|
||||||
//
|
//
|
||||||
// BadaAppForm
|
// BadaAppForm
|
||||||
//
|
//
|
||||||
BadaAppForm::BadaAppForm() :
|
BadaAppForm::BadaAppForm() :
|
||||||
_gameThread(0),
|
_gameThread(0),
|
||||||
_state(InitState),
|
_state(InitState),
|
||||||
_buttonState(LeftButton),
|
_buttonState(LeftButton),
|
||||||
_shortcut(SetVolume) {
|
_shortcut(SetVolume) {
|
||||||
|
@ -67,7 +67,7 @@ result BadaAppForm::Construct() {
|
||||||
|
|
||||||
badaSystem = new BadaSystem(this);
|
badaSystem = new BadaSystem(this);
|
||||||
r = badaSystem != NULL ? E_SUCCESS : E_OUT_OF_MEMORY;
|
r = badaSystem != NULL ? E_SUCCESS : E_OUT_OF_MEMORY;
|
||||||
|
|
||||||
if (!IsFailed(r)) {
|
if (!IsFailed(r)) {
|
||||||
r = badaSystem->Construct();
|
r = badaSystem->Construct();
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ BadaAppForm::~BadaAppForm() {
|
||||||
_gameThread->Stop();
|
_gameThread->Stop();
|
||||||
if (_state != ErrorState) {
|
if (_state != ErrorState) {
|
||||||
_gameThread->Join();
|
_gameThread->Join();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete _gameThread;
|
delete _gameThread;
|
||||||
_gameThread = NULL;
|
_gameThread = NULL;
|
||||||
|
@ -205,13 +205,13 @@ void BadaAppForm::pushEvent(Common::EventType type,
|
||||||
BadaSystem *system = (BadaSystem *)g_system;
|
BadaSystem *system = (BadaSystem *)g_system;
|
||||||
BadaGraphicsManager *graphics = system->getGraphics();
|
BadaGraphicsManager *graphics = system->getGraphics();
|
||||||
if (graphics) {
|
if (graphics) {
|
||||||
// graphics could be NULL at startup or when
|
// graphics could be NULL at startup or when
|
||||||
// displaying the system error screen
|
// displaying the system error screen
|
||||||
Common::Event e;
|
Common::Event e;
|
||||||
e.type = type;
|
e.type = type;
|
||||||
e.mouse.x = currentPosition.x;
|
e.mouse.x = currentPosition.x;
|
||||||
e.mouse.y = currentPosition.y > MIN_TOUCH_Y ? currentPosition.y : 1;
|
e.mouse.y = currentPosition.y > MIN_TOUCH_Y ? currentPosition.y : 1;
|
||||||
|
|
||||||
bool moved = graphics->moveMouse(e.mouse.x, e.mouse.y);
|
bool moved = graphics->moveMouse(e.mouse.x, e.mouse.y);
|
||||||
|
|
||||||
_eventQueueLock->Acquire();
|
_eventQueueLock->Acquire();
|
||||||
|
@ -245,7 +245,7 @@ void BadaAppForm::pushKey(Common::KeyCode keycode) {
|
||||||
_eventQueueLock->Release();
|
_eventQueueLock->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BadaAppForm::OnOrientationChanged(const Control &source,
|
void BadaAppForm::OnOrientationChanged(const Control &source,
|
||||||
OrientationStatus orientationStatus) {
|
OrientationStatus orientationStatus) {
|
||||||
logEntered();
|
logEntered();
|
||||||
if (_state == InitState) {
|
if (_state == InitState) {
|
||||||
|
@ -334,8 +334,8 @@ void BadaAppForm::showKeypad() {
|
||||||
pushKey(Common::KEYCODE_F7);
|
pushKey(Common::KEYCODE_F7);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BadaAppForm::OnTouchDoublePressed(const Control &source,
|
void BadaAppForm::OnTouchDoublePressed(const Control &source,
|
||||||
const Point ¤tPosition,
|
const Point ¤tPosition,
|
||||||
const TouchEventInfo &touchInfo) {
|
const TouchEventInfo &touchInfo) {
|
||||||
if (_buttonState != MoveOnly) {
|
if (_buttonState != MoveOnly) {
|
||||||
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
|
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,
|
void BadaAppForm::OnTouchFocusIn(const Control &source,
|
||||||
const Point ¤tPosition,
|
const Point ¤tPosition,
|
||||||
const TouchEventInfo &touchInfo) {
|
const TouchEventInfo &touchInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BadaAppForm::OnTouchFocusOut(const Control &source,
|
void BadaAppForm::OnTouchFocusOut(const Control &source,
|
||||||
const Point ¤tPosition,
|
const Point ¤tPosition,
|
||||||
const TouchEventInfo &touchInfo) {
|
const TouchEventInfo &touchInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BadaAppForm::OnTouchLongPressed(const Control &source,
|
void BadaAppForm::OnTouchLongPressed(const Control &source,
|
||||||
const Point ¤tPosition,
|
const Point ¤tPosition,
|
||||||
const TouchEventInfo &touchInfo) {
|
const TouchEventInfo &touchInfo) {
|
||||||
if (_buttonState != LeftButton) {
|
if (_buttonState != LeftButton) {
|
||||||
pushKey(Common::KEYCODE_RETURN);
|
pushKey(Common::KEYCODE_RETURN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BadaAppForm::OnTouchMoved(const Control &source,
|
void BadaAppForm::OnTouchMoved(const Control &source,
|
||||||
const Point ¤tPosition,
|
const Point ¤tPosition,
|
||||||
const TouchEventInfo &touchInfo) {
|
const TouchEventInfo &touchInfo) {
|
||||||
pushEvent(Common::EVENT_MOUSEMOVE, currentPosition);
|
pushEvent(Common::EVENT_MOUSEMOVE, currentPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BadaAppForm::OnTouchPressed(const Control &source,
|
void BadaAppForm::OnTouchPressed(const Control &source,
|
||||||
const Point ¤tPosition,
|
const Point ¤tPosition,
|
||||||
const TouchEventInfo &touchInfo) {
|
const TouchEventInfo &touchInfo) {
|
||||||
if (_buttonState != MoveOnly) {
|
if (_buttonState != MoveOnly) {
|
||||||
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
|
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,
|
void BadaAppForm::OnTouchReleased(const Control &source,
|
||||||
const Point ¤tPosition,
|
const Point ¤tPosition,
|
||||||
const TouchEventInfo &touchInfo) {
|
const TouchEventInfo &touchInfo) {
|
||||||
if (_buttonState != MoveOnly) {
|
if (_buttonState != MoveOnly) {
|
||||||
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONUP : Common::EVENT_RBUTTONUP,
|
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONUP : Common::EVENT_RBUTTONUP,
|
||||||
|
@ -434,7 +434,7 @@ void BadaAppForm::OnKeyPressed(const Control &source, KeyCode keyCode) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EscapeKey:
|
case EscapeKey:
|
||||||
pushKey(Common::KEYCODE_ESCAPE);
|
pushKey(Common::KEYCODE_ESCAPE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GameMenu:
|
case GameMenu:
|
||||||
|
@ -446,7 +446,7 @@ void BadaAppForm::OnKeyPressed(const Control &source, KeyCode keyCode) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
setVolume(false, false);
|
setVolume(false, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -58,34 +58,34 @@ private:
|
||||||
Object *Run();
|
Object *Run();
|
||||||
result OnInitializing(void);
|
result OnInitializing(void);
|
||||||
result OnDraw(void);
|
result OnDraw(void);
|
||||||
void OnOrientationChanged(const Osp::Ui::Control &source,
|
void OnOrientationChanged(const Osp::Ui::Control &source,
|
||||||
Osp::Ui::OrientationStatus orientationStatus);
|
Osp::Ui::OrientationStatus orientationStatus);
|
||||||
void OnTouchDoublePressed(const Osp::Ui::Control &source,
|
void OnTouchDoublePressed(const Osp::Ui::Control &source,
|
||||||
const Osp::Graphics::Point ¤tPosition,
|
const Osp::Graphics::Point ¤tPosition,
|
||||||
const Osp::Ui::TouchEventInfo &touchInfo);
|
const Osp::Ui::TouchEventInfo &touchInfo);
|
||||||
void OnTouchFocusIn(const Osp::Ui::Control &source,
|
void OnTouchFocusIn(const Osp::Ui::Control &source,
|
||||||
const Osp::Graphics::Point ¤tPosition,
|
const Osp::Graphics::Point ¤tPosition,
|
||||||
const Osp::Ui::TouchEventInfo &touchInfo);
|
const Osp::Ui::TouchEventInfo &touchInfo);
|
||||||
void OnTouchFocusOut(const Osp::Ui::Control &source,
|
void OnTouchFocusOut(const Osp::Ui::Control &source,
|
||||||
const Osp::Graphics::Point ¤tPosition,
|
const Osp::Graphics::Point ¤tPosition,
|
||||||
const Osp::Ui::TouchEventInfo &touchInfo);
|
const Osp::Ui::TouchEventInfo &touchInfo);
|
||||||
void OnTouchLongPressed(const Osp::Ui::Control &source,
|
void OnTouchLongPressed(const Osp::Ui::Control &source,
|
||||||
const Osp::Graphics::Point ¤tPosition,
|
const Osp::Graphics::Point ¤tPosition,
|
||||||
const Osp::Ui::TouchEventInfo &touchInfo);
|
const Osp::Ui::TouchEventInfo &touchInfo);
|
||||||
void OnTouchMoved(const Osp::Ui::Control &source,
|
void OnTouchMoved(const Osp::Ui::Control &source,
|
||||||
const Osp::Graphics::Point ¤tPosition,
|
const Osp::Graphics::Point ¤tPosition,
|
||||||
const Osp::Ui::TouchEventInfo &touchInfo);
|
const Osp::Ui::TouchEventInfo &touchInfo);
|
||||||
void OnTouchPressed(const Osp::Ui::Control &source,
|
void OnTouchPressed(const Osp::Ui::Control &source,
|
||||||
const Osp::Graphics::Point ¤tPosition,
|
const Osp::Graphics::Point ¤tPosition,
|
||||||
const Osp::Ui::TouchEventInfo &touchInfo);
|
const Osp::Ui::TouchEventInfo &touchInfo);
|
||||||
void OnTouchReleased(const Osp::Ui::Control &source,
|
void OnTouchReleased(const Osp::Ui::Control &source,
|
||||||
const Osp::Graphics::Point ¤tPosition,
|
const Osp::Graphics::Point ¤tPosition,
|
||||||
const Osp::Ui::TouchEventInfo &touchInfo);
|
const Osp::Ui::TouchEventInfo &touchInfo);
|
||||||
void OnKeyLongPressed(const Osp::Ui::Control &source,
|
void OnKeyLongPressed(const Osp::Ui::Control &source,
|
||||||
Osp::Ui::KeyCode keyCode);
|
Osp::Ui::KeyCode keyCode);
|
||||||
void OnKeyPressed(const Osp::Ui::Control &source,
|
void OnKeyPressed(const Osp::Ui::Control &source,
|
||||||
Osp::Ui::KeyCode keyCode);
|
Osp::Ui::KeyCode keyCode);
|
||||||
void OnKeyReleased(const Osp::Ui::Control &source,
|
void OnKeyReleased(const Osp::Ui::Control &source,
|
||||||
Osp::Ui::KeyCode keyCode);
|
Osp::Ui::KeyCode keyCode);
|
||||||
|
|
||||||
void pushEvent(Common::EventType type,
|
void pushEvent(Common::EventType type,
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#define PATH_MEDIA "/Media"
|
#define PATH_MEDIA "/Media"
|
||||||
#define PATH_CARD "/Storagecard"
|
#define PATH_CARD "/Storagecard"
|
||||||
#define PATH_CARD_MEDIA "/Storagecard/Media"
|
#define PATH_CARD_MEDIA "/Storagecard/Media"
|
||||||
|
|
||||||
//
|
//
|
||||||
// BadaFileStream
|
// BadaFileStream
|
||||||
//
|
//
|
||||||
|
@ -68,7 +68,7 @@ private:
|
||||||
File *file;
|
File *file;
|
||||||
};
|
};
|
||||||
|
|
||||||
BadaFileStream::BadaFileStream(File *ioFile, bool writeMode) :
|
BadaFileStream::BadaFileStream(File *ioFile, bool writeMode) :
|
||||||
bufferIndex(0),
|
bufferIndex(0),
|
||||||
bufferLength(0),
|
bufferLength(0),
|
||||||
writeMode(writeMode),
|
writeMode(writeMode),
|
||||||
|
@ -178,7 +178,7 @@ uint32 BadaFileStream::read(void *ptr, uint32 len) {
|
||||||
memcpy((byte*)ptr, &buffer[bufferIndex], available);
|
memcpy((byte*)ptr, &buffer[bufferIndex], available);
|
||||||
uint32 remaining = len - available;
|
uint32 remaining = len - available;
|
||||||
result = available;
|
result = available;
|
||||||
|
|
||||||
if (remaining) {
|
if (remaining) {
|
||||||
result += file->Read(((byte*)ptr) + available, remaining);
|
result += file->Read(((byte*)ptr) + available, remaining);
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ BadaFileStream *BadaFileStream::makeFromPath(const String &path, bool writeMode)
|
||||||
if (r == E_SUCCESS) {
|
if (r == E_SUCCESS) {
|
||||||
return new BadaFileStream(ioFile, writeMode);
|
return new BadaFileStream(ioFile, writeMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppLog("Failed to open file");
|
AppLog("Failed to open file");
|
||||||
delete ioFile;
|
delete ioFile;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -244,7 +244,7 @@ Common::String fromString(const Osp::Base::String &in) {
|
||||||
ByteBuffer *buf = StringUtil::StringToUtf8N(in);
|
ByteBuffer *buf = StringUtil::StringToUtf8N(in);
|
||||||
Common::String result((const char*)buf->GetPointer());
|
Common::String result((const char*)buf->GetPointer());
|
||||||
delete buf;
|
delete buf;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,8 +300,8 @@ bool BadaFilesystemNode::isDirectory() const {
|
||||||
|
|
||||||
bool BadaFilesystemNode::isWritable() const {
|
bool BadaFilesystemNode::isWritable() const {
|
||||||
bool result = (_isValid && !_isVirtualDir && !_attr.IsDirectory() && !_attr.IsReadOnly());
|
bool result = (_isValid && !_isVirtualDir && !_attr.IsDirectory() && !_attr.IsReadOnly());
|
||||||
if (_path == PATH_HOME ||
|
if (_path == PATH_HOME ||
|
||||||
_path == PATH_HOME_EXT ||
|
_path == PATH_HOME_EXT ||
|
||||||
_path == PATH_HOME_SHARE ||
|
_path == PATH_HOME_SHARE ||
|
||||||
_path == PATH_HOME_SHARE2) {
|
_path == PATH_HOME_SHARE2) {
|
||||||
result = true;
|
result = true;
|
||||||
|
@ -338,11 +338,11 @@ bool BadaFilesystemNode::getChildren(AbstractFSList &myList,
|
||||||
myList.push_back(new BadaFilesystemNode(PATH_HOME_SHARE2));
|
myList.push_back(new BadaFilesystemNode(PATH_HOME_SHARE2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
DirEnumerator *pDirEnum = 0;
|
DirEnumerator *pDirEnum = 0;
|
||||||
Directory *pDir = new Directory();
|
Directory *pDir = new Directory();
|
||||||
|
|
||||||
// open directory
|
// open directory
|
||||||
if (IsFailed(pDir->Construct(_unicodePath))) {
|
if (IsFailed(pDir->Construct(_unicodePath))) {
|
||||||
AppLog("Failed to open directory");
|
AppLog("Failed to open directory");
|
||||||
|
@ -352,24 +352,24 @@ bool BadaFilesystemNode::getChildren(AbstractFSList &myList,
|
||||||
if (pDirEnum) {
|
if (pDirEnum) {
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop through all directory entries
|
// loop through all directory entries
|
||||||
while (pDirEnum && pDirEnum->MoveNext() == E_SUCCESS) {
|
while (pDirEnum && pDirEnum->MoveNext() == E_SUCCESS) {
|
||||||
DirEntry dirEntry = pDirEnum->GetCurrentDirEntry();
|
DirEntry dirEntry = pDirEnum->GetCurrentDirEntry();
|
||||||
|
|
||||||
// skip 'invisible' files if necessary
|
// skip 'invisible' files if necessary
|
||||||
Osp::Base::String fileName = dirEntry.GetName();
|
Osp::Base::String fileName = dirEntry.GetName();
|
||||||
|
|
||||||
if (fileName[0] == '.' && !hidden) {
|
if (fileName[0] == '.' && !hidden) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip '.' and '..' to avoid cycles
|
// skip '.' and '..' to avoid cycles
|
||||||
if ((fileName[0] == '.' && fileName[1] == 0) ||
|
if ((fileName[0] == '.' && fileName[1] == 0) ||
|
||||||
(fileName[0] == '.' && fileName[1] == '.')) {
|
(fileName[0] == '.' && fileName[1] == '.')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Honor the chosen mode
|
// Honor the chosen mode
|
||||||
if ((mode == Common::FSNode::kListFilesOnly && dirEntry.IsDirectory()) ||
|
if ((mode == Common::FSNode::kListFilesOnly && dirEntry.IsDirectory()) ||
|
||||||
(mode == Common::FSNode::kListDirectoriesOnly && !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)));
|
myList.push_back(new BadaFilesystemNode(_path, fromString(fileName)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
if (pDirEnum) {
|
if (pDirEnum) {
|
||||||
delete pDirEnum;
|
delete pDirEnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
// close the opened directory
|
// close the opened directory
|
||||||
if (pDir) {
|
if (pDir) {
|
||||||
delete pDir;
|
delete pDir;
|
||||||
|
|
|
@ -75,7 +75,7 @@ Common::List<Graphics::PixelFormat> BadaGraphicsManager::getSupportedFormats() c
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BadaGraphicsManager::hasFeature(OSystem::Feature f) {
|
bool BadaGraphicsManager::hasFeature(OSystem::Feature f) {
|
||||||
bool result = (f == OSystem::kFeatureFullscreenMode ||
|
bool result = (f == OSystem::kFeatureFullscreenMode ||
|
||||||
f == OSystem::kFeatureVirtualKeyboard ||
|
f == OSystem::kFeatureVirtualKeyboard ||
|
||||||
OpenGLGraphicsManager::hasFeature(f));
|
OpenGLGraphicsManager::hasFeature(f));
|
||||||
return result;
|
return result;
|
||||||
|
@ -111,7 +111,7 @@ bool BadaGraphicsManager::loadEgl() {
|
||||||
};
|
};
|
||||||
|
|
||||||
EGLint eglContextList[] = {
|
EGLint eglContextList[] = {
|
||||||
EGL_CONTEXT_CLIENT_VERSION, 1,
|
EGL_CONTEXT_CLIENT_VERSION, 1,
|
||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -126,14 +126,14 @@ bool BadaGraphicsManager::loadEgl() {
|
||||||
systemError("eglGetDisplay() failed");
|
systemError("eglGetDisplay() failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EGL_FALSE == eglInitialize(_eglDisplay, NULL, NULL) ||
|
if (EGL_FALSE == eglInitialize(_eglDisplay, NULL, NULL) ||
|
||||||
EGL_SUCCESS != eglGetError()) {
|
EGL_SUCCESS != eglGetError()) {
|
||||||
systemError("eglInitialize() failed");
|
systemError("eglInitialize() failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EGL_FALSE == eglChooseConfig(_eglDisplay, eglConfigList,
|
if (EGL_FALSE == eglChooseConfig(_eglDisplay, eglConfigList,
|
||||||
&_eglConfig, 1, &numConfigs) ||
|
&_eglConfig, 1, &numConfigs) ||
|
||||||
EGL_SUCCESS != eglGetError()) {
|
EGL_SUCCESS != eglGetError()) {
|
||||||
systemError("eglChooseConfig() failed");
|
systemError("eglChooseConfig() failed");
|
||||||
|
@ -145,14 +145,14 @@ bool BadaGraphicsManager::loadEgl() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
|
_eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
|
||||||
(EGLNativeWindowType)_appForm, NULL);
|
(EGLNativeWindowType)_appForm, NULL);
|
||||||
if (EGL_NO_SURFACE == _eglSurface || EGL_SUCCESS != eglGetError()) {
|
if (EGL_NO_SURFACE == _eglSurface || EGL_SUCCESS != eglGetError()) {
|
||||||
systemError("eglCreateWindowSurface() failed. EGL_NO_SURFACE");
|
systemError("eglCreateWindowSurface() failed. EGL_NO_SURFACE");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_eglContext = eglCreateContext(_eglDisplay, _eglConfig,
|
_eglContext = eglCreateContext(_eglDisplay, _eglConfig,
|
||||||
EGL_NO_CONTEXT, eglContextList);
|
EGL_NO_CONTEXT, eglContextList);
|
||||||
if (EGL_NO_CONTEXT == _eglContext ||
|
if (EGL_NO_CONTEXT == _eglContext ||
|
||||||
EGL_SUCCESS != eglGetError()) {
|
EGL_SUCCESS != eglGetError()) {
|
||||||
|
@ -227,7 +227,7 @@ void BadaGraphicsManager::unloadGFXMode() {
|
||||||
eglTerminate(_eglDisplay);
|
eglTerminate(_eglDisplay);
|
||||||
_eglDisplay = EGL_NO_DISPLAY;
|
_eglDisplay = EGL_NO_DISPLAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
_eglConfig = NULL;
|
_eglConfig = NULL;
|
||||||
|
|
||||||
OpenGLGraphicsManager::unloadGFXMode();
|
OpenGLGraphicsManager::unloadGFXMode();
|
||||||
|
@ -292,7 +292,7 @@ void BadaGraphicsManager::showSplash() {
|
||||||
canvas.Construct();
|
canvas.Construct();
|
||||||
canvas.SetBackgroundColor(Color::COLOR_BLACK);
|
canvas.SetBackgroundColor(Color::COLOR_BLACK);
|
||||||
canvas.Clear();
|
canvas.Clear();
|
||||||
|
|
||||||
int x = _videoMode.hardwareWidth / 3;
|
int x = _videoMode.hardwareWidth / 3;
|
||||||
int y = _videoMode.hardwareHeight / 3;
|
int y = _videoMode.hardwareHeight / 3;
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ void BadaGraphicsManager::showSplash() {
|
||||||
canvas.SetForegroundColor(Color::COLOR_WHITE);
|
canvas.SetForegroundColor(Color::COLOR_WHITE);
|
||||||
canvas.DrawText(Point(x + 70, y + 50), L"Loading ...");
|
canvas.DrawText(Point(x + 70, y + 50), L"Loading ...");
|
||||||
delete pFont;
|
delete pFont;
|
||||||
|
|
||||||
canvas.Show();
|
canvas.Show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ C_LINKAGE_BEGIN
|
||||||
|
|
||||||
int __errno; // for overridden method in saves/default/default-saves.cpp
|
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) {
|
const char *func, const char *err) {
|
||||||
char buffer[BUF_SIZE];
|
char buffer[BUF_SIZE];
|
||||||
snprintf(buffer, sizeof(buffer), "%s %d %s %s", file, line, func, err);
|
snprintf(buffer, sizeof(buffer), "%s %d %s %s", file, line, func, err);
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include <ctype.h> // causes a link error when building c programs
|
#include <ctype.h> // causes a link error when building c programs
|
||||||
#define C_LINKAGE_BEGIN extern "C" {
|
#define C_LINKAGE_BEGIN extern "C" {
|
||||||
#define C_LINKAGE_END }
|
#define C_LINKAGE_END }
|
||||||
#else
|
#else
|
||||||
#define C_LINKAGE_BEGIN
|
#define C_LINKAGE_BEGIN
|
||||||
#define C_LINKAGE_END
|
#define C_LINKAGE_END
|
||||||
#endif
|
#endif
|
||||||
|
@ -50,7 +50,7 @@ C_LINKAGE_BEGIN
|
||||||
#define fseeko fseek
|
#define fseeko fseek
|
||||||
#define ftello ftell
|
#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').
|
// support stderr/stdout (undefined reference to `_impure_ptr').
|
||||||
|
|
||||||
void stderr_fprintf(void*, const char *format, ...);
|
void stderr_fprintf(void*, const char *format, ...);
|
||||||
|
|
|
@ -155,7 +155,7 @@ extern "C" int simple_sscanf(const char *input, const char *format, ...) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ int main(int argc, char *pArgv[]) {
|
||||||
|
|
||||||
// strcpy(buffer, "in the buffer something");
|
// strcpy(buffer, "in the buffer something");
|
||||||
if (simple_sscanf("CAT 123x-10 0x100 FONT large 1 enough\n 123456.AUD $",
|
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) {
|
&x, &y, &h, b, &u, &c) != 6) {
|
||||||
printf("Failed\n");
|
printf("Failed\n");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -96,7 +96,7 @@ bool BadaSaveFileManager::removeSavefile(const Common::String &filename) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case E_ILLEGAL_ACCESS:
|
case E_ILLEGAL_ACCESS:
|
||||||
setError(Common::kWritePermissionDenied, "Search or write permission denied: " +
|
setError(Common::kWritePermissionDenied, "Search or write permission denied: " +
|
||||||
file.getName());
|
file.getName());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -206,9 +206,9 @@ int BadaEventManager::shouldQuit() const {
|
||||||
//
|
//
|
||||||
// BadaSystem
|
// BadaSystem
|
||||||
//
|
//
|
||||||
BadaSystem::BadaSystem(BadaAppForm *appForm) :
|
BadaSystem::BadaSystem(BadaAppForm *appForm) :
|
||||||
_appForm(appForm),
|
_appForm(appForm),
|
||||||
_audioThread(0),
|
_audioThread(0),
|
||||||
_epoch(0) {
|
_epoch(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ result BadaSystem::initModules() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// depends on _graphicsManager when ENABLE_VKEYBD enabled
|
// depends on _graphicsManager when ENABLE_VKEYBD enabled
|
||||||
_eventManager = new BadaEventManager(this);
|
_eventManager = new BadaEventManager(this);
|
||||||
if (!_eventManager) {
|
if (!_eventManager) {
|
||||||
return E_OUT_OF_MEMORY;
|
return E_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ void systemError(const char *message);
|
||||||
//
|
//
|
||||||
// BadaSystem
|
// BadaSystem
|
||||||
//
|
//
|
||||||
class BadaSystem : public ModularBackend,
|
class BadaSystem : public ModularBackend,
|
||||||
Common::EventSource {
|
Common::EventSource {
|
||||||
public:
|
public:
|
||||||
BadaSystem(BadaAppForm *appForm);
|
BadaSystem(BadaAppForm *appForm);
|
||||||
|
@ -92,7 +92,7 @@ private:
|
||||||
Common::EventSource *getDefaultEventSource() {return this;}
|
Common::EventSource *getDefaultEventSource() {return this;}
|
||||||
Common::SeekableReadStream *createConfigReadStream();
|
Common::SeekableReadStream *createConfigReadStream();
|
||||||
Common::WriteStream *createConfigWriteStream();
|
Common::WriteStream *createConfigWriteStream();
|
||||||
|
|
||||||
BadaAppForm *_appForm;
|
BadaAppForm *_appForm;
|
||||||
AudioThread *_audioThread;
|
AudioThread *_audioThread;
|
||||||
long long _epoch;
|
long long _epoch;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue