Browse Source

Fixed issue with screen res define

Tim Newell 12 years ago
parent
commit
29b1b15ab9

+ 4 - 4
engine/source/platformAndroid/AndroidWindow.cpp

@@ -60,8 +60,8 @@ AndroidPlatState::AndroidPlatState()
 
     // start with something reasonable.
     desktopBitsPixel = ANDROID_DEFAULT_RESOLUTION_BIT_DEPTH;
-    desktopWidth = _AndroidGetScreenWidth();
-    desktopHeight = _AndroidGetScreenHeight();
+    desktopWidth = ANDROID_DEFAULT_RESOLUTION_X;
+    desktopHeight = ANDROID_DEFAULT_RESOLUTION_Y;
     fullscreen = true;
 
     osVersion = 0;
@@ -160,8 +160,8 @@ bool gStatusBarHidden = true;
 //------------------------------------------------------------------------------
 void Platform::initWindow(const Point2I &initialSize, const char *name)
 {
-    S32 resolutionWidth = _AndroidGetScreenWidth();
-    S32 resolutionHeight = _AndroidGetScreenHeight();
+    S32 resolutionWidth = ANDROID_DEFAULT_RESOLUTION_X;
+    S32 resolutionHeight = ANDROID_DEFAULT_RESOLUTION_Y;
 
     dSprintf(platState.appWindowTitle, sizeof(platState.appWindowTitle), name);
 

+ 5 - 3
engine/source/platformAndroid/T2DActivity.cpp

@@ -942,6 +942,8 @@ void android_main(struct android_app* state) {
     // Make sure glue isn't stripped.
     app_dummy();
 
+    platState.engine = &engine;
+
     memset(&engine, 0, sizeof(engine));
     state->userData = &engine;
     state->onAppCmd = engine_handle_cmd;
@@ -961,8 +963,6 @@ void android_main(struct android_app* state) {
         engine.state = *(struct saved_state*)state->savedState;
     }
 
-    platState.engine = &engine;
-
     keepScreenOn();
 
     //This is to help the debugger catch up.  If you dont have this you cant debug this early in the execution
@@ -1291,7 +1291,7 @@ bool android_IsDir(const char* path)
 U32 android_GetFileSize(const char* pFilePath)
 {
 	// Attaches the current thread to the JVM.
-	jint lResult;
+	/*jint lResult;
 	jint lFlags = 0;
 
 	JavaVM* lJavaVM = engine.app->activity->vm;
@@ -1328,6 +1328,8 @@ U32 android_GetFileSize(const char* pFilePath)
 	lJavaVM->DetachCurrentThread();
 
 	return size;
+	*/
+	return 0;
 }
 
 ConsoleFunction(doDeviceVibrate, void, 1, 1, "Makes the device do a quick vibration. Only works on devices with vibration functionality.")

+ 3 - 0
engine/source/platformAndroid/platformGL.h

@@ -49,6 +49,9 @@ extern AGLContext agl_ctx;
 #define MIN_RESOLUTION_BIT_DEPTH		16
 #define MIN_RESOLUTION_XY_STRING		"480 320"
 
+#define ANDROID_DEFAULT_RESOLUTION_X    1024
+#define ANDROID_DEFAULT_RESOLUTION_Y    768
+
 #define ANDROID_DEFAULT_RESOLUTION_BIT_DEPTH	32
 
 #define ANDROID_SCREEN_PORTRAIT			0