summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorJoost Heitbrink <joostheitbrink@outlook.com>2019-11-30 17:22:22 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-01-06 13:13:17 +0100
commitdc61323b2ce5478b1fc07581e64f7b7fcfdaf239 (patch)
tree274e43b88e7e666418730cc522ef1db6c8ead375 /scene/resources
parent845480497207839bef48997d152f00b60b6176a8 (diff)
PCK: Set VERSION_PATCH in header, factor out header magic
Unify pack file version and magic to avoid hardcoded literals. `version.py` now always includes `patch` even for the first release in a new stable branch (e.g. 3.2). The public name stays without the patch number, but `Engine.get_version_info()` already included `patch == 0`, and we can remove some extra handling of undefined `VERSION_PATCH` this way. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/packed_scene.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 5a2cd9a1c2..3bc998567d 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -39,7 +39,7 @@
#include "scene/gui/control.h"
#include "scene/main/instance_placeholder.h"
-#define PACK_VERSION 2
+#define PACKED_SCENE_VERSION 2
bool SceneState::can_instance() const {
@@ -1095,7 +1095,7 @@ void SceneState::set_bundled_scene(const Dictionary &p_dictionary) {
if (p_dictionary.has("version"))
version = p_dictionary["version"];
- ERR_FAIL_COND_MSG(version > PACK_VERSION, "Save format version too new.");
+ ERR_FAIL_COND_MSG(version > PACKED_SCENE_VERSION, "Save format version too new.");
PoolVector<String> snames = p_dictionary["names"];
if (snames.size()) {
@@ -1283,9 +1283,7 @@ Dictionary SceneState::get_bundled_scene() const {
d["base_scene"] = base_scene_idx;
}
- d["version"] = PACK_VERSION;
-
- //d["path"]=path;
+ d["version"] = PACKED_SCENE_VERSION;
return d;
}