project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c
branchhedgeroid
changeset 5934 9f05a0f43003
parent 5369 0ce1ef75c08f
child 8465 9114b50fed82
equal deleted inserted replaced
5932:5164d17b6374 5934:9f05a0f43003
    15 	
    15 	
    16 
    16 
    17         __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine being loaded");
    17         __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine being loaded");
    18 	handle = dlopen("libhwengine.so", RTLD_NOW|RTLD_GLOBAL);
    18 	handle = dlopen("libhwengine.so", RTLD_NOW|RTLD_GLOBAL);
    19 	if(!handle){
    19 	if(!handle){
    20 		__android_log_print(ANDROID_LOG_INFO, "foo", dlerror());
    20 		__android_log_print(ANDROID_LOG_INFO, TAG, dlerror());
    21 		__android_log_print(ANDROID_LOG_INFO, "foo", "error dlopen");
    21 		__android_log_print(ANDROID_LOG_INFO, TAG, "error dlopen");
    22 		exit(EXIT_FAILURE);
    22 		exit(EXIT_FAILURE);
    23 	}
    23 	}
    24 	dlerror();
    24 	dlerror();
    25 
    25 
    26         __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine successfully loaded..");
    26         __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine successfully loaded..");
    27 
    27 
    28 
    28 
    29 	Game = (HWEngine_Game) dlsym(handle,"Game");
    29 	Game = (HWEngine_Game) dlsym(handle,"Game");
    30 	if((error = dlerror()) != NULL){
    30 	if((error = dlerror()) != NULL){
    31 		__android_log_print(ANDROID_LOG_INFO, "foo", error);
    31 		__android_log_print(ANDROID_LOG_INFO, TAG, error);
    32 		__android_log_print(ANDROID_LOG_INFO, "foo", "error dlsym");
    32 		__android_log_print(ANDROID_LOG_INFO, TAG, "error dlsym");
    33 		exit(EXIT_FAILURE);
    33 		exit(EXIT_FAILURE);
    34 	}
    34 	}
    35 	__android_log_print(ANDROID_LOG_INFO, "foo", "dlsym succeeded");
    35 	__android_log_print(ANDROID_LOG_INFO, TAG, "dlsym succeeded");
    36 	Game(argv);
    36 	Game(argv);
    37 	__android_log_print(ANDROID_LOG_INFO, "foo", "Game() succeeded");
    37 	__android_log_print(ANDROID_LOG_INFO, TAG, "Game() ended");
    38 
    38 
    39 	dlclose(handle);
    39 	dlclose(handle);
    40 }
    40 }