From dddd305f07fe395531cab48975eeda3f9b8fd07b Mon Sep 17 00:00:00 2001 From: Chewico Date: Tue, 24 Jun 2025 20:53:13 +0200 Subject: [PATCH] Fixed some bugs --- DeerStudio/imgui.ini | 5 +- .../EditorEngine/AngelscriptPredefined.cpp | 50 +- .../ServiceScript/ServiceScriptContext.cpp | 145 ++-- .../EntityManipulation/PropertiesPannel.as | 2 +- .../EntityManipulation/Tree.as | 4 +- .../EntityManipulation/as.predefined | 8 +- .../MeshExplorer/as.predefined | 8 +- .../DockPanelModules/TestModule/Test.as | 2 +- .../DockPanelModules/TestModule/as.predefined | 8 +- .../DockPanelModules/Viewport/as.predefined | 8 +- .../ActiveEntity/as.predefined | 780 +++++++++++------- 11 files changed, 592 insertions(+), 428 deletions(-) diff --git a/DeerStudio/imgui.ini b/DeerStudio/imgui.ini index 56eb4be..1e7d615 100644 --- a/DeerStudio/imgui.ini +++ b/DeerStudio/imgui.ini @@ -67,9 +67,10 @@ Size=104,68 Collapsed=0 [Window][Test] -Pos=560,275 -Size=396,176 +Pos=440,24 +Size=385,361 Collapsed=0 +DockId=0x00000005,2 [Docking][Data] DockSpace ID=0xA1672E74 Window=0x4647B76E Pos=0,24 Size=1280,696 Split=Y Selected=0x34A4C10F diff --git a/DeerStudio/src/DeerStudio/EditorEngine/AngelscriptPredefined.cpp b/DeerStudio/src/DeerStudio/EditorEngine/AngelscriptPredefined.cpp index d2666e1..43ea061 100644 --- a/DeerStudio/src/DeerStudio/EditorEngine/AngelscriptPredefined.cpp +++ b/DeerStudio/src/DeerStudio/EditorEngine/AngelscriptPredefined.cpp @@ -26,19 +26,28 @@ static std::stringstream stream; static std::string str; -void printFuncList(const asIScriptEngine &engine) { +void printFuncList(const asIScriptEngine& engine) { for (int i = 0; i < engine.GetFuncdefCount(); ++i) { - asITypeInfo *t = engine.GetFuncdefByIndex(i); + asITypeInfo* t = engine.GetFuncdefByIndex(i); if (!t) continue; - asIScriptFunction *f = t->GetFuncdefSignature(); + asIScriptFunction* func = t->GetFuncdefSignature(); + if (!func || func->GetSubType()) + continue; - stream << "funcdef " << f->GetDeclaration(true, false, true) << ";\n"; + std::string decl = func->GetDeclaration(true, true, true); + + // Detect class-scoped funcdefs by presence of "::" in the declaration + size_t scopePos = decl.find("::"); + if (scopePos != std::string::npos) + continue; + + stream << "funcdef " << decl << ";\n"; } } -void printEnumList(const asIScriptEngine &engine) { +void printEnumList(const asIScriptEngine& engine) { for (int i = 0; i < engine.GetEnumCount(); ++i) { const auto e = engine.GetEnumByIndex(i); if (!e) @@ -63,9 +72,9 @@ void printEnumList(const asIScriptEngine &engine) { } } -void printClassTypeList(const asIScriptEngine &engine) { +void printClassTypeList(const asIScriptEngine& engine) { for (int i = 0; i < engine.GetObjectTypeCount(); ++i) { - asITypeInfo *t = engine.GetObjectTypeByIndex(i); + asITypeInfo* t = engine.GetObjectTypeByIndex(i); if (!t) continue; @@ -89,8 +98,17 @@ void printClassTypeList(const asIScriptEngine &engine) { stream << " {\n"; + for (int i = 0; i < t->GetChildFuncdefCount(); ++i) { + asITypeInfo* ftype = t->GetChildFuncdef(i); + + asIScriptFunction* func = ftype->GetFuncdefSignature(); + + std::string decl = func->GetDeclaration(false, false, true); + stream << "\tfuncdef " << decl << ";\n"; + } + for (int j = 0; j < t->GetFactoryCount(); ++j) { - asIScriptFunction *f = t->GetFactoryByIndex(j); + asIScriptFunction* f = t->GetFactoryByIndex(j); stream << "\t" << f->GetDeclaration(false, false, true) << ";\n"; } @@ -132,7 +150,7 @@ void printClassTypeList(const asIScriptEngine &engine) { } } -void printGlobalFunctionList(const asIScriptEngine &engine) { +void printGlobalFunctionList(const asIScriptEngine& engine) { for (int i = 0; i < engine.GetGlobalFunctionCount(); ++i) { const auto f = engine.GetGlobalFunctionByIndex(i); if (!f) @@ -148,10 +166,10 @@ void printGlobalFunctionList(const asIScriptEngine &engine) { } } -void printGlobalPropertyList(const asIScriptEngine &engine) { +void printGlobalPropertyList(const asIScriptEngine& engine) { for (int i = 0; i < engine.GetGlobalPropertyCount(); ++i) { - const char *name; - const char *ns0; + const char* name; + const char* ns0; int type; engine.GetGlobalPropertyByIndex(i, &name, &ns0, &type, nullptr, nullptr, nullptr, nullptr); @@ -170,7 +188,7 @@ void printGlobalPropertyList(const asIScriptEngine &engine) { } } -void printGlobalTypedef(const asIScriptEngine &engine) { +void printGlobalTypedef(const asIScriptEngine& engine) { for (int i = 0; i < engine.GetTypedefCount(); ++i) { const auto type = engine.GetTypedefByIndex(i); if (!type) @@ -187,7 +205,7 @@ void printGlobalTypedef(const asIScriptEngine &engine) { } } -void printAngelInfo(const asIScriptEngine &engine) { +void printAngelInfo(const asIScriptEngine& engine) { printFuncList(engine); printEnumList(engine); @@ -211,12 +229,12 @@ namespace Deer { str = stream.str(); } - void EditorEngine::saveAngelscriptPredefined(const Path &path) { + void EditorEngine::saveAngelscriptPredefined(const Path& path) { Deer::Path filePath = path / "as.predefined"; std::ofstream file(filePath, std::ios::out | std::ios::binary); - file.write(reinterpret_cast(str.c_str()), str.size()); + file.write(reinterpret_cast(str.c_str()), str.size()); file.close(); } diff --git a/DeerStudio/src/DeerStudio/EditorEngine/ServiceScript/ServiceScriptContext.cpp b/DeerStudio/src/DeerStudio/EditorEngine/ServiceScript/ServiceScriptContext.cpp index 4dd8fc4..7a4fd84 100644 --- a/DeerStudio/src/DeerStudio/EditorEngine/ServiceScript/ServiceScriptContext.cpp +++ b/DeerStudio/src/DeerStudio/EditorEngine/ServiceScript/ServiceScriptContext.cpp @@ -1,93 +1,98 @@ #include "DeerStudio/EditorEngine/ServiceScript/ServiceScriptContext.h" -#include "DeerStudio/EditorEngine/ErrorHandle.h" #include "DeerStudio/EditorEngine.h" +#include "DeerStudio/EditorEngine/ErrorHandle.h" #include "angelscript.h" namespace Deer { - namespace EditorEngine { - ServiceScriptContext::ServiceScriptContext(asIScriptModule* _module, ServiceScriptInfo* _info) - : info(_info), module(_module) { + namespace EditorEngine { + ServiceScriptContext::ServiceScriptContext(asIScriptModule* _module, + ServiceScriptInfo* _info) + : info(_info), module(_module) { - size_t nScripts = module->GetObjectTypeCount(); - asITypeInfo* serviceScriptType = scriptEngine->GetTypeInfoByName("ServiceScript"); - - if (!serviceScriptType) { - DEER_EDITOR_ENGINE_ERROR("Could not load ServiceScript interface type"); - return; - } + size_t nScripts = module->GetObjectTypeCount(); + asITypeInfo* serviceScriptType = + scriptEngine->GetTypeInfoByName("ServiceScript"); - context = scriptEngine->CreateContext(); - context->AddRef(); - for (size_t i = 0; i < nScripts; i++) { - asITypeInfo* info = module->GetObjectTypeByIndex(i); + if (!serviceScriptType) { + DEER_EDITOR_ENGINE_ERROR( + "Could not load ServiceScript interface type"); + return; + } - // If it does not implement service script we are not interested int it - if (!info->Implements(serviceScriptType)) - continue; + context = scriptEngine->CreateContext(); + context->AddRef(); + for (size_t i = 0; i < nScripts; i++) { + asITypeInfo* info = module->GetObjectTypeByIndex(i); - scriptServices.push_back({info, context}); - } - } + // If it does not implement service script we are not interested + // int it + if (!info->Implements(serviceScriptType)) + continue; - ServiceScriptContext::~ServiceScriptContext() { - scriptServices.clear(); + scriptServices.push_back({info, context}); + } + } - if (context) - context->Release(); + ServiceScriptContext::~ServiceScriptContext() { + scriptServices.clear(); - delete info; - } + if (context) + context->Release(); - ServiceScriptContext::ServiceScriptContext(ServiceScriptContext&& o) - : scriptServices(std::move(o.scriptServices)) { - context = o.context; - module = o.module; - info = o.info; + delete info; + } - o.context = nullptr; - o.module = nullptr; - o.info = nullptr; - } + ServiceScriptContext::ServiceScriptContext(ServiceScriptContext&& o) + : scriptServices(std::move(o.scriptServices)) { + context = o.context; + module = o.module; + info = o.info; - ServiceScriptContext& ServiceScriptContext::operator=(ServiceScriptContext&& o) { - if (&o != this) { - scriptServices = std::move(o.scriptServices); - context = o.context; - module = o.module; - info = o.info; + o.context = nullptr; + o.module = nullptr; + o.info = nullptr; + } - o.context = nullptr; - o.module = nullptr; - o.info = nullptr; - } - return *this; - } + ServiceScriptContext& + ServiceScriptContext::operator=(ServiceScriptContext&& o) { + if (&o != this) { + scriptServices = std::move(o.scriptServices); + context = o.context; + module = o.module; + info = o.info; - void ServiceScriptContext::update() { - for (auto& scriptService : scriptServices) { - scriptService.update(); - } - } + o.context = nullptr; + o.module = nullptr; + o.info = nullptr; + } + return *this; + } - void ServiceScriptContext::init() { - for (auto& scriptService : scriptServices) { - scriptService.init(); - } - } + void ServiceScriptContext::update() { + for (auto& scriptService : scriptServices) { + scriptService.update(); + } + } - void ServiceScriptContext::bindFunctions() { - std::string ns; - ns = info->author + "::" + info->name +"::" + info->name; + void ServiceScriptContext::init() { + for (auto& scriptService : scriptServices) { + scriptService.init(); + } + } - DEER_CORE_INFO(ns.c_str()); + void ServiceScriptContext::bindFunctions() { + std::string ns; + ns = info->name; - scriptEngine->SetDefaultNamespace(ns.c_str()); - for (ServiceScriptObject& object : scriptServices) { - object.bindFunctions(); - } - scriptEngine->SetDefaultNamespace(""); - } + DEER_CORE_INFO(ns.c_str()); - } -} \ No newline at end of file + scriptEngine->SetDefaultNamespace(ns.c_str()); + for (ServiceScriptObject& object : scriptServices) { + object.bindFunctions(); + } + scriptEngine->SetDefaultNamespace(""); + } + + } // namespace EditorEngine +} // namespace Deer \ No newline at end of file diff --git a/roe/Editor/DockPanelModules/EntityManipulation/PropertiesPannel.as b/roe/Editor/DockPanelModules/EntityManipulation/PropertiesPannel.as index e286e86..955391b 100644 --- a/roe/Editor/DockPanelModules/EntityManipulation/PropertiesPannel.as +++ b/roe/Editor/DockPanelModules/EntityManipulation/PropertiesPannel.as @@ -4,7 +4,7 @@ class PropertiesPannel : DockPanel { vec3 slid2; void onRender() { - Entity entity = Chewico::ActiveEntity::ActiveEntity::getActiveEntity(); + Entity entity = ActiveEntity::getActiveEntity(); // We don't want to change root options if (entity.isRoot) diff --git a/roe/Editor/DockPanelModules/EntityManipulation/Tree.as b/roe/Editor/DockPanelModules/EntityManipulation/Tree.as index 4138f90..c3374c1 100644 --- a/roe/Editor/DockPanelModules/EntityManipulation/Tree.as +++ b/roe/Editor/DockPanelModules/EntityManipulation/Tree.as @@ -21,7 +21,7 @@ class TreePannel : DockPanel { for (int i = 0; i < entity.childs.count; i++) { Entity child = entity.childs[i]; - bool isActive = child == Chewico::ActiveEntity::ActiveEntity::getActiveEntity(); + bool isActive = child == ActiveEntity::getActiveEntity(); string displayName = child.name; if (displayName == "") { @@ -52,7 +52,7 @@ class TreePannel : DockPanel { // We can't select the entity if (UI::isItemClicked(0)) { - Chewico::ActiveEntity::ActiveEntity::setActiveEntity(entity); + ActiveEntity::setActiveEntity(entity); } } diff --git a/roe/Editor/DockPanelModules/EntityManipulation/as.predefined b/roe/Editor/DockPanelModules/EntityManipulation/as.predefined index 503322e..e7484f3 100644 --- a/roe/Editor/DockPanelModules/EntityManipulation/as.predefined +++ b/roe/Editor/DockPanelModules/EntityManipulation/as.predefined @@ -1,5 +1,4 @@ //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -115,6 +114,7 @@ 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); @@ -401,7 +401,6 @@ namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); } //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -517,6 +516,7 @@ 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); @@ -802,5 +802,5 @@ 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, any@, TransferFunc@); } -namespace Chewico::ActiveEntity::ActiveEntity { Entity getActiveEntity(); } -namespace Chewico::ActiveEntity::ActiveEntity { void setActiveEntity(Entity); } +namespace ActiveEntity { Entity getActiveEntity(); } +namespace ActiveEntity { void setActiveEntity(Entity); } diff --git a/roe/Editor/DockPanelModules/MeshExplorer/as.predefined b/roe/Editor/DockPanelModules/MeshExplorer/as.predefined index 503322e..e7484f3 100644 --- a/roe/Editor/DockPanelModules/MeshExplorer/as.predefined +++ b/roe/Editor/DockPanelModules/MeshExplorer/as.predefined @@ -1,5 +1,4 @@ //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -115,6 +114,7 @@ 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); @@ -401,7 +401,6 @@ namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); } //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -517,6 +516,7 @@ 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); @@ -802,5 +802,5 @@ 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, any@, TransferFunc@); } -namespace Chewico::ActiveEntity::ActiveEntity { Entity getActiveEntity(); } -namespace Chewico::ActiveEntity::ActiveEntity { void setActiveEntity(Entity); } +namespace ActiveEntity { Entity getActiveEntity(); } +namespace ActiveEntity { void setActiveEntity(Entity); } diff --git a/roe/Editor/DockPanelModules/TestModule/Test.as b/roe/Editor/DockPanelModules/TestModule/Test.as index 26ae56e..9bb7690 100644 --- a/roe/Editor/DockPanelModules/TestModule/Test.as +++ b/roe/Editor/DockPanelModules/TestModule/Test.as @@ -1,6 +1,6 @@ class Test : DockPanel { void onRender() { - Entity ent = Chewico::ActiveEntity::ActiveEntity::getActiveEntity(); + Entity ent = ActiveEntity::getActiveEntity(); UI::text("Hi"); UI::text(ent.name); diff --git a/roe/Editor/DockPanelModules/TestModule/as.predefined b/roe/Editor/DockPanelModules/TestModule/as.predefined index 503322e..e7484f3 100644 --- a/roe/Editor/DockPanelModules/TestModule/as.predefined +++ b/roe/Editor/DockPanelModules/TestModule/as.predefined @@ -1,5 +1,4 @@ //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -115,6 +114,7 @@ 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); @@ -401,7 +401,6 @@ namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); } //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -517,6 +516,7 @@ 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); @@ -802,5 +802,5 @@ 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, any@, TransferFunc@); } -namespace Chewico::ActiveEntity::ActiveEntity { Entity getActiveEntity(); } -namespace Chewico::ActiveEntity::ActiveEntity { void setActiveEntity(Entity); } +namespace ActiveEntity { Entity getActiveEntity(); } +namespace ActiveEntity { void setActiveEntity(Entity); } diff --git a/roe/Editor/DockPanelModules/Viewport/as.predefined b/roe/Editor/DockPanelModules/Viewport/as.predefined index 503322e..e7484f3 100644 --- a/roe/Editor/DockPanelModules/Viewport/as.predefined +++ b/roe/Editor/DockPanelModules/Viewport/as.predefined @@ -1,5 +1,4 @@ //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -115,6 +114,7 @@ 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); @@ -401,7 +401,6 @@ namespace UI { void closePopup(); } namespace UI { void dragDropSource(const string&in, any@, const string&in); } namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); } //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); enum key { @@ -517,6 +516,7 @@ 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); @@ -802,5 +802,5 @@ 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, any@, TransferFunc@); } -namespace Chewico::ActiveEntity::ActiveEntity { Entity getActiveEntity(); } -namespace Chewico::ActiveEntity::ActiveEntity { void setActiveEntity(Entity); } +namespace ActiveEntity { Entity getActiveEntity(); } +namespace ActiveEntity { void setActiveEntity(Entity); } diff --git a/roe/Editor/ScriptServiceModules/ActiveEntity/as.predefined b/roe/Editor/ScriptServiceModules/ActiveEntity/as.predefined index 86fa8bc..ab3d10a 100644 --- a/roe/Editor/ScriptServiceModules/ActiveEntity/as.predefined +++ b/roe/Editor/ScriptServiceModules/ActiveEntity/as.predefined @@ -1,120 +1,120 @@ //This file was generated automatically -funcdef bool T[]::less(const T&in a, const T&in b); funcdef void ReciverFunc(any@); funcdef void TransferFunc(any@, any@); 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 = 641, - MouseRight = 642, - MouseMiddle = 643 + 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 = 641, + MouseRight = 642, + MouseMiddle = 643 } enum ResourceType { - Mesh = 1, - Shader = 2 + Mesh = 1, + Shader = 2 } 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); + ~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 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); @@ -145,184 +145,184 @@ class array { funcdef bool less(const T&in, const T&in); } 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(); + ~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; + 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 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; + ~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 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 DockPanel { - void onRender(); + void onRender(); } class ServiceScript { } 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(); + 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; + 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; + 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(); - string getMesh(); - void setMesh(string&in); - void set_isActive(const bool) property; + bool get_isActive() const property; + bool get_hasMesh() const property; + void clear(); + string getMesh(); + void setMesh(string&in); + void set_isActive(const bool) property; } class ShaderComponent { - bool get_hasShader() const property; - void clear(); - string getShader(); - void setShader(const string&in); + bool get_hasShader() const property; + void clear(); + string getShader(); + void setShader(const string&in); } 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; + 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 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; + 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; + ~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; + Transform(); + vec3 relative(vec3); + vec3 position; + vec3 scale; + quat rotation; } class Camera { - Camera(); - float fov; - float aspect; - float nearZ; - float farZ; + Camera(); + float fov; + float aspect; + float nearZ; + float farZ; } class SceneCamera { - SceneCamera(); - Camera camera; - Transform transform; + SceneCamera(); + Camera camera; + Transform transform; } 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(); + FrameBuffer(); + void clearRGBA(int, int, int, int); + int get_height() const property; + void resize(int, int); + string get_name() const property; + bool isValid(); } class Environment { - void render(FrameBuffer, SceneCamera&in); - Entity getRootEntity(); - Entity getEntity(int); + void render(FrameBuffer, SceneCamera&in); + Entity getRootEntity(); + Entity getEntity(int); } string formatInt(int64 val, const string&in options = "", uint width = 0); string formatUInt(uint64 val, const string&in options = "", uint width = 0); @@ -330,73 +330,213 @@ string formatFloat(double val, const string&in options = "", uint width = 0, uin 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 Engine { Entity getRoot(); } -namespace UI { bool button(const string&in); } -namespace UI { bool buttonCenter(const string&in); } -namespace UI { bool buttonEnd(const string&in); } -namespace UI { bool checkbox(const string&in, bool); } -namespace UI { bool checkboxDisabled(const string&in, bool); } -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 { bool inputText(const string&in, const string&in, string&out); } -namespace UI { bool isItemClicked(int); } -namespace UI { bool isMouseDoubleClicked(int); } -namespace UI { float magicSlider(const string&in, float, float); } -namespace UI { vec3 magicSlider3(const string&in, vec3, float); } -namespace UI { bool menuItem(const string&in); } -namespace UI { void menuItemDisabled(const string&in); } -namespace UI { void menuSpace(const string&in, any@, ReciverFunc@); } -namespace UI { void sameline(); } -namespace UI { void separator(); } -namespace UI { void space(); } -namespace UI { void space(int, int = 10); } -namespace UI { void text(const string&in); } -namespace UI { void textCenter(const string&in); } -namespace UI { void textColor(float, float, float, const string&in); } -namespace UI { void textEnd(const string&in); } -namespace UI { void title(const string&in); } -namespace UI { void titleCenter(const string&in); } -namespace UI { void titleCenterY(const string&in, int); } -namespace UI { void titleEnd(const string&in); } -namespace UI { bool isKeyDown(key); } -namespace UI { bool isKeyPressed(key); } -namespace UI { bool isMouseDraggin(key); } -namespace UI { bool isPannelActive(); } -namespace UI { float getMouseDragDeltaX(); } -namespace UI { float getMouseDragDeltaY(); } -namespace UI { float getMouseDeltaX(); } -namespace UI { float getMouseDeltaY(); } -namespace UI { int getAvailableSizeX(); } -namespace UI { int getAvailableSizeY(); } -namespace UI { void disablePannelPadding(bool); } -namespace UI { int sliderInt(string&in, int, int, int); } -namespace UI { float slider(string&in, float, float, float); } -namespace Engine { FrameBuffer createRGBA8FrameBuffer(const string&in, int, int); } -namespace Engine { FrameBuffer getFrameBuffer(const string&in); } -namespace Engine { Environment getMainEnvironment(); } -namespace Engine { Environment createEnvironment(); } -namespace UI { void setupAutomaticColumns(int); } -namespace UI { void setupColumns(int); } -namespace UI { void endColumns(); } -namespace UI { void nextColumn(); } -namespace Resource { int getResourceCount(ResourceType, const string&in); } -namespace Resource { string getResourceNameById(ResourceType, const string&in, int); } -namespace Resource { string getResourcePathById(ResourceType, const string&in, int); } -namespace Resource { int getDirCount(ResourceType, const string&in); } -namespace Resource { string getDirPathById(ResourceType, const string&in, int); } -namespace Resource { string getDirNameById(ResourceType, const string&in, int); } -namespace Engine { void print(const string&in); } -namespace UI { void treeNodeLeaf(const string&in, bool); } -namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); } -namespace UI { bool componentNode(const string&in, any@, ReciverFunc@); } -namespace UI { bool componentNode_contextMenu(const string&in, any@, ReciverFunc@, ReciverFunc@); } -namespace UI { void contextItemPopup(const string&in, any@, ReciverFunc@); } -namespace UI { void contextMenuPopup(const string&in, any@, ReciverFunc@); } -namespace UI { void modalPopup(const string&in, ReciverFunc@); } -namespace UI { void simplePopup(const string&in, ReciverFunc@); } -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, any@, TransferFunc@); } +namespace Engine { + Entity getRoot(); +} +namespace UI { + bool button(const string&in); +} +namespace UI { + bool buttonCenter(const string&in); +} +namespace UI { + bool buttonEnd(const string&in); +} +namespace UI { + bool checkbox(const string&in, bool); +} +namespace UI { + bool checkboxDisabled(const string&in, bool); +} +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 { + bool inputText(const string&in, const string&in, string&out); +} +namespace UI { + bool isItemClicked(int); +} +namespace UI { + bool isMouseDoubleClicked(int); +} +namespace UI { + float magicSlider(const string&in, float, float); +} +namespace UI { + vec3 magicSlider3(const string&in, vec3, float); +} +namespace UI { + bool menuItem(const string&in); +} +namespace UI { + void menuItemDisabled(const string&in); +} +namespace UI { + void menuSpace(const string&in, any@, ReciverFunc@); +} +namespace UI { + void sameline(); +} +namespace UI { + void separator(); +} +namespace UI { + void space(); +} +namespace UI { + void space(int, int = 10); +} +namespace UI { + void text(const string&in); +} +namespace UI { + void textCenter(const string&in); +} +namespace UI { + void textColor(float, float, float, const string&in); +} +namespace UI { + void textEnd(const string&in); +} +namespace UI { + void title(const string&in); +} +namespace UI { + void titleCenter(const string&in); +} +namespace UI { + void titleCenterY(const string&in, int); +} +namespace UI { + void titleEnd(const string&in); +} +namespace UI { + bool isKeyDown(key); +} +namespace UI { + bool isKeyPressed(key); +} +namespace UI { + bool isMouseDraggin(key); +} +namespace UI { + bool isPannelActive(); +} +namespace UI { + float getMouseDragDeltaX(); +} +namespace UI { + float getMouseDragDeltaY(); +} +namespace UI { + float getMouseDeltaX(); +} +namespace UI { + float getMouseDeltaY(); +} +namespace UI { + int getAvailableSizeX(); +} +namespace UI { + int getAvailableSizeY(); +} +namespace UI { + void disablePannelPadding(bool); +} +namespace UI { + int sliderInt(string&in, int, int, int); +} +namespace UI { + float slider(string&in, float, float, float); +} +namespace Engine { + FrameBuffer createRGBA8FrameBuffer(const string&in, int, int); +} +namespace Engine { + FrameBuffer getFrameBuffer(const string&in); +} +namespace Engine { + Environment getMainEnvironment(); +} +namespace Engine { + Environment createEnvironment(); +} +namespace UI { + void setupAutomaticColumns(int); +} +namespace UI { + void setupColumns(int); +} +namespace UI { + void endColumns(); +} +namespace UI { + void nextColumn(); +} +namespace Resource { + int getResourceCount(ResourceType, const string&in); +} +namespace Resource { + string getResourceNameById(ResourceType, const string&in, int); +} +namespace Resource { + string getResourcePathById(ResourceType, const string&in, int); +} +namespace Resource { + int getDirCount(ResourceType, const string&in); +} +namespace Resource { + string getDirPathById(ResourceType, const string&in, int); +} +namespace Resource { + string getDirNameById(ResourceType, const string&in, int); +} +namespace Engine { + void print(const string&in); +} +namespace UI { + void treeNodeLeaf(const string&in, bool); +} +namespace UI { + bool treeNode(const string&in, bool, any@, ReciverFunc@); +} +namespace UI { + bool componentNode(const string&in, any@, ReciverFunc@); +} +namespace UI { + bool componentNode_contextMenu(const string&in, any@, ReciverFunc@, ReciverFunc@); +} +namespace UI { + void contextItemPopup(const string&in, any@, ReciverFunc@); +} +namespace UI { + void contextMenuPopup(const string&in, any@, ReciverFunc@); +} +namespace UI { + void modalPopup(const string&in, ReciverFunc@); +} +namespace UI { + void simplePopup(const string&in, ReciverFunc@); +} +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, any@, TransferFunc@); +}