Daniele Bartolini преди 1 година
родител
ревизия
6a71b1ef3a
променени са 3 файла, в които са добавени 38 реда и са изтрити 23 реда
  1. 22 18
      src/resource/mesh.cpp
  2. 10 5
      src/resource/mesh.h
  3. 6 0
      src/resource/mesh_resource.h

+ 22 - 18
src/resource/mesh.cpp

@@ -4,24 +4,26 @@
  */
 
 #include "config.h"
-#include "core/containers/array.inl"
-#include "core/containers/vector.inl"
-#include "core/filesystem/filesystem.h"
-#include "core/json/json_object.inl"
-#include "core/json/sjson.h"
-#include "core/math/aabb.inl"
-#include "core/math/constants.h"
-#include "core/math/matrix4x4.inl"
-#include "core/math/vector2.inl"
-#include "core/math/vector3.inl"
-#include "core/memory/temp_allocator.inl"
-#include "core/strings/dynamic_string.inl"
-#include "resource/compile_options.inl"
-#include "resource/mesh.h"
-#include "resource/mesh_resource.h"
-#include <bx/error.h>
-#include <bx/readerwriter.h>
-#include <vertexlayout.h> // bgfx::write, bgfx::read
+
+#if CROWN_CAN_COMPILE
+#   include "core/containers/array.inl"
+#   include "core/containers/vector.inl"
+#   include "core/filesystem/filesystem.h"
+#   include "core/json/json_object.inl"
+#   include "core/json/sjson.h"
+#   include "core/math/aabb.inl"
+#   include "core/math/constants.h"
+#   include "core/math/matrix4x4.inl"
+#   include "core/math/vector2.inl"
+#   include "core/math/vector3.inl"
+#   include "core/memory/temp_allocator.inl"
+#   include "core/strings/dynamic_string.inl"
+#   include "resource/compile_options.inl"
+#   include "resource/mesh.h"
+#   include "resource/mesh_resource.h"
+#   include <bx/error.h>
+#   include <bx/readerwriter.h>
+#   include <vertexlayout.h> // bgfx::write, bgfx::read
 
 namespace crown
 {
@@ -258,3 +260,5 @@ Mesh::Mesh(Allocator &a)
 }
 
 } // namespace crown
+
+#endif // if CROWN_CAN_COMPILE

+ 10 - 5
src/resource/mesh.h

@@ -5,11 +5,14 @@
 
 #pragma once
 
-#include "core/filesystem/types.h"
-#include "core/math/types.h"
-#include "core/memory/types.h"
-#include "core/strings/dynamic_string.h"
-#include "resource/types.h"
+#include "config.h"
+
+#if CROWN_CAN_COMPILE
+#   include "core/filesystem/types.h"
+#   include "core/math/types.h"
+#   include "core/memory/types.h"
+#   include "core/strings/dynamic_string.h"
+#   include "resource/types.h"
 
 namespace crown
 {
@@ -73,3 +76,5 @@ namespace mesh
 } // namespace mesh
 
 } // namespace crown
+
+#endif // if CROWN_CAN_COMPILE

+ 6 - 0
src/resource/mesh_resource.h

@@ -58,6 +58,7 @@ struct MeshResource
 	const MeshGeometry *geometry(StringId32 name) const;
 };
 
+#if CROWN_CAN_COMPILE
 namespace mesh
 {
 	///
@@ -70,6 +71,11 @@ namespace mesh_resource_internal
 	///
 	s32 compile(CompileOptions &opts);
 
+} // namespace mesh_resource_internal
+#endif
+
+namespace mesh_resource_internal
+{
 	///
 	void *load(File &file, Allocator &a);