ANDROID: Formatting/whitespaces

This commit is contained in:
dhewg 2011-03-03 11:20:37 +01:00
parent f9354eb4d8
commit 1e3c96b3ef
7 changed files with 31 additions and 18 deletions

View file

@ -55,7 +55,8 @@ extern "C" {
expr, file, line); expr, file, line);
} }
void __assert2(const char *file, int line, const char *func, const char *expr) { void __assert2(const char *file, int line, const char *func,
const char *expr) {
__android_log_assert(expr, android_log_tag, __android_log_assert(expr, android_log_tag,
"Assertion failure: '%s' in %s:%d (%s)", "Assertion failure: '%s' in %s:%d (%s)",
expr, file, line, func); expr, file, line, func);
@ -152,7 +153,7 @@ void *OSystem_Android::timerThreadFunc(void *arg) {
sem_wait(&JNI::pause_sem); sem_wait(&JNI::pause_sem);
LOGD("timer thread woke up"); LOGD("timer thread woke up");
} }
timer->handler(); timer->handler();
nanosleep(&tv, 0); nanosleep(&tv, 0);
} }
@ -199,7 +200,7 @@ void *OSystem_Android::audioThreadFunc(void *arg) {
sem_wait(&JNI::pause_sem); sem_wait(&JNI::pause_sem);
LOGD("audio thread woke up"); LOGD("audio thread woke up");
} }
buf = (byte *)env->GetPrimitiveArrayCritical(bufa, 0); buf = (byte *)env->GetPrimitiveArrayCritical(bufa, 0);
assert(buf); assert(buf);
@ -650,7 +651,8 @@ void OSystem_Android::addSysArchivesToSearchSet(Common::SearchSet &s,
JNI::addSysArchivesToSearchSet(s, priority); JNI::addSysArchivesToSearchSet(s, priority);
} }
void OSystem_Android::logMessage(LogMessageType::Type type, const char *message) { void OSystem_Android::logMessage(LogMessageType::Type type,
const char *message) {
switch (type) { switch (type) {
case LogMessageType::kDebug: case LogMessageType::kDebug:
__android_log_write(ANDROID_LOG_DEBUG, android_log_tag, message); __android_log_write(ANDROID_LOG_DEBUG, android_log_tag, message);

View file

@ -177,7 +177,8 @@ protected:
virtual void grabPalette(byte *colors, uint start, uint num); virtual void grabPalette(byte *colors, uint start, uint num);
public: public:
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y,
int w, int h);
virtual void updateScreen(); virtual void updateScreen();
virtual Graphics::Surface *lockScreen(); virtual Graphics::Surface *lockScreen();
virtual void unlockScreen(); virtual void unlockScreen();
@ -190,7 +191,8 @@ public:
virtual void hideOverlay(); virtual void hideOverlay();
virtual void clearOverlay(); virtual void clearOverlay();
virtual void grabOverlay(OverlayColor *buf, int pitch); virtual void grabOverlay(OverlayColor *buf, int pitch);
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); virtual void copyRectToOverlay(const OverlayColor *buf, int pitch,
int x, int y, int w, int h);
virtual int16 getOverlayHeight(); virtual int16 getOverlayHeight();
virtual int16 getOverlayWidth(); virtual int16 getOverlayWidth();
@ -214,7 +216,10 @@ public:
virtual bool showMouse(bool visible); virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y); virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format); virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
int hotspotY, uint32 keycolor,
int cursorTargetScale,
const Graphics::PixelFormat *format);
virtual void setCursorPalette(const byte *colors, uint start, uint num); virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual void disableCursorPalette(bool disable); virtual void disableCursorPalette(bool disable);
@ -240,7 +245,8 @@ public:
virtual Common::TimerManager *getTimerManager(); virtual Common::TimerManager *getTimerManager();
virtual FilesystemFactory *getFilesystemFactory(); virtual FilesystemFactory *getFilesystemFactory();
virtual void logMessage(LogMessageType::Type type, const char *message); virtual void logMessage(LogMessageType::Type type, const char *message);
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual void addSysArchivesToSearchSet(Common::SearchSet &s,
int priority = 0);
}; };
#endif #endif

View file

