Skip to content

Commit

Permalink
fix: reduce export size and fix mobile/windows (#129)
Browse files Browse the repository at this point in the history
* chore: remove lib/ windows export
fix: spinner was looping forever
bump gdext crate

* disable glow on mobile
enable experimental-threads feature
disable lazy-function-tables

* fix format/lint
  • Loading branch information
leanmendoza authored Jan 4, 2024
1 parent 11867fd commit b51c1db
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 29 deletions.
Binary file modified godot/.godot/uid_cache.bin
Binary file not shown.
26 changes: 26 additions & 0 deletions godot/assets/sky/sky_basic_without_glow.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[gd_scene load_steps=5 format=3 uid="uid://cj4u0wghcfjsi"]

[ext_resource type="Script" path="res://assets/sky/sky_basic.gd" id="1_vmmd2"]

[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_bfvnp"]
sky_top_color = Color(0.85098, 0.913725, 1, 1)

[sub_resource type="Sky" id="Sky_0guyp"]
sky_material = SubResource("ProceduralSkyMaterial_bfvnp")

[sub_resource type="Environment" id="Environment_mvu0t"]
background_mode = 2
sky = SubResource("Sky_0guyp")
glow_levels/1 = 16.0
glow_levels/2 = 16.0
glow_levels/3 = 16.0
glow_levels/4 = 16.0
glow_levels/5 = 16.0
glow_levels/6 = 16.0
glow_levels/7 = 2.95
glow_blend_mode = 0
fog_density = 0.001

[node name="SkyBasic" type="WorldEnvironment"]
environment = SubResource("Environment_mvu0t")
script = ExtResource("1_vmmd2")
16 changes: 8 additions & 8 deletions godot/assets/themes/theme.tres

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions godot/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter="*, *.*"
exclude_filter=""
export_path="exports/decentraland.godot.win64.exe"
include_filter="*,*.*"
exclude_filter="lib/android/*.so,lib/*.dll"
export_path="../../../../Desktop/builds/decentraland-godot-self-hosted-windows/local/decentraland.godot.win64.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
Expand Down Expand Up @@ -214,8 +214,8 @@ runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter="*, *.*"
exclude_filter=""
include_filter="*,*.*"
exclude_filter="lib/android/*.so,lib/*.dll"
export_path="../../../dcl-explorer-godot.apk"
encryption_include_filters=""
encryption_exclude_filters=""
Expand Down
1 change: 0 additions & 1 deletion godot/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,3 @@ limits/debugger/max_chars_per_second=3276800
[rendering]

textures/vram_compression/import_etc2_astc=true
vulkan/rendering/back_end=1
2 changes: 1 addition & 1 deletion godot/src/logic/content/content_thread.gd
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func _get_gltf_dependencies(local_gltf_path: String) -> Array[String]:
p_file.get_32() # version
p_file.get_32() # length
var chunk_length := p_file.get_32()
var chunk_type := p_file.get_32()
p_file.get_32() # chunk_type
var json_data := p_file.get_buffer(chunk_length)
text = json_data.get_string_from_utf8()
else:
Expand Down
13 changes: 4 additions & 9 deletions godot/src/ui/components/loading_spinner/loading_spinner.gd
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
extends TextureProgressBar

var tween: Tween = null


func _ready() -> void:
tween = get_tree().create_tween().set_loops()
tween.tween_property(self, "radial_initial_angle", 360.0, 1.5).as_relative()
@onready var animation_player = $AnimationPlayer


func _on_visibility_changed():
if tween == null:
if animation_player == null:
return

if self.visible:
tween.play()
animation_player.play("spin")
else:
tween.pause()
animation_player.pause()
31 changes: 30 additions & 1 deletion godot/src/ui/components/loading_spinner/loading_spinner.tscn
Original file line number Diff line number Diff line change
@@ -1,15 +1,44 @@
[gd_scene load_steps=3 format=3 uid="uid://buu3ox7iefpgx"]
[gd_scene load_steps=5 format=3 uid="uid://buu3ox7iefpgx"]

[ext_resource type="Texture2D" uid="uid://dx7vyin0sc2ne" path="res://assets/ui/loading_spinner_progress.png" id="1_roup2"]
[ext_resource type="Script" path="res://src/ui/components/loading_spinner/loading_spinner.gd" id="2_rds4p"]

[sub_resource type="Animation" id="Animation_h8jfn"]
resource_name = "spin"
length = 1.5
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:radial_initial_angle")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 360.0]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_rrpsh"]
_data = {
"spin": SubResource("Animation_h8jfn")
}

[node name="TextureProgressBar" type="TextureProgressBar"]
offset_right = 40.0
offset_bottom = 40.0
value = 100.0
fill_mode = 4
texture_progress = ExtResource("1_roup2")
radial_initial_angle = 343.23
radial_fill_degrees = 60.0
script = ExtResource("2_rds4p")

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_rrpsh")
}
autoplay = "spin"

[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
5 changes: 4 additions & 1 deletion godot/src/ui/explorer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func _ready():
button_jump.hide()

var sky = null
if Global.testing_scene_mode:
if Global.is_mobile:
sky = load("res://assets/sky/sky_basic_without_glow").instantiate()
add_child(sky)
elif Global.testing_scene_mode:
sky = load("res://assets/sky/sky_test.tscn").instantiate()
add_child(sky)
else:
Expand Down
4 changes: 1 addition & 3 deletions rust/decentraland-godot-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
crate-type = ["cdylib"]

[dependencies]
godot = { git = "https://github.com/godot-rust/gdext", rev = "ef5f388def606ee119849e01ac0fafc1e0ec2c2a" }
godot = { git = "https://github.com/godot-rust/gdext", rev = "5e18af87a13bf8d40b4f50bfcb180228e227b773", features=["experimental-threads"] }
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0.92", features = ["raw_value"] }
Expand Down Expand Up @@ -68,8 +68,6 @@ ethers-providers = { version = "2.0", features = ["ws","rustls"] }
ffmpeg-next = { git = "https://github.com/decentraland/rust-ffmpeg/", branch = "audioline-and-mobile-fix", features = ["fix_usize_size_t"] }
jni = { version = "0.21.1", features = ["invocation"] }
paranoid-android = "0.2.1"
godot = { git = "https://github.com/godot-rust/gdext", rev = "ef5f388def606ee119849e01ac0fafc1e0ec2c2a", features = ["lazy-function-tables"] }


[build-dependencies]
webrtc-sys-build = "0.2.0"
Expand Down

0 comments on commit b51c1db

Please sign in to comment.