1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #include <jni.h>
- #include "palcommon.h"
- #include "global.h"
- #include "palcfg.h"
- char externalStoragePath[255];
- /*
- * Class: com_codeplex_sdlpal_PalActivity
- * Method: setExternalStorage
- * Signature: (Ljava/lang/String;)V
- */
- JNIEXPORT void JNICALL Java_com_codeplex_sdlpal_PalActivity_setExternalStorage(JNIEnv *env, jclass cls, jstring j_str)
- {
- const jchar* c_str= NULL;
- char* pBuff = externalStoragePath;
- c_str = (*env)->GetStringCritical(env,j_str,NULL);
- if (c_str == NULL)
- {
- return;
- }
- while(*c_str)
- {
- *pBuff++ = *c_str++;
- }
- (*env)->ReleaseStringCritical(env,j_str,c_str);
- strncat(externalStoragePath,"/sdlpal/",strnlen("/sdlpal/",255));
- return;
- }
- LPCSTR
- UTIL_BasePath(
- VOID
- )
- {
- return externalStoragePath;
- }
- LPCSTR
- UTIL_SavePath(
- VOID
- )
- {
- return externalStoragePath;
- }
- BOOL
- UTIL_GetScreenSize(
- DWORD *pdwScreenWidth,
- DWORD *pdwScreenHeight
- )
- {
- *pdwScreenWidth = 640;
- *pdwScreenHeight = 400;
- return TRUE;
- }
- BOOL
- UTIL_IsAbsolutePath(
- LPCSTR lpszFileName
- )
- {
- return FALSE;
- }
- INT
- UTIL_Platform_Init(
- int argc,
- char* argv[]
- )
- {
- gConfig.fLaunchSetting = FALSE;
- return 0;
- }
- VOID
- UTIL_Platform_Quit(
- VOID
- )
- {
- }
|