This commit is contained in:
Henrik Rydgard 2012-04-14 07:39:22 +02:00
parent a9087ea47c
commit dccb7bafdd
5 changed files with 15 additions and 6 deletions

View File

@ -122,12 +122,12 @@ extern "C" void Java_com_turboviking_libnative_NativeApp_init
extern "C" void Java_com_turboviking_libnative_NativeApp_shutdown
(JNIEnv *, jclass) {
ILOG("RollerBallMainShutdown - calling NativeShutdown.");
ILOG("NativeShutdown.");
if (renderer_inited) {
NativeShutdownGraphics();
}
NativeShutdown();
ILOG("RollerBallMainShutdown - calling VFSShutdown.");
ILOG("VFSShutdown.");
VFSShutdown();
}

View File

@ -275,7 +275,6 @@ public class NativeActivity extends Activity {
// Adjust these as necessary
private static String TAG = "NativeActivity";
String packageName = "com.turboviking.rollerball";
// Graphics and audio interfaces
private GLSurfaceView mGLSurfaceView;
@ -300,6 +299,7 @@ public class NativeActivity extends Activity {
// Get system information
ApplicationInfo appInfo = null;
PackageManager packMgmr = getPackageManager();
String packageName = getPackageName();
try {
appInfo = packMgmr.getApplicationInfo(packageName, 0);
} catch (NameNotFoundException e) {
@ -344,7 +344,7 @@ public class NativeActivity extends Activity {
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
ConfigurationInfo info = am.getDeviceConfigurationInfo();
return info.reqGlEsVersion >= 0x20000;
}
}
@Override

View File

@ -106,7 +106,7 @@ static int num_entries = 0;
void VFSRegister(const char *prefix, AssetReader *reader) {
entries[num_entries].prefix = prefix;
entries[num_entries].reader = reader;
ILOG("Registered VFS for %s", prefix);
ILOG("Registered VFS for prefix %s: %s", prefix, reader->toString().c_str());
num_entries++;
}

View File

@ -5,6 +5,7 @@
#endif
#include <string.h>
#include <string>
#include "base/basictypes.h"
#include "file/vfs.h"
@ -16,6 +17,7 @@ class AssetReader {
public:
// use delete[]
virtual uint8_t *ReadAsset(const char *path, size_t *size) = 0;
virtual std::string toString() const = 0;
};
#ifndef _WIN32
@ -26,6 +28,9 @@ public:
~ZipAssetReader();
// use delete[]
virtual uint8_t *ReadAsset(const char *path, size_t *size);
virtual std::string toString() const {
return in_zip_path_;
}
private:
zip *zip_file_;
@ -40,6 +45,9 @@ public:
}
// use delete[]
virtual uint8_t *ReadAsset(const char *path, size_t *size);
virtual std::string toString() const {
return path_;
}
private:
char path_[512];

View File

@ -160,8 +160,9 @@ int UIImageButton(int id, const LayoutManager &layout, float w, int image, int b
} else {
// button is not hot, but it may be active
}
ui_draw2d.DrawImage2GridH(themeButtonImage, x, y, x + w);
ui_draw2d.DrawImage(image, x + w/2, y + h/2 + txOffset, 0xFFFFFFFF, ALIGN_HCENTER | ALIGN_VCENTER);
ui_draw2d.DrawImage(image, x + w/2, y + h/2 + txOffset, 1.0f, 0xFFFFFFFF, ALIGN_HCENTER | ALIGN_VCENTER);
int clicked = 0;
// If button is hot and active, but mouse button is not