forked from Shell4026/ShellEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditorResource.cpp
More file actions
37 lines (32 loc) · 1.07 KB
/
Copy pathEditorResource.cpp
File metadata and controls
37 lines (32 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "Game/PCH.h"
#include "EditorResource.h"
#include "EditorWorld.h"
#include "Game/TextureLoader.h"
#include "Game/ModelLoader.h"
namespace sh::editor
{
SH_EDITOR_API void EditorResource::LoadAllAssets(EditorWorld& world)
{
game::TextureLoader texLoader{ world.renderer };
folderIcon.Create(world.renderer, *world.textures.AddResource("FolderIcon", texLoader.Load("textures/folder.png")));
fileIcon.Create(world.renderer, *world.textures.AddResource("FileIcon", texLoader.Load("textures/file.png")));
meshIcon.Create(world.renderer, *world.textures.AddResource("MeshIcon", texLoader.Load("textures/meshIcon.png")));
materialIcon.Create(world.renderer, *world.textures.AddResource("MaterialIcon", texLoader.Load("textures/MaterialIcon.png")));
}
SH_EDITOR_API auto EditorResource::GetIcon(Icon icon) const -> const game::GUITexture*
{
switch (icon)
{
case Icon::Folder:
return &folderIcon;
case Icon::File:
return &fileIcon;
case Icon::Mesh:
return &meshIcon;
case Icon::Material:
return &materialIcon;
default:
return nullptr;
}
}
}