-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8ff4a7
commit 5921f80
Showing
4 changed files
with
51 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
source/godot_tscn_format/lib/src/godot_scene_format_plugin.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (C) 2024 Albin Johansson (GNU General Public License v3.0) | ||
|
||
#include "tactile/godot_tscn_format/godot_scene_format_plugin.hpp" | ||
|
||
#include <new> // nothrow | ||
|
||
#include "tactile/base/runtime.hpp" | ||
#include "tactile/runtime/logging.hpp" | ||
|
||
namespace tactile::godot { | ||
|
||
void GodotSceneFormatPlugin::load(IRuntime* runtime) | ||
{ | ||
log(LogLevel::kTrace, "Loading Godot TSCN format plugin"); | ||
m_runtime = runtime; | ||
|
||
m_format = std::make_unique<GodotSceneFormat>(m_runtime); | ||
m_runtime->set_save_format(SaveFormatId::kGodotTscn, m_format.get()); | ||
} | ||
|
||
void GodotSceneFormatPlugin::unload() | ||
{ | ||
log(LogLevel::kTrace, "Unloading Godot TSCN format plugin"); | ||
|
||
m_runtime->set_save_format(SaveFormatId::kGodotTscn, nullptr); | ||
m_format.reset(); | ||
|
||
m_runtime = nullptr; | ||
} | ||
|
||
auto tactile_make_plugin() -> IPlugin* | ||
{ | ||
return new (std::nothrow) GodotSceneFormatPlugin {}; | ||
} | ||
|
||
void tactile_free_plugin(IPlugin* plugin) | ||
{ | ||
delete plugin; | ||
} | ||
|
||
} // namespace tactile::godot |
33 changes: 0 additions & 33 deletions
33
source/godot_tscn_format/lib/src/godot_tscn_format_plugin.cpp
This file was deleted.
Oops, something went wrong.