From 19c342b921ab21dd06b00e2b4948fa8e7ce9e1eb Mon Sep 17 00:00:00 2001 From: Chewico Date: Tue, 9 Dec 2025 10:19:44 +0100 Subject: [PATCH] Improving visuals and icons --- .../AngelScriptEngine/Registers/Entity.cpp | 12 +- .../Registers/Environment.cpp | 2 +- .../Registers/FrameBuffer.cpp | 2 +- .../AngelScriptEngine/Registers/Resource.cpp | 18 +- .../AngelScriptEngine/Registers/UI.cpp | 8 +- DeerStudio/src/DeerStudio/Fonts.cpp | 7 +- .../src/DeerStudio/StudioAPI/FrameBuffer.cpp | 1 - Editor/Modules/ActiveEntity/ActiveEntity.as | 2 +- Editor/Modules/ActiveEntity/as.predefined | 38 +- .../EntityManipulation/AddComponent.as | 14 +- .../EntityManipulation/PropertiesPannel.as | 14 +- .../EntityManipulation/ShaderProperties.as | 2 +- .../Modules/EntityManipulation/as.predefined | 38 +- Editor/Modules/Previewer/MeshPreview.as | 7 + Editor/Modules/Previewer/as.predefined | 405 ++++++++++++++++++ Editor/Modules/ResourceExplorer/IconRender.as | 2 +- .../ResourceExplorer/ResourceExplorer.as | 2 +- Editor/Modules/ResourceExplorer/as.predefined | 38 +- Editor/Modules/TreeExplorer/as.predefined | 38 +- Editor/Modules/Viewport/Viewport.as | 4 +- Editor/Modules/Viewport/as.predefined | 40 +- .../EntityManipulation/ShaderProperties.as | 2 +- .../Panels/EntityManipulation/as.predefined | 48 +-- Editor/Panels/ResourceExplorer/IconRender.as | 2 +- .../ResourceExplorer/ResourceExplorer.as | 4 +- Editor/Panels/ResourceExplorer/as.predefined | 48 +-- Editor/Panels/TreeExplorer/as.predefined | 48 +-- Editor/Panels/Viewport/as.predefined | 48 +-- Editor/Services/ActiveEntity/as.predefined | 24 +- imgui.ini | 2 +- 30 files changed, 667 insertions(+), 253 deletions(-) create mode 100644 Editor/Modules/Previewer/MeshPreview.as create mode 100644 Editor/Modules/Previewer/as.predefined diff --git a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Entity.cpp b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Entity.cpp index 283d67d..fe7d157 100644 --- a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Entity.cpp +++ b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Entity.cpp @@ -62,8 +62,8 @@ namespace Deer { REGISTER_OBJECT_METHOD("MeshComponent", "bool get_isActive() const property", StudioAPI::MeshComponentStruct, isActive); REGISTER_OBJECT_METHOD("MeshComponent", "bool get_hasMesh() const property", StudioAPI::MeshComponentStruct, hasMesh); REGISTER_OBJECT_METHOD("MeshComponent", "void clear()", StudioAPI::MeshComponentStruct, clear); - REGISTER_OBJECT_METHOD("MeshComponent", "GPUMeshResource get_meshResource() property", StudioAPI::MeshComponentStruct, getMesh); - REGISTER_OBJECT_METHOD("MeshComponent", "void set_meshResource(GPUMeshResource) property", StudioAPI::MeshComponentStruct, setMesh); + REGISTER_OBJECT_METHOD("MeshComponent", "GPUMesh get_meshResource() property", StudioAPI::MeshComponentStruct, getMesh); + REGISTER_OBJECT_METHOD("MeshComponent", "void set_meshResource(GPUMesh) property", StudioAPI::MeshComponentStruct, setMesh); REGISTER_OBJECT_METHOD("MeshComponent", "void set_isActive(const bool) const property", StudioAPI::MeshComponentStruct, setActive); } @@ -81,11 +81,11 @@ namespace Deer { REGISTER_OBJECT_METHOD("ShaderComponent", "bool get_hasShader() const property", StudioAPI::ShaderComponentStruct, hasShader); REGISTER_OBJECT_METHOD("ShaderComponent", "void clear()", StudioAPI::ShaderComponentStruct, clear); - REGISTER_OBJECT_METHOD("ShaderComponent", "ShaderResource get_shader() const property", StudioAPI::ShaderComponentStruct, getShader); - REGISTER_OBJECT_METHOD("ShaderComponent", "void set_shader(ShaderResource) property", StudioAPI::ShaderComponentStruct, setShader); + REGISTER_OBJECT_METHOD("ShaderComponent", "Shader get_shader() const property", StudioAPI::ShaderComponentStruct, getShader); + REGISTER_OBJECT_METHOD("ShaderComponent", "void set_shader(Shader) property", StudioAPI::ShaderComponentStruct, setShader); - REGISTER_OBJECT_METHOD("ShaderComponent", "TextureResource get_texture() const property", StudioAPI::ShaderComponentStruct, getTexture); - REGISTER_OBJECT_METHOD("ShaderComponent", "void set_texture(TextureResource) property", StudioAPI::ShaderComponentStruct, setTexture); + REGISTER_OBJECT_METHOD("ShaderComponent", "Texture get_texture() const property", StudioAPI::ShaderComponentStruct, getTexture); + REGISTER_OBJECT_METHOD("ShaderComponent", "void set_texture(Texture) property", StudioAPI::ShaderComponentStruct, setTexture); } void AngelScriptEngine::registerComponentComponentFunctions() { diff --git a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Environment.cpp b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Environment.cpp index 0d0609f..6dbd805 100644 --- a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Environment.cpp +++ b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Environment.cpp @@ -10,7 +10,7 @@ namespace Deer { } void AngelScriptEngine::registerEnvironmentFunctions() { - scriptEngine->SetDefaultNamespace("Engine"); + scriptEngine->SetDefaultNamespace("Resource"); REGISTER_GLOBAL_FUNC("Environment getMainEnvironment()", StudioAPI::getMainEnvironment); REGISTER_GLOBAL_FUNC("Environment createLoadEnvironment(const string&in envId)", StudioAPI::createLoadEnvironment); scriptEngine->SetDefaultNamespace(""); diff --git a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/FrameBuffer.cpp b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/FrameBuffer.cpp index cdc8e24..98d152c 100644 --- a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/FrameBuffer.cpp +++ b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/FrameBuffer.cpp @@ -14,7 +14,7 @@ namespace Deer { REGISTER_OBJECT_METHOD("FrameBuffer", "bool isValid()", StudioAPI::FrameBufferStruct, isValid); REGISTER_EXT_OBJECT_CONSTRUCTOR("FrameBuffer", "void f()", StudioAPI::frameBuffer_constructor); - scriptEngine->SetDefaultNamespace("Engine"); + scriptEngine->SetDefaultNamespace("Resource"); REGISTER_GLOBAL_FUNC("FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4)", StudioAPI::createLoadRGBA8FrameBuffer); scriptEngine->SetDefaultNamespace(""); } diff --git a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Resource.cpp b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Resource.cpp index cfe7850..2e784e6 100644 --- a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Resource.cpp +++ b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/Resource.cpp @@ -16,9 +16,9 @@ namespace Deer { void AngelScriptEngine::registerResourceStructs() { scriptEngine->SetDefaultNamespace(""); - AS_CHECK(scriptEngine->RegisterObjectType("GPUMeshResource", sizeof(StudioAPI::APIResource), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_ALLINTS | asGetTypeTraits>())); - AS_CHECK(scriptEngine->RegisterObjectType("ShaderResource", sizeof(StudioAPI::APIResource), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_ALLINTS | asGetTypeTraits>())); - AS_CHECK(scriptEngine->RegisterObjectType("TextureResource", sizeof(StudioAPI::APIResource), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_ALLINTS | asGetTypeTraits>())); + AS_CHECK(scriptEngine->RegisterObjectType("GPUMesh", sizeof(StudioAPI::APIResource), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_ALLINTS | asGetTypeTraits>())); + AS_CHECK(scriptEngine->RegisterObjectType("Shader", sizeof(StudioAPI::APIResource), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_ALLINTS | asGetTypeTraits>())); + AS_CHECK(scriptEngine->RegisterObjectType("Texture", sizeof(StudioAPI::APIResource), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_ALLINTS | asGetTypeTraits>())); scriptEngine->SetDefaultNamespace(""); scriptEngine->RegisterEnum("ResourceType"); @@ -29,14 +29,14 @@ namespace Deer { } void AngelScriptEngine::registerResourceFunctions() { - registerResourceBasics("GPUMeshResource"); - registerResourceBasics("ShaderResource"); - registerResourceBasics("TextureResource"); + registerResourceBasics("GPUMesh"); + registerResourceBasics("Shader"); + registerResourceBasics("Texture"); scriptEngine->SetDefaultNamespace("Resource"); - REGISTER_GLOBAL_FUNC("GPUMeshResource loadGPUMesh(string&in path)", ResourceManager::loadResource); - REGISTER_GLOBAL_FUNC("ShaderResource loadShader(string&in path)", ResourceManager::loadResource); - REGISTER_GLOBAL_FUNC("TextureResource loadTexture(string&in path)", ResourceManager::loadResource); + REGISTER_GLOBAL_FUNC("GPUMesh loadGPUMesh(string&in path)", ResourceManager::loadResource); + REGISTER_GLOBAL_FUNC("Shader loadShader(string&in path)", ResourceManager::loadResource); + REGISTER_GLOBAL_FUNC("Texture loadTexture(string&in path)", ResourceManager::loadResource); REGISTER_GLOBAL_FUNC("array@ getResourceFolders(string&in path)", StudioAPI::getResourceFolders); REGISTER_GLOBAL_FUNC("array@ getResourceFiles(string&in path)", StudioAPI::getResourceFiles); diff --git a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/UI.cpp b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/UI.cpp index e08d006..2c1233c 100644 --- a/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/UI.cpp +++ b/DeerStudio/src/DeerStudio/AngelScriptEngine/Registers/UI.cpp @@ -57,10 +57,10 @@ namespace Deer { REGISTER_GLOBAL_FUNC("void drawIconHighlight(const string& in, int)", StudioAPI::drawIconHighlight); REGISTER_GLOBAL_FUNC("void drawIconCenteredHighlight(const string& in, int)", StudioAPI::drawIconCenteredHighlight); - REGISTER_GLOBAL_FUNC("void drawIcon(TextureResource texture, int)", StudioAPI::drawIcon_resource); - REGISTER_GLOBAL_FUNC("void drawIconCentered(TextureResource texture, int)", StudioAPI::drawIconCentered_resource); - REGISTER_GLOBAL_FUNC("void drawIconHighlight(TextureResource texture, int)", StudioAPI::drawIconHighlight_resource); - REGISTER_GLOBAL_FUNC("void drawIconCenteredHighlight(TextureResource texture, int)", StudioAPI::drawIconCenteredHighlight_resource); + REGISTER_GLOBAL_FUNC("void drawIcon(Texture texture, int)", StudioAPI::drawIcon_resource); + REGISTER_GLOBAL_FUNC("void drawIconCentered(Texture texture, int)", StudioAPI::drawIconCentered_resource); + REGISTER_GLOBAL_FUNC("void drawIconHighlight(Texture texture, int)", StudioAPI::drawIconHighlight_resource); + REGISTER_GLOBAL_FUNC("void drawIconCenteredHighlight(Texture texture, int)", StudioAPI::drawIconCenteredHighlight_resource); // Input state REGISTER_GLOBAL_FUNC("bool isKeyDown(key)", StudioAPI::isKeyDown); diff --git a/DeerStudio/src/DeerStudio/Fonts.cpp b/DeerStudio/src/DeerStudio/Fonts.cpp index fb9fc1c..8cc92d9 100644 --- a/DeerStudio/src/DeerStudio/Fonts.cpp +++ b/DeerStudio/src/DeerStudio/Fonts.cpp @@ -11,6 +11,7 @@ namespace Deer { Path rfPath = "Editor/fonts/Roboto-Regular.ttf"; Path faPath = "Editor/fonts/FontAwesome.otf"; + Path faNPath = "Editor/fonts/FontAwesome-Normal.otf"; ImFontConfig cnfg; // cnfg.SizePixels = 26 normalText = io.Fonts->AddFontFromFileTTF(rfPath.generic_string().c_str(), 18); @@ -27,6 +28,7 @@ namespace Deer { cfg.GlyphRanges = icons_ranges; cfg.GlyphMinAdvanceX = 18.0f; io.Fonts->AddFontFromFileTTF(faPath.generic_string().c_str(), 14, &cfg); + io.Fonts->AddFontFromFileTTF(faNPath.generic_string().c_str(), 14, &cfg); } titleText = io.Fonts->AddFontFromFileTTF(rfPath.generic_string().c_str(), 32); @@ -35,8 +37,9 @@ namespace Deer { ImFontConfig cfg; cfg.MergeMode = true; cfg.GlyphRanges = icons_ranges; - cfg.GlyphMinAdvanceX = 32.0f; - io.Fonts->AddFontFromFileTTF(faPath.generic_string().c_str(), 32, &cfg); + cfg.GlyphMinAdvanceX = 20.0f; + io.Fonts->AddFontFromFileTTF(faPath.generic_string().c_str(), 20, &cfg); + io.Fonts->AddFontFromFileTTF(faNPath.generic_string().c_str(), 20, &cfg); } diff --git a/DeerStudio/src/DeerStudio/StudioAPI/FrameBuffer.cpp b/DeerStudio/src/DeerStudio/StudioAPI/FrameBuffer.cpp index c1d2c6b..59f4159 100644 --- a/DeerStudio/src/DeerStudio/StudioAPI/FrameBuffer.cpp +++ b/DeerStudio/src/DeerStudio/StudioAPI/FrameBuffer.cpp @@ -51,7 +51,6 @@ namespace Deer { } bool FrameBufferStruct::isValid() { - DEER_CORE_TRACE("{} fbid", frameBufferId); return frameBufferId >= 0 && frameBufferId < 100; } } // namespace StudioAPI diff --git a/Editor/Modules/ActiveEntity/ActiveEntity.as b/Editor/Modules/ActiveEntity/ActiveEntity.as index d79737d..5607143 100644 --- a/Editor/Modules/ActiveEntity/ActiveEntity.as +++ b/Editor/Modules/ActiveEntity/ActiveEntity.as @@ -1,4 +1,4 @@ -Entity entity = Engine::getMainEnvironment().getRootEntity(); +Entity entity = Resource::getMainEnvironment().getRootEntity(); Entity getActiveEntity() { return entity; } diff --git a/Editor/Modules/ActiveEntity/as.predefined b/Editor/Modules/ActiveEntity/as.predefined index 0fd4352..40b097e 100644 --- a/Editor/Modules/ActiveEntity/as.predefined +++ b/Editor/Modules/ActiveEntity/as.predefined @@ -247,19 +247,19 @@ class SceneCamera { Camera camera; Transform transform; } -class GPUMeshResource { +class GPUMesh { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -313,17 +313,17 @@ class MeshComponent { bool get_isActive() const property; bool get_hasMesh() const property; void clear(); - GPUMeshResource get_meshResource() property; - void set_meshResource(GPUMeshResource) property; + GPUMesh get_meshResource() property; + void set_meshResource(GPUMesh) property; void set_isActive(const bool) const property; } class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -419,18 +419,18 @@ namespace UI { void openPopup(const string&in, any@); } namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, AnyCallback@); } -namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { GPUMesh loadGPUMesh(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } -namespace Engine { Environment getMainEnvironment(); } -namespace Engine { Environment createLoadEnvironment(const string&in envId); } +namespace Resource { Environment getMainEnvironment(); } +namespace Resource { Environment createLoadEnvironment(const string&in envId); } namespace Engine { Entity getRoot(); } namespace Engine { void print(const string&in text); } namespace Path { string getParent(const string&in path); } namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } -namespace Engine { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } +namespace Resource { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } diff --git a/Editor/Modules/EntityManipulation/AddComponent.as b/Editor/Modules/EntityManipulation/AddComponent.as index aaaddd9..b3ccd1f 100644 --- a/Editor/Modules/EntityManipulation/AddComponent.as +++ b/Editor/Modules/EntityManipulation/AddComponent.as @@ -5,7 +5,7 @@ class AddComponentRender { } void addComponentPopup() { - UI::titleCenter("Component"); + UI::titleCenter("\uf055 Add Component"); UI::separator(); UI::subMenu("Rendering", Callback(this.addComponentRendering)); if (UI::menuItem("Script Component")) { @@ -14,25 +14,25 @@ class AddComponentRender { void addComponentRendering() { if (entity.hasMeshComponent()) { - UI::menuItemDisabled("Mesh Render Component"); + UI::menuItemDisabled("\uf248 Mesh Render Component"); } else { - if (UI::menuItem("Mesh Render Component")) { + if (UI::menuItem("\uf248 Mesh Render Component")) { entity.createMeshComponent(); } } if (entity.hasShaderComponent()) { - UI::menuItemDisabled("Shader Render Component"); + UI::menuItemDisabled("\uf042 Shader Render Component"); } else { - if (UI::menuItem("Shader Render Component")) { + if (UI::menuItem("\uf042 Shader Render Component")) { entity.createShaderComponent(); } } if (entity.hasCameraComponent()) { - UI::menuItemDisabled("Camera Component"); + UI::menuItemDisabled("\uf030 Camera Component"); } else { - if (UI::menuItem("Camera Component")) { + if (UI::menuItem("\uf030 Camera Component")) { entity.createCameraComponent(); } } diff --git a/Editor/Modules/EntityManipulation/PropertiesPannel.as b/Editor/Modules/EntityManipulation/PropertiesPannel.as index 636b6ac..324b89f 100644 --- a/Editor/Modules/EntityManipulation/PropertiesPannel.as +++ b/Editor/Modules/EntityManipulation/PropertiesPannel.as @@ -11,7 +11,7 @@ class PropertiesPanel : Panel { // NAME // Id:0 [+ add component] - UI::title(entity.name); + UI::title("\uf1b2 " + entity.name); if (!entity.isRoot) UI::contextItemPopup("##MenuOptions", Callback(this.renameEntityMenu)); UI::separator(); @@ -22,35 +22,35 @@ class PropertiesPanel : Panel { return; UI::sameline(); - if (UI::buttonEnd("Add Component")) { + if (UI::buttonEnd("\uf055 Add Component")) { UI::openPopup("ADD_COMPONENT", any(entity)); } UI::space(); TransformPropertiesRender transformComponentRender(entity); - UI::componentNode("Transform Component", Callback(transformComponentRender.renderTransformComponent)); + UI::componentNode("\uf0b2 Transform Component", Callback(transformComponentRender.renderTransformComponent)); if (entity.hasMeshComponent()) { MeshComponentRender meshComponentRender(entity); - UI::componentNodeContextMenu("Mesh Component", Callback(meshComponentRender.render), Callback(meshComponentRender.remove)); + UI::componentNodeContextMenu("\uf248 Mesh Component", Callback(meshComponentRender.render), Callback(meshComponentRender.remove)); } if (entity.hasShaderComponent()) { ShaderComponentRender shaderComponentRender(entity); - UI::componentNodeContextMenu("Shader Component", Callback(shaderComponentRender.render), Callback(shaderComponentRender.remove)); + UI::componentNodeContextMenu("\uf248 Shader Component", Callback(shaderComponentRender.render), Callback(shaderComponentRender.remove)); } if (entity.hasCameraComponent()) { CameraComponentRender cameraComponentRender(entity); - UI::componentNodeContextMenu("Camera Component", Callback(cameraComponentRender.render), Callback(cameraComponentRender.remove)); + UI::componentNodeContextMenu("\uf030 Camera Component", Callback(cameraComponentRender.render), Callback(cameraComponentRender.remove)); } UI::space(); UI::separator(); - if (UI::buttonCenter("Add Component##2")) { + if (UI::buttonCenter("\uf055 Add Component##2")) { UI::openPopup("ADD_COMPONENT", any(entity)); } diff --git a/Editor/Modules/EntityManipulation/ShaderProperties.as b/Editor/Modules/EntityManipulation/ShaderProperties.as index 873cc7b..401138a 100644 --- a/Editor/Modules/EntityManipulation/ShaderProperties.as +++ b/Editor/Modules/EntityManipulation/ShaderProperties.as @@ -14,7 +14,7 @@ class ShaderComponentRender { } void setTexture(any@ texture_data) { - TextureResource texture; + Texture texture; texture_data.retrieve(texture); Engine::print(texture.name); diff --git a/Editor/Modules/EntityManipulation/as.predefined b/Editor/Modules/EntityManipulation/as.predefined index 0fd4352..40b097e 100644 --- a/Editor/Modules/EntityManipulation/as.predefined +++ b/Editor/Modules/EntityManipulation/as.predefined @@ -247,19 +247,19 @@ class SceneCamera { Camera camera; Transform transform; } -class GPUMeshResource { +class GPUMesh { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -313,17 +313,17 @@ class MeshComponent { bool get_isActive() const property; bool get_hasMesh() const property; void clear(); - GPUMeshResource get_meshResource() property; - void set_meshResource(GPUMeshResource) property; + GPUMesh get_meshResource() property; + void set_meshResource(GPUMesh) property; void set_isActive(const bool) const property; } class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -419,18 +419,18 @@ namespace UI { void openPopup(const string&in, any@); } namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, AnyCallback@); } -namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { GPUMesh loadGPUMesh(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } -namespace Engine { Environment getMainEnvironment(); } -namespace Engine { Environment createLoadEnvironment(const string&in envId); } +namespace Resource { Environment getMainEnvironment(); } +namespace Resource { Environment createLoadEnvironment(const string&in envId); } namespace Engine { Entity getRoot(); } namespace Engine { void print(const string&in text); } namespace Path { string getParent(const string&in path); } namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } -namespace Engine { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } +namespace Resource { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } diff --git a/Editor/Modules/Previewer/MeshPreview.as b/Editor/Modules/Previewer/MeshPreview.as new file mode 100644 index 0000000..97ed8b8 --- /dev/null +++ b/Editor/Modules/Previewer/MeshPreview.as @@ -0,0 +1,7 @@ +void do() { + + + array arrayInt; + + +} diff --git a/Editor/Modules/Previewer/as.predefined b/Editor/Modules/Previewer/as.predefined new file mode 100644 index 0000000..0f8e79f --- /dev/null +++ b/Editor/Modules/Previewer/as.predefined @@ -0,0 +1,405 @@ +//This file was generated automatically +funcdef void Callback(); +funcdef void AnyCallback(any@); +funcdef void ReciverFunc(any@); +funcdef void TransferFunc(any@, any@); +enum ResourceType { + None = 0, + Mesh = 1, + Shader = 2, + Texture = 3 +} +enum key { + A = 546, + B = 547, + C = 548, + D = 549, + E = 550, + F = 551, + G = 552, + H = 553, + I = 554, + J = 555, + K = 556, + L = 557, + M = 558, + N = 559, + O = 560, + P = 561, + Q = 562, + R = 563, + S = 564, + T = 565, + U = 566, + V = 567, + W = 568, + X = 569, + Y = 570, + Z = 571, + K0 = 536, + K1 = 537, + K2 = 538, + K3 = 539, + K4 = 540, + K5 = 541, + K6 = 542, + K7 = 543, + K8 = 544, + K9 = 545, + Tab = 512, + Enter = 525, + Escape = 526, + Backspace = 523, + Space = 524, + Delete = 522, + Insert = 521, + Home = 519, + End = 520, + PageUp = 517, + PageDown = 518, + Right = 514, + Up = 515, + Down = 516, + Left = 513, + RightCtrl = 531, + LeftShift = 528, + RightShift = 532, + LeftAlt = 529, + RightAlt = 533, + LeftSuper = 530, + RightSuper = 534, + LeftCtrl = 527, + MouseLeft = 656, + MouseRight = 657, + MouseMiddle = 658 +} +class ref { + ~ref(); + ref(); + ref(const ref&in); + ref(const ?&in); + void opCast(?&out); + ref& opHndlAssign(const ref&in); + ref& opHndlAssign(const ?&in); + bool opEquals(const ref&in) const; + bool opEquals(const ?&in) const; +} +class any { + any@ any(); + any@ any(?&in); + any@ any(const int64&in); + any@ any(const double&in); + any& opAssign(any&in); + void store(?&in); + void store(const int64&in); + void store(const double&in); + bool retrieve(?&out); + bool retrieve(int64&out); + bool retrieve(double&out); +} +class string { + ~string(); + string(); + string(const string&in); + string& opAssign(const string&in); + string& opAddAssign(const string&in); + bool opEquals(const string&in) const; + int opCmp(const string&in) const; + string opAdd(const string&in) const; + uint length() const; + void resize(uint); + bool isEmpty() const; + uint8& opIndex(uint); + const uint8& opIndex(uint) const; + string& opAssign(double); + string& opAddAssign(double); + string opAdd(double) const; + string opAdd_r(double) const; + string& opAssign(float); + string& opAddAssign(float); + string opAdd(float) const; + string opAdd_r(float) const; + string& opAssign(int64); + string& opAddAssign(int64); + string opAdd(int64) const; + string opAdd_r(int64) const; + string& opAssign(uint64); + string& opAddAssign(uint64); + string opAdd(uint64) const; + string opAdd_r(uint64) const; + string& opAssign(bool); + string& opAddAssign(bool); + string opAdd(bool) const; + string opAdd_r(bool) const; + string substr(uint start = 0, int count = - 1) const; + int findFirst(const string&in, uint start = 0) const; + int findFirstOf(const string&in, uint start = 0) const; + int findFirstNotOf(const string&in, uint start = 0) const; + int findLast(const string&in, int start = - 1) const; + int findLastOf(const string&in, int start = - 1) const; + int findLastNotOf(const string&in, int start = - 1) const; + void insert(uint pos, const string&in other); + void erase(uint pos, int count = - 1); +} +class dictionaryValue { + ~dictionaryValue(); + dictionaryValue(); + dictionaryValue& opAssign(const dictionaryValue&in); + dictionaryValue& opHndlAssign(const ?&in); + dictionaryValue& opHndlAssign(const dictionaryValue&in); + dictionaryValue& opAssign(const ?&in); + dictionaryValue& opAssign(double); + dictionaryValue& opAssign(int64); + void opCast(?&out); + void opConv(?&out); + int64 opConv(); + double opConv(); +} +class dictionary { + dictionary@ dictionary(); + dictionary& opAssign(const dictionary&in); + void set(const string&in, const ?&in); + bool get(const string&in, ?&out) const; + void set(const string&in, const int64&in); + bool get(const string&in, int64&out) const; + void set(const string&in, const double&in); + bool get(const string&in, double&out) const; + bool exists(const string&in) const; + bool isEmpty() const; + uint getSize() const; + bool delete(const string&in); + void deleteAll(); + string[]@ getKeys() const; + dictionaryValue& opIndex(const string&in); + const dictionaryValue& opIndex(const string&in) const; +} +class vec3 { + vec3(); + vec3(float, float = 0, float = 0); + vec3 opAdd(const vec3&in); + vec3 opSub(const vec3&in) const; + vec3 opNeg() const; + vec3 opMul(float) const; + vec3 opMul_r(float) const; + float x; + float y; + float z; +} +class quat { + ~quat(); + quat(); + quat(float, float, float, float); + quat opMul(const quat&in) const; + vec3 getEuler() const; + void setEuler(vec3); + float x; + float y; + float z; + float w; +} +class Transform { + Transform(); + vec3 relative(vec3); + vec3 position; + vec3 scale; + quat rotation; +} +class Camera { + Camera(); + float fov; + float aspect; + float nearZ; + float farZ; +} +class SceneCamera { + SceneCamera(); + Camera camera; + Transform transform; +} +class GPUMesh { + bool isValid() const; + string get_name() const property; + string get_path() const property; + int get_resourceId() const property; +} +class Shader { + bool isValid() const; + string get_name() const property; + string get_path() const property; + int get_resourceId() const property; +} +class Texture { + bool isValid() const; + string get_name() const property; + string get_path() const property; + int get_resourceId() const property; +} +class Environment { + void render(FrameBuffer, SceneCamera&in); + Entity getRootEntity(); + Entity getEntity(int); +} +class Entity { + string get_name() const property; + void set_name(string&in) property; + int get_id() const property; + Entity createChild(const string&in); + bool get_isRoot() const property; + void destroy(); + bool get_exists() const property; + Entity get_parent() property; + void set_parent(Entity) property; + bool isDescendantOf(Entity); + bool opEquals(const Entity&in) const; + EntityChilds get_childs() const property; + TransformComponent get_transform() const property; + MeshComponent getMeshComponent(); + MeshComponent createMeshComponent(); + bool hasMeshComponent(); + void removeMeshComponent(); + ShaderComponent getShaderComponent(); + ShaderComponent createShaderComponent(); + bool hasShaderComponent(); + void removeShaderComponent(); + CameraComponent getCameraComponent(); + CameraComponent createCameraComponent(); + bool hasCameraComponent(); + void removeCameraComponent(); +} +class EntityChilds { + int get_count() const property; + Entity opIndex(int) const; +} +class TransformComponent { + vec3 get_position() const property; + vec3 get_scale() const property; + vec3 get_rotation() const property; + void set_position(const vec3) property; + void set_scale(const vec3) property; + void set_rotation(const vec3) property; +} +class MeshComponent { + bool get_isActive() const property; + bool get_hasMesh() const property; + void clear(); + GPUMesh get_meshResource() property; + void set_meshResource(GPUMesh) property; + void set_isActive(const bool) const property; +} +class ShaderComponent { + bool get_hasShader() const property; + void clear(); + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; +} +class CameraComponent { + float get_fov() const property; + float get_aspectRatio() const property; + float get_nearZ() const property; + float get_farZ() const property; + void set_fov(float) property; + void set_aspectRatio(float) property; + void set_nearZ(float) property; + void set_farZ(float) property; +} +class Panel { + void render(); +} +class Service { +} +class FrameBuffer { + FrameBuffer(); + void clearRGBA(int, int, int, int); + int get_height() const property; + void resize(int, int); + string get_name() const property; + bool isValid(); +} +string formatInt(int64 val, const string&in options = "", uint width = 0); +string formatUInt(uint64 val, const string&in options = "", uint width = 0); +string formatFloat(double val, const string&in options = "", uint width = 0, uint precision = 0); +int64 parseInt(const string&in, uint base = 10, uint&out byteCount = 0); +uint64 parseUInt(const string&in, uint base = 10, uint&out byteCount = 0); +double parseFloat(const string&in, uint&out byteCount = 0); +namespace UI { bool button(const string&in text); } +namespace UI { bool buttonCenter(const string&in text); } +namespace UI { bool buttonEnd(const string&in text); } +namespace UI { bool cartIconButton(const string&in label, const string&in icon, int iconSize, int width); } +namespace UI { bool checkbox(const string&in text, bool value); } +namespace UI { bool checkboxDisabled(const string&in text, bool value); } +namespace UI { float magicSlider(const string&in text, float value, float speed); } +namespace UI { vec3 magicSlider3(const string&in text, vec3 value, float speed); } +namespace UI { int sliderInt(string&in text, int value, int min, int max); } +namespace UI { float slider(string&in text, float value, float min, float max); } +namespace UI { bool inputText(const string&in text, const string&in value, string&out valueOutput); } +namespace UI { bool menuItem(const string&in text); } +namespace UI { void menuItemDisabled(const string&in text); } +namespace UI { void subMenu(const string&in text, Callback@ func); } +namespace UI { void text(const string&in text); } +namespace UI { void textCenter(const string&in text); } +namespace UI { void textEnd(const string&in text); } +namespace UI { void textColor(float r, float g, float b, const string&in text); } +namespace UI { void title(const string&in text); } +namespace UI { void titleCenter(const string&in text); } +namespace UI { void titleCenterY(const string&in text, int height); } +namespace UI { void titleEnd(const string&in text); } +namespace UI { void sameline(); } +namespace UI { void separator(); } +namespace UI { void space(); } +namespace UI { void space(int x, int y = 10); } +namespace UI { void drawFrameBuffer(FrameBuffer, int, int); } +namespace UI { void drawFrameBufferCentered(FrameBuffer, int, int); } +namespace UI { void drawIcon(const string&in, int); } +namespace UI { void drawIconCentered(const string&in, int); } +namespace UI { void drawIconHighlight(const string&in, int); } +namespace UI { void drawIconCenteredHighlight(const string&in, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } +namespace UI { bool isKeyDown(key); } +namespace UI { bool isKeyPressed(key); } +namespace UI { bool isMouseDragging(key); } +namespace UI { bool isItemClicked(int); } +namespace UI { bool isMouseDoubleClicked(int); } +namespace UI { float getMouseDragDeltaX(); } +namespace UI { float getMouseDragDeltaY(); } +namespace UI { float getMouseDeltaX(); } +namespace UI { float getMouseDeltaY(); } +namespace UI { bool isPanelActive(); } +namespace UI { void disablePanelPadding(bool); } +namespace UI { int getAvailableSizeX(); } +namespace UI { int getAvailableSizeY(); } +namespace UI { void automaticColumns(int); } +namespace UI { void columns(int); } +namespace UI { void nextColumn(); } +namespace UI { void endColumns(); } +namespace UI { void treeNodeLeaf(const string&in, bool); } +namespace UI { bool treeNode(const string&in, bool, Callback@); } +namespace UI { bool componentNode(const string&in, Callback@); } +namespace UI { bool componentNodeContextMenu(const string&in, Callback@, Callback@); } +namespace UI { void contextItemPopup(const string&in, Callback@); } +namespace UI { void contextMenuPopup(const string&in, Callback@); } +namespace UI { void modalPopup(const string&in, Callback@); } +namespace UI { void simplePopup(const string&in, Callback@); } +namespace UI { void openPopup(const string&in, any@); } +namespace UI { void closePopup(); } +namespace UI { void dragDropSource(const string&in, any@, const string&in); } +namespace UI { void dragDropTarget(const string&in, AnyCallback@); } +namespace Resource { GPUMesh loadGPUMesh(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } +namespace Resource { string[]@ getResourceFolders(string&in path); } +namespace Resource { string[]@ getResourceFiles(string&in path); } +namespace Resource { ResourceType getResourceType(string&in path); } +namespace Resource { Environment getMainEnvironment(); } +namespace Resource { Environment createLoadEnvironment(const string&in envId); } +namespace Engine { Entity getRoot(); } +namespace Engine { void print(const string&in text); } +namespace Path { string getParent(const string&in path); } +namespace Path { string getParentName(const string&in path); } +namespace Path { string getName(const string&in path); } +namespace Path { string[]@ divide(const string&in path); } +namespace Resource { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } diff --git a/Editor/Modules/ResourceExplorer/IconRender.as b/Editor/Modules/ResourceExplorer/IconRender.as index 0b09873..e28e023 100644 --- a/Editor/Modules/ResourceExplorer/IconRender.as +++ b/Editor/Modules/ResourceExplorer/IconRender.as @@ -71,7 +71,7 @@ bool drawFileIcon(string&in name, string&in dragId, any dragData, string&in over return click; } -bool drawTextureIcon(string&in name, string&in dragId, any dragData, string&in overlay, TextureResource texture, bool selected = false) { +bool drawTextureIcon(string&in name, string&in dragId, any dragData, string&in overlay, Texture texture, bool selected = false) { bool click = false; if (selected) { UI::drawIconCenteredHighlight(texture, 64); diff --git a/Editor/Modules/ResourceExplorer/ResourceExplorer.as b/Editor/Modules/ResourceExplorer/ResourceExplorer.as index fb27758..06da6d1 100644 --- a/Editor/Modules/ResourceExplorer/ResourceExplorer.as +++ b/Editor/Modules/ResourceExplorer/ResourceExplorer.as @@ -56,7 +56,7 @@ class ResourceExplorer : Panel { } if (resType == ResourceType::Texture) { - TextureResource textureResource = Resource::loadTexture(filename); + Texture texture = Resource::loadTexture(filename); if (UI::cartIconButton(Path::getName(filename), "texture.png", 64, UI::getAvailableSizeX())) { selectedResource = filename; } diff --git a/Editor/Modules/ResourceExplorer/as.predefined b/Editor/Modules/ResourceExplorer/as.predefined index 0fd4352..40b097e 100644 --- a/Editor/Modules/ResourceExplorer/as.predefined +++ b/Editor/Modules/ResourceExplorer/as.predefined @@ -247,19 +247,19 @@ class SceneCamera { Camera camera; Transform transform; } -class GPUMeshResource { +class GPUMesh { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -313,17 +313,17 @@ class MeshComponent { bool get_isActive() const property; bool get_hasMesh() const property; void clear(); - GPUMeshResource get_meshResource() property; - void set_meshResource(GPUMeshResource) property; + GPUMesh get_meshResource() property; + void set_meshResource(GPUMesh) property; void set_isActive(const bool) const property; } class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -419,18 +419,18 @@ namespace UI { void openPopup(const string&in, any@); } namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, AnyCallback@); } -namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { GPUMesh loadGPUMesh(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } -namespace Engine { Environment getMainEnvironment(); } -namespace Engine { Environment createLoadEnvironment(const string&in envId); } +namespace Resource { Environment getMainEnvironment(); } +namespace Resource { Environment createLoadEnvironment(const string&in envId); } namespace Engine { Entity getRoot(); } namespace Engine { void print(const string&in text); } namespace Path { string getParent(const string&in path); } namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } -namespace Engine { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } +namespace Resource { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } diff --git a/Editor/Modules/TreeExplorer/as.predefined b/Editor/Modules/TreeExplorer/as.predefined index 0fd4352..40b097e 100644 --- a/Editor/Modules/TreeExplorer/as.predefined +++ b/Editor/Modules/TreeExplorer/as.predefined @@ -247,19 +247,19 @@ class SceneCamera { Camera camera; Transform transform; } -class GPUMeshResource { +class GPUMesh { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -313,17 +313,17 @@ class MeshComponent { bool get_isActive() const property; bool get_hasMesh() const property; void clear(); - GPUMeshResource get_meshResource() property; - void set_meshResource(GPUMeshResource) property; + GPUMesh get_meshResource() property; + void set_meshResource(GPUMesh) property; void set_isActive(const bool) const property; } class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -419,18 +419,18 @@ namespace UI { void openPopup(const string&in, any@); } namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, AnyCallback@); } -namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { GPUMesh loadGPUMesh(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } -namespace Engine { Environment getMainEnvironment(); } -namespace Engine { Environment createLoadEnvironment(const string&in envId); } +namespace Resource { Environment getMainEnvironment(); } +namespace Resource { Environment createLoadEnvironment(const string&in envId); } namespace Engine { Entity getRoot(); } namespace Engine { void print(const string&in text); } namespace Path { string getParent(const string&in path); } namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } -namespace Engine { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } +namespace Resource { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } diff --git a/Editor/Modules/Viewport/Viewport.as b/Editor/Modules/Viewport/Viewport.as index f7befe2..7f14872 100644 --- a/Editor/Modules/Viewport/Viewport.as +++ b/Editor/Modules/Viewport/Viewport.as @@ -70,8 +70,8 @@ class ViewportPanel : Panel { } void init() { - frameBuffer = Engine::createLoadRGBA8FrameBuffer("MainFrameBuffer", 400, 400); - mainEnv = Engine::getMainEnvironment(); + frameBuffer = Resource::createLoadRGBA8FrameBuffer("MainFrameBuffer", 400, 400); + mainEnv = Resource::getMainEnvironment(); sceneCamera.transform.position = vec3(0, 1, -2); sceneCamera.camera.nearZ = 0.1; diff --git a/Editor/Modules/Viewport/as.predefined b/Editor/Modules/Viewport/as.predefined index 0fd4352..16381f4 100644 --- a/Editor/Modules/Viewport/as.predefined +++ b/Editor/Modules/Viewport/as.predefined @@ -142,7 +142,6 @@ class string { void erase(uint pos, int count = - 1); } class array { - funcdef bool less(const T&in a, const T&in b); T[]@ array(int&in); T[]@ array(int&in, uint length); T[]@ array(int&in, uint length, const T&in value); @@ -169,6 +168,7 @@ class array { int findByRef(uint startAt, const T&in value) const; bool opEquals(const T[]&in) const; bool isEmpty() const; + funcdef bool less(const T&in a, const T&in b); void sort(T[]::less&in, uint startAt = 0, uint count = uint ( - 1 )); funcdef bool less(const T&in, const T&in); } @@ -247,19 +247,19 @@ class SceneCamera { Camera camera; Transform transform; } -class GPUMeshResource { +class GPUMesh { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -313,17 +313,17 @@ class MeshComponent { bool get_isActive() const property; bool get_hasMesh() const property; void clear(); - GPUMeshResource get_meshResource() property; - void set_meshResource(GPUMeshResource) property; + GPUMesh get_meshResource() property; + void set_meshResource(GPUMesh) property; void set_isActive(const bool) const property; } class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -419,18 +419,18 @@ namespace UI { void openPopup(const string&in, any@); } namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, AnyCallback@); } -namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { GPUMesh loadGPUMesh(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } -namespace Engine { Environment getMainEnvironment(); } -namespace Engine { Environment createLoadEnvironment(const string&in envId); } +namespace Resource { Environment getMainEnvironment(); } +namespace Resource { Environment createLoadEnvironment(const string&in envId); } namespace Engine { Entity getRoot(); } namespace Engine { void print(const string&in text); } namespace Path { string getParent(const string&in path); } namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } -namespace Engine { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } +namespace Resource { FrameBuffer createLoadRGBA8FrameBuffer(const string&in, int width, int height, int samples = 4); } diff --git a/Editor/Panels/EntityManipulation/ShaderProperties.as b/Editor/Panels/EntityManipulation/ShaderProperties.as index 873cc7b..401138a 100644 --- a/Editor/Panels/EntityManipulation/ShaderProperties.as +++ b/Editor/Panels/EntityManipulation/ShaderProperties.as @@ -14,7 +14,7 @@ class ShaderComponentRender { } void setTexture(any@ texture_data) { - TextureResource texture; + Texture texture; texture_data.retrieve(texture); Engine::print(texture.name); diff --git a/Editor/Panels/EntityManipulation/as.predefined b/Editor/Panels/EntityManipulation/as.predefined index 0136037..2298fff 100644 --- a/Editor/Panels/EntityManipulation/as.predefined +++ b/Editor/Panels/EntityManipulation/as.predefined @@ -259,10 +259,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -336,13 +336,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -413,8 +413,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } @@ -695,10 +695,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -772,13 +772,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -822,10 +822,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -849,8 +849,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } diff --git a/Editor/Panels/ResourceExplorer/IconRender.as b/Editor/Panels/ResourceExplorer/IconRender.as index 2e98fda..73bde19 100644 --- a/Editor/Panels/ResourceExplorer/IconRender.as +++ b/Editor/Panels/ResourceExplorer/IconRender.as @@ -72,7 +72,7 @@ bool drawFileIcon(string&in name, string&in dragId, any dragData, string&in over return click; } -bool drawTextureIcon(string&in name, string&in dragId, any dragData, string&in overlay, TextureResource texture, bool selected = false) { +bool drawTextureIcon(string&in name, string&in dragId, any dragData, string&in overlay, Texture texture, bool selected = false) { bool click = false; if (selected) { UI::drawIconCenteredHighlight(texture, 64); diff --git a/Editor/Panels/ResourceExplorer/ResourceExplorer.as b/Editor/Panels/ResourceExplorer/ResourceExplorer.as index 133ddd6..8f41d02 100644 --- a/Editor/Panels/ResourceExplorer/ResourceExplorer.as +++ b/Editor/Panels/ResourceExplorer/ResourceExplorer.as @@ -50,8 +50,8 @@ class ResourceExplorer : DockPanel { } if (resType == ResourceType::Texture) { - TextureResource textureResource = Resource::loadTexture(filename); - if (drawTextureIcon(Path::getName(filename), "TEXTURE", any(textureResource), Path::getName(filename), textureResource, selected)) { + Texture Texture = Resource::loadTexture(filename); + if (drawTextureIcon(Path::getName(filename), "TEXTURE", any(Texture), Path::getName(filename), Texture, selected)) { selectedResource = filename; } return; diff --git a/Editor/Panels/ResourceExplorer/as.predefined b/Editor/Panels/ResourceExplorer/as.predefined index 0136037..2298fff 100644 --- a/Editor/Panels/ResourceExplorer/as.predefined +++ b/Editor/Panels/ResourceExplorer/as.predefined @@ -259,10 +259,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -336,13 +336,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -413,8 +413,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } @@ -695,10 +695,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -772,13 +772,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -822,10 +822,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -849,8 +849,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } diff --git a/Editor/Panels/TreeExplorer/as.predefined b/Editor/Panels/TreeExplorer/as.predefined index 0136037..2298fff 100644 --- a/Editor/Panels/TreeExplorer/as.predefined +++ b/Editor/Panels/TreeExplorer/as.predefined @@ -259,10 +259,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -336,13 +336,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -413,8 +413,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } @@ -695,10 +695,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -772,13 +772,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -822,10 +822,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -849,8 +849,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } diff --git a/Editor/Panels/Viewport/as.predefined b/Editor/Panels/Viewport/as.predefined index 0136037..2298fff 100644 --- a/Editor/Panels/Viewport/as.predefined +++ b/Editor/Panels/Viewport/as.predefined @@ -259,10 +259,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -336,13 +336,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -413,8 +413,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } @@ -695,10 +695,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -772,13 +772,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -822,10 +822,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -849,8 +849,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } diff --git a/Editor/Services/ActiveEntity/as.predefined b/Editor/Services/ActiveEntity/as.predefined index a3e220b..288490a 100644 --- a/Editor/Services/ActiveEntity/as.predefined +++ b/Editor/Services/ActiveEntity/as.predefined @@ -259,10 +259,10 @@ class MeshComponent { class ShaderComponent { bool get_hasShader() const property; void clear(); - ShaderResource get_shader() const property; - void set_shader(ShaderResource) property; - TextureResource get_texture() const property; - void set_texture(TextureResource) property; + Shader get_shader() const property; + void set_shader(Shader) property; + Texture get_texture() const property; + void set_texture(Texture) property; } class CameraComponent { float get_fov() const property; @@ -336,13 +336,13 @@ class GPUMeshResource { string get_path() const property; int get_resourceId() const property; } -class ShaderResource { +class Shader { bool isValid() const; string get_name() const property; string get_path() const property; int get_resourceId() const property; } -class TextureResource { +class Texture { bool isValid() const; string get_name() const property; string get_path() const property; @@ -386,10 +386,10 @@ namespace UI { void drawIcon(const string&in, int); } namespace UI { void drawIconCentered(const string&in, int); } namespace UI { void drawIconHighlight(const string&in, int); } namespace UI { void drawIconCenteredHighlight(const string&in, int); } -namespace UI { void drawIcon(TextureResource texture, int); } -namespace UI { void drawIconCentered(TextureResource texture, int); } -namespace UI { void drawIconHighlight(TextureResource texture, int); } -namespace UI { void drawIconCenteredHighlight(TextureResource texture, int); } +namespace UI { void drawIcon(Texture texture, int); } +namespace UI { void drawIconCentered(Texture texture, int); } +namespace UI { void drawIconHighlight(Texture texture, int); } +namespace UI { void drawIconCenteredHighlight(Texture texture, int); } namespace UI { bool isKeyDown(key); } namespace UI { bool isKeyPressed(key); } namespace UI { bool isMouseDragging(key); } @@ -413,8 +413,8 @@ namespace Path { string getParentName(const string&in path); } namespace Path { string getName(const string&in path); } namespace Path { string[]@ divide(const string&in path); } namespace Resource { GPUMeshResource loadGPUMesh(string&in path); } -namespace Resource { ShaderResource loadShader(string&in path); } -namespace Resource { TextureResource loadTexture(string&in path); } +namespace Resource { Shader loadShader(string&in path); } +namespace Resource { Texture loadTexture(string&in path); } namespace Resource { string[]@ getResourceFolders(string&in path); } namespace Resource { string[]@ getResourceFiles(string&in path); } namespace Resource { ResourceType getResourceType(string&in path); } diff --git a/imgui.ini b/imgui.ini index d8c774c..836a392 100644 --- a/imgui.ini +++ b/imgui.ini @@ -70,7 +70,7 @@ DockSpace ID=0x0AC2E849 Window=0xD0388BC8 Pos=0,34 Size=1920,976 Split=Y DockNode ID=0x00000005 Parent=0x0AC2E849 SizeRef=1920,615 Split=X DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1490,645 Split=X Selected=0xD9E076F4 DockNode ID=0x00000001 Parent=0x00000002 SizeRef=431,976 Selected=0x16E3C1E7 - DockNode ID=0x00000004 Parent=0x00000002 SizeRef=1057,976 CentralNode=1 Selected=0x0F5FFC8C + DockNode ID=0x00000004 Parent=0x00000002 SizeRef=1057,976 CentralNode=1 Selected=0xD9E076F4 DockNode ID=0x00000003 Parent=0x00000005 SizeRef=428,645 Selected=0x9876A79B DockNode ID=0x00000006 Parent=0x0AC2E849 SizeRef=1920,359 Selected=0x018A0F9B DockSpace ID=0xA1672E74 Pos=0,34 Size=1920,976 CentralNode=1 Selected=0x9ED090AF