Skip to content

Commit 9857e47

Browse files
committed
2 parents fd9045f + 9e60984 commit 9857e47

File tree

54 files changed

+723
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+723
-220
lines changed

core/config/project_settings.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,16 +516,19 @@ void ProjectSettings::_convert_to_last_version(int p_from_version) {
516516
}
517517
}
518518
}
519-
if (p_from_version <= 5) {
520-
// Converts the device in events from -1 (emulated events) to -3 (all events).
519+
if (p_from_version == 5) {
520+
// Converts the device in events from -3 to -1.
521+
// -3 was introduced in GH-97707 as a way to prevent a clash in device IDs, but as reported in GH-99243, this leads to problems.
522+
// -3 was used during dev-releases, so this conversion helps to revert such affected projects.
523+
// This conversion doesn't affect any other projects, since -3 is not used otherwise.
521524
for (KeyValue<StringName, ProjectSettings::VariantContainer> &E : props) {
522525
if (String(E.key).begins_with("input/")) {
523526
Dictionary action = E.value.variant;
524527
Array events = action["events"];
525528
for (int i = 0; i < events.size(); i++) {
526529
Ref<InputEvent> ev = events[i];
527-
if (ev.is_valid() && ev->get_device() == -1) { // -1 was the previous value (GH-97707).
528-
ev->set_device(InputEvent::DEVICE_ID_ALL_DEVICES);
530+
if (ev.is_valid() && ev->get_device() == -3) {
531+
ev->set_device(-1);
529532
}
530533
}
531534
}

core/extension/gdextension.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class GDExtensionMethodBind : public MethodBind {
156156
}
157157

158158
virtual bool is_vararg() const override {
159-
return false;
159+
return vararg;
160160
}
161161

162162
#ifdef TOOLS_ENABLED

core/input/input_event.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#include "core/os/keyboard.h"
3838
#include "core/os/os.h"
3939

40+
const int InputEvent::DEVICE_ID_EMULATION = -1;
41+
const int InputEvent::DEVICE_ID_INTERNAL = -2;
42+
4043
void InputEvent::set_device(int p_device) {
4144
device = p_device;
4245
emit_changed();

core/input/input_event.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ class InputEvent : public Resource {
6464
static void _bind_methods();
6565

6666
public:
67-
inline static constexpr int DEVICE_ID_EMULATION = -1;
68-
inline static constexpr int DEVICE_ID_INTERNAL = -2;
69-
inline static constexpr int DEVICE_ID_ALL_DEVICES = -3; // Signify that a given Action can be triggered by any device.
67+
static const int DEVICE_ID_EMULATION;
68+
static const int DEVICE_ID_INTERNAL;
7069

7170
void set_device(int p_device);
7271
int get_device() const;

core/input/input_map.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
InputMap *InputMap::singleton = nullptr;
4343

44+
int InputMap::ALL_DEVICES = -1;
45+
4446
void InputMap::_bind_methods() {
4547
ClassDB::bind_method(D_METHOD("has_action", "action"), &InputMap::has_action);
4648
ClassDB::bind_method(D_METHOD("get_actions"), &InputMap::_get_actions);
@@ -163,7 +165,7 @@ List<Ref<InputEvent>>::Element *InputMap::_find_event(Action &p_action, const Re
163165
int i = 0;
164166
for (List<Ref<InputEvent>>::Element *E = p_action.inputs.front(); E; E = E->next()) {
165167
int device = E->get()->get_device();
166-
if (device == InputEvent::DEVICE_ID_ALL_DEVICES || device == p_event->get_device()) {
168+
if (device == ALL_DEVICES || device == p_event->get_device()) {
167169
if (E->get()->action_match(p_event, p_exact_match, p_action.deadzone, r_pressed, r_strength, r_raw_strength)) {
168170
if (r_event_index) {
169171
*r_event_index = i;

core/input/input_map.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ class InputMap : public Object {
4545
GDCLASS(InputMap, Object);
4646

4747
public:
48+
/**
49+
* A special value used to signify that a given Action can be triggered by any device
50+
*/
51+
static int ALL_DEVICES;
52+
4853
struct Action {
4954
int id;
5055
float deadzone;

core/io/resource_loader.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,13 @@ Ref<Resource> ResourceLoader::_load(const String &p_path, const String &p_origin
297297
load_paths_stack.push_back(original_path);
298298

299299
// Try all loaders and pick the first match for the type hint
300-
bool loader_found = false;
300+
bool found = false;
301301
Ref<Resource> res;
302302
for (int i = 0; i < loader_count; i++) {
303303
if (!loader[i]->recognize_path(p_path, p_type_hint)) {
304304
continue;
305305
}
306-
loader_found = true;
306+
found = true;
307307
res = loader[i]->load(p_path, original_path, r_error, p_use_sub_threads, r_progress, p_cache_mode);
308308
if (!res.is_null()) {
309309
break;
@@ -318,24 +318,15 @@ Ref<Resource> ResourceLoader::_load(const String &p_path, const String &p_origin
318318
return res;
319319
}
320320

321-
if (!loader_found) {
322-
if (r_error) {
323-
*r_error = ERR_FILE_UNRECOGNIZED;
324-
}
325-
ERR_FAIL_V_MSG(Ref<Resource>(), vformat("No loader found for resource: %s (expected type: %s)", p_path, p_type_hint));
326-
}
321+
ERR_FAIL_COND_V_MSG(found, Ref<Resource>(),
322+
vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path));
327323

328324
#ifdef TOOLS_ENABLED
329325
Ref<FileAccess> file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES);
330-
if (!file_check->file_exists(p_path)) {
331-
if (r_error) {
332-
*r_error = ERR_FILE_NOT_FOUND;
333-
}
334-
ERR_FAIL_V_MSG(Ref<Resource>(), vformat("Resource file not found: %s (expected type: %s)", p_path, p_type_hint));
335-
}
326+
ERR_FAIL_COND_V_MSG(!file_check->file_exists(p_path), Ref<Resource>(), vformat("Resource file not found: %s (expected type: %s)", p_path, p_type_hint));
336327
#endif
337328

338-
ERR_FAIL_V_MSG(Ref<Resource>(), vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path));
329+
ERR_FAIL_V_MSG(Ref<Resource>(), vformat("No loader found for resource: %s (expected type: %s)", p_path, p_type_hint));
339330
}
340331

341332
// This implementation must allow re-entrancy for a task that started awaiting in a deeper stack frame.

doc/classes/EditorSpinSlider.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
Emitted when the spinner/slider is ungrabbed.
4141
</description>
4242
</signal>
43+
<signal name="updown_pressed">
44+
<description>
45+
Emitted when the updown button is pressed.
46+
</description>
47+
</signal>
4348
<signal name="value_focus_entered">
4449
<description>
4550
Emitted when the value form gains focus.

doc/classes/FileAccess.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Provides methods for file reading and writing operations.
55
</brief_description>
66
<description>
7-
This class can be used to permanently store data in the user device's file system and to read from it. This is useful for store game save data or player configuration files.
7+
This class can be used to permanently store data in the user device's file system and to read from it. This is useful for storing game save data or player configuration files.
88
Here's a sample on how to write and read from a file:
99
[codeblocks]
1010
[gdscript]

drivers/vulkan/rendering_device_driver_vulkan.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,9 @@ RDD::CommandQueueFamilyID RenderingDeviceDriverVulkan::command_queue_family_get(
23942394
}
23952395
}
23962396

2397-
ERR_FAIL_COND_V_MSG(picked_family_index >= queue_family_properties.size(), CommandQueueFamilyID(), "A queue family with the requested bits could not be found.");
2397+
if (picked_family_index >= queue_family_properties.size()) {
2398+
return CommandQueueFamilyID();
2399+
}
23982400

23992401
// Since 0 is a valid index and we use 0 as the error case, we make the index start from 1 instead.
24002402
return CommandQueueFamilyID(picked_family_index + 1);

0 commit comments

Comments
 (0)