Je ne sais pas trop...

This commit is contained in:
Edouard Dupin 2011-12-07 09:41:36 +01:00
parent 0879f1db9c
commit fbb244b398
8 changed files with 56 additions and 3 deletions

View File

@ -100,7 +100,7 @@ void APP_Init(int argc, char *argv[])
//fontID = GetFontIdWithFileName("dataTest/TextMonospace.ebt");
}
*/
ewol::SetFontFolder("Font/");
ewol::SetFontFolder("Font");
//ewol::SetDefaultFont("freefont/FreeMono", 14);
ewol::SetDefaultFont("ebtfont/Monospace", 14);
//ewol::theme::LoadDefault("dataTest/exemple.eol");

View File

@ -139,6 +139,31 @@ extern "C"
EWOL_WARNING("Event : Unknow ID=" << eventID);
}
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeParamSetArchiveDir( JNIEnv* env, jobject thiz, jint mode, jstring myString)
{
const char* str = env->GetStringUTFChars(myString,0);
switch(mode)
{
case 0:
EWOL_WARNING("Directory mode=FILE path=" << str);
etk::SetBaseFolder(str);
break;
case 1:
EWOL_WARNING("Directory mode=CACHE path=" << str);
break;
case 2:
EWOL_WARNING("Directory mode=EXTERNAL_CACHE path=" << str);
break;
default:
EWOL_WARNING("Directory mode=???? path=" << str);
break;
}
//env->ReleaseStringUTFChars(str,myString,0);
}
static bool isAlreadyInit = false;
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeApplicationInit( JNIEnv* env)

View File

@ -136,6 +136,15 @@ bool etk::File::operator!= (const etk::File &etkF) const
}
etk::String baseFolderMobile = "/data/data/com.example.ewolAbstraction/assets/";
// for specific device contraint :
void etk::SetBaseFolder(const char * folder)
{
//baseFolderMobile = folder;
}
void etk::File::SetCompleateName(etk::String &newFilename)
{
char buf[MAX_FILE_NAME];
@ -157,7 +166,7 @@ void etk::File::SetCompleateName(etk::String &newFilename)
// Get the command came from the running of the program :
char cCurrentPath[FILENAME_MAX];
#ifdef __PLATFORM__Android
strcpy(cCurrentPath, "/data/data/" PACKAGE_NAME "/assets//");
strcpy(cCurrentPath, baseFolderMobile.c_str() );
#else
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return;

View File

@ -65,6 +65,8 @@ namespace etk
etk::CCout& operator <<(etk::CCout &os, const etk::File &obj);
void SetBaseFolder(const char * folder);
}
#endif

View File

@ -12,3 +12,9 @@
# The name of the output folder.
#out-folder=Object_Android/bin
# asset config
assets.dir = ${basedir}/assets
assets.relativeDir = assets
assets.extension = png eol bmp ebt

View File

@ -14,7 +14,6 @@ LOCAL_CFLAGS := -D__PLATFORM__Android \
-DEWOL_DEBUG_LEVEL=3 \
-DEWOL_VERSION_TAG_NAME="\"UNKNOW-debug\"" \
-DVERSION_BUILD_TIME="\"pasd_heure\"" \
-DPACKAGE_NAME="\"com.example.EwolActivity.app\""
LOCAL_SRC_FILES := \
../Sources/Main.cpp \

View File

@ -35,6 +35,7 @@ public class EwolActivity extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
// set full screen Mode :
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// create bsurface system
mGLView = new EwolGLSurfaceView(this);
setContentView(mGLView);
}

View File

@ -11,6 +11,8 @@ import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.MotionEvent;
import java.io.File;
import android.content.Context;
/**
* @brief Class :
@ -23,9 +25,18 @@ class EwolGLSurfaceView extends GLSurfaceView {
private static native void nativeEventInputMotion(int pointerID, float x, float y);
private static native void nativeEventInputState(int pointerID, boolean isDown);
private static native void nativeEventUnknow(int eventID);
private static native void nativeParamSetArchiveDir(int mode, String myString);
public EwolGLSurfaceView(Context context) {
// super must be first statement in constructor
super(context);
// Load the application directory
nativeParamSetArchiveDir(0, context.getFilesDir().toString());
nativeParamSetArchiveDir(1, context.getCacheDir().toString());
// to enable extarnal storage: add in the manifest the restriction needed ...
//nativeParamSetArchiveDir(2, context.getExternalCacheDir().toString());
// je n'ai pas compris ...
mRenderer = new EwolRenderer();
setRenderer(mRenderer);
nativeApplicationInit();