Skip to content

Commit 2392b6c

Browse files
committed
Fix Bunnymark for current Kotlin API
1 parent 11ec5fc commit 2392b6c

18 files changed

Lines changed: 83 additions & 60 deletions

File tree

harness/bunnymark/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Go in the bunnymark directory and run `gradlew build` to build this sample.
44
Open the project in Godot and inspect the root node.
55
You can choose between GdScript or Kotlin (also C# if you built the engine with mono enabled), and the benchmark as well.
6+
Open the project in the editor once before command-line runs so Godot imports the texture assets into `.godot/imported`.
67
You can also run the benchmarks from the commandline:
78
Example: `../../../../bin/godot.x11.opt.tools.64.mono --bench=BunnymarkV2 --lang=kt`
89

@@ -115,4 +116,3 @@ Attempts to draw as many sprites to the screen as possible by adding Sprite node
115116

116117

117118
Original work: [@Carter Anderson](https://github.com/cart/godot3-bunnymark). Thanks to him.
118-

harness/bunnymark/benchmarks/BunnymarkV1DrawTexture/gdj/BunnymarkV1DrawTexture.gdj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
registeredName = BunnymarkV1DrawTexture
55
fqName = godot.benchmark.bunnymark.BunnymarkV1DrawTexture
6-
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV1DrawTexture.kt
76
baseType = Node2D
87
supertypes = [
9-
godot.Node2D,
10-
godot.CanvasItem,
11-
godot.Node,
12-
godot.Object,
8+
godot.api.Node2D,
9+
godot.api.CanvasItem,
10+
godot.api.Node,
11+
godot.api.Object,
1312
godot.core.KtObject,
14-
kotlin.Any
13+
godot.common.interop.NativeWrapper,
14+
godot.common.interop.NativePointer
1515
]
1616
signals = [
1717
benchmark_finished

harness/bunnymark/benchmarks/BunnymarkV1Sprites/gdj/BunnymarkV1Sprites.gdj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
registeredName = BunnymarkV1Sprites
55
fqName = godot.benchmark.bunnymark.BunnymarkV1Sprites
6-
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV1Sprites.kt
76
baseType = Node2D
87
supertypes = [
9-
godot.Node2D,
10-
godot.CanvasItem,
11-
godot.Node,
12-
godot.Object,
8+
godot.api.Node2D,
9+
godot.api.CanvasItem,
10+
godot.api.Node,
11+
godot.api.Object,
1312
godot.core.KtObject,
14-
kotlin.Any
13+
godot.common.interop.NativeWrapper,
14+
godot.common.interop.NativePointer
1515
]
1616
signals = [
1717
benchmark_finished

harness/bunnymark/benchmarks/BunnymarkV2/gdj/BunnymarkV2.gdj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
registeredName = BunnymarkV2
55
fqName = godot.benchmark.bunnymark.BunnymarkV2
6-
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV2.kt
76
baseType = Node2D
87
supertypes = [
9-
godot.Node2D,
10-
godot.CanvasItem,
11-
godot.Node,
12-
godot.Object,
8+
godot.api.Node2D,
9+
godot.api.CanvasItem,
10+
godot.api.Node,
11+
godot.api.Object,
1312
godot.core.KtObject,
14-
kotlin.Any
13+
godot.common.interop.NativeWrapper,
14+
godot.common.interop.NativePointer
1515
]
1616
signals = [
1717
benchmark_finished

harness/bunnymark/benchmarks/BunnymarkV3/gd/Bunny.gd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
class_name Bunny
21
extends Sprite2D
32

43

harness/bunnymark/benchmarks/BunnymarkV3/gd/BunnymarkV3.gd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
extends Node2D
22

3+
const GdBunny = preload("res://benchmarks/BunnymarkV3/gd/Bunny.gd")
4+
35
var bunny_texture := load("res://images/godot_bunny.png") as Texture2D
46
var label := Label.new()
57
var bunnies := Node2D.new()
@@ -16,7 +18,7 @@ func _process(delta):
1618
label.text = "Bunnies: " + str(bunnies.get_child_count())
1719

1820
func add_bunny():
19-
var bunny: Bunny = Bunny.new()
21+
var bunny = GdBunny.new()
2022
bunny.set_texture(bunny_texture)
2123
bunny.speed = Vector2(randi() % 200 + 50, randi() % 200 + 50)
2224
bunnies.add_child(bunny)
@@ -26,7 +28,7 @@ func remove_bunny():
2628
var child_count: int = bunnies.get_child_count()
2729
if child_count == 0:
2830
return
29-
var bunny: Bunny = bunnies.get_child(child_count - 1)
31+
var bunny = bunnies.get_child(child_count - 1)
3032
bunnies.remove_child(bunny)
3133
bunny.queue_free()
3234

harness/bunnymark/benchmarks/BunnymarkV3/gdj/Bunny.gdj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
registeredName = Bunny
55
fqName = godot.benchmark.bunnymark.v3.Bunny
6-
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/v3/Bunny.kt
76
baseType = Sprite2D
87
supertypes = [
9-
godot.Sprite2D,
10-
godot.Node2D,
11-
godot.CanvasItem,
12-
godot.Node,
13-
godot.Object,
8+
godot.api.Sprite2D,
9+
godot.api.Node2D,
10+
godot.api.CanvasItem,
11+
godot.api.Node,
12+
godot.api.Object,
1413
godot.core.KtObject,
15-
kotlin.Any
14+
godot.common.interop.NativeWrapper,
15+
godot.common.interop.NativePointer
1616
]
1717
signals = [
1818

harness/bunnymark/benchmarks/BunnymarkV3/gdj/BunnymarkV3.gdj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
registeredName = BunnymarkV3
55
fqName = godot.benchmark.bunnymark.BunnymarkV3
6-
relativeSourcePath = src/main/kotlin/godot/benchmark/bunnymark/BunnymarkV3.kt
76
baseType = Node2D
87
supertypes = [
9-
godot.Node2D,
10-
godot.CanvasItem,
11-
godot.Node,
12-
godot.Object,
8+
godot.api.Node2D,
9+
godot.api.CanvasItem,
10+
godot.api.Node,
11+
godot.api.Object,
1312
godot.core.KtObject,
14-
kotlin.Any
13+
godot.common.interop.NativeWrapper,
14+
godot.common.interop.NativePointer
1515
]
1616
signals = [
1717
benchmark_finished
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2+
"custom_jvm_args": [],
23
"debug_address": "*",
34
"debug_port": 5005,
45
"disable_gc": false,
56
"jmx_port": -1,
6-
"jvm_args": "",
77
"max_string_size": -1,
88
"use_debug": false,
9-
"version": "1.0",
9+
"version": "2.0",
1010
"vm_type": "auto",
1111
"wait_for_debugger": true
1212
}

harness/bunnymark/icon.png.import

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.cte
1818
compress/mode=0
1919
compress/high_quality=false
2020
compress/lossy_quality=0.7
21+
compress/uastc_level=0
22+
compress/rdo_quality_loss=0.0
2123
compress/hdr_compression=1
2224
compress/normal_map=0
2325
compress/channel_pack=0
2426
mipmaps/generate=false
2527
mipmaps/limit=-1
2628
roughness/mode=0
2729
roughness/src_normal=""
30+
process/channel_remap/red=0
31+
process/channel_remap/green=1
32+
process/channel_remap/blue=2
33+
process/channel_remap/alpha=3
2834
process/fix_alpha_border=true
2935
process/premult_alpha=false
3036
process/normal_map_invert_y=false

0 commit comments

Comments
 (0)