Skip to content

Commit fd43a7f

Browse files
committed
Merge pull request #88188 from dsnopek/gdextension-api-double-compatibility-hashes
Fix `gdextension_compat_hashes.cpp` for double precision builds
2 parents 306dd5b + 445e301 commit fd43a7f

File tree

1 file changed

+125
-9
lines changed

1 file changed

+125
-9
lines changed

core/extension/gdextension_compat_hashes.cpp

Lines changed: 125 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool GDExtensionCompatHashes::get_legacy_hashes(const StringName &p_class, const
6565
if (p_check_valid) {
6666
MethodBind *mb = ClassDB::get_method_with_compatibility(p_class, p_method, mapping.current_hash);
6767
if (!mb) {
68-
WARN_PRINT(vformat("Compatibility hash %d mapped to non-existent hash %d. Please update gdextension_compat_hashes.cpp.", mapping.legacy_hash, mapping.current_hash));
68+
WARN_PRINT(vformat("Compatibility hash %d for %s::%s() mapped to non-existent hash %d. Please update gdextension_compat_hashes.cpp.", mapping.legacy_hash, p_class, p_method, mapping.current_hash));
6969
continue;
7070
}
7171
}
@@ -107,7 +107,11 @@ void GDExtensionCompatHashes::initialize() {
107107
{ "add_track", 2393815928, 3843682357 },
108108
{ "track_insert_key", 1985425300, 808952278 },
109109
{ "track_find_key", 3898229885, 3245197284 },
110+
#ifdef REAL_T_IS_DOUBLE
111+
{ "bezier_track_insert_key", 1057544502, 3767441357 },
112+
#else
110113
{ "bezier_track_insert_key", 1057544502, 3656773645 },
114+
#endif
111115
{ "bezier_track_set_key_in_handle", 1028302688, 1719223284 },
112116
{ "bezier_track_set_key_out_handle", 1028302688, 1719223284 },
113117
{ "audio_track_insert_key", 3489962123, 4021027286 },
@@ -125,10 +129,18 @@ void GDExtensionCompatHashes::initialize() {
125129
{ "add_triangle", 642454959, 753017335 },
126130
});
127131
mappings.insert("AnimationNodeBlendTree", {
132+
#ifdef REAL_T_IS_DOUBLE
133+
{ "add_node", 2055804584, 1407702499 },
134+
#else
128135
{ "add_node", 2055804584, 1980270704 },
136+
#endif
129137
});
130138
mappings.insert("AnimationNodeStateMachine", {
139+
#ifdef REAL_T_IS_DOUBLE
140+
{ "add_node", 2055804584, 1407702499 },
141+
#else
131142
{ "add_node", 2055804584, 1980270704 },
143+
#endif
132144
});
133145
mappings.insert("AnimationNodeStateMachinePlayback", {
134146
{ "travel", 3683006648, 3823612587 },
@@ -177,8 +189,13 @@ void GDExtensionCompatHashes::initialize() {
177189
{ "draw_multiline_string_outline", 3717870722, 1912318525 },
178190
{ "draw_char", 2329089032, 3339793283 },
179191
{ "draw_char_outline", 419453826, 3302344391 },
192+
#ifdef REAL_T_IS_DOUBLE
193+
{ "draw_mesh", 1634855856, 4036154158 },
194+
{ "draw_set_transform", 3283884939, 156553079 },
195+
#else
180196
{ "draw_mesh", 1634855856, 153818295 },
181197
{ "draw_set_transform", 3283884939, 288975085 },
198+
#endif
182199
{ "draw_animation_slice", 2295343543, 3112831842 },
183200
});
184201
mappings.insert("CodeEdit", {
@@ -210,10 +227,18 @@ void GDExtensionCompatHashes::initialize() {
210227
{ "add_point", 2766148617, 434072736 },
211228
});
212229
mappings.insert("Curve2D", {
230+
#ifdef REAL_T_IS_DOUBLE
231+
{ "add_point", 529706502, 3343370600 },
232+
#else
213233
{ "add_point", 2437345566, 4175465202 },
234+
#endif
214235
});
215236
mappings.insert("Curve3D", {
237+
#ifdef REAL_T_IS_DOUBLE
238+
{ "add_point", 3544159631, 917388502 },
239+
#else
216240
{ "add_point", 3836314258, 2931053748 },
241+
#endif
217242
});
218243
mappings.insert("DirAccess", {
219244
{ "list_dir_begin", 2018049411, 2610976713 },
@@ -253,8 +278,13 @@ void GDExtensionCompatHashes::initialize() {
253278
{ "window_set_ime_active", 450484987, 1661950165 },
254279
{ "window_set_ime_position", 3614040015, 2019273902 },
255280
{ "window_set_vsync_mode", 1708924624, 2179333492 },
256-
{ "virtual_keyboard_show", 860410478, 3042891259 },
281+
#ifdef REAL_T_IS_DOUBLE
282+
{ "cursor_set_custom_image", 1358907026, 4163678968 },
283+
{ "virtual_keyboard_show", 384539973, 1323934605 },
284+
#else
257285
{ "cursor_set_custom_image", 1358907026, 1816663697 },
286+
{ "virtual_keyboard_show", 860410478, 3042891259 },
287+
#endif
258288
});
259289
mappings.insert("ENetConnection", {
260290
{ "create_host_bound", 866250949, 1515002313 },
@@ -289,7 +319,11 @@ void GDExtensionCompatHashes::initialize() {
289319
});
290320
mappings.insert("EditorNode3DGizmo", {
291321
{ "add_lines", 302451090, 2910971437 },
322+
#ifdef REAL_T_IS_DOUBLE
323+
{ "add_mesh", 3332776472, 2161761131 },
324+
#else
292325
{ "add_mesh", 1868867708, 1579955111 },
326+
#endif
293327
{ "add_unscaled_billboard", 3719733075, 520007164 },
294328
});
295329
mappings.insert("EditorNode3DGizmoPlugin", {
@@ -316,7 +350,6 @@ void GDExtensionCompatHashes::initialize() {
316350
{ "add_filter", 233059325, 3388804757 },
317351
});
318352
mappings.insert("Font", {
319-
{ "find_variation", 1222433716, 3344325384 },
320353
{ "get_string_size", 3678918099, 1868866121 },
321354
{ "get_multiline_string_size", 2427690650, 519636710 },
322355
{ "draw_string", 2565402639, 1983721962 },
@@ -325,8 +358,13 @@ void GDExtensionCompatHashes::initialize() {
325358
{ "draw_multiline_string_outline", 1649790182, 3206388178 },
326359
{ "draw_char", 1462476057, 3815617597 },
327360
{ "draw_char_outline", 4161008124, 209525354 },
361+
#ifdef REAL_T_IS_DOUBLE
362+
{ "find_variation", 625117670, 2196349508 },
363+
#else
364+
{ "find_variation", 1222433716, 3344325384 },
328365
// Pre-existing compatibility hash.
329366
{ "find_variation", 1149405976, 1851767612 },
367+
#endif
330368
});
331369
mappings.insert("GLTFDocument", {
332370
{ "append_from_file", 1862991421, 866380864 },
@@ -380,11 +418,19 @@ void GDExtensionCompatHashes::initialize() {
380418
{ "get_vector", 1517139831, 2479607902 },
381419
{ "start_joy_vibration", 1890603622, 2576575033 },
382420
{ "action_press", 573731101, 1713091165 },
421+
#ifdef REAL_T_IS_DOUBLE
422+
{ "set_custom_mouse_cursor", 3489634142, 1277868338 },
423+
#else
383424
{ "set_custom_mouse_cursor", 3489634142, 703945977 },
425+
#endif
384426
});
385427
mappings.insert("InputEvent", {
386428
{ "is_match", 3392494811, 1754951977 },
429+
#ifdef REAL_T_IS_DOUBLE
430+
{ "xformed_by", 2747409789, 3242949850 },
431+
#else
387432
{ "xformed_by", 2747409789, 1282766827 },
433+
#endif
388434
});
389435
mappings.insert("InputMap", {
390436
{ "add_action", 573731101, 4100757082 },
@@ -429,8 +475,13 @@ void GDExtensionCompatHashes::initialize() {
429475
{ "set_multiplayer_authority", 4023243586, 972357352 },
430476
});
431477
mappings.insert("Node3D", {
478+
#ifdef REAL_T_IS_DOUBLE
479+
{ "look_at", 136915519, 819337406 },
480+
{ "look_at_from_position", 4067663783, 1809580162 },
481+
#else
432482
{ "look_at", 3123400617, 2882425029 },
433483
{ "look_at_from_position", 4067663783, 2086826090 },
484+
#endif
434485
});
435486
mappings.insert("Noise", {
436487
{ "get_image", 2569233413, 3180683109 },
@@ -470,7 +521,11 @@ void GDExtensionCompatHashes::initialize() {
470521
{ "add_custom_monitor", 2865980031, 4099036814 },
471522
});
472523
mappings.insert("PhysicalBone3D", {
524+
#ifdef REAL_T_IS_DOUBLE
525+
{ "apply_impulse", 1002852006, 2485728502 },
526+
#else
473527
{ "apply_impulse", 1002852006, 2754756483 },
528+
#endif
474529
});
475530
mappings.insert("PhysicsBody2D", {
476531
{ "move_and_collide", 1529961754, 3681923724 },
@@ -481,14 +536,26 @@ void GDExtensionCompatHashes::initialize() {
481536
{ "test_move", 680299713, 2481691619 },
482537
});
483538
mappings.insert("PhysicsDirectBodyState2D", {
539+
#ifdef REAL_T_IS_DOUBLE
540+
{ "apply_impulse", 496058220, 1271588277 },
541+
{ "apply_force", 496058220, 1271588277 },
542+
{ "add_constant_force", 496058220, 1271588277 },
543+
#else
484544
{ "apply_impulse", 496058220, 4288681949 },
485545
{ "apply_force", 496058220, 4288681949 },
486546
{ "add_constant_force", 496058220, 4288681949 },
547+
#endif
487548
});
488549
mappings.insert("PhysicsDirectBodyState3D", {
550+
#ifdef REAL_T_IS_DOUBLE
551+
{ "apply_impulse", 1002852006, 2485728502 },
552+
{ "apply_force", 1002852006, 2485728502 },
553+
{ "add_constant_force", 1002852006, 2485728502 },
554+
#else
489555
{ "apply_impulse", 1002852006, 2754756483 },
490556
{ "apply_force", 1002852006, 2754756483 },
491557
{ "add_constant_force", 1002852006, 2754756483 },
558+
#endif
492559
});
493560
mappings.insert("PhysicsDirectSpaceState2D", {
494561
{ "intersect_point", 3278207904, 2118456068 },
@@ -507,21 +574,37 @@ void GDExtensionCompatHashes::initialize() {
507574
{ "create", 680321959, 3110599579 },
508575
});
509576
mappings.insert("PhysicsServer2D", {
577+
#ifdef REAL_T_IS_DOUBLE
578+
{ "area_add_shape", 754862190, 3597527023 },
579+
{ "body_add_shape", 754862190, 3597527023 },
580+
{ "body_apply_impulse", 34330743, 1124035137 },
581+
{ "body_apply_force", 34330743, 1124035137 },
582+
{ "body_add_constant_force", 34330743, 1124035137 },
583+
#else
510584
{ "area_add_shape", 754862190, 339056240 },
511585
{ "body_add_shape", 754862190, 339056240 },
512586
{ "body_apply_impulse", 34330743, 205485391 },
513587
{ "body_apply_force", 34330743, 205485391 },
514588
{ "body_add_constant_force", 34330743, 205485391 },
589+
#endif
515590
{ "joint_make_pin", 2288600450, 1612646186 },
516591
{ "joint_make_groove", 3573265764, 481430435 },
517592
{ "joint_make_damped_spring", 206603952, 1994657646 },
518593
});
519594
mappings.insert("PhysicsServer3D", {
595+
#ifdef REAL_T_IS_DOUBLE
596+
{ "area_add_shape", 4040559639, 183938777 },
597+
{ "body_add_shape", 4040559639, 183938777 },
598+
{ "body_apply_impulse", 110375048, 2238283471 },
599+
{ "body_apply_force", 110375048, 2238283471 },
600+
{ "body_add_constant_force", 110375048, 2238283471 },
601+
#else
520602
{ "area_add_shape", 4040559639, 3711419014 },
521603
{ "body_add_shape", 4040559639, 3711419014 },
522604
{ "body_apply_impulse", 110375048, 390416203 },
523605
{ "body_apply_force", 110375048, 390416203 },
524606
{ "body_add_constant_force", 110375048, 390416203 },
607+
#endif
525608
});
526609
mappings.insert("PopupMenu", {
527610
{ "add_item", 3224536192, 3674230041 },
@@ -581,23 +664,27 @@ void GDExtensionCompatHashes::initialize() {
581664
{ "buffer_get_data", 125363422, 3101830688 },
582665
{ "render_pipeline_create", 2911419500, 2385451958 },
583666
{ "compute_pipeline_create", 403593840, 1448838280 },
667+
{ "draw_list_draw", 3710874499, 4230067973 },
668+
#ifdef REAL_T_IS_DOUBLE
669+
{ "draw_list_begin", 4252992020, 848735039 },
670+
{ "draw_list_begin_split", 832527510, 2228306807 },
671+
{ "draw_list_enable_scissor", 338791288, 730833978 },
672+
#else
584673
{ "draw_list_begin", 4252992020, 2468082605 },
585674
{ "draw_list_begin_split", 832527510, 2406300660 },
586-
{ "draw_list_draw", 3710874499, 4230067973 },
587675
{ "draw_list_enable_scissor", 338791288, 244650101 },
676+
#endif
588677
});
589678
mappings.insert("RenderingServer", {
590679
{ "texture_rd_create", 3291180269, 1434128712 },
591680
{ "shader_set_default_texture_parameter", 3864903085, 4094001817 },
592681
{ "shader_get_default_texture_parameter", 2523186822, 1464608890 },
593682
{ "mesh_create_from_surfaces", 4007581507, 4291747531 },
594683
{ "mesh_add_surface_from_arrays", 1247008646, 2342446560 },
595-
{ "viewport_attach_to_screen", 1278520651, 1062245816 },
596684
{ "environment_set_ambient_light", 491659071, 1214961493 },
597685
{ "instances_cull_aabb", 2031554939, 2570105777 },
598686
{ "instances_cull_ray", 3388524336, 2208759584 },
599687
{ "instances_cull_convex", 3690700105, 2488539944 },
600-
{ "canvas_item_set_custom_rect", 2180266943, 1333997032 },
601688
{ "canvas_item_add_line", 2843922985, 1819681853 },
602689
{ "canvas_item_add_polyline", 3438017257, 3098767073 },
603690
{ "canvas_item_add_multiline", 3176074788, 2088642721 },
@@ -607,11 +694,19 @@ void GDExtensionCompatHashes::initialize() {
607694
{ "canvas_item_add_nine_patch", 904428547, 389957886 },
608695
{ "canvas_item_add_polygon", 2907936855, 3580000528 },
609696
{ "canvas_item_add_triangle_array", 749685193, 660261329 },
610-
{ "canvas_item_add_mesh", 3548053052, 316450961 },
611697
{ "canvas_item_add_multimesh", 1541595251, 2131855138 },
612698
{ "canvas_item_add_animation_slice", 4107531031, 2646834499 },
613699
{ "canvas_item_set_canvas_group_mode", 41973386, 3973586316 },
614700
{ "set_boot_image", 2244367877, 3759744527 },
701+
#ifdef REAL_T_IS_DOUBLE
702+
{ "viewport_attach_to_screen", 1410474027, 2248302004 },
703+
{ "canvas_item_set_custom_rect", 2180266943, 1134449082 },
704+
{ "canvas_item_add_mesh", 3877492181, 3024949314 },
705+
#else
706+
{ "viewport_attach_to_screen", 1278520651, 1062245816 },
707+
{ "canvas_item_set_custom_rect", 2180266943, 1333997032 },
708+
{ "canvas_item_add_mesh", 3548053052, 316450961 },
709+
#endif
615710
});
616711
mappings.insert("ResourceLoader", {
617712
{ "load_threaded_request", 1939848623, 3614384323 },
@@ -623,23 +718,40 @@ void GDExtensionCompatHashes::initialize() {
623718
{ "save", 2303056517, 2983274697 },
624719
});
625720
mappings.insert("RichTextLabel", {
626-
{ "add_image", 3346058748, 3580801207 },
627721
{ "push_font", 814287596, 2347424842 },
628722
{ "push_paragraph", 3218895358, 3089306873 },
629723
{ "push_list", 4036303897, 3017143144 },
630724
{ "push_table", 1125058220, 2623499273 },
631-
{ "push_dropcap", 311501835, 4061635501 },
632725
{ "set_table_column_expand", 4132157579, 2185176273 },
726+
#ifdef REAL_T_IS_DOUBLE
727+
{ "add_image", 3346058748, 1507062345 },
728+
{ "push_dropcap", 981432822, 763534173 },
729+
#else
730+
{ "add_image", 3346058748, 3580801207 },
731+
{ "push_dropcap", 311501835, 4061635501 },
732+
#endif
633733
});
634734
mappings.insert("RigidBody2D", {
735+
#ifdef REAL_T_IS_DOUBLE
736+
{ "apply_impulse", 496058220, 1271588277 },
737+
{ "apply_force", 496058220, 1271588277 },
738+
{ "add_constant_force", 496058220, 1271588277 },
739+
#else
635740
{ "apply_impulse", 496058220, 4288681949 },
636741
{ "apply_force", 496058220, 4288681949 },
637742
{ "add_constant_force", 496058220, 4288681949 },
743+
#endif
638744
});
639745
mappings.insert("RigidBody3D", {
746+
#ifdef REAL_T_IS_DOUBLE
747+
{ "apply_impulse", 1002852006, 2485728502 },
748+
{ "apply_force", 1002852006, 2485728502 },
749+
{ "add_constant_force", 1002852006, 2485728502 },
750+
#else
640751
{ "apply_impulse", 1002852006, 2754756483 },
641752
{ "apply_force", 1002852006, 2754756483 },
642753
{ "add_constant_force", 1002852006, 2754756483 },
754+
#endif
643755
});
644756
mappings.insert("SceneMultiplayer", {
645757
{ "send_bytes", 2742700601, 1307428718 },
@@ -699,7 +811,11 @@ void GDExtensionCompatHashes::initialize() {
699811
{ "draw_outline", 1364491366, 1343401456 },
700812
});
701813
mappings.insert("TextParagraph", {
814+
#ifdef REAL_T_IS_DOUBLE
815+
{ "set_dropcap", 2613124475, 2897844600 },
816+
#else
702817
{ "set_dropcap", 2613124475, 2498990330 },
818+
#endif
703819
{ "add_string", 867188035, 621426851 },
704820
{ "add_object", 735420116, 1316529304 },
705821
{ "resize_object", 960819067, 2095776372 },

0 commit comments

Comments
 (0)