@ -99,7 +99,7 @@ JavaInputStream::JavaInputStream(JNIEnv *env, jobject is) :
{ {
_input_stream = env->NewGlobalRef(is); _input_stream = env->NewGlobalRef(is);
_buflen = 8192; _buflen = 8192;
_buf = static_cast<jbyteArray>(env->NewGlobalRef(env->NewByteArray(_buflen))); _buf = (jbyteArray)env->NewGlobalRef(env->NewByteArray(_buflen));
jclass cls = env->GetObjectClass(_input_stream); jclass cls = env->GetObjectClass(_input_stream);
MID_mark = env->GetMethodID(cls, "mark", "(I)V"); MID_mark = env->GetMethodID(cls, "mark", "(I)V");
@ -142,7 +142,7 @@ uint32 JavaInputStream::read(void *dataPtr, uint32 dataSize) {
if (_buflen < jint(dataSize)) { if (_buflen < jint(dataSize)) {
_buflen = dataSize; _buflen = dataSize;
env->DeleteGlobalRef(_buf); env->DeleteGlobalRef(_buf);
_buf = static_cast<jbyteArray>(env->NewGlobalRef(env->NewByteArray(_buflen))); _buf = static_cast<jbyteArray>(env->NewGlobalRef(env->NewByteArray(_buflen)));
} }
@ -304,7 +304,8 @@ AssetFdReadStream::AssetFdReadStream(JNIEnv *env, jobject assetfd) :
_declared_len = env->CallLongMethod(_assetfd, MID_getDeclaredLength); _declared_len = env->CallLongMethod(_assetfd, MID_getDeclaredLength);
jmethodID MID_getFileDescriptor = jmethodID MID_getFileDescriptor =
env->GetMethodID(cls, "getFileDescriptor", "()Ljava/io/FileDescriptor;"); env->GetMethodID(cls, "getFileDescriptor",
"()Ljava/io/FileDescriptor;");
assert(MID_getFileDescriptor); assert(MID_getFileDescriptor);
jobject javafd = env->CallObjectMethod(_assetfd, MID_getFileDescriptor); jobject javafd = env->CallObjectMethod(_assetfd, MID_getFileDescriptor);
assert(javafd); assert(javafd);
@ -376,8 +377,8 @@ AndroidAssetArchive::AndroidAssetArchive(jobject am) {
"(Ljava/lang/String;I)Ljava/io/InputStream;"); "(Ljava/lang/String;I)Ljava/io/InputStream;");
assert(MID_open); assert(MID_open);
MID_openFd = env->GetMethodID(cls, "openFd", MID_openFd = env->GetMethodID(cls, "openFd", "(Ljava/lang/String;)"
"(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;"); "Landroid/content/res/AssetFileDescriptor;");
assert(MID_openFd); assert(MID_openFd);
MID_list = env->GetMethodID(cls, "list", MID_list = env->GetMethodID(cls, "list",
@ -421,7 +422,8 @@ int AndroidAssetArchive::listMembers(Common::ArchiveMemberList &member_list) {
dirlist.pop_back(); dirlist.pop_back();
jstring jpath = env->NewStringUTF(dir.c_str()); jstring jpath = env->NewStringUTF(dir.c_str());
jobjectArray jpathlist = static_cast<jobjectArray>(env->CallObjectMethod(_am, MID_list, jpath)); jobjectArray jpathlist =
(jobjectArray)env->CallObjectMethod(_am, MID_list, jpath);
if (env->ExceptionCheck()) { if (env->ExceptionCheck()) {
warning("Error while calling AssetManager->list(%s). Ignoring.", warning("Error while calling AssetManager->list(%s). Ignoring.",

View file

@ -90,9 +90,9 @@ const JNINativeMethod JNI::_natives[] = {
{ "destroy", "()V", { "destroy", "()V",
(void *)JNI::destroy }, (void *)JNI::destroy },
{ "setSurface", "(II)V", { "setSurface", "(II)V",
(void *)JNI::setSurface }, (void *)JNI::setSurface },
{ "main", "([Ljava/lang/String;)I", { "main", "([Ljava/lang/String;)I",
(void *)JNI::main }, (void *)JNI::main },
{ "pushEvent", "(Lorg/inodes/gus/scummvm/Event;)V", { "pushEvent", "(Lorg/inodes/gus/scummvm/Event;)V",
(void *)JNI::pushEvent }, (void *)JNI::pushEvent },
{ "enableZoning", "(Z)V", { "enableZoning", "(Z)V",

View file

@ -149,7 +149,8 @@ inline bool JNI::swapBuffers() {
} }
inline int JNI::writeAudio(JNIEnv *env, jbyteArray &data, int offset, int size) { inline int JNI::writeAudio(JNIEnv *env, jbyteArray &data, int offset, int size) {
return env->CallIntMethod(_jobj_audio_track, _MID_AudioTrack_write, data, offset, size); return env->CallIntMethod(_jobj_audio_track, _MID_AudioTrack_write, data,
offset, size);
} }
#endif #endif

View file

@ -370,3 +370,4 @@ public class Unpacker extends Activity {
} }
} }
} }

View file

@ -332,7 +332,8 @@ void GLESPaletteTexture::uploadTexture() const {
0, texture_size, _texture)); 0, texture_size, _texture));
} }
void GLESPaletteTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) { void GLESPaletteTexture::drawTexture(GLshort x, GLshort y, GLshort w,
GLshort h) {
if (_all_dirty) { if (_all_dirty) {
GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name)); GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name));
GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GLCALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,