Daniele Bartolini 10 лет назад
Родитель
Сommit
1faf0db83e

+ 17 - 17
src/resource/bundle_compiler.cpp

@@ -3,31 +3,31 @@
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  */
 
-#include "config.h"
+#include "allocator.h"
 #include "bundle_compiler.h"
-#include "vector.h"
+#include "compile_options.h"
+#include "config.h"
+#include "config_resource.h"
+#include "disk_filesystem.h"
 #include "dynamic_string.h"
-#include "allocator.h"
-#include "os.h"
+#include "font_resource.h"
+#include "level_resource.h"
 #include "log.h"
-#include "path.h"
-#include "disk_filesystem.h"
-#include "compile_options.h"
-#include "temp_allocator.h"
-#include "sort_map.h"
 #include "lua_resource.h"
-#include "texture_resource.h"
+#include "material_resource.h"
 #include "mesh_resource.h"
+#include "os.h"
+#include "package_resource.h"
+#include "path.h"
+#include "physics_resource.h"
+#include "shader_resource.h"
+#include "sort_map.h"
 #include "sound_resource.h"
 #include "sprite_resource.h"
-#include "package_resource.h"
+#include "temp_allocator.h"
+#include "texture_resource.h"
 #include "unit_resource.h"
-#include "physics_resource.h"
-#include "material_resource.h"
-#include "font_resource.h"
-#include "level_resource.h"
-#include "shader.h"
-#include "config_resource.h"
+#include "vector.h"
 #include <setjmp.h>
 
 namespace crown

+ 12 - 12
src/resource/resource_manager.cpp

@@ -3,24 +3,24 @@
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  */
 
-#include "resource_manager.h"
-#include "resource_loader.h"
-#include "temp_allocator.h"
-#include "sort_map.h"
 #include "array.h"
+#include "config_resource.h"
+#include "font_resource.h"
+#include "level_resource.h"
 #include "lua_resource.h"
-#include "texture_resource.h"
+#include "material_resource.h"
 #include "mesh_resource.h"
+#include "package_resource.h"
+#include "physics_resource.h"
+#include "resource_loader.h"
+#include "resource_manager.h"
+#include "shader_resource.h"
+#include "sort_map.h"
 #include "sound_resource.h"
 #include "sprite_resource.h"
-#include "package_resource.h"
+#include "temp_allocator.h"
+#include "texture_resource.h"
 #include "unit_resource.h"
-#include "physics_resource.h"
-#include "material_resource.h"
-#include "font_resource.h"
-#include "level_resource.h"
-#include "shader.h"
-#include "config_resource.h"
 
 namespace crown
 {

+ 3 - 3
src/resource/resource_manager.h

@@ -5,12 +5,12 @@
 
 #pragma once
 
-#include "types.h"
 #include "container_types.h"
-#include "resource_types.h"
+#include "filesystem_types.h"
 #include "proxy_allocator.h"
+#include "resource_types.h"
 #include "string_id.h"
-#include "filesystem_types.h"
+#include "types.h"
 
 namespace crown
 {

+ 12 - 11
src/resource/resource_types.h

@@ -5,61 +5,64 @@
 
 #pragma once
 
+#define CONFIG_EXTENSION           "config"
 #define FONT_EXTENSION             "font"
 #define LEVEL_EXTENSION            "level"
-#define SCRIPT_EXTENSION           "lua"
 #define MATERIAL_EXTENSION         "material"
 #define MESH_EXTENSION             "mesh"
 #define PACKAGE_EXTENSION          "package"
 #define PHYSICS_CONFIG_EXTENSION   "physics_config"
 #define PHYSICS_EXTENSION          "physics"
+#define SCRIPT_EXTENSION           "lua"
 #define SHADER_EXTENSION           "shader"
 #define SOUND_EXTENSION            "sound"
 #define SPRITE_ANIMATION_EXTENSION "sprite_animation"
 #define SPRITE_EXTENSION           "sprite"
 #define TEXTURE_EXTENSION          "texture"
 #define UNIT_EXTENSION             "unit"
-#define CONFIG_EXTENSION           "config"
 
+#define CONFIG_TYPE                StringId64(0x82645835e6b73232)
 #define FONT_TYPE                  StringId64(0x9efe0a916aae7880)
 #define LEVEL_TYPE                 StringId64(0x2a690fd348fe9ac5)
-#define SCRIPT_TYPE                StringId64(0xa14e8dfa2cd117e2)
 #define MATERIAL_TYPE              StringId64(0xeac0b497876adedf)
 #define MESH_TYPE                  StringId64(0x48ff313713a997a1)
 #define PACKAGE_TYPE               StringId64(0xad9c6d9ed1e5e77a)
 #define PHYSICS_CONFIG_TYPE        StringId64(0x72e3cc03787a11a1)
 #define PHYSICS_TYPE               StringId64(0x5f7203c8f280dab8)
+#define SCRIPT_TYPE                StringId64(0xa14e8dfa2cd117e2)
 #define SHADER_TYPE                StringId64(0xcce8d5b5f5ae333f)
 #define SOUND_TYPE                 StringId64(0x90641b51c98b7aac)
 #define SPRITE_ANIMATION_TYPE      StringId64(0x487e78e3f87f238d)
 #define SPRITE_TYPE                StringId64(0x8d5871f9ebdb651c)
 #define TEXTURE_TYPE               StringId64(0xcd4238c6a0c69e32)
 #define UNIT_TYPE                  StringId64(0xe0a48d0be9a7453f)
-#define CONFIG_TYPE                StringId64(0x82645835e6b73232)
 
+#define CONFIG_VERSION             uint32_t(1)
 #define FONT_VERSION               uint32_t(1)
 #define LEVEL_VERSION              uint32_t(1)
-#define SCRIPT_VERSION             uint32_t(1)
 #define MATERIAL_VERSION           uint32_t(1)
 #define MESH_VERSION               uint32_t(1)
 #define PACKAGE_VERSION            uint32_t(1)
 #define PHYSICS_CONFIG_VERSION     uint32_t(1)
 #define PHYSICS_VERSION            uint32_t(1)
+#define SCRIPT_VERSION             uint32_t(1)
 #define SHADER_VERSION             uint32_t(1)
 #define SOUND_VERSION              uint32_t(1)
 #define SPRITE_ANIMATION_VERSION   uint32_t(1)
 #define SPRITE_VERSION             uint32_t(1)
 #define TEXTURE_VERSION            uint32_t(1)
 #define UNIT_VERSION               uint32_t(1)
-#define CONFIG_VERSION             uint32_t(1)
 
 namespace crown
 {
-	class ResourceManager;
 	class ResourceLoader;
+	class ResourceManager;
 	struct ResourcePackage;
 
+	struct ActorResource;
+	struct ControllerResource;
 	struct FontResource;
+	struct JointResource;
 	struct LevelResource;
 	struct LuaResource;
 	struct MaterialResource;
@@ -67,13 +70,11 @@ namespace crown
 	struct PackageResource;
 	struct PhysicsConfigResource;
 	struct PhysicsResource;
+	struct ShaderResource;
+	struct ShapeResource;
 	struct SoundResource;
 	struct SpriteAnimationResource;
 	struct SpriteResource;
 	struct TextureResource;
 	struct UnitResource;
-	struct ActorResource;
-	struct ShapeResource;
-	struct JointResource;
-	struct ControllerResource;
 } // namespace crown

+ 7 - 7
src/world/shader.cpp → src/resource/shader_resource.cpp

@@ -3,18 +3,18 @@
  * License: https://github.com/taylor001/crown/blob/master/LICENSE
  */
 
-#include "shader.h"
+#include "compile_options.h"
 #include "config.h"
+#include "device.h"
 #include "filesystem.h"
+#include "map.h"
 #include "os.h"
 #include "resource_manager.h"
-#include "compile_options.h"
-#include "temp_allocator.h"
-#include "string_stream.h"
-#include "sjson.h"
-#include "map.h"
 #include "shader_manager.h"
-#include "device.h"
+#include "shader_resource.h"
+#include "sjson.h"
+#include "string_stream.h"
+#include "temp_allocator.h"
 
 #if CROWN_DEBUG
 #	define SHADERC_NAME "shaderc-debug-"

+ 0 - 0
src/world/shader.h → src/resource/shader_resource.h


+ 1 - 1
src/world/shader_manager.cpp

@@ -6,8 +6,8 @@
 #include "array.h"
 #include "reader_writer.h"
 #include "resource_manager.h"
-#include "shader.h"
 #include "shader_manager.h"
+#include "shader_resource.h"
 #include "sort_map.h"
 #include "string_utils.h"