Merge branch 'master' of https://github.com/okamstudio/godot
This commit is contained in:
commit
2592f0da9f
5 changed files with 59 additions and 2 deletions
|
@ -3,6 +3,10 @@
|
||||||
name="2D Lighting"
|
name="2D Lighting"
|
||||||
main_scene="res://light_shadows.scn"
|
main_scene="res://light_shadows.scn"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
stretch_mode="2d"
|
||||||
|
|
||||||
[rasterizer]
|
[rasterizer]
|
||||||
|
|
||||||
shadow_filter=2
|
shadow_filter=2
|
||||||
|
|
|
@ -200,6 +200,6 @@ $$ADD_PERMISSION_CHUNKS$$
|
||||||
<uses-permission android:name="godot.custom.18"/>
|
<uses-permission android:name="godot.custom.18"/>
|
||||||
<uses-permission android:name="godot.custom.19"/>
|
<uses-permission android:name="godot.custom.19"/>
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15"/>
|
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19"/>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -186,6 +186,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
|
||||||
bool apk_expansion;
|
bool apk_expansion;
|
||||||
bool remove_prev;
|
bool remove_prev;
|
||||||
bool use_32_fb;
|
bool use_32_fb;
|
||||||
|
bool immersive;
|
||||||
String apk_expansion_salt;
|
String apk_expansion_salt;
|
||||||
String apk_expansion_pkey;
|
String apk_expansion_pkey;
|
||||||
int orientation;
|
int orientation;
|
||||||
|
@ -282,6 +283,8 @@ bool EditorExportPlatformAndroid::_set(const StringName& p_name, const Variant&
|
||||||
_signed=p_value;
|
_signed=p_value;
|
||||||
else if (n=="screen/use_32_bits_view")
|
else if (n=="screen/use_32_bits_view")
|
||||||
use_32_fb=p_value;
|
use_32_fb=p_value;
|
||||||
|
else if (n=="screen/immersive_mode")
|
||||||
|
immersive=p_value;
|
||||||
else if (n=="screen/orientation")
|
else if (n=="screen/orientation")
|
||||||
orientation=p_value;
|
orientation=p_value;
|
||||||
else if (n=="screen/support_small")
|
else if (n=="screen/support_small")
|
||||||
|
@ -349,6 +352,8 @@ bool EditorExportPlatformAndroid::_get(const StringName& p_name,Variant &r_ret)
|
||||||
r_ret=_signed;
|
r_ret=_signed;
|
||||||
else if (n=="screen/use_32_bits_view")
|
else if (n=="screen/use_32_bits_view")
|
||||||
r_ret=use_32_fb;
|
r_ret=use_32_fb;
|
||||||
|
else if (n=="screen/immersive_mode")
|
||||||
|
r_ret=immersive;
|
||||||
else if (n=="screen/orientation")
|
else if (n=="screen/orientation")
|
||||||
r_ret=orientation;
|
r_ret=orientation;
|
||||||
else if (n=="screen/support_small")
|
else if (n=="screen/support_small")
|
||||||
|
@ -399,6 +404,7 @@ void EditorExportPlatformAndroid::_get_property_list( List<PropertyInfo> *p_list
|
||||||
p_list->push_back( PropertyInfo( Variant::STRING, "package/icon",PROPERTY_HINT_FILE,"png") );
|
p_list->push_back( PropertyInfo( Variant::STRING, "package/icon",PROPERTY_HINT_FILE,"png") );
|
||||||
p_list->push_back( PropertyInfo( Variant::BOOL, "package/signed") );
|
p_list->push_back( PropertyInfo( Variant::BOOL, "package/signed") );
|
||||||
p_list->push_back( PropertyInfo( Variant::BOOL, "screen/use_32_bits_view") );
|
p_list->push_back( PropertyInfo( Variant::BOOL, "screen/use_32_bits_view") );
|
||||||
|
p_list->push_back( PropertyInfo( Variant::BOOL, "screen/immersive_mode") );
|
||||||
p_list->push_back( PropertyInfo( Variant::INT, "screen/orientation",PROPERTY_HINT_ENUM,"Landscape,Portrait") );
|
p_list->push_back( PropertyInfo( Variant::INT, "screen/orientation",PROPERTY_HINT_ENUM,"Landscape,Portrait") );
|
||||||
p_list->push_back( PropertyInfo( Variant::BOOL, "screen/support_small") );
|
p_list->push_back( PropertyInfo( Variant::BOOL, "screen/support_small") );
|
||||||
p_list->push_back( PropertyInfo( Variant::BOOL, "screen/support_normal") );
|
p_list->push_back( PropertyInfo( Variant::BOOL, "screen/support_normal") );
|
||||||
|
@ -1171,6 +1177,8 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
|
||||||
if (use_32_fb)
|
if (use_32_fb)
|
||||||
cl.push_back("-use_depth_32");
|
cl.push_back("-use_depth_32");
|
||||||
|
|
||||||
|
if (immersive)
|
||||||
|
cl.push_back("-use_immersive");
|
||||||
|
|
||||||
if (cl.size()) {
|
if (cl.size()) {
|
||||||
//add comandline
|
//add comandline
|
||||||
|
@ -1547,6 +1555,7 @@ EditorExportPlatformAndroid::EditorExportPlatformAndroid() {
|
||||||
orientation=0;
|
orientation=0;
|
||||||
remove_prev=true;
|
remove_prev=true;
|
||||||
use_32_fb=true;
|
use_32_fb=true;
|
||||||
|
immersive=true;
|
||||||
|
|
||||||
device_thread=Thread::create(_device_poll_thread,this);
|
device_thread=Thread::create(_device_poll_thread,this);
|
||||||
devices_changed=true;
|
devices_changed=true;
|
||||||
|
|
|
@ -110,6 +110,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||||
private Button mWiFiSettingsButton;
|
private Button mWiFiSettingsButton;
|
||||||
|
|
||||||
private boolean use_32_bits=false;
|
private boolean use_32_bits=false;
|
||||||
|
private boolean use_immersive=false;
|
||||||
private boolean mStatePaused;
|
private boolean mStatePaused;
|
||||||
private int mState;
|
private int mState;
|
||||||
|
|
||||||
|
@ -374,6 +375,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||||
mRemoteService.onClientUpdated(mDownloaderClientStub.getMessenger());
|
mRemoteService.onClientUpdated(mDownloaderClientStub.getMessenger());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle icicle) {
|
protected void onCreate(Bundle icicle) {
|
||||||
|
|
||||||
|
@ -402,6 +405,19 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||||
boolean has_extra = i< command_line.length -1;
|
boolean has_extra = i< command_line.length -1;
|
||||||
if (command_line[i].equals("-use_depth_32")) {
|
if (command_line[i].equals("-use_depth_32")) {
|
||||||
use_32_bits=true;
|
use_32_bits=true;
|
||||||
|
} else if (command_line[i].equals("-use_immersive")) {
|
||||||
|
use_immersive=true;
|
||||||
|
if(Build.VERSION.SDK_INT >= 19.0){ // check if the application runs on an android 4.4+
|
||||||
|
window.getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
|
||||||
|
UiChangeListener();
|
||||||
|
}
|
||||||
} else if (command_line[i].equals("-use_apk_expansion")) {
|
} else if (command_line[i].equals("-use_apk_expansion")) {
|
||||||
use_apk_expansion=true;
|
use_apk_expansion=true;
|
||||||
} else if (has_extra && command_line[i].equals("-apk_expansion_md5")) {
|
} else if (has_extra && command_line[i].equals("-apk_expansion_md5")) {
|
||||||
|
@ -560,6 +576,16 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||||
mView.onResume();
|
mView.onResume();
|
||||||
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
|
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
|
||||||
GodotLib.focusin();
|
GodotLib.focusin();
|
||||||
|
if(use_immersive && Build.VERSION.SDK_INT >= 19.0){ // check if the application runs on an android 4.4+
|
||||||
|
Window window = getWindow();
|
||||||
|
window.getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
}
|
||||||
|
|
||||||
for(int i=0;i<singleton_count;i++) {
|
for(int i=0;i<singleton_count;i++) {
|
||||||
|
|
||||||
|
@ -570,6 +596,24 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UiChangeListener() {
|
||||||
|
final View decorView = getWindow().getDecorView();
|
||||||
|
decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onSystemUiVisibilityChange(int visibility) {
|
||||||
|
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||||
|
decorView.setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override public void onSensorChanged(SensorEvent event) {
|
@Override public void onSensorChanged(SensorEvent event) {
|
||||||
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
|
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
|
||||||
int displayRotation = display.getRotation();
|
int displayRotation = display.getRotation();
|
||||||
|
|
|
@ -12,4 +12,4 @@
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
#android.library=true
|
#android.library=true
|
||||||
target=android-15
|
target=android-19
|
||||||
|
|
Loading…
Reference in a new issue