summaryrefslogtreecommitdiff
path: root/editor/import
diff options
context:
space:
mode:
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp42
-rw-r--r--editor/import/resource_importer_csv_translation.cpp12
-rw-r--r--editor/import/resource_importer_scene.cpp30
-rw-r--r--editor/import/resource_importer_shader_file.cpp30
-rw-r--r--editor/import/resource_importer_shader_file.h30
5 files changed, 119 insertions, 25 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 45e376a2aa..1a1e7171b9 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -538,12 +538,18 @@ Error EditorSceneImporterGLTF::_parse_accessors(GLTFState &state) {
String EditorSceneImporterGLTF::_get_component_type_name(const uint32_t p_component) {
switch (p_component) {
- case COMPONENT_TYPE_BYTE: return "Byte";
- case COMPONENT_TYPE_UNSIGNED_BYTE: return "UByte";
- case COMPONENT_TYPE_SHORT: return "Short";
- case COMPONENT_TYPE_UNSIGNED_SHORT: return "UShort";
- case COMPONENT_TYPE_INT: return "Int";
- case COMPONENT_TYPE_FLOAT: return "Float";
+ case COMPONENT_TYPE_BYTE:
+ return "Byte";
+ case COMPONENT_TYPE_UNSIGNED_BYTE:
+ return "UByte";
+ case COMPONENT_TYPE_SHORT:
+ return "Short";
+ case COMPONENT_TYPE_UNSIGNED_SHORT:
+ return "UShort";
+ case COMPONENT_TYPE_INT:
+ return "Int";
+ case COMPONENT_TYPE_FLOAT:
+ return "Float";
}
return "<Error>";
@@ -655,12 +661,24 @@ Error EditorSceneImporterGLTF::_decode_buffer_view(GLTFState &state, double *dst
int EditorSceneImporterGLTF::_get_component_type_size(const int component_type) {
switch (component_type) {
- case COMPONENT_TYPE_BYTE: return 1; break;
- case COMPONENT_TYPE_UNSIGNED_BYTE: return 1; break;
- case COMPONENT_TYPE_SHORT: return 2; break;
- case COMPONENT_TYPE_UNSIGNED_SHORT: return 2; break;
- case COMPONENT_TYPE_INT: return 4; break;
- case COMPONENT_TYPE_FLOAT: return 4; break;
+ case COMPONENT_TYPE_BYTE:
+ return 1;
+ break;
+ case COMPONENT_TYPE_UNSIGNED_BYTE:
+ return 1;
+ break;
+ case COMPONENT_TYPE_SHORT:
+ return 2;
+ break;
+ case COMPONENT_TYPE_UNSIGNED_SHORT:
+ return 2;
+ break;
+ case COMPONENT_TYPE_INT:
+ return 4;
+ break;
+ case COMPONENT_TYPE_FLOAT:
+ return 4;
+ break;
default: {
ERR_FAIL_V(0);
}
diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp
index 1d7bed3975..9d72396449 100644
--- a/editor/import/resource_importer_csv_translation.cpp
+++ b/editor/import/resource_importer_csv_translation.cpp
@@ -83,9 +83,15 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const
String delimiter;
switch ((int)p_options["delimiter"]) {
- case 0: delimiter = ","; break;
- case 1: delimiter = ";"; break;
- case 2: delimiter = "\t"; break;
+ case 0:
+ delimiter = ",";
+ break;
+ case 1:
+ delimiter = ";";
+ break;
+ case 2:
+ delimiter = "\t";
+ break;
}
FileAccessRef f = FileAccess::open(p_source_file, FileAccess::READ);
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 239fae2268..e7f87acd03 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -221,16 +221,26 @@ int ResourceImporterScene::get_preset_count() const {
String ResourceImporterScene::get_preset_name(int p_idx) const {
switch (p_idx) {
- case PRESET_SINGLE_SCENE: return TTR("Import as Single Scene");
- case PRESET_SEPARATE_ANIMATIONS: return TTR("Import with Separate Animations");
- case PRESET_SEPARATE_MATERIALS: return TTR("Import with Separate Materials");
- case PRESET_SEPARATE_MESHES: return TTR("Import with Separate Objects");
- case PRESET_SEPARATE_MESHES_AND_MATERIALS: return TTR("Import with Separate Objects+Materials");
- case PRESET_SEPARATE_MESHES_AND_ANIMATIONS: return TTR("Import with Separate Objects+Animations");
- case PRESET_SEPARATE_MATERIALS_AND_ANIMATIONS: return TTR("Import with Separate Materials+Animations");
- case PRESET_SEPARATE_MESHES_MATERIALS_AND_ANIMATIONS: return TTR("Import with Separate Objects+Materials+Animations");
- case PRESET_MULTIPLE_SCENES: return TTR("Import as Multiple Scenes");
- case PRESET_MULTIPLE_SCENES_AND_MATERIALS: return TTR("Import as Multiple Scenes+Materials");
+ case PRESET_SINGLE_SCENE:
+ return TTR("Import as Single Scene");
+ case PRESET_SEPARATE_ANIMATIONS:
+ return TTR("Import with Separate Animations");
+ case PRESET_SEPARATE_MATERIALS:
+ return TTR("Import with Separate Materials");
+ case PRESET_SEPARATE_MESHES:
+ return TTR("Import with Separate Objects");
+ case PRESET_SEPARATE_MESHES_AND_MATERIALS:
+ return TTR("Import with Separate Objects+Materials");
+ case PRESET_SEPARATE_MESHES_AND_ANIMATIONS:
+ return TTR("Import with Separate Objects+Animations");
+ case PRESET_SEPARATE_MATERIALS_AND_ANIMATIONS:
+ return TTR("Import with Separate Materials+Animations");
+ case PRESET_SEPARATE_MESHES_MATERIALS_AND_ANIMATIONS:
+ return TTR("Import with Separate Objects+Materials+Animations");
+ case PRESET_MULTIPLE_SCENES:
+ return TTR("Import as Multiple Scenes");
+ case PRESET_MULTIPLE_SCENES_AND_MATERIALS:
+ return TTR("Import as Multiple Scenes+Materials");
}
return "";
diff --git a/editor/import/resource_importer_shader_file.cpp b/editor/import/resource_importer_shader_file.cpp
index a2f178de12..3a6215e035 100644
--- a/editor/import/resource_importer_shader_file.cpp
+++ b/editor/import/resource_importer_shader_file.cpp
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* resource_importer_shader_file.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#include "resource_importer_shader_file.h"
#include "core/io/marshalls.h"
diff --git a/editor/import/resource_importer_shader_file.h b/editor/import/resource_importer_shader_file.h
index f6b50bee9e..fa95ceecc1 100644
--- a/editor/import/resource_importer_shader_file.h
+++ b/editor/import/resource_importer_shader_file.h
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* resource_importer_shader_file.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#ifndef RESOURCE_IMPORTER_SHADER_FILE_H
#define RESOURCE_IMPORTER_SHADER_FILE_H