Trying to fix stuff
This commit is contained in:
parent
17445e04af
commit
768ff7d0d5
32
imgui.ini
32
imgui.ini
@ -1,6 +1,6 @@
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1920,1177
|
||||
Size=1280,720
|
||||
Collapsed=0
|
||||
|
||||
[Window][Debug##Default]
|
||||
@ -68,32 +68,32 @@ Size=1920,1177
|
||||
Collapsed=0
|
||||
|
||||
[Window][Inspector##InspectorWindow]
|
||||
Pos=1536,27
|
||||
Size=376,1142
|
||||
Pos=896,27
|
||||
Size=376,685
|
||||
Collapsed=0
|
||||
DockId=0x00000016,0
|
||||
|
||||
[Window][Editor##EditorWindow]
|
||||
Pos=410,27
|
||||
Size=1124,709
|
||||
Pos=523,27
|
||||
Size=371,252
|
||||
Collapsed=0
|
||||
DockId=0x00000017,0
|
||||
|
||||
[Window][Performance##performance]
|
||||
Pos=8,761
|
||||
Size=400,408
|
||||
Pos=8,468
|
||||
Size=513,244
|
||||
Collapsed=0
|
||||
DockId=0x0000001C,0
|
||||
|
||||
[Window][Logger##logger]
|
||||
Pos=8,395
|
||||
Size=400,364
|
||||
Pos=8,248
|
||||
Size=513,218
|
||||
Collapsed=0
|
||||
DockId=0x0000001A,0
|
||||
|
||||
[Window][Lua Text Editor##LuaEditor]
|
||||
Pos=410,738
|
||||
Size=1124,431
|
||||
Pos=523,281
|
||||
Size=371,431
|
||||
Collapsed=0
|
||||
DockId=0x00000018,0
|
||||
|
||||
@ -105,7 +105,7 @@ DockId=0x0000000F,0
|
||||
|
||||
[Window][Scene Window##SceneWindow]
|
||||
Pos=8,27
|
||||
Size=400,366
|
||||
Size=513,219
|
||||
Collapsed=0
|
||||
DockId=0x00000019,0
|
||||
|
||||
@ -128,14 +128,14 @@ Column 2 Weight=0.6474
|
||||
Column 3 Weight=1.0088
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0x14621557 Window=0x3DA2F1DE Pos=8,50 Size=1904,1142 Split=X Selected=0xF7365A5A
|
||||
DockNode ID=0x00000013 Parent=0x14621557 SizeRef=400,1142 Split=Y Selected=0x818D04BB
|
||||
DockSpace ID=0x14621557 Window=0x3DA2F1DE Pos=94,136 Size=1264,685 Split=X Selected=0xF7365A5A
|
||||
DockNode ID=0x00000013 Parent=0x14621557 SizeRef=513,1142 Split=Y Selected=0x818D04BB
|
||||
DockNode ID=0x0000001B Parent=0x00000013 SizeRef=264,456 Split=Y Selected=0x1D5D92B6
|
||||
DockNode ID=0x00000019 Parent=0x0000001B SizeRef=264,366 HiddenTabBar=1 Selected=0x1D5D92B6
|
||||
DockNode ID=0x0000001A Parent=0x0000001B SizeRef=264,364 HiddenTabBar=1 Selected=0x1C0788A1
|
||||
DockNode ID=0x0000001C Parent=0x00000013 SizeRef=264,254 HiddenTabBar=1 Selected=0x818D04BB
|
||||
DockNode ID=0x00000014 Parent=0x14621557 SizeRef=862,1142 Split=X
|
||||
DockNode ID=0x00000015 Parent=0x00000014 SizeRef=484,1142 Split=X
|
||||
DockNode ID=0x00000014 Parent=0x14621557 SizeRef=749,1142 Split=X
|
||||
DockNode ID=0x00000015 Parent=0x00000014 SizeRef=371,1142 Split=X
|
||||
DockNode ID=0x00000011 Parent=0x00000015 SizeRef=265,1142 Selected=0x1D5D92B6
|
||||
DockNode ID=0x00000012 Parent=0x00000015 SizeRef=1259,1142 Split=X
|
||||
DockNode ID=0x00000009 Parent=0x00000012 SizeRef=364,1142 Split=Y Selected=0x3DC5AC3F
|
||||
|
@ -7,157 +7,158 @@ Entities:
|
||||
Rotation: [0, -90, 0]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
MeshPath: assets/models/sponza.obj
|
||||
submeshes_len: 26
|
||||
submeshes:
|
||||
- vao: 3
|
||||
- vao: 2
|
||||
indexCount: 43452
|
||||
textures:
|
||||
- id: 30
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_roof_diff.tga
|
||||
- vao: 4
|
||||
indexCount: 27552
|
||||
textures:
|
||||
- id: 31
|
||||
type: texture_diffuse
|
||||
path: textures/vase_dif.tga
|
||||
- vao: 5
|
||||
indexCount: 33024
|
||||
textures:
|
||||
- id: 21
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_fabric_diff.tga
|
||||
- vao: 6
|
||||
indexCount: 54
|
||||
textures: ~
|
||||
- vao: 7
|
||||
indexCount: 12258
|
||||
textures:
|
||||
- id: 11
|
||||
type: texture_diffuse
|
||||
path: textures/background.tga
|
||||
- vao: 8
|
||||
indexCount: 10416
|
||||
textures:
|
||||
- id: 12
|
||||
type: texture_diffuse
|
||||
path: textures/vase_plant.tga
|
||||
- vao: 9
|
||||
indexCount: 49536
|
||||
textures:
|
||||
- id: 23
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_fabric_blue_diff.tga
|
||||
- vao: 10
|
||||
indexCount: 94308
|
||||
textures:
|
||||
- id: 29
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_thorn_diff.tga
|
||||
- vao: 11
|
||||
indexCount: 49536
|
||||
textures:
|
||||
- id: 24
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_fabric_green_diff.tga
|
||||
- vao: 12
|
||||
indexCount: 17628
|
||||
textures:
|
||||
- id: 15
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_ceiling_a_diff.tga
|
||||
- vao: 13
|
||||
indexCount: 30504
|
||||
textures:
|
||||
- id: 13
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_arch_diff.tga
|
||||
- vao: 14
|
||||
indexCount: 53064
|
||||
textures:
|
||||
- id: 33
|
||||
type: texture_diffuse
|
||||
path: textures/vase_round.tga
|
||||
- vao: 15
|
||||
indexCount: 69624
|
||||
textures:
|
||||
- id: 18
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_column_b_diff.tga
|
||||
- vao: 16
|
||||
indexCount: 2640
|
||||
textures:
|
||||
- id: 20
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_details_diff.tga
|
||||
- vao: 17
|
||||
indexCount: 43008
|
||||
textures:
|
||||
- id: 26
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_curtain_blue_diff.tga
|
||||
- vao: 18
|
||||
indexCount: 0
|
||||
textures: ~
|
||||
- vao: 19
|
||||
indexCount: 2388
|
||||
textures:
|
||||
- id: 14
|
||||
type: texture_diffuse
|
||||
path: textures/spnza_bricks_a_diff.tga
|
||||
- vao: 20
|
||||
indexCount: 21264
|
||||
textures:
|
||||
- id: 19
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_column_c_diff.tga
|
||||
- vao: 21
|
||||
indexCount: 63
|
||||
textures:
|
||||
- id: 28
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_floor_a_diff.tga
|
||||
- vao: 22
|
||||
indexCount: 43008
|
||||
path: textures/sponza_roof_diff.tga
|
||||
- vao: 3
|
||||
indexCount: 27552
|
||||
textures:
|
||||
- id: 25
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_curtain_green_diff.tga
|
||||
- vao: 23
|
||||
indexCount: 9126
|
||||
path: textures/vase_dif.tga
|
||||
- vao: 4
|
||||
indexCount: 33024
|
||||
textures:
|
||||
- id: 10
|
||||
- id: 15
|
||||
type: texture_diffuse
|
||||
path: textures/lion.tga
|
||||
- vao: 24
|
||||
indexCount: 96
|
||||
path: textures/sponza_fabric_diff.tga
|
||||
- vao: 5
|
||||
indexCount: 54
|
||||
textures: ~
|
||||
- vao: 6
|
||||
indexCount: 12258
|
||||
textures:
|
||||
- id: 16
|
||||
- id: 5
|
||||
type: texture_diffuse
|
||||
path: textures/chain_texture.tga
|
||||
- vao: 25
|
||||
indexCount: 56832
|
||||
path: textures/background.tga
|
||||
- vao: 7
|
||||
indexCount: 10416
|
||||
textures:
|
||||
- id: 22
|
||||
- id: 6
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_curtain_diff.tga
|
||||
- vao: 26
|
||||
indexCount: 8448
|
||||
path: textures/vase_plant.tga
|
||||
- vao: 8
|
||||
indexCount: 49536
|
||||
textures:
|
||||
- id: 17
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_column_a_diff.tga
|
||||
- vao: 27
|
||||
indexCount: 49488
|
||||
path: textures/sponza_fabric_blue_diff.tga
|
||||
- vao: 9
|
||||
indexCount: 94308
|
||||
textures:
|
||||
- id: 23
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_thorn_diff.tga
|
||||
- vao: 10
|
||||
indexCount: 49536
|
||||
textures:
|
||||
- id: 18
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_fabric_green_diff.tga
|
||||
- vao: 11
|
||||
indexCount: 17628
|
||||
textures:
|
||||
- id: 9
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_ceiling_a_diff.tga
|
||||
- vao: 12
|
||||
indexCount: 30504
|
||||
textures:
|
||||
- id: 7
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_arch_diff.tga
|
||||
- vao: 13
|
||||
indexCount: 53064
|
||||
textures:
|
||||
- id: 27
|
||||
type: texture_diffuse
|
||||
path: textures/vase_round.tga
|
||||
- vao: 14
|
||||
indexCount: 69624
|
||||
textures:
|
||||
- id: 12
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_column_b_diff.tga
|
||||
- vao: 15
|
||||
indexCount: 2640
|
||||
textures:
|
||||
- id: 14
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_details_diff.tga
|
||||
- vao: 16
|
||||
indexCount: 43008
|
||||
textures:
|
||||
- id: 20
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_curtain_blue_diff.tga
|
||||
- vao: 17
|
||||
indexCount: 0
|
||||
textures: ~
|
||||
- vao: 18
|
||||
indexCount: 2388
|
||||
textures:
|
||||
- id: 8
|
||||
type: texture_diffuse
|
||||
path: textures/spnza_bricks_a_diff.tga
|
||||
- vao: 19
|
||||
indexCount: 21264
|
||||
textures:
|
||||
- id: 13
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_column_c_diff.tga
|
||||
- vao: 20
|
||||
indexCount: 63
|
||||
textures:
|
||||
- id: 22
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_floor_a_diff.tga
|
||||
- vao: 21
|
||||
indexCount: 43008
|
||||
textures:
|
||||
- id: 19
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_curtain_green_diff.tga
|
||||
- vao: 22
|
||||
indexCount: 9126
|
||||
textures:
|
||||
- id: 4
|
||||
type: texture_diffuse
|
||||
path: textures/lion.tga
|
||||
- vao: 23
|
||||
indexCount: 96
|
||||
textures:
|
||||
- id: 10
|
||||
type: texture_diffuse
|
||||
path: textures/chain_texture.tga
|
||||
- vao: 24
|
||||
indexCount: 56832
|
||||
textures:
|
||||
- id: 16
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_curtain_diff.tga
|
||||
- vao: 25
|
||||
indexCount: 8448
|
||||
textures:
|
||||
- id: 11
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_column_a_diff.tga
|
||||
- vao: 26
|
||||
indexCount: 49488
|
||||
textures:
|
||||
- id: 21
|
||||
type: texture_diffuse
|
||||
path: textures/sponza_flagpole_diff.tga
|
||||
- vao: 28
|
||||
- vao: 27
|
||||
indexCount: 59484
|
||||
textures:
|
||||
- id: 32
|
||||
- id: 26
|
||||
type: texture_diffuse
|
||||
path: textures/vase_hanging.tga
|
||||
MeshPath: assets/models/sponza.obj
|
||||
ScriptComponent:
|
||||
ScriptPath: assets/scripts/BouncingItem.lua
|
@ -4,8 +4,10 @@
|
||||
#include "gcml.h"
|
||||
|
||||
#include "../Engine/AssetManager.h"
|
||||
#include "Windows/LoggerWindow.h"
|
||||
|
||||
extern AssetManager g_AssetManager;
|
||||
extern LoggerWindow *g_LoggerWindow;
|
||||
|
||||
const std::string MeshComponent::name = "Mesh";
|
||||
|
||||
@ -30,9 +32,7 @@ void MeshComponent::Update(float deltaTime)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MeshComponent::Draw(Shader* shader)
|
||||
void MeshComponent::Draw(Shader *shader)
|
||||
{
|
||||
for (auto &submesh : submeshes)
|
||||
{
|
||||
@ -40,14 +40,11 @@ void MeshComponent::Draw(Shader* shader)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
YAML::Node MeshComponent::Serialize()
|
||||
{
|
||||
YAML::Node node;
|
||||
|
||||
// Serialize each submesh
|
||||
node["MeshPath"] = MeshPath;
|
||||
|
||||
YAML::Node submeshesNode;
|
||||
for (const auto &submesh : submeshes)
|
||||
{
|
||||
@ -69,14 +66,20 @@ YAML::Node MeshComponent::Serialize()
|
||||
|
||||
submeshesNode.push_back(submeshNode);
|
||||
}
|
||||
node["MeshPath"] = MeshPath;
|
||||
node["submeshes_len"] = submeshes.size();
|
||||
node["submeshes"] = submeshesNode;
|
||||
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
void MeshComponent::Deserialize(const YAML::Node &node)
|
||||
{
|
||||
int submeshes_len = 0;
|
||||
if (node["submeshes_len"])
|
||||
{
|
||||
submeshes_len = node["submeshes_len"].as<int>();
|
||||
}
|
||||
if (node["MeshPath"])
|
||||
{
|
||||
MeshPath = node["MeshPath"].as<std::string>();
|
||||
@ -93,6 +96,11 @@ void MeshComponent::Deserialize(const YAML::Node &node)
|
||||
|
||||
DEBUG_PRINT("Model loaded successfully with %zu submeshes.", model->submeshes.size());
|
||||
|
||||
if (submeshes_len != static_cast<int>(model->submeshes.size()))
|
||||
{
|
||||
g_LoggerWindow->AddLog("[Mesh] Size Mismatch [%d:%d]: Check for Curupted Scene Files", submeshes_len, static_cast<int>(submeshes.size()));
|
||||
}
|
||||
|
||||
// Assign submeshes
|
||||
submeshes = std::move(model->submeshes);
|
||||
}
|
||||
@ -128,9 +136,12 @@ void MeshComponent::Deserialize(const YAML::Node &node)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
submeshes.push_back(std::move(submesh));
|
||||
}
|
||||
if (submeshes_len != static_cast<int>(submeshes.size()))
|
||||
{
|
||||
g_LoggerWindow->AddLog("[Mesh] Size Mismatch [%d:%d]: Check for Curupted Scene Files", submeshes_len, static_cast<int>(submeshes.size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -235,6 +235,6 @@ private:
|
||||
std::unordered_map<std::string, AssetVariant> m_AssetMap;
|
||||
|
||||
AssetVariant loadAssetFromDisk(AssetType type, const std::string &path);
|
||||
// Generate the unique key
|
||||
// Generate the Key for each file
|
||||
std::string generateKey(AssetType type, const std::string &path);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user