Modules: Don't build editor-specific classes in templates
They're moved to an `editor` subfolder so that we can easily handle them separately.
This commit is contained in:
parent
41d075de58
commit
5fe6984639
23 changed files with 105 additions and 48 deletions
|
|
@ -3,7 +3,10 @@
|
|||
Import("env")
|
||||
Import("env_modules")
|
||||
|
||||
# Godot's own source files
|
||||
env_csg = env_modules.Clone()
|
||||
|
||||
# Godot's own source files
|
||||
env_csg.add_source_files(env.modules_sources, "*.cpp")
|
||||
if env["tools"]:
|
||||
env_csg.add_source_files(env.modules_sources, "editor/*.cpp")
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include "csg_gizmos.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/plugins/node_3d_editor_plugin.h"
|
||||
#include "scene/3d/camera_3d.h"
|
||||
|
|
@ -425,3 +427,5 @@ EditorPluginCSG::EditorPluginCSG() {
|
|||
Ref<CSGShape3DGizmoPlugin> gizmo_plugin = Ref<CSGShape3DGizmoPlugin>(memnew(CSGShape3DGizmoPlugin));
|
||||
Node3DEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin);
|
||||
}
|
||||
|
||||
#endif // TOOLS_ENABLED
|
||||
|
|
@ -31,7 +31,9 @@
|
|||
#ifndef CSG_GIZMOS_H
|
||||
#define CSG_GIZMOS_H
|
||||
|
||||
#include "csg_shape.h"
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
#include "../csg_shape.h"
|
||||
#include "editor/editor_plugin.h"
|
||||
#include "editor/plugins/node_3d_editor_gizmos.h"
|
||||
|
||||
|
|
@ -60,4 +62,6 @@ public:
|
|||
EditorPluginCSG();
|
||||
};
|
||||
|
||||
#endif // TOOLS_ENABLED
|
||||
|
||||
#endif // CSG_GIZMOS_H
|
||||
|
|
@ -30,12 +30,15 @@
|
|||
|
||||
#include "register_types.h"
|
||||
|
||||
#include "csg_gizmos.h"
|
||||
#include "csg_shape.h"
|
||||
|
||||
void register_csg_types() {
|
||||
#ifndef _3D_DISABLED
|
||||
|
||||
#include "csg_shape.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
#include "editor/csg_gizmos.h"
|
||||
#endif
|
||||
|
||||
void register_csg_types() {
|
||||
GDREGISTER_ABSTRACT_CLASS(CSGShape3D);
|
||||
GDREGISTER_ABSTRACT_CLASS(CSGPrimitive3D);
|
||||
GDREGISTER_CLASS(CSGMesh3D);
|
||||
|
|
@ -49,8 +52,9 @@ void register_csg_types() {
|
|||
#ifdef TOOLS_ENABLED
|
||||
EditorPlugins::add_by_type<EditorPluginCSG>();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void unregister_csg_types() {
|
||||
}
|
||||
|
||||
#endif // _3D_DISABLED
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue