Skip to content

Commit

Permalink
Add initial Godot 3 exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Oct 6, 2024
1 parent f4b4d68 commit 5a79276
Show file tree
Hide file tree
Showing 5 changed files with 565 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/base/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ add_library(tactile::base ALIAS tactile-base)

target_sources(tactile-base
INTERFACE FILE_SET "HEADERS" BASE_DIRS "inc" FILES
"inc/tactile/base/container/result.hpp"
"inc/tactile/base/container/string_map.hpp"
"inc/tactile/base/document/component_view.hpp"
"inc/tactile/base/document/document.hpp"
Expand Down
15 changes: 15 additions & 0 deletions source/base/lib/inc/tactile/base/container/result.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (C) 2024 Albin Johansson (GNU General Public License v3.0)

#pragma once

#include <expected> // expected
#include <system_error> // error_code

namespace tactile {

template <typename T>
using Result = std::expected<T, std::error_code>;

inline const Result<void> kOK {};

} // namespace tactile
2 changes: 2 additions & 0 deletions source/godot_tscn_format/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ add_library(tactile::godot_tscn_format ALIAS tactile-godot-tscn-format)
target_sources(tactile-godot-tscn-format
PRIVATE
"src/gd3_document_converter.cpp"
"src/gd3_exporter.cpp"
"src/gd3_scene_writer.cpp"
"src/godot_scene_format.cpp"
"src/godot_scene_format_plugin.cpp"

PUBLIC FILE_SET "HEADERS" BASE_DIRS "inc" FILES
"inc/tactile/godot_tscn_format/api.hpp"
"inc/tactile/godot_tscn_format/gd3_document_converter.hpp"
"inc/tactile/godot_tscn_format/gd3_exporter.hpp"
"inc/tactile/godot_tscn_format/gd3_scene_writer.hpp"
"inc/tactile/godot_tscn_format/gd3_types.hpp"
"inc/tactile/godot_tscn_format/godot_scene_format.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (C) 2024 Albin Johansson (GNU General Public License v3.0)

#pragma once

#include "tactile/base/container/result.hpp"
#include "tactile/base/io/save/save_format.hpp"
#include "tactile/godot_tscn_format/api.hpp"

namespace tactile::godot {

struct Gd3Map;

/**
* Saves a Godot 3 scene.
*
* \param map The Godot 3 map to save.
* \param options The save options to use.
*
* \return
* Nothing if successful; an error code otherwise.
*/
[[nodiscard]]
TACTILE_GODOT_API auto save_godot3_scene(const Gd3Map& map,
const SaveFormatWriteOptions& options)
-> Result<void>;

} // namespace tactile::godot
Loading

0 comments on commit 5a79276

Please sign in to comment.