diff --git a/.gitignore b/.gitignore index 62a16ec..8323cfe 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,8 @@ cmake-build-*/ build/ # Files -*.user \ No newline at end of file +*.user + +# dotnet project +[Bb]in/ +[Oo]bj/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index be2e8f8..f73a0f7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,3 +17,6 @@ [submodule "Prism/vendor/ImGuizmo"] path = Prism/vendor/ImGuizmo url = https://github.com/CedricGuillemet/ImGuizmo.git +[submodule "Prism/vendor/EnTT"] + path = Prism/vendor/EnTT + url = https://github.com/skypjack/entt.git diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index 317d305..c012ebc 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -1,7 +1,12 @@ project(PrismEditor) +set(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/bin) + file(GLOB ASSETS assets) -file(COPY ${ASSETS} DESTINATION ${CMAKE_BINARY_DIR}/bin) +file(COPY ${ASSETS} DESTINATION ${CMAKE_BINARY_DIR}) + +file(GLOB DOTNET_LIBRARY library) +file(COPY ${DOTNET_LIBRARY} DESTINATION ${CMAKE_BINARY_DIR}) file(GLOB_RECURSE SRC_SOURCE ./**.cpp) diff --git a/Editor/Editor/EditorLayer.cpp b/Editor/Editor/EditorLayer.cpp index 7f8f0b0..731ffa2 100644 --- a/Editor/Editor/EditorLayer.cpp +++ b/Editor/Editor/EditorLayer.cpp @@ -129,31 +129,43 @@ namespace Prism void EditorLayer::OnAttach() { - auto environment = Environment::Load("assets/env/birchwood_4k.hdr"); + const auto environment = Environment::Load("assets/env/birchwood_4k.hdr"); // Model Scene { m_Scene = Ref::Create("Model Scene"); - m_Scene->SetCamera(Camera(glm::perspectiveFov(glm::radians(45.0f), 1280.0f, 720.0f, 0.1f, 10000.0f))); + m_CameraEntity = m_Scene->CreateEntity("Camera Entity"); + m_CameraEntity.AddComponent(Camera(glm::perspectiveFov(glm::radians(45.0f), 1280.0f, 720.0f, 0.1f, 10000.0f))); m_Scene->SetEnvironment(environment); m_MeshEntity = m_Scene->CreateEntity("test Entity"); auto mesh = Ref::Create("assets/meshes/TestScene.fbx"); - m_MeshEntity->SetMesh(mesh); + // auto mesh = Ref::Create("assets/models/Apollo AE/Apollo AE.fbx"); + // auto mesh = Ref::Create("assets/models/tafi/塔菲.pmx"); + m_MeshEntity.AddComponent(mesh); m_MeshMaterial = mesh->GetMaterial(); + m_MeshEntity.AddComponent("Example.Script"); + + // Test Sandbox + auto mapGenerator = m_Scene->CreateEntity("Map Generator"); + mapGenerator.AddComponent("Example.MapGenerator"); + + /* auto secondEntity = m_Scene->CreateEntity("Gun Entity"); secondEntity->Transform() = glm::translate(glm::mat4(1.0f), { 5, 5, 5 }) * glm::scale(glm::mat4(1.0f), {10, 10, 10}); mesh = Ref::Create("assets/models/m1911/M1911Materials.fbx"); secondEntity->SetMesh(mesh); + */ } // Sphere Scene { m_SphereScene = Ref::Create("PBR Sphere Scene"); - m_SphereScene->SetCamera(Camera(glm::perspectiveFov(glm::radians(45.0f), 1280.0f, 720.0f, 0.1f, 10000.0f))); + auto cameraEntity = m_SphereScene->CreateEntity("camera"); + cameraEntity.AddComponent(Camera(glm::perspectiveFov(glm::radians(45.0f), 1280.0f, 720.0f, 0.1f, 10000.0f))); m_SphereScene->SetEnvironment(environment); @@ -173,9 +185,11 @@ namespace Prism roughness += 0.15f; m_MetalSphereMaterialInstances.push_back(mi); + /* sphereEntity->SetMesh(sphereMesh); sphereEntity->SetMaterial(mi); sphereEntity->Transform() = glm::translate(glm::mat4(1.0f), glm::vec3(x, 0.0f, 0.0f)); + */ } x = -4.0f; @@ -191,16 +205,17 @@ namespace Prism roughness += 0.15f; m_DielectricSphereMaterialInstances.push_back(mi); + /* sphereEntity->SetMesh(sphereMesh); sphereEntity->SetMaterial(mi); sphereEntity->Transform() = glm::translate(glm::mat4(1.0f), glm::vec3(x, 1.2f, 0.0f)); + */ } } m_ActiveScene = m_Scene; m_SceneHierarchyPanel = CreateScope(m_ActiveScene); - m_PlaneMesh = Ref::Create("assets/models/Plane1m.obj"); // Editor m_CheckerboardTex = Texture2D::Create("assets/editor/Checkerboard.tga"); @@ -210,7 +225,7 @@ namespace Prism light.Direction = { -0.5f, -0.5f, 1.0f }; light.Radiance = { 1.0f, 1.0f, 1.0f }; - m_CurrentlySelectedTransform = &m_MeshEntity->Transform(); + m_CurrentlySelectedTransform = &m_MeshEntity.Transform(); } void EditorLayer::OnDetach() @@ -254,29 +269,35 @@ namespace Prism if (m_RoughnessInput.TextureMap) m_MeshMaterial->Set("u_RoughnessTexture", m_RoughnessInput.TextureMap); + /* if (m_AllowViewportCameraEvents) m_Scene->GetCamera().OnUpdate(deltaTime); + */ m_ActiveScene->OnUpdate(deltaTime); if (m_DrawOnTopBoundingBoxes) { Renderer::BeginRenderPass(SceneRenderer::GetFinalRenderPass(), false); - auto viewProj = m_Scene->GetCamera().GetViewProjection(); + auto viewProj = m_CameraEntity.GetComponent().Camera.GetViewProjection(); Renderer2D::BeginScene(viewProj, false); - Renderer::DrawAABB(m_MeshEntity->GetMesh(), m_MeshEntity->Transform()); + Renderer::DrawAABB(m_MeshEntity.GetComponent(), m_MeshEntity.GetComponent()); Renderer2D::EndScene(); Renderer::EndRenderPass(); } - if (!m_SelectedSubmeshes.empty()) + if (!m_SelectionContext.empty()) { + auto& selection = m_SelectionContext[0]; + Renderer::BeginRenderPass(SceneRenderer::GetFinalRenderPass(), false); - const auto viewProj = m_Scene->GetCamera().GetViewProjection(); + const auto viewProj = m_CameraEntity.GetComponent().Camera.GetViewProjection(); Renderer2D::BeginScene(viewProj, false); - const auto& submesh = m_SelectedSubmeshes[0]; - Renderer::DrawAABB(submesh.Mesh->BoundingBox, m_MeshEntity->GetTransform() * submesh.Mesh->Transform); + + const glm::vec4 color = (m_SelectionMode == SelectionMode::Entity) ? glm::vec4{ 1.0f, 1.0f, 1.0f, 1.0f } : glm::vec4{ 0.2f, 0.9f, 0.2f, 1.0f }; + Renderer::DrawAABB(selection.Mesh->BoundingBox, selection.Entity.GetComponent().Transform * selection.Mesh->Transform, color); + Renderer2D::EndScene(); Renderer::EndRenderPass(); } @@ -456,7 +477,7 @@ namespace Prism Property("Light Direction", light.Direction); Property("Light Radiance", light.Radiance, PropertyFlag::ColorProperty); Property("Light Multiplier", light.Multiplier, 0.0f, 5.0f); - Property("Exposure", m_ActiveScene->GetCamera().GetExposure(), 0.0f, 5.0f); + Property("Exposure", m_CameraEntity.GetComponent().Camera.GetExposure(), 0.0f, 5.0f); Property("Radiance Prefiltering", m_RadiancePrefilter); Property("Env Map Rotation", m_EnvMapRotation, -360.0f, 360.0f); @@ -466,6 +487,12 @@ namespace Prism if (m_UIShowBoundingBoxes && Property("On Top", m_UIShowBoundingBoxesOnTop)) ShowBoundingBoxes(m_UIShowBoundingBoxes, m_UIShowBoundingBoxesOnTop); + const char* label = m_SelectionMode == SelectionMode::Entity ? "Entity" : "Mesh"; + if (ImGui::Button(label)) + { + m_SelectionMode = m_SelectionMode == SelectionMode::Entity ? SelectionMode::SubMesh : SelectionMode::Entity; + } + ImGui::Columns(1); ImGui::End(); @@ -473,8 +500,8 @@ namespace Prism ImGui::Separator(); { ImGui::Text("Mesh"); - auto mesh = m_MeshEntity->GetMesh(); - std::string fullpath = mesh ? mesh->GetFilePath() : "None"; + auto meshComponent = m_MeshEntity.GetComponent(); + std::string fullpath = meshComponent.Mesh ? meshComponent.Mesh->GetFilePath() : "None"; size_t found = fullpath.find_last_of("/\\"); std::string path = found != std::string::npos ? fullpath.substr(found + 1) : fullpath; ImGui::Text(path.c_str()); @@ -487,7 +514,7 @@ namespace Prism auto newMesh = Ref::Create(filename); // m_MeshMaterial.reset(new MaterialInstance(newMesh->GetMaterial())); // m_MeshEntity->SetMaterial(m_MeshMaterial); - m_MeshEntity->SetMesh(newMesh); + meshComponent.Mesh = newMesh; } } } @@ -658,8 +685,8 @@ namespace Prism auto viewportOffset = ImGui::GetCursorPos(); // includes tab bar auto viewportSize = ImGui::GetContentRegionAvail(); SceneRenderer::SetViewportSize((uint32_t)viewportSize.x, (uint32_t)viewportSize.y); - m_ActiveScene->GetCamera().SetProjectionMatrix(glm::perspectiveFov(glm::radians(45.0f), viewportSize.x, viewportSize.y, 0.1f, 10000.0f)); - m_ActiveScene->GetCamera().SetViewportSize((uint32_t)viewportSize.x, (uint32_t)viewportSize.y); + m_CameraEntity.GetComponent().Camera.SetProjectionMatrix(glm::perspectiveFov(glm::radians(45.0f), viewportSize.x, viewportSize.y, 0.1f, 10000.0f)); + m_CameraEntity.GetComponent().Camera.SetViewportSize((uint32_t)viewportSize.x, (uint32_t)viewportSize.y); ImGui::Image((ImTextureRef)SceneRenderer::GetFinalColorBufferRendererID(), viewportSize, { 0, 1 }, { 1, 0 }); @@ -677,21 +704,41 @@ namespace Prism // ImGuizmo if (m_GizmoType != -1 && m_CurrentlySelectedTransform) { + auto& selection = m_SelectionContext[0]; + const auto rw = (float)ImGui::GetWindowWidth(); const auto rh = (float)ImGui::GetWindowHeight(); ImGuizmo::SetOrthographic(false); ImGuizmo::SetDrawlist(); ImGuizmo::SetRect(ImGui::GetWindowPos().x, ImGui::GetWindowPos().y, rw, rh); - const auto& camera = m_ActiveScene->GetCamera(); - bool snap = Input::IsKeyPressed(PM_KEY_LEFT_CONTROL); - ImGuizmo::Manipulate(glm::value_ptr(camera.GetViewMatrix()), - glm::value_ptr(camera.GetProjectionMatrix()), - (ImGuizmo::OPERATION)m_GizmoType, - ImGuizmo::LOCAL, - glm::value_ptr(m_MeshEntity->Transform()), - nullptr, - snap ? &m_SnapValue : nullptr); + const auto& camera = m_CameraEntity.GetComponent().Camera; + bool snap = Input::IsKeyPressed(Key::LEFT_CONTROL); + + auto& entityTransform = selection.Entity.Transform(); + float snapValue[3] = { m_SnapValue, m_SnapValue, m_SnapValue }; + if (m_SelectionMode == SelectionMode::Entity) + { + ImGuizmo::Manipulate(glm::value_ptr(camera.GetViewMatrix()), + glm::value_ptr(camera.GetProjectionMatrix()), + (ImGuizmo::OPERATION)m_GizmoType, + ImGuizmo::LOCAL, + glm::value_ptr(m_MeshEntity.GetComponent().Transform), + nullptr, + snap ? snapValue : nullptr); + }else + { + glm::mat4 transformBase = entityTransform * selection.Mesh->Transform; + ImGuizmo::Manipulate(glm::value_ptr(camera.GetViewMatrix()), + glm::value_ptr(camera.GetProjectionMatrix()), + (ImGuizmo::OPERATION)m_GizmoType, + ImGuizmo::LOCAL, + glm::value_ptr(transformBase), + nullptr, + snap ? snapValue : nullptr); + + selection.Mesh->Transform = glm::inverse(entityTransform) * transformBase; + } } ImGui::End(); @@ -701,8 +748,10 @@ namespace Prism void EditorLayer::OnEvent(Event& e) { + /* if (m_AllowViewportCameraEvents) m_Scene->GetCamera().OnEvent(e); + */ EventDispatcher dispatcher(e); dispatcher.Dispatch(PM_BIND_EVENT_FN(EditorLayer::OnKeyPressedEvent)); @@ -713,26 +762,26 @@ namespace Prism { switch (e.GetKeyCode()) { - case PM_KEY_Q: + case KeyCode::Q: m_GizmoType = -1; break; - case PM_KEY_W: + case KeyCode::W: m_GizmoType = ImGuizmo::OPERATION::TRANSLATE; break; - case PM_KEY_E: + case KeyCode::E: m_GizmoType = ImGuizmo::OPERATION::ROTATE; break; - case PM_KEY_R: + case KeyCode::R: m_GizmoType = ImGuizmo::OPERATION::SCALE; break; - case PM_KEY_G: + case KeyCode::G: // Toggle grid - if (Input::IsKeyPressed(PM_KEY_LEFT_CONTROL)) + if (Input::IsKeyPressed(KeyCode::LEFT_CONTROL)) SceneRenderer::GetOptions().ShowGrid = !SceneRenderer::GetOptions().ShowGrid; break; - case PM_KEY_B: + case KeyCode::B: // Toggle bounding boxes - if (Input::IsKeyPressed(PM_KEY_LEFT_CONTROL)) + if (Input::IsKeyPressed(KeyCode::LEFT_CONTROL)) { m_UIShowBoundingBoxes = !m_UIShowBoundingBoxes; ShowBoundingBoxes(m_UIShowBoundingBoxes, m_UIShowBoundingBoxesOnTop); @@ -746,49 +795,57 @@ namespace Prism bool EditorLayer::OnMouseButtonPressedEvent(MouseButtonPressedEvent& e) { auto [mx, my] = Input::GetMousePosition(); - if (e.GetMouseButton() == PM_MOUSE_BUTTON_LEFT && !Input::IsKeyPressed(PM_KEY_LEFT_ALT) && !ImGuizmo::IsOver()) + if (e.GetMouseButton() == PM_MOUSE_BUTTON_LEFT && !Input::IsKeyPressed(KeyCode::LEFT_ALT) && !ImGuizmo::IsOver()) { auto [mouseX, mouseY] = GetMouseViewportSpace(); if (mouseX > -1.0f && mouseX < 1.0f && mouseY > -1.0f && mouseY < 1.0f) { auto [origin, direction] = CastRay(mouseX, mouseY); - m_SelectedSubmeshes.clear(); - auto mesh = m_MeshEntity->GetMesh(); - auto& submeshes = mesh->GetSubmeshes(); - float lastT = std::numeric_limits::max(); - for (uint32_t i = 0; i < submeshes.size(); i++) + m_SelectionContext.clear(); + const auto meshEntities = m_Scene->GetAllEntitiesWith(); + for (auto e : meshEntities) { - auto& submesh = submeshes[i]; - Ray ray = { - glm::inverse(m_MeshEntity->GetTransform() * submesh.Transform) * glm::vec4(origin, 1.0f), - glm::inverse(glm::mat3(m_MeshEntity->GetTransform()) * glm::mat3(submesh.Transform)) * direction - }; + Entity entity = { e, m_Scene.Raw() }; + auto mesh = entity.GetComponent().Mesh; - float t; - const bool intersects = ray.IntersectsAABB(submesh.BoundingBox, t); - if (intersects) + if (!mesh) + continue; + + auto& submeshes = mesh->GetSubmeshes(); + float lastT = std::numeric_limits::max(); + for (uint32_t i = 0; i < submeshes.size(); i++) { - const auto& triangleCache = mesh->GetTriangleCache(i); - for (const auto& triangle : triangleCache) + auto& submesh = submeshes[i]; + Ray ray = { + glm::inverse(entity.Transform() * submesh.Transform) * glm::vec4(origin, 1.0f), + glm::inverse(glm::mat3(entity.Transform()) * glm::mat3(submesh.Transform)) * direction + }; + + float t; + if (bool intersects = ray.IntersectsAABB(submesh.BoundingBox, t)) { - if (ray.IntersectsTriangle(triangle.V0.Position, triangle.V1.Position, triangle.V2.Position, t)) + const auto& triangleCache = mesh->GetTriangleCache(i); + for (const auto& triangle : triangleCache) { - PM_CLIENT_WARN("INTERSECTION: {0}, t={1}", submesh.NodeName, t); - m_SelectedSubmeshes.push_back({ &submesh, t }); - break; + if (ray.IntersectsTriangle(triangle.V0.Position, triangle.V1.Position, triangle.V2.Position, t)) + { + PM_CLIENT_WARN("INTERSECTION: {0}, t={1}", submesh.NodeName, t); + m_SelectionContext.push_back({ entity, &submesh, t }); + break; + } } } } + } - std::sort(m_SelectedSubmeshes.begin(), m_SelectedSubmeshes.end(), [](auto& a, auto& b) { return a.Distance < b.Distance; }); - - // TODO: Handle mesh being deleted, etc. - if (!m_SelectedSubmeshes.empty()) - m_CurrentlySelectedTransform = &m_SelectedSubmeshes[0].Mesh->Transform; - else - m_CurrentlySelectedTransform = &m_MeshEntity->Transform(); + std::sort(m_SelectionContext.begin(), m_SelectionContext.end(), [](auto& a, auto& b) + { + return a.Distance < b.Distance; + }); + if (!m_SelectionContext.empty()) + OnSelected(m_SelectionContext[0]); } } return false; @@ -815,13 +872,29 @@ namespace Prism { const glm::vec4 mouseClipPos = { mx, my, -1.0f, 1.0f }; - const auto inverseProj = glm::inverse(m_Scene->GetCamera().GetProjectionMatrix()); - const auto inverseView = glm::inverse(glm::mat3(m_Scene->GetCamera().GetViewMatrix())); + const auto inverseProj = glm::inverse(m_CameraEntity.GetComponent().Camera.GetProjectionMatrix()); + const auto inverseView = glm::inverse(glm::mat3(m_CameraEntity.GetComponent().Camera.GetViewMatrix())); const glm::vec4 ray = inverseProj * mouseClipPos; - glm::vec3 rayPos = m_Scene->GetCamera().GetPosition(); + glm::vec3 rayPos = m_CameraEntity.GetComponent().Camera.GetPosition(); glm::vec3 rayDir = inverseView * glm::vec3(ray); return { rayPos, rayDir }; } + + void EditorLayer::OnSelected(const SelectedSubmesh& selectionContext) + { + m_SceneHierarchyPanel->SetSelected(selectionContext.Entity); + } + + Ray EditorLayer::CastMouseRay() + { + auto [mouseX, mouseY] = GetMouseViewportSpace(); + if (mouseX > -1.0f && mouseX < 1.0f && mouseY > -1.0f && mouseY < 1.0f) + { + auto [origin, direction] = CastRay(mouseX, mouseY); + return Ray(origin, direction); + } + return Ray::Zero(); + } } diff --git a/Editor/Editor/EditorLayer.h b/Editor/Editor/EditorLayer.h index 6bd7a64..ce2d4e6 100644 --- a/Editor/Editor/EditorLayer.h +++ b/Editor/Editor/EditorLayer.h @@ -32,6 +32,14 @@ namespace Prism std::pair GetMouseViewportSpace() const; std::pair CastRay(float mx, float my); + struct SelectedSubmesh + { + Prism::Entity Entity; + Submesh* Mesh; + float Distance; + }; + void OnSelected(const SelectedSubmesh& selectionContext); + Ray CastMouseRay(); private: Scope m_SceneHierarchyPanel; @@ -39,9 +47,9 @@ namespace Prism Ref m_SphereScene; Ref m_ActiveScene; - Entity* m_MeshEntity = nullptr; + Entity m_MeshEntity; + Entity m_CameraEntity; - Ref m_PlaneMesh; Ref m_SphereBaseMaterial; Ref m_MeshMaterial; @@ -55,12 +63,14 @@ namespace Prism int m_GizmoType = -1; // -1 = no gizmo float m_SnapValue = 0.5f; - struct SelectedSubmesh + enum class SelectionMode { - Submesh* Mesh; - float Distance; + None = 0, Entity = 1, SubMesh = 2 }; - std::vector m_SelectedSubmeshes; + SelectionMode m_SelectionMode = SelectionMode::Entity; + + std::vector m_SelectionContext; + glm::mat4* m_RelativeTransform = nullptr; glm::mat4* m_CurrentlySelectedTransform = nullptr; // configure button diff --git a/Editor/library/mono/net8.0/Microsoft.CSharp.dll b/Editor/library/mono/net8.0/Microsoft.CSharp.dll new file mode 100644 index 0000000..0aa8bc1 Binary files /dev/null and b/Editor/library/mono/net8.0/Microsoft.CSharp.dll differ diff --git a/Editor/library/mono/net8.0/Microsoft.NETCore.App.deps.json b/Editor/library/mono/net8.0/Microsoft.NETCore.App.deps.json new file mode 100644 index 0000000..c16757d --- /dev/null +++ b/Editor/library/mono/net8.0/Microsoft.NETCore.App.deps.json @@ -0,0 +1,840 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0/win-x64", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": {}, + ".NETCoreApp,Version=v8.0/win-x64": { + "Microsoft.NETCore.App.Runtime.Mono.win-x64/8.0.22": { + "runtime": { + "System.Private.CoreLib.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "Microsoft.CSharp.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "Microsoft.VisualBasic.Core.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.2225.52707" + }, + "Microsoft.VisualBasic.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "Microsoft.Win32.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "Microsoft.Win32.Registry.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "mscorlib.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "netstandard.dll": { + "assemblyVersion": "2.1.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.AppContext.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Buffers.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Collections.Concurrent.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Collections.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Collections.Immutable.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Collections.NonGeneric.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Collections.Specialized.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ComponentModel.Annotations.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ComponentModel.DataAnnotations.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ComponentModel.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ComponentModel.EventBasedAsync.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ComponentModel.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Configuration.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Console.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Core.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Data.Common.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Data.DataSetExtensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Data.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.Contracts.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.Debug.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.FileVersionInfo.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.Process.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.StackTrace.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.TextWriterTraceListener.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.Tools.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.TraceSource.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Diagnostics.Tracing.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Drawing.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Drawing.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Dynamic.Runtime.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Formats.Asn1.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Formats.Tar.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Globalization.Calendars.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Globalization.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Globalization.Extensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.Compression.Brotli.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.Compression.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.Compression.FileSystem.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.Compression.ZipFile.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.FileSystem.AccessControl.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.FileSystem.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.FileSystem.DriveInfo.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.FileSystem.Watcher.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.IsolatedStorage.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.MemoryMappedFiles.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.Pipes.AccessControl.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.Pipes.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.IO.UnmanagedMemoryStream.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Linq.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Linq.Expressions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Linq.Parallel.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Linq.Queryable.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Memory.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Http.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Http.Json.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.HttpListener.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Mail.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.NameResolution.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.NetworkInformation.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Ping.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Quic.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Requests.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Security.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.ServicePoint.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.Sockets.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.WebClient.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.WebHeaderCollection.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.WebProxy.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.WebSockets.Client.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Net.WebSockets.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Numerics.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Numerics.Vectors.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ObjectModel.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Private.DataContractSerialization.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Private.Uri.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Private.Xml.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Private.Xml.Linq.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.DispatchProxy.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.Emit.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.Extensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.Metadata.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Resources.Reader.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Resources.ResourceManager.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Resources.Writer.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.CompilerServices.VisualC.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Extensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Handles.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.InteropServices.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.InteropServices.JavaScript.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.InteropServices.RuntimeInformation.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Intrinsics.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Loader.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Numerics.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Serialization.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Runtime.Serialization.Xml.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.AccessControl.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Claims.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.Algorithms.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.Cng.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.Csp.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.Encoding.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Cryptography.X509Certificates.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Principal.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.Principal.Windows.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Security.SecureString.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ServiceModel.Web.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ServiceProcess.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Text.Encoding.CodePages.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Text.Encoding.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Text.Encoding.Extensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Text.Encodings.Web.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Text.Json.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Text.RegularExpressions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Channels.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Overlapped.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Tasks.Dataflow.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Tasks.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Tasks.Parallel.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Thread.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.ThreadPool.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Threading.Timer.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Transactions.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Transactions.Local.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.ValueTuple.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Web.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Web.HttpUtility.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Windows.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.Linq.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.ReaderWriter.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.Serialization.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.XDocument.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.XmlDocument.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.XmlSerializer.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.XPath.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "System.Xml.XPath.XDocument.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.2225.52707" + }, + "WindowsBase.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "8.0.2225.52707" + } + }, + "native": { + "coreclr.dll": { + "fileVersion": "8.0.2225.52707" + }, + "msquic.dll": { + "fileVersion": "2.4.8.0" + }, + "System.IO.Compression.Native.dll": { + "fileVersion": "8.0.2225.52707" + }, + "hostpolicy.dll": { + "fileVersion": "8.0.2225.52707" + }, + "Microsoft.DiaSymReader.Native.amd64.dll": { + "fileVersion": "14.42.34436.0" + } + } + } + } + }, + "libraries": { + "Microsoft.NETCore.App.Runtime.Mono.win-x64/8.0.22": { + "type": "package", + "serviceable": true, + "sha512": "", + "path": "microsoft.netcore.app.runtime.mono.win-x64/8.0.22" + } + }, + "runtimes": { + "win-x64": [ + "win", + "any", + "base" + ], + "win-x64-aot": [ + "win-aot", + "win-x64", + "win", + "aot", + "any", + "base" + ], + "win10-x64": [ + "win10", + "win81-x64", + "win81", + "win8-x64", + "win8", + "win7-x64", + "win7", + "win-x64", + "win", + "any", + "base" + ], + "win10-x64-aot": [ + "win10-aot", + "win10-x64", + "win10", + "win81-x64-aot", + "win81-aot", + "win81-x64", + "win81", + "win8-x64-aot", + "win8-aot", + "win8-x64", + "win8", + "win7-x64-aot", + "win7-aot", + "win7-x64", + "win7", + "win-x64-aot", + "win-aot", + "win-x64", + "win", + "aot", + "any", + "base" + ], + "win7-x64": [ + "win7", + "win-x64", + "win", + "any", + "base" + ], + "win7-x64-aot": [ + "win7-aot", + "win7-x64", + "win7", + "win-x64-aot", + "win-aot", + "win-x64", + "win", + "aot", + "any", + "base" + ], + "win8-x64": [ + "win8", + "win7-x64", + "win7", + "win-x64", + "win", + "any", + "base" + ], + "win8-x64-aot": [ + "win8-aot", + "win8-x64", + "win8", + "win7-x64-aot", + "win7-aot", + "win7-x64", + "win7", + "win-x64-aot", + "win-aot", + "win-x64", + "win", + "aot", + "any", + "base" + ], + "win81-x64": [ + "win81", + "win8-x64", + "win8", + "win7-x64", + "win7", + "win-x64", + "win", + "any", + "base" + ], + "win81-x64-aot": [ + "win81-aot", + "win81-x64", + "win81", + "win8-x64-aot", + "win8-aot", + "win8-x64", + "win8", + "win7-x64-aot", + "win7-aot", + "win7-x64", + "win7", + "win-x64-aot", + "win-aot", + "win-x64", + "win", + "aot", + "any", + "base" + ] + } +} \ No newline at end of file diff --git a/Editor/library/mono/net8.0/Microsoft.NETCore.App.runtimeconfig.json b/Editor/library/mono/net8.0/Microsoft.NETCore.App.runtimeconfig.json new file mode 100644 index 0000000..c4fb572 --- /dev/null +++ b/Editor/library/mono/net8.0/Microsoft.NETCore.App.runtimeconfig.json @@ -0,0 +1,5 @@ +{ + "runtimeOptions": { + "tfm": "net8.0" + } +} \ No newline at end of file diff --git a/Editor/library/mono/net8.0/Microsoft.VisualBasic.Core.dll b/Editor/library/mono/net8.0/Microsoft.VisualBasic.Core.dll new file mode 100644 index 0000000..bda0df7 Binary files /dev/null and b/Editor/library/mono/net8.0/Microsoft.VisualBasic.Core.dll differ diff --git a/Editor/library/mono/net8.0/Microsoft.VisualBasic.dll b/Editor/library/mono/net8.0/Microsoft.VisualBasic.dll new file mode 100644 index 0000000..348a13e Binary files /dev/null and b/Editor/library/mono/net8.0/Microsoft.VisualBasic.dll differ diff --git a/Editor/library/mono/net8.0/Microsoft.Win32.Primitives.dll b/Editor/library/mono/net8.0/Microsoft.Win32.Primitives.dll new file mode 100644 index 0000000..f1f52be Binary files /dev/null and b/Editor/library/mono/net8.0/Microsoft.Win32.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/Microsoft.Win32.Registry.dll b/Editor/library/mono/net8.0/Microsoft.Win32.Registry.dll new file mode 100644 index 0000000..2889290 Binary files /dev/null and b/Editor/library/mono/net8.0/Microsoft.Win32.Registry.dll differ diff --git a/Editor/library/mono/net8.0/System.AppContext.dll b/Editor/library/mono/net8.0/System.AppContext.dll new file mode 100644 index 0000000..83dd276 Binary files /dev/null and b/Editor/library/mono/net8.0/System.AppContext.dll differ diff --git a/Editor/library/mono/net8.0/System.Buffers.dll b/Editor/library/mono/net8.0/System.Buffers.dll new file mode 100644 index 0000000..8892b4f Binary files /dev/null and b/Editor/library/mono/net8.0/System.Buffers.dll differ diff --git a/Editor/library/mono/net8.0/System.Collections.Concurrent.dll b/Editor/library/mono/net8.0/System.Collections.Concurrent.dll new file mode 100644 index 0000000..bbbf3b6 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Collections.Concurrent.dll differ diff --git a/Editor/library/mono/net8.0/System.Collections.Immutable.dll b/Editor/library/mono/net8.0/System.Collections.Immutable.dll new file mode 100644 index 0000000..9d8188d Binary files /dev/null and b/Editor/library/mono/net8.0/System.Collections.Immutable.dll differ diff --git a/Editor/library/mono/net8.0/System.Collections.NonGeneric.dll b/Editor/library/mono/net8.0/System.Collections.NonGeneric.dll new file mode 100644 index 0000000..e7aaa90 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Collections.NonGeneric.dll differ diff --git a/Editor/library/mono/net8.0/System.Collections.Specialized.dll b/Editor/library/mono/net8.0/System.Collections.Specialized.dll new file mode 100644 index 0000000..a70f693 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Collections.Specialized.dll differ diff --git a/Editor/library/mono/net8.0/System.Collections.dll b/Editor/library/mono/net8.0/System.Collections.dll new file mode 100644 index 0000000..233388a Binary files /dev/null and b/Editor/library/mono/net8.0/System.Collections.dll differ diff --git a/Editor/library/mono/net8.0/System.ComponentModel.Annotations.dll b/Editor/library/mono/net8.0/System.ComponentModel.Annotations.dll new file mode 100644 index 0000000..d73c7b8 Binary files /dev/null and b/Editor/library/mono/net8.0/System.ComponentModel.Annotations.dll differ diff --git a/Editor/library/mono/net8.0/System.ComponentModel.DataAnnotations.dll b/Editor/library/mono/net8.0/System.ComponentModel.DataAnnotations.dll new file mode 100644 index 0000000..6f4638d Binary files /dev/null and b/Editor/library/mono/net8.0/System.ComponentModel.DataAnnotations.dll differ diff --git a/Editor/library/mono/net8.0/System.ComponentModel.EventBasedAsync.dll b/Editor/library/mono/net8.0/System.ComponentModel.EventBasedAsync.dll new file mode 100644 index 0000000..c03acb4 Binary files /dev/null and b/Editor/library/mono/net8.0/System.ComponentModel.EventBasedAsync.dll differ diff --git a/Editor/library/mono/net8.0/System.ComponentModel.Primitives.dll b/Editor/library/mono/net8.0/System.ComponentModel.Primitives.dll new file mode 100644 index 0000000..ebf1637 Binary files /dev/null and b/Editor/library/mono/net8.0/System.ComponentModel.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/System.ComponentModel.TypeConverter.dll b/Editor/library/mono/net8.0/System.ComponentModel.TypeConverter.dll new file mode 100644 index 0000000..864887f Binary files /dev/null and b/Editor/library/mono/net8.0/System.ComponentModel.TypeConverter.dll differ diff --git a/Editor/library/mono/net8.0/System.ComponentModel.dll b/Editor/library/mono/net8.0/System.ComponentModel.dll new file mode 100644 index 0000000..aea91fa Binary files /dev/null and b/Editor/library/mono/net8.0/System.ComponentModel.dll differ diff --git a/Editor/library/mono/net8.0/System.Configuration.dll b/Editor/library/mono/net8.0/System.Configuration.dll new file mode 100644 index 0000000..e88c436 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Configuration.dll differ diff --git a/Editor/library/mono/net8.0/System.Console.dll b/Editor/library/mono/net8.0/System.Console.dll new file mode 100644 index 0000000..c326266 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Console.dll differ diff --git a/Editor/library/mono/net8.0/System.Core.dll b/Editor/library/mono/net8.0/System.Core.dll new file mode 100644 index 0000000..b85a86c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Core.dll differ diff --git a/Editor/library/mono/net8.0/System.Data.Common.dll b/Editor/library/mono/net8.0/System.Data.Common.dll new file mode 100644 index 0000000..5b269a3 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Data.Common.dll differ diff --git a/Editor/library/mono/net8.0/System.Data.DataSetExtensions.dll b/Editor/library/mono/net8.0/System.Data.DataSetExtensions.dll new file mode 100644 index 0000000..e726e21 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Data.DataSetExtensions.dll differ diff --git a/Editor/library/mono/net8.0/System.Data.dll b/Editor/library/mono/net8.0/System.Data.dll new file mode 100644 index 0000000..b6eba6a Binary files /dev/null and b/Editor/library/mono/net8.0/System.Data.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.Contracts.dll b/Editor/library/mono/net8.0/System.Diagnostics.Contracts.dll new file mode 100644 index 0000000..68a1109 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.Contracts.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.Debug.dll b/Editor/library/mono/net8.0/System.Diagnostics.Debug.dll new file mode 100644 index 0000000..e69f352 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.Debug.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.DiagnosticSource.dll b/Editor/library/mono/net8.0/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 0000000..cad11fa Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.DiagnosticSource.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.FileVersionInfo.dll b/Editor/library/mono/net8.0/System.Diagnostics.FileVersionInfo.dll new file mode 100644 index 0000000..f246452 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.FileVersionInfo.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.Process.dll b/Editor/library/mono/net8.0/System.Diagnostics.Process.dll new file mode 100644 index 0000000..a963dd9 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.Process.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.StackTrace.dll b/Editor/library/mono/net8.0/System.Diagnostics.StackTrace.dll new file mode 100644 index 0000000..2eb61ab Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.StackTrace.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.TextWriterTraceListener.dll b/Editor/library/mono/net8.0/System.Diagnostics.TextWriterTraceListener.dll new file mode 100644 index 0000000..94d373b Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.TextWriterTraceListener.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.Tools.dll b/Editor/library/mono/net8.0/System.Diagnostics.Tools.dll new file mode 100644 index 0000000..d243fde Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.Tools.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.TraceSource.dll b/Editor/library/mono/net8.0/System.Diagnostics.TraceSource.dll new file mode 100644 index 0000000..8729505 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.TraceSource.dll differ diff --git a/Editor/library/mono/net8.0/System.Diagnostics.Tracing.dll b/Editor/library/mono/net8.0/System.Diagnostics.Tracing.dll new file mode 100644 index 0000000..c22d44d Binary files /dev/null and b/Editor/library/mono/net8.0/System.Diagnostics.Tracing.dll differ diff --git a/Editor/library/mono/net8.0/System.Drawing.Primitives.dll b/Editor/library/mono/net8.0/System.Drawing.Primitives.dll new file mode 100644 index 0000000..444b9bc Binary files /dev/null and b/Editor/library/mono/net8.0/System.Drawing.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/System.Drawing.dll b/Editor/library/mono/net8.0/System.Drawing.dll new file mode 100644 index 0000000..8dd6a2c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Drawing.dll differ diff --git a/Editor/library/mono/net8.0/System.Dynamic.Runtime.dll b/Editor/library/mono/net8.0/System.Dynamic.Runtime.dll new file mode 100644 index 0000000..fc25f02 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Dynamic.Runtime.dll differ diff --git a/Editor/library/mono/net8.0/System.Formats.Asn1.dll b/Editor/library/mono/net8.0/System.Formats.Asn1.dll new file mode 100644 index 0000000..df206e0 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Formats.Asn1.dll differ diff --git a/Editor/library/mono/net8.0/System.Formats.Tar.dll b/Editor/library/mono/net8.0/System.Formats.Tar.dll new file mode 100644 index 0000000..1b756d5 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Formats.Tar.dll differ diff --git a/Editor/library/mono/net8.0/System.Globalization.Calendars.dll b/Editor/library/mono/net8.0/System.Globalization.Calendars.dll new file mode 100644 index 0000000..fd90c8b Binary files /dev/null and b/Editor/library/mono/net8.0/System.Globalization.Calendars.dll differ diff --git a/Editor/library/mono/net8.0/System.Globalization.Extensions.dll b/Editor/library/mono/net8.0/System.Globalization.Extensions.dll new file mode 100644 index 0000000..9ddd427 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Globalization.Extensions.dll differ diff --git a/Editor/library/mono/net8.0/System.Globalization.dll b/Editor/library/mono/net8.0/System.Globalization.dll new file mode 100644 index 0000000..67a009d Binary files /dev/null and b/Editor/library/mono/net8.0/System.Globalization.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.Compression.Brotli.dll b/Editor/library/mono/net8.0/System.IO.Compression.Brotli.dll new file mode 100644 index 0000000..8d14534 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.Compression.Brotli.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.Compression.FileSystem.dll b/Editor/library/mono/net8.0/System.IO.Compression.FileSystem.dll new file mode 100644 index 0000000..b2be5fa Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.Compression.FileSystem.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.Compression.ZipFile.dll b/Editor/library/mono/net8.0/System.IO.Compression.ZipFile.dll new file mode 100644 index 0000000..540969b Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.Compression.ZipFile.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.Compression.dll b/Editor/library/mono/net8.0/System.IO.Compression.dll new file mode 100644 index 0000000..c70bf48 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.Compression.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.FileSystem.AccessControl.dll b/Editor/library/mono/net8.0/System.IO.FileSystem.AccessControl.dll new file mode 100644 index 0000000..7101e27 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.FileSystem.AccessControl.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.FileSystem.DriveInfo.dll b/Editor/library/mono/net8.0/System.IO.FileSystem.DriveInfo.dll new file mode 100644 index 0000000..8bf3cf3 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.FileSystem.DriveInfo.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.FileSystem.Primitives.dll b/Editor/library/mono/net8.0/System.IO.FileSystem.Primitives.dll new file mode 100644 index 0000000..9ba655e Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.FileSystem.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.FileSystem.Watcher.dll b/Editor/library/mono/net8.0/System.IO.FileSystem.Watcher.dll new file mode 100644 index 0000000..61a9a15 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.FileSystem.Watcher.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.FileSystem.dll b/Editor/library/mono/net8.0/System.IO.FileSystem.dll new file mode 100644 index 0000000..fb8dc7d Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.FileSystem.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.IsolatedStorage.dll b/Editor/library/mono/net8.0/System.IO.IsolatedStorage.dll new file mode 100644 index 0000000..868fd41 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.IsolatedStorage.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.MemoryMappedFiles.dll b/Editor/library/mono/net8.0/System.IO.MemoryMappedFiles.dll new file mode 100644 index 0000000..27082b4 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.MemoryMappedFiles.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.Pipes.AccessControl.dll b/Editor/library/mono/net8.0/System.IO.Pipes.AccessControl.dll new file mode 100644 index 0000000..407705d Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.Pipes.AccessControl.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.Pipes.dll b/Editor/library/mono/net8.0/System.IO.Pipes.dll new file mode 100644 index 0000000..c718875 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.Pipes.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.UnmanagedMemoryStream.dll b/Editor/library/mono/net8.0/System.IO.UnmanagedMemoryStream.dll new file mode 100644 index 0000000..c353aa2 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.UnmanagedMemoryStream.dll differ diff --git a/Editor/library/mono/net8.0/System.IO.dll b/Editor/library/mono/net8.0/System.IO.dll new file mode 100644 index 0000000..7e18f44 Binary files /dev/null and b/Editor/library/mono/net8.0/System.IO.dll differ diff --git a/Editor/library/mono/net8.0/System.Linq.Expressions.dll b/Editor/library/mono/net8.0/System.Linq.Expressions.dll new file mode 100644 index 0000000..81d7351 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Linq.Expressions.dll differ diff --git a/Editor/library/mono/net8.0/System.Linq.Parallel.dll b/Editor/library/mono/net8.0/System.Linq.Parallel.dll new file mode 100644 index 0000000..65d5ae6 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Linq.Parallel.dll differ diff --git a/Editor/library/mono/net8.0/System.Linq.Queryable.dll b/Editor/library/mono/net8.0/System.Linq.Queryable.dll new file mode 100644 index 0000000..06c0e89 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Linq.Queryable.dll differ diff --git a/Editor/library/mono/net8.0/System.Linq.dll b/Editor/library/mono/net8.0/System.Linq.dll new file mode 100644 index 0000000..4c30752 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Linq.dll differ diff --git a/Editor/library/mono/net8.0/System.Memory.dll b/Editor/library/mono/net8.0/System.Memory.dll new file mode 100644 index 0000000..5177b86 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Memory.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Http.Json.dll b/Editor/library/mono/net8.0/System.Net.Http.Json.dll new file mode 100644 index 0000000..548bff9 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Http.Json.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Http.dll b/Editor/library/mono/net8.0/System.Net.Http.dll new file mode 100644 index 0000000..c63863d Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Http.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.HttpListener.dll b/Editor/library/mono/net8.0/System.Net.HttpListener.dll new file mode 100644 index 0000000..4afaa95 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.HttpListener.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Mail.dll b/Editor/library/mono/net8.0/System.Net.Mail.dll new file mode 100644 index 0000000..16414c2 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Mail.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.NameResolution.dll b/Editor/library/mono/net8.0/System.Net.NameResolution.dll new file mode 100644 index 0000000..9d4c58b Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.NameResolution.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.NetworkInformation.dll b/Editor/library/mono/net8.0/System.Net.NetworkInformation.dll new file mode 100644 index 0000000..52110f0 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.NetworkInformation.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Ping.dll b/Editor/library/mono/net8.0/System.Net.Ping.dll new file mode 100644 index 0000000..6fd6a54 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Ping.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Primitives.dll b/Editor/library/mono/net8.0/System.Net.Primitives.dll new file mode 100644 index 0000000..bf4c3a6 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Quic.dll b/Editor/library/mono/net8.0/System.Net.Quic.dll new file mode 100644 index 0000000..26f4529 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Quic.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Requests.dll b/Editor/library/mono/net8.0/System.Net.Requests.dll new file mode 100644 index 0000000..aa31d6e Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Requests.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Security.dll b/Editor/library/mono/net8.0/System.Net.Security.dll new file mode 100644 index 0000000..a4b7bd9 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Security.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.ServicePoint.dll b/Editor/library/mono/net8.0/System.Net.ServicePoint.dll new file mode 100644 index 0000000..bcaddc5 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.ServicePoint.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.Sockets.dll b/Editor/library/mono/net8.0/System.Net.Sockets.dll new file mode 100644 index 0000000..cd3fb9e Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.Sockets.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.WebClient.dll b/Editor/library/mono/net8.0/System.Net.WebClient.dll new file mode 100644 index 0000000..fb8e8f5 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.WebClient.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.WebHeaderCollection.dll b/Editor/library/mono/net8.0/System.Net.WebHeaderCollection.dll new file mode 100644 index 0000000..8f25316 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.WebHeaderCollection.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.WebProxy.dll b/Editor/library/mono/net8.0/System.Net.WebProxy.dll new file mode 100644 index 0000000..5e6a63c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.WebProxy.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.WebSockets.Client.dll b/Editor/library/mono/net8.0/System.Net.WebSockets.Client.dll new file mode 100644 index 0000000..728b4c6 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.WebSockets.Client.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.WebSockets.dll b/Editor/library/mono/net8.0/System.Net.WebSockets.dll new file mode 100644 index 0000000..c05522e Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.WebSockets.dll differ diff --git a/Editor/library/mono/net8.0/System.Net.dll b/Editor/library/mono/net8.0/System.Net.dll new file mode 100644 index 0000000..8f69e80 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Net.dll differ diff --git a/Editor/library/mono/net8.0/System.Numerics.Vectors.dll b/Editor/library/mono/net8.0/System.Numerics.Vectors.dll new file mode 100644 index 0000000..aff2f94 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Numerics.Vectors.dll differ diff --git a/Editor/library/mono/net8.0/System.Numerics.dll b/Editor/library/mono/net8.0/System.Numerics.dll new file mode 100644 index 0000000..0b6f838 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Numerics.dll differ diff --git a/Editor/library/mono/net8.0/System.ObjectModel.dll b/Editor/library/mono/net8.0/System.ObjectModel.dll new file mode 100644 index 0000000..2a4fa3f Binary files /dev/null and b/Editor/library/mono/net8.0/System.ObjectModel.dll differ diff --git a/Editor/library/mono/net8.0/System.Private.DataContractSerialization.dll b/Editor/library/mono/net8.0/System.Private.DataContractSerialization.dll new file mode 100644 index 0000000..edcb84f Binary files /dev/null and b/Editor/library/mono/net8.0/System.Private.DataContractSerialization.dll differ diff --git a/Editor/library/mono/net8.0/System.Private.Uri.dll b/Editor/library/mono/net8.0/System.Private.Uri.dll new file mode 100644 index 0000000..b384ae7 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Private.Uri.dll differ diff --git a/Editor/library/mono/net8.0/System.Private.Xml.Linq.dll b/Editor/library/mono/net8.0/System.Private.Xml.Linq.dll new file mode 100644 index 0000000..c040443 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Private.Xml.Linq.dll differ diff --git a/Editor/library/mono/net8.0/System.Private.Xml.dll b/Editor/library/mono/net8.0/System.Private.Xml.dll new file mode 100644 index 0000000..b9290f3 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Private.Xml.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.DispatchProxy.dll b/Editor/library/mono/net8.0/System.Reflection.DispatchProxy.dll new file mode 100644 index 0000000..6ae62d9 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.DispatchProxy.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.Emit.ILGeneration.dll b/Editor/library/mono/net8.0/System.Reflection.Emit.ILGeneration.dll new file mode 100644 index 0000000..893cc54 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.Emit.ILGeneration.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.Emit.Lightweight.dll b/Editor/library/mono/net8.0/System.Reflection.Emit.Lightweight.dll new file mode 100644 index 0000000..3e3c32c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.Emit.Lightweight.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.Emit.dll b/Editor/library/mono/net8.0/System.Reflection.Emit.dll new file mode 100644 index 0000000..a71c742 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.Emit.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.Extensions.dll b/Editor/library/mono/net8.0/System.Reflection.Extensions.dll new file mode 100644 index 0000000..24083ad Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.Extensions.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.Metadata.dll b/Editor/library/mono/net8.0/System.Reflection.Metadata.dll new file mode 100644 index 0000000..29dbb60 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.Metadata.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.Primitives.dll b/Editor/library/mono/net8.0/System.Reflection.Primitives.dll new file mode 100644 index 0000000..947947a Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.TypeExtensions.dll b/Editor/library/mono/net8.0/System.Reflection.TypeExtensions.dll new file mode 100644 index 0000000..547a94c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.TypeExtensions.dll differ diff --git a/Editor/library/mono/net8.0/System.Reflection.dll b/Editor/library/mono/net8.0/System.Reflection.dll new file mode 100644 index 0000000..9b7a0cf Binary files /dev/null and b/Editor/library/mono/net8.0/System.Reflection.dll differ diff --git a/Editor/library/mono/net8.0/System.Resources.Reader.dll b/Editor/library/mono/net8.0/System.Resources.Reader.dll new file mode 100644 index 0000000..465f5a1 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Resources.Reader.dll differ diff --git a/Editor/library/mono/net8.0/System.Resources.ResourceManager.dll b/Editor/library/mono/net8.0/System.Resources.ResourceManager.dll new file mode 100644 index 0000000..a6f22f1 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Resources.ResourceManager.dll differ diff --git a/Editor/library/mono/net8.0/System.Resources.Writer.dll b/Editor/library/mono/net8.0/System.Resources.Writer.dll new file mode 100644 index 0000000..1ff23e8 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Resources.Writer.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.CompilerServices.Unsafe.dll b/Editor/library/mono/net8.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000..e22f8ba Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.CompilerServices.VisualC.dll b/Editor/library/mono/net8.0/System.Runtime.CompilerServices.VisualC.dll new file mode 100644 index 0000000..92c9c0e Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.CompilerServices.VisualC.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Extensions.dll b/Editor/library/mono/net8.0/System.Runtime.Extensions.dll new file mode 100644 index 0000000..20f5f38 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Extensions.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Handles.dll b/Editor/library/mono/net8.0/System.Runtime.Handles.dll new file mode 100644 index 0000000..481c41e Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Handles.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.InteropServices.JavaScript.dll b/Editor/library/mono/net8.0/System.Runtime.InteropServices.JavaScript.dll new file mode 100644 index 0000000..f5e83af Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.InteropServices.JavaScript.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.InteropServices.RuntimeInformation.dll b/Editor/library/mono/net8.0/System.Runtime.InteropServices.RuntimeInformation.dll new file mode 100644 index 0000000..b75db9f Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.InteropServices.RuntimeInformation.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.InteropServices.dll b/Editor/library/mono/net8.0/System.Runtime.InteropServices.dll new file mode 100644 index 0000000..7a79982 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.InteropServices.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Intrinsics.dll b/Editor/library/mono/net8.0/System.Runtime.Intrinsics.dll new file mode 100644 index 0000000..6cc72f5 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Intrinsics.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Loader.dll b/Editor/library/mono/net8.0/System.Runtime.Loader.dll new file mode 100644 index 0000000..2095e0b Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Loader.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Numerics.dll b/Editor/library/mono/net8.0/System.Runtime.Numerics.dll new file mode 100644 index 0000000..358aadc Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Numerics.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Serialization.Formatters.dll b/Editor/library/mono/net8.0/System.Runtime.Serialization.Formatters.dll new file mode 100644 index 0000000..7cd78c4 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Serialization.Formatters.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Serialization.Json.dll b/Editor/library/mono/net8.0/System.Runtime.Serialization.Json.dll new file mode 100644 index 0000000..333f84c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Serialization.Json.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Serialization.Primitives.dll b/Editor/library/mono/net8.0/System.Runtime.Serialization.Primitives.dll new file mode 100644 index 0000000..49d7ce1 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Serialization.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Serialization.Xml.dll b/Editor/library/mono/net8.0/System.Runtime.Serialization.Xml.dll new file mode 100644 index 0000000..27d167d Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Serialization.Xml.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.Serialization.dll b/Editor/library/mono/net8.0/System.Runtime.Serialization.dll new file mode 100644 index 0000000..3696ef9 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.Serialization.dll differ diff --git a/Editor/library/mono/net8.0/System.Runtime.dll b/Editor/library/mono/net8.0/System.Runtime.dll new file mode 100644 index 0000000..6aa52cd Binary files /dev/null and b/Editor/library/mono/net8.0/System.Runtime.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.AccessControl.dll b/Editor/library/mono/net8.0/System.Security.AccessControl.dll new file mode 100644 index 0000000..db5dbcd Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.AccessControl.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Claims.dll b/Editor/library/mono/net8.0/System.Security.Claims.dll new file mode 100644 index 0000000..78e93e7 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Claims.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.Algorithms.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.Algorithms.dll new file mode 100644 index 0000000..0d7db81 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.Algorithms.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.Cng.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.Cng.dll new file mode 100644 index 0000000..bd75973 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.Cng.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.Csp.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.Csp.dll new file mode 100644 index 0000000..f8411fc Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.Csp.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.Encoding.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.Encoding.dll new file mode 100644 index 0000000..8b77473 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.Encoding.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.OpenSsl.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.OpenSsl.dll new file mode 100644 index 0000000..6a1d23c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.OpenSsl.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.Primitives.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.Primitives.dll new file mode 100644 index 0000000..eb9c913 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.Primitives.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.X509Certificates.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.X509Certificates.dll new file mode 100644 index 0000000..df137d8 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.X509Certificates.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Cryptography.dll b/Editor/library/mono/net8.0/System.Security.Cryptography.dll new file mode 100644 index 0000000..1389f5c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Cryptography.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Principal.Windows.dll b/Editor/library/mono/net8.0/System.Security.Principal.Windows.dll new file mode 100644 index 0000000..cb55c7c Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Principal.Windows.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.Principal.dll b/Editor/library/mono/net8.0/System.Security.Principal.dll new file mode 100644 index 0000000..afe3b1a Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.Principal.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.SecureString.dll b/Editor/library/mono/net8.0/System.Security.SecureString.dll new file mode 100644 index 0000000..556f6e4 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.SecureString.dll differ diff --git a/Editor/library/mono/net8.0/System.Security.dll b/Editor/library/mono/net8.0/System.Security.dll new file mode 100644 index 0000000..504e399 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Security.dll differ diff --git a/Editor/library/mono/net8.0/System.ServiceModel.Web.dll b/Editor/library/mono/net8.0/System.ServiceModel.Web.dll new file mode 100644 index 0000000..d2e9268 Binary files /dev/null and b/Editor/library/mono/net8.0/System.ServiceModel.Web.dll differ diff --git a/Editor/library/mono/net8.0/System.ServiceProcess.dll b/Editor/library/mono/net8.0/System.ServiceProcess.dll new file mode 100644 index 0000000..1df34f2 Binary files /dev/null and b/Editor/library/mono/net8.0/System.ServiceProcess.dll differ diff --git a/Editor/library/mono/net8.0/System.Text.Encoding.CodePages.dll b/Editor/library/mono/net8.0/System.Text.Encoding.CodePages.dll new file mode 100644 index 0000000..3b4c500 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Text.Encoding.CodePages.dll differ diff --git a/Editor/library/mono/net8.0/System.Text.Encoding.Extensions.dll b/Editor/library/mono/net8.0/System.Text.Encoding.Extensions.dll new file mode 100644 index 0000000..86c656e Binary files /dev/null and b/Editor/library/mono/net8.0/System.Text.Encoding.Extensions.dll differ diff --git a/Editor/library/mono/net8.0/System.Text.Encoding.dll b/Editor/library/mono/net8.0/System.Text.Encoding.dll new file mode 100644 index 0000000..8e010e6 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Text.Encoding.dll differ diff --git a/Editor/library/mono/net8.0/System.Text.Encodings.Web.dll b/Editor/library/mono/net8.0/System.Text.Encodings.Web.dll new file mode 100644 index 0000000..2935a16 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Text.Encodings.Web.dll differ diff --git a/Editor/library/mono/net8.0/System.Text.Json.dll b/Editor/library/mono/net8.0/System.Text.Json.dll new file mode 100644 index 0000000..8eb9bcf Binary files /dev/null and b/Editor/library/mono/net8.0/System.Text.Json.dll differ diff --git a/Editor/library/mono/net8.0/System.Text.RegularExpressions.dll b/Editor/library/mono/net8.0/System.Text.RegularExpressions.dll new file mode 100644 index 0000000..2ead673 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Text.RegularExpressions.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Channels.dll b/Editor/library/mono/net8.0/System.Threading.Channels.dll new file mode 100644 index 0000000..e6a8c5f Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Channels.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Overlapped.dll b/Editor/library/mono/net8.0/System.Threading.Overlapped.dll new file mode 100644 index 0000000..0d1ac31 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Overlapped.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Tasks.Dataflow.dll b/Editor/library/mono/net8.0/System.Threading.Tasks.Dataflow.dll new file mode 100644 index 0000000..ef66c92 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Tasks.Dataflow.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Tasks.Extensions.dll b/Editor/library/mono/net8.0/System.Threading.Tasks.Extensions.dll new file mode 100644 index 0000000..2b94b03 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Tasks.Extensions.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Tasks.Parallel.dll b/Editor/library/mono/net8.0/System.Threading.Tasks.Parallel.dll new file mode 100644 index 0000000..addc6b1 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Tasks.Parallel.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Tasks.dll b/Editor/library/mono/net8.0/System.Threading.Tasks.dll new file mode 100644 index 0000000..bbecf4a Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Tasks.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Thread.dll b/Editor/library/mono/net8.0/System.Threading.Thread.dll new file mode 100644 index 0000000..ea809bd Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Thread.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.ThreadPool.dll b/Editor/library/mono/net8.0/System.Threading.ThreadPool.dll new file mode 100644 index 0000000..24c0cb5 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.ThreadPool.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.Timer.dll b/Editor/library/mono/net8.0/System.Threading.Timer.dll new file mode 100644 index 0000000..62e2b28 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.Timer.dll differ diff --git a/Editor/library/mono/net8.0/System.Threading.dll b/Editor/library/mono/net8.0/System.Threading.dll new file mode 100644 index 0000000..1c31195 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Threading.dll differ diff --git a/Editor/library/mono/net8.0/System.Transactions.Local.dll b/Editor/library/mono/net8.0/System.Transactions.Local.dll new file mode 100644 index 0000000..0acf88a Binary files /dev/null and b/Editor/library/mono/net8.0/System.Transactions.Local.dll differ diff --git a/Editor/library/mono/net8.0/System.Transactions.dll b/Editor/library/mono/net8.0/System.Transactions.dll new file mode 100644 index 0000000..cacdae4 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Transactions.dll differ diff --git a/Editor/library/mono/net8.0/System.ValueTuple.dll b/Editor/library/mono/net8.0/System.ValueTuple.dll new file mode 100644 index 0000000..771f0b7 Binary files /dev/null and b/Editor/library/mono/net8.0/System.ValueTuple.dll differ diff --git a/Editor/library/mono/net8.0/System.Web.HttpUtility.dll b/Editor/library/mono/net8.0/System.Web.HttpUtility.dll new file mode 100644 index 0000000..e4af9a6 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Web.HttpUtility.dll differ diff --git a/Editor/library/mono/net8.0/System.Web.dll b/Editor/library/mono/net8.0/System.Web.dll new file mode 100644 index 0000000..7a06ee9 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Web.dll differ diff --git a/Editor/library/mono/net8.0/System.Windows.dll b/Editor/library/mono/net8.0/System.Windows.dll new file mode 100644 index 0000000..dc70e89 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Windows.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.Linq.dll b/Editor/library/mono/net8.0/System.Xml.Linq.dll new file mode 100644 index 0000000..25e5ec0 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.Linq.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.ReaderWriter.dll b/Editor/library/mono/net8.0/System.Xml.ReaderWriter.dll new file mode 100644 index 0000000..039761b Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.ReaderWriter.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.Serialization.dll b/Editor/library/mono/net8.0/System.Xml.Serialization.dll new file mode 100644 index 0000000..19981c7 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.Serialization.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.XDocument.dll b/Editor/library/mono/net8.0/System.Xml.XDocument.dll new file mode 100644 index 0000000..234cf30 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.XDocument.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.XPath.XDocument.dll b/Editor/library/mono/net8.0/System.Xml.XPath.XDocument.dll new file mode 100644 index 0000000..d4f0558 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.XPath.XDocument.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.XPath.dll b/Editor/library/mono/net8.0/System.Xml.XPath.dll new file mode 100644 index 0000000..5aadc29 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.XPath.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.XmlDocument.dll b/Editor/library/mono/net8.0/System.Xml.XmlDocument.dll new file mode 100644 index 0000000..2f35f5e Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.XmlDocument.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.XmlSerializer.dll b/Editor/library/mono/net8.0/System.Xml.XmlSerializer.dll new file mode 100644 index 0000000..05133f4 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.XmlSerializer.dll differ diff --git a/Editor/library/mono/net8.0/System.Xml.dll b/Editor/library/mono/net8.0/System.Xml.dll new file mode 100644 index 0000000..6332df9 Binary files /dev/null and b/Editor/library/mono/net8.0/System.Xml.dll differ diff --git a/Editor/library/mono/net8.0/System.dll b/Editor/library/mono/net8.0/System.dll new file mode 100644 index 0000000..b5ce4fb Binary files /dev/null and b/Editor/library/mono/net8.0/System.dll differ diff --git a/Editor/library/mono/net8.0/WindowsBase.dll b/Editor/library/mono/net8.0/WindowsBase.dll new file mode 100644 index 0000000..e30d210 Binary files /dev/null and b/Editor/library/mono/net8.0/WindowsBase.dll differ diff --git a/Editor/library/mono/net8.0/mscorlib.dll b/Editor/library/mono/net8.0/mscorlib.dll new file mode 100644 index 0000000..1c0b484 Binary files /dev/null and b/Editor/library/mono/net8.0/mscorlib.dll differ diff --git a/Editor/library/mono/net8.0/netstandard.dll b/Editor/library/mono/net8.0/netstandard.dll new file mode 100644 index 0000000..28c7a47 Binary files /dev/null and b/Editor/library/mono/net8.0/netstandard.dll differ diff --git a/ExampleApp/ExampleApp.csproj b/ExampleApp/ExampleApp.csproj new file mode 100644 index 0000000..310e341 --- /dev/null +++ b/ExampleApp/ExampleApp.csproj @@ -0,0 +1,15 @@ + + + + net9.0 + enable + enable + + + + + ..\Prism-ScriptCore\bin\Debug\net9.0\Prism-ScriptCore.dll + + + + diff --git a/ExampleApp/ExampleApp.sln b/ExampleApp/ExampleApp.sln new file mode 100644 index 0000000..df9a7e1 --- /dev/null +++ b/ExampleApp/ExampleApp.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleApp", "ExampleApp.csproj", "{C201DF2F-9FD5-438D-8D27-5DF3B24E6C68}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C201DF2F-9FD5-438D-8D27-5DF3B24E6C68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C201DF2F-9FD5-438D-8D27-5DF3B24E6C68}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C201DF2F-9FD5-438D-8D27-5DF3B24E6C68}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C201DF2F-9FD5-438D-8D27-5DF3B24E6C68}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/ExampleApp/Src/MapGenerator.cs b/ExampleApp/Src/MapGenerator.cs new file mode 100644 index 0000000..a2f19bb --- /dev/null +++ b/ExampleApp/Src/MapGenerator.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Prism; + +namespace Example +{ + public class MapGenerator : Entity + { + // TODO: [EditorSlider("MapWidth Custom Name", 2, 0, 1024)] + public int MapWidth = 128; + public int MapHeight = 128; + public int Octaves = 4; + public float Persistance = 0.74f; + public int Seed = 21; + public float Lacunarity = 3.0f; + public Vec2 Offset = new Vec2(13.4f, 6.26f); + public float NoiseScale = 0.5f; + + public void GenerateMap() + { + // float[,] noiseMap = Noise.GenerateNoiseMap(MapWidth, MapHeight, NoiseScale); + float[,] noiseMap; + try + { + noiseMap = Noise.GenerateNoiseMap(MapWidth, MapHeight, Seed, NoiseScale, Octaves, Persistance, Lacunarity, Offset); + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + + uint width = (uint)noiseMap.GetLength(0); + uint height = (uint)noiseMap.GetLength(1); + + + Texture2D texture = new Texture2D(width, height); + Vec4[] colorMap = new Vec4[width * height]; + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + colorMap[x + y * width] = Vec4.Lerp(Color.Black, Color.White, noiseMap[x, y]); + } + } + + texture.SetData(colorMap); + + Console.WriteLine("HasComponent - TransformComponent = {0}", HasComponent()); + Console.WriteLine("HasComponent - ScriptComponent = {0}", HasComponent()); + Console.WriteLine("HasComponent - MeshComponent = {0}", HasComponent()); + + MeshComponent meshComponent = GetComponent(); + if (meshComponent == null) + { + Console.WriteLine("MeshComponent is null!"); + meshComponent = CreateComponent(); + } + meshComponent.Mesh = MeshFactory.CreatePlane(1.0f, 1.0f); + + Console.WriteLine("Mesh has {0} materials!", meshComponent.Mesh.GetMaterialCount()); + + MaterialInstance material = meshComponent.Mesh.GetMaterial(1); + material.Set("u_AlbedoTexToggle", 1.0f); + material.Set("u_AlbedoTexture", texture); + } + + void OnCreate() + { + GenerateMap(); + } + + void OnUpdate(float ts) + { + + } + + + } +} diff --git a/ExampleApp/Src/Noise.cs b/ExampleApp/Src/Noise.cs new file mode 100644 index 0000000..d9a0241 --- /dev/null +++ b/ExampleApp/Src/Noise.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Prism; + +namespace Example +{ + public static class Noise + { + public static float[,] GenerateNoiseMap(int mapWidth, int mapHeight, float scale) + { + float[,] noiseMap = new float[mapWidth, mapHeight]; + + if (scale <= 0) + scale = 0.0001f; + + for (int y = 0; y < mapHeight; y++) + { + for (int x = 0; x < mapWidth; x++) + { + float sampleX = x / scale; + float sampleY = y / scale; + + float perlinValue = Prism.Noise.PerlinNoise(sampleX, sampleY); + noiseMap[x, y] = perlinValue; + } + } + + return noiseMap; + } + + public static float InverseLerp(float min, float max, float value) + { + if (Math.Abs(max - min) < 0.000001f) return min; + return (value - min) / (max - min); + } + + public static float[,] GenerateNoiseMap(int mapWidth, int mapHeight, int seed, float scale, int octaves, float persistance, float lacunarity, Vec2 offset) + { + float[,] noiseMap = new float[mapWidth, mapHeight]; + + System.Random prng = new System.Random(seed); + + Vec2[] octaveOffsets = new Vec2[octaves]; + for (int i = 0; i < octaves; i++) + { + float offsetX = prng.Next(-100000, 100000) + offset.X; + float offsetY = prng.Next(-100000, 100000) + offset.Y; + octaveOffsets[i] = new Vec2(offsetX, offsetY); + } + + if (scale <= 0) + { + scale = 0.0001f; + } + + float maxNoiseHeight = float.MinValue; + float minNoiseHeight = float.MaxValue; + + float halfWidth = mapWidth / 2f; + float halfHeight = mapHeight / 2f; + + + for (int y = 0; y < mapHeight; y++) + { + for (int x = 0; x < mapWidth; x++) + { + + float amplitude = 1; + float frequency = 1; + float noiseHeight = 0; + + for (int i = 0; i < octaves; i++) + { + float sampleX = (x - halfWidth) / scale * frequency + octaveOffsets[i].X; + float sampleY = (y - halfHeight) / scale * frequency + octaveOffsets[i].Y; + + float perlinValue = Prism.Noise.PerlinNoise(sampleX, sampleY);// * 2 - 1; // 0->1 // -1 -> 1 + noiseHeight += perlinValue * amplitude; + + amplitude *= persistance; + frequency *= lacunarity; + } + + if (noiseHeight > maxNoiseHeight) + { + maxNoiseHeight = noiseHeight; + } + else if (noiseHeight < minNoiseHeight) + { + minNoiseHeight = noiseHeight; + } + noiseMap[x, y] = noiseHeight; + } + } + + for (int y = 0; y < mapHeight; y++) + { + for (int x = 0; x < mapWidth; x++) + { + noiseMap[x, y] = InverseLerp(minNoiseHeight, maxNoiseHeight, noiseMap[x, y]); + } + } + + return noiseMap; + } + + } +} diff --git a/ExampleApp/Src/Script.cs b/ExampleApp/Src/Script.cs new file mode 100644 index 0000000..6890cf6 --- /dev/null +++ b/ExampleApp/Src/Script.cs @@ -0,0 +1,38 @@ +using System; + +using Prism; + +namespace Example +{ + public class Script : Entity + { + public float Speed = 5.0f; + + public void OnCreate() + { + Console.WriteLine("Script.OnCreate"); + Console.WriteLine("this is c# function OnCreate, this will be called by cpp"); + } + + public void OnUpdate(float ts) + { + Mat4 transform = GetTransform(); + Vec3 translation = transform.Translation; + + float speed = Speed * ts; + + if (Input.IsKeyPressed(KeyCode.Up)) + translation.Y += speed; + else if (Input.IsKeyPressed(KeyCode.Down)) + translation.Y -= speed; + if (Input.IsKeyPressed(KeyCode.Right)) + translation.X += speed; + else if (Input.IsKeyPressed(KeyCode.Left)) + translation.X -= speed; + + transform.Translation = translation; + SetTransform(transform); + } + + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Prism-ScriptCore.csproj b/Prism-ScriptCore/Prism-ScriptCore.csproj new file mode 100644 index 0000000..4d66758 --- /dev/null +++ b/Prism-ScriptCore/Prism-ScriptCore.csproj @@ -0,0 +1,10 @@ + + + + net9.0 + Prism_ScriptCore + enable + enable + + + diff --git a/Prism-ScriptCore/Prism-ScriptCore.sln b/Prism-ScriptCore/Prism-ScriptCore.sln new file mode 100644 index 0000000..0c874f6 --- /dev/null +++ b/Prism-ScriptCore/Prism-ScriptCore.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prism-ScriptCore", "Prism-ScriptCore.csproj", "{B94EF710-0487-4388-97E3-B650761A849C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B94EF710-0487-4388-97E3-B650761A849C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B94EF710-0487-4388-97E3-B650761A849C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B94EF710-0487-4388-97E3-B650761A849C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B94EF710-0487-4388-97E3-B650761A849C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Prism-ScriptCore/Src/Prism/Entity.cs b/Prism-ScriptCore/Src/Prism/Entity.cs new file mode 100644 index 0000000..7e808ca --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Entity.cs @@ -0,0 +1,61 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public class Entity + { + public uint SceneID { get; private set; } + public uint EntityID { get; private set; } + + ~Entity() + { + Console.WriteLine("Destroyed Entity {0}:{1}", SceneID, EntityID); + } + + public T CreateComponent() where T : Component, new() + { + CreateComponent_Native(SceneID, EntityID, typeof(T)); + T component = new T(); + component.Entity = this; + return component; + } + + public bool HasComponent() where T : Component, new() + { + return HasComponent_Native(SceneID, EntityID, typeof(T)); + } + + public T GetComponent() where T : Component, new() + { + if (HasComponent()) + { + T component = new T(); + component.Entity = this; + return component; + } + return null; + } + + public Mat4 GetTransform() + { + Mat4 mat4Instance; + GetTransform_Native(SceneID, EntityID, out mat4Instance); + return mat4Instance; + } + + public void SetTransform(Mat4 transform) + { + SetTransform_Native(SceneID, EntityID, ref transform); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void CreateComponent_Native(uint sceneID, uint entityID, Type type); + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool HasComponent_Native(uint sceneID, uint entityID, Type type); + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void GetTransform_Native(uint sceneID, uint entityID, out Mat4 matrix); + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void SetTransform_Native(uint sceneID, uint entityID, ref Mat4 matrix); + + } +} diff --git a/Prism-ScriptCore/Src/Prism/Input.cs b/Prism-ScriptCore/Src/Prism/Input.cs new file mode 100644 index 0000000..32db526 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Input.cs @@ -0,0 +1,17 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public class Input + { + + public static bool IsKeyPressed(KeyCode keycode) + { + return IsKeyPressed_Native(keycode); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool IsKeyPressed_Native(KeyCode keycode); + + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Src/Prism/KeyCodes.cs b/Prism-ScriptCore/Src/Prism/KeyCodes.cs new file mode 100644 index 0000000..9b97a4f --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/KeyCodes.cs @@ -0,0 +1,138 @@ +// ReSharper disable All +namespace Prism +{ + public enum KeyCode + { + Space = 32, + Apostrophe = 39, /* ' */ + Comma = 44, /* , */ + Minus = 45, /* - */ + Period = 46, /* . */ + Slash = 47, /* / */ + + D0 = 48, /* 0 */ + D1 = 49, /* 1 */ + D2 = 50, /* 2 */ + D3 = 51, /* 3 */ + D4 = 52, /* 4 */ + D5 = 53, /* 5 */ + D6 = 54, /* 6 */ + D7 = 55, /* 7 */ + D8 = 56, /* 8 */ + D9 = 57, /* 9 */ + + Semicolon = 59, /* ; */ + Equal = 61, /* = */ + + A = 65, + B = 66, + C = 67, + D = 68, + E = 69, + F = 70, + G = 71, + H = 72, + I = 73, + J = 74, + K = 75, + L = 76, + M = 77, + N = 78, + O = 79, + P = 80, + Q = 81, + R = 82, + S = 83, + T = 84, + U = 85, + V = 86, + W = 87, + X = 88, + Y = 89, + Z = 90, + + LeftBracket = 91, /* [ */ + Backslash = 92, /* \ */ + RightBracket = 93, /* ] */ + GraveAccent = 96, /* ` */ + + World1 = 161, /* non-US #1 */ + World2 = 162, /* non-US #2 */ + + /* Function keys */ + Escape = 256, + Enter = 257, + Tab = 258, + Backspace = 259, + Insert = 260, + Delete = 261, + Right = 262, + Left = 263, + Down = 264, + Up = 265, + PageUp = 266, + PageDown = 267, + Home = 268, + End = 269, + CapsLock = 280, + ScrollLock = 281, + NumLock = 282, + PrintScreen = 283, + Pause = 284, + F1 = 290, + F2 = 291, + F3 = 292, + F4 = 293, + F5 = 294, + F6 = 295, + F7 = 296, + F8 = 297, + F9 = 298, + F10 = 299, + F11 = 300, + F12 = 301, + F13 = 302, + F14 = 303, + F15 = 304, + F16 = 305, + F17 = 306, + F18 = 307, + F19 = 308, + F20 = 309, + F21 = 310, + F22 = 311, + F23 = 312, + F24 = 313, + F25 = 314, + + /* Keypad */ + KP0 = 320, + KP1 = 321, + KP2 = 322, + KP3 = 323, + KP4 = 324, + KP5 = 325, + KP6 = 326, + KP7 = 327, + KP8 = 328, + KP9 = 329, + KPDecimal = 330, + KPDivide = 331, + KPMultiply = 332, + KPSubtract = 333, + KPAdd = 334, + KPEnter = 335, + KPEqual = 336, + + LeftShift = 340, + LeftControl = 341, + LeftAlt = 342, + LeftSuper = 343, + RightShift = 344, + RightControl = 345, + RightAlt = 346, + RightSuper = 347, + Menu = 348 + + } +} diff --git a/Prism-ScriptCore/Src/Prism/Math/Mat4.cs b/Prism-ScriptCore/Src/Prism/Math/Mat4.cs new file mode 100644 index 0000000..cd0fc56 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Math/Mat4.cs @@ -0,0 +1,75 @@ +using System.Runtime.InteropServices; + +namespace Prism +{ + [StructLayout(LayoutKind.Explicit)] + public struct Mat4 + { + [FieldOffset( 0)] public float D00; + [FieldOffset( 4)] public float D10; + [FieldOffset( 8)] public float D20; + [FieldOffset(12)] public float D30; + [FieldOffset(16)] public float D01; + [FieldOffset(20)] public float D11; + [FieldOffset(24)] public float D21; + [FieldOffset(28)] public float D31; + [FieldOffset(32)] public float D02; + [FieldOffset(36)] public float D12; + [FieldOffset(40)] public float D22; + [FieldOffset(44)] public float D32; + [FieldOffset(48)] public float D03; + [FieldOffset(52)] public float D13; + [FieldOffset(56)] public float D23; + [FieldOffset(60)] public float D33; + + public Mat4(float value) + { + D00 = value; D10 = 0.0f; D20 = 0.0f; D30 = 0.0f; + D01 = 0.0f; D11 = value; D21 = 0.0f; D31 = 0.0f; + D02 = 0.0f; D12 = 0.0f; D22 = value; D32 = 0.0f; + D03 = 0.0f; D13 = 0.0f; D23 = 0.0f; D33 = value; + } + + public Vec3 Translation + { + get { return new Vec3(D03, D13, D23); } + set { D03 = value.X; D13 = value.Y; D23 = value.Z; } + } + + public static Mat4 Translate(Vec3 translation) + { + Mat4 result = new Mat4(1.0f); + result.D03 = translation.X; + result.D13 = translation.Y; + result.D23 = translation.Z; + return result; + } + + public static Mat4 Scale(Vec3 scale) + { + Mat4 result = new Mat4(1.0f); + result.D00 = scale.X; + result.D11 = scale.Y; + result.D22 = scale.Z; + return result; + } + + public static Mat4 Scale(float scale) + { + Mat4 result = new Mat4(1.0f); + result.D00 = scale; + result.D11 = scale; + result.D22 = scale; + return result; + } + + public void DebugPrint() + { + Console.WriteLine("{0:0.00} {1:0.00} {2:0.00} {3:0.00}", D00, D10, D20, D30); + Console.WriteLine("{0:0.00} {1:0.00} {2:0.00} {3:0.00}", D01, D11, D21, D31); + Console.WriteLine("{0:0.00} {1:0.00} {2:0.00} {3:0.00}", D02, D12, D22, D32); + Console.WriteLine("{0:0.00} {1:0.00} {2:0.00} {3:0.00}", D03, D13, D23, D33); + } + + } +} diff --git a/Prism-ScriptCore/Src/Prism/Math/Noise.cs b/Prism-ScriptCore/Src/Prism/Math/Noise.cs new file mode 100644 index 0000000..db43209 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Math/Noise.cs @@ -0,0 +1,16 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public static class Noise + { + public static float PerlinNoise(float x, float y) + { + return PerlinNoise_Native(x, y); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float PerlinNoise_Native(float x, float y); + + } +} diff --git a/Prism-ScriptCore/Src/Prism/Math/Vec2.cs b/Prism-ScriptCore/Src/Prism/Math/Vec2.cs new file mode 100644 index 0000000..13a22f0 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Math/Vec2.cs @@ -0,0 +1,22 @@ +using System.Runtime.InteropServices; + +namespace Prism +{ + [StructLayout(LayoutKind.Sequential)] + public struct Vec2 + { + public float X; + public float Y; + + public Vec2(float scalar) + { + X = Y = scalar; + } + + public Vec2(float x, float y) + { + X = x; + Y = y; + } + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Src/Prism/Math/Vec3.cs b/Prism-ScriptCore/Src/Prism/Math/Vec3.cs new file mode 100644 index 0000000..a5dfeec --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Math/Vec3.cs @@ -0,0 +1,26 @@ +using System.Runtime.InteropServices; + +namespace Prism +{ + [StructLayout(LayoutKind.Explicit)] + public struct Vec3 + { + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + + public Vec3(float scalar) + { + X = Y = Z = scalar; + } + + public Vec3(float x, float y, float z) + { + X = x; + Y = y; + Z = z; + } + + + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Src/Prism/Math/Vec4.cs b/Prism-ScriptCore/Src/Prism/Math/Vec4.cs new file mode 100644 index 0000000..55cd5d0 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Math/Vec4.cs @@ -0,0 +1,69 @@ +using System.Runtime.InteropServices; + +namespace Prism +{ + [StructLayout(LayoutKind.Explicit)] + public struct Vec4 + { + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + [FieldOffset(12)] public float W; + + public Vec4(float scalar) + { + X = Y = Z = W =scalar; + } + + public Vec4(float x, float y, float z, float w) + { + X = x; + Y = y; + Z = z; + W = w; + } + + public static Vec4 operator+(Vec4 left, Vec4 right) + { + return new Vec4(left.X + right.X, left.Y + right.Y, left.Z + right.Z, left.W + right.W); + } + + public static Vec4 operator-(Vec4 left, Vec4 right) + { + return new Vec4(left.X - right.X, left.Y - right.Y, left.Z - right.Z, left.W - right.W); + } + + public static Vec4 operator*(Vec4 left, Vec4 right) + { + return new Vec4(left.X * right.X, left.Y * right.Y, left.Z * right.Z, left.W * right.W); + } + + public static Vec4 operator *(Vec4 left, float scalar) + { + return new Vec4(left.X * scalar, left.Y * scalar, left.Z * scalar, left.W * scalar); + } + + public static Vec4 operator *(float scalar, Vec4 right) + { + return new Vec4(scalar * right.X, scalar * right.Y, scalar * right.Z, scalar * right.W); + } + + public static Vec4 operator/(Vec4 left, Vec4 right) + { + return new Vec4(left.X / right.X, left.Y / right.Y, left.Z / right.Z, left.W / right.W); + } + + public static Vec4 operator /(Vec4 left, float scalar) + { + return new Vec4(left.X / scalar, left.Y / scalar, left.Z / scalar, left.W / scalar); + } + + public static Vec4 Lerp(Vec4 a, Vec4 b, float t) + { + if (t < 0.0f) t = 0.0f; + if (t > 1.0f) t = 1.0f; + return (1.0f - t) * a + t * b; + } + + } +} diff --git a/Prism-ScriptCore/Src/Prism/Renderer/Color.cs b/Prism-ScriptCore/Src/Prism/Renderer/Color.cs new file mode 100644 index 0000000..16b8613 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Renderer/Color.cs @@ -0,0 +1,10 @@ + +namespace Prism +{ + public class Color + { + public static Vec4 Black { get { return new Vec4(0.0f, 0.0f, 0.0f, 1.0f); } } + public static Vec4 White { get { return new Vec4(1.0f, 1.0f, 1.0f, 1.0f); } } + + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Src/Prism/Renderer/Material.cs b/Prism-ScriptCore/Src/Prism/Renderer/Material.cs new file mode 100644 index 0000000..b805379 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Renderer/Material.cs @@ -0,0 +1,87 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public class Material + { + public void Set(string uniform, float value) + { + SetFloat_Native(m_UnmanagedInstance, uniform, value); + } + + public void Set(string uniform, Texture2D texture) + { + SetTexture_Native(m_UnmanagedInstance, uniform, texture.m_UnmanagedInstance); + } + + public void SetTexture(string uniform, Texture2D texture) + { + SetTexture_Native(m_UnmanagedInstance, uniform, texture.m_UnmanagedInstance); + } + + internal Material(IntPtr unmanagedInstance) + { + m_UnmanagedInstance = unmanagedInstance; + } + + ~Material() + { + Destructor_Native(m_UnmanagedInstance); + } + + internal IntPtr m_UnmanagedInstance; + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void Destructor_Native(IntPtr unmanagedInstance); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetFloat_Native(IntPtr unmanagedInstance, string uniform, float value); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetTexture_Native(IntPtr unmanagedInstance, string uniform, IntPtr texture); + + } + + public class MaterialInstance + { + public void Set(string uniform, float value) + { + SetFloat_Native(m_UnmanagedInstance, uniform, value); + } + + public void Set(string uniform, Texture2D texture) + { + SetTexture_Native(m_UnmanagedInstance, uniform, texture.m_UnmanagedInstance); + } + + public void Set(string uniform, Vec3 value) + { + SetVec3_Native(m_UnmanagedInstance, uniform, ref value); + } + + + public void SetTexture(string uniform, Texture2D texture) + { + SetTexture_Native(m_UnmanagedInstance, uniform, texture.m_UnmanagedInstance); + } + + internal MaterialInstance(IntPtr unmanagedInstance) + { + m_UnmanagedInstance = unmanagedInstance; + } + + ~MaterialInstance() + { + Destructor_Native(m_UnmanagedInstance); + } + + internal IntPtr m_UnmanagedInstance; + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void Destructor_Native(IntPtr unmanagedInstance); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetFloat_Native(IntPtr unmanagedInstance, string uniform, float value); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetVec3_Native(IntPtr unmanagedInstance, string uniform, ref Vec3 value); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetTexture_Native(IntPtr unmanagedInstance, string uniform, IntPtr texture); + } +} diff --git a/Prism-ScriptCore/Src/Prism/Renderer/Mesh.cs b/Prism-ScriptCore/Src/Prism/Renderer/Mesh.cs new file mode 100644 index 0000000..2073b52 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Renderer/Mesh.cs @@ -0,0 +1,54 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public class Mesh + { + public Mesh(string filepath) + { + m_UnmanagedInstance = Constructor_Native(filepath); + } + + internal Mesh(IntPtr unmanagedInstance) + { + m_UnmanagedInstance = unmanagedInstance; + } + + ~Mesh() + { + Destructor_Native(m_UnmanagedInstance); + } + + public Material BaseMaterial + { + get + { + return new Material(GetMaterial_Native(m_UnmanagedInstance)); + } + } + + public MaterialInstance GetMaterial(int index) + { + return new MaterialInstance(GetMaterialByIndex_Native(m_UnmanagedInstance, index)); + } + + public int GetMaterialCount() + { + return GetMaterialCount_Native(m_UnmanagedInstance); + } + + internal IntPtr m_UnmanagedInstance; + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern IntPtr Constructor_Native(string filepath); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void Destructor_Native(IntPtr unmanagedInstance); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern IntPtr GetMaterial_Native(IntPtr unmanagedInstance); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern IntPtr GetMaterialByIndex_Native(IntPtr unmanagedInstance, int index); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern int GetMaterialCount_Native(IntPtr unmanagedInstance); + + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Src/Prism/Renderer/MeshFactory.cs b/Prism-ScriptCore/Src/Prism/Renderer/MeshFactory.cs new file mode 100644 index 0000000..078edf0 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Renderer/MeshFactory.cs @@ -0,0 +1,17 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public static class MeshFactory + { + + public static Mesh CreatePlane(float width, float height) + { + return new Mesh(CreatePlane_Native(width, height)); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern IntPtr CreatePlane_Native(float width, float height); + + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Src/Prism/Renderer/Texture2D.cs b/Prism-ScriptCore/Src/Prism/Renderer/Texture2D.cs new file mode 100644 index 0000000..43d1b57 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Renderer/Texture2D.cs @@ -0,0 +1,34 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public class Texture2D + { + + public Texture2D(uint width, uint height) + { + m_UnmanagedInstance = Constructor_Native(width, height); + } + + ~Texture2D() + { + Destructor_Native(m_UnmanagedInstance); + } + + public void SetData(Vec4[] data) + { + SetData_Native(m_UnmanagedInstance, data, data.Length); + } + + internal IntPtr m_UnmanagedInstance; + + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern IntPtr Constructor_Native(uint width, uint height); + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern void Destructor_Native(IntPtr unmanagedInstance); + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern void SetData_Native(IntPtr unmanagedInstance, Vec4[] data, int size); + + + } +} \ No newline at end of file diff --git a/Prism-ScriptCore/Src/Prism/Scene/Component.cs b/Prism-ScriptCore/Src/Prism/Scene/Component.cs new file mode 100644 index 0000000..3383b16 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/Scene/Component.cs @@ -0,0 +1,95 @@ +using System.Runtime.CompilerServices; + +namespace Prism +{ + public abstract class Component + { + public Entity Entity { get; set; } + + } + + public class TagComponent : Component + { + public string Tag + { + get + { + return GetTag_Native(Entity.SceneID, Entity.EntityID); + } + set + { + SetTag_Native(value); + } + } + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern string GetTag_Native(uint sceneID, uint entityID); + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetTag_Native(string tag); + + } + + public class TransformComponent : Component + { + public Mat4 Transform + { + get + { + Mat4 result; + GetTransform_Native(Entity.SceneID, Entity.EntityID, out result); + return result; + } + set + { + SetTransform_Native(Entity.SceneID, Entity.EntityID, ref value); + } + } + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void GetTransform_Native(uint sceneID, uint entityID, out Mat4 result); + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetTransform_Native(uint sceneID, uint entityID, ref Mat4 result); + + } + + public class MeshComponent : Component + { + public Mesh Mesh + { + get + { + Mesh result = new Mesh(GetMesh_Native(Entity.SceneID, Entity.EntityID)); + return result; + } + set + { + IntPtr ptr = value == null ? IntPtr.Zero : value.m_UnmanagedInstance; + SetMesh_Native(Entity.SceneID, Entity.EntityID, ptr); + } + } + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern IntPtr GetMesh_Native(uint sceneID, uint entityID); + + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void SetMesh_Native(uint sceneID, uint entityID, IntPtr unmanagedInstance); + + } + + public class CameraComponent : Component + { + // TODO + } + + public class ScriptComponent : Component + { + // TODO + } + + public class SpriteRendererComponent : Component + { + // TODO + } +} diff --git a/Prism-ScriptCore/Src/Prism/SpriteRenderer.cs b/Prism-ScriptCore/Src/Prism/SpriteRenderer.cs new file mode 100644 index 0000000..1cb5297 --- /dev/null +++ b/Prism-ScriptCore/Src/Prism/SpriteRenderer.cs @@ -0,0 +1,32 @@ + +namespace Prism +{ + public class SpriteRenderer : Component + { + + /* public Texture2D Texture + { + get + { + Texture2D tex; + GetTexture_Native(Entity.EntityID, Entity.SceneID, out tex); + return tex; + } + set { } + } + + + public Vec4 Color + { + get; + set; + } + + public float TilingFactor + { + get; + set; + }*/ + + } +} \ No newline at end of file diff --git a/Prism/CMakeLists.txt b/Prism/CMakeLists.txt index b0f525e..5516872 100644 --- a/Prism/CMakeLists.txt +++ b/Prism/CMakeLists.txt @@ -13,6 +13,9 @@ add_subdirectory(vendor/glm EXCLUDE_FROM_ALL) add_subdirectory(vendor/assimp EXCLUDE_FROM_ALL) add_subdirectory(vendor/stb EXCLUDE_FROM_ALL) add_subdirectory(vendor/TinyFileDialog EXCLUDE_FROM_ALL) +add_subdirectory(vendor/EnTT EXCLUDE_FROM_ALL) +add_subdirectory(vendor/mono EXCLUDE_FROM_ALL) +add_subdirectory(vendor/FastNoise EXCLUDE_FROM_ALL) # ------------- imgui ------------- @@ -48,11 +51,14 @@ set(LINK_LIBRARIES_PRIVATE assimp stb tinyFileDialogs + FastNoise ) set(LINK_LIBRARIES_PUBLIC spdlog glm + EnTT::EnTT + mono ) # link library opengl diff --git a/Prism/src/Prism/Core/Application.cpp b/Prism/src/Prism/Core/Application.cpp index cea1c94..aa73fb8 100644 --- a/Prism/src/Prism/Core/Application.cpp +++ b/Prism/src/Prism/Core/Application.cpp @@ -11,6 +11,7 @@ #include "Prism/Renderer/FrameBuffer.h" #include "tinyfiledialogs.h" +#include "Prism/Script/ScriptEngine.h" namespace Prism { @@ -33,6 +34,8 @@ namespace Prism m_ImGuiLayer = new ImGuiLayer("ImGui Layer"); PushOverlay(m_ImGuiLayer); + ScriptEngine::Init("assets/scripts/ExampleApp.dll"); + Renderer::Init(); Renderer::WaitAndRender(); } diff --git a/Prism/src/Prism/Core/Log.cpp b/Prism/src/Prism/Core/Log.cpp index 30f0f32..d9495d2 100644 --- a/Prism/src/Prism/Core/Log.cpp +++ b/Prism/src/Prism/Core/Log.cpp @@ -28,12 +28,12 @@ namespace Prism s_ClientLogger->set_level(LOG_LEVEL); } - std::shared_ptr& Log::GetCoreLogger() + const std::shared_ptr& Log::GetCoreLogger() { return s_CoreLogger; } - std::shared_ptr& Log::GetClientLogger() + const std::shared_ptr& Log::GetClientLogger() { return s_ClientLogger; } diff --git a/Prism/src/Prism/Core/Log.h b/Prism/src/Prism/Core/Log.h index 6612c26..41b970c 100644 --- a/Prism/src/Prism/Core/Log.h +++ b/Prism/src/Prism/Core/Log.h @@ -15,8 +15,8 @@ namespace Prism public: static void Init(); - PRISM_API static std::shared_ptr& GetCoreLogger(); - PRISM_API static std::shared_ptr& GetClientLogger(); + PRISM_API static const std::shared_ptr& GetCoreLogger(); + PRISM_API static const std::shared_ptr& GetClientLogger(); private: static std::shared_ptr s_CoreLogger; diff --git a/Prism/src/Prism/Core/Math/Noise.cpp b/Prism/src/Prism/Core/Math/Noise.cpp new file mode 100644 index 0000000..661c8ec --- /dev/null +++ b/Prism/src/Prism/Core/Math/Noise.cpp @@ -0,0 +1,20 @@ +// +// Created by sfd on 25-12-7. +// + +#include "Noise.h" + +#include "FastNoise.h" + +namespace Prism +{ + + static FastNoise s_FastNoise; + + float Noise::PerlinNoise(float x, float y) + { + s_FastNoise.SetNoiseType(FastNoise::Perlin); + float result = s_FastNoise.GetNoise(x, y); // This returns a value between -1 and 1 + return result; + } +} \ No newline at end of file diff --git a/Prism/src/Prism/Core/Math/Noise.h b/Prism/src/Prism/Core/Math/Noise.h new file mode 100644 index 0000000..d20678d --- /dev/null +++ b/Prism/src/Prism/Core/Math/Noise.h @@ -0,0 +1,19 @@ +// +// Created by sfd on 25-12-7. +// + +#ifndef NOISE_H +#define NOISE_H + + +namespace Prism +{ + class Noise + { + public: + static float PerlinNoise(float x, float y); + }; +} + + +#endif //NOISE_H diff --git a/Prism/src/Prism/Core/Ref.h b/Prism/src/Prism/Core/Ref.h index 7574f32..ed0eb93 100644 --- a/Prism/src/Prism/Core/Ref.h +++ b/Prism/src/Prism/Core/Ref.h @@ -14,12 +14,12 @@ namespace Prism class PRISM_API RefCounted { public: - void IncRefCount() + void IncRefCount() const { m_RefCount ++; } - void DecRefCount() + void DecRefCount() const { m_RefCount --; } diff --git a/Prism/src/Prism/Editor/SceneHierachyPanel.cpp b/Prism/src/Prism/Editor/SceneHierachyPanel.cpp index 8295bd2..59f9011 100644 --- a/Prism/src/Prism/Editor/SceneHierachyPanel.cpp +++ b/Prism/src/Prism/Editor/SceneHierachyPanel.cpp @@ -9,6 +9,7 @@ #define GLM_ENABLE_EXPERIMENTAL #include "assimp/scene.h" #include "glm/gtx/matrix_decompose.hpp" +#include "Prism/Script/ScriptEngine.h" namespace Prism { @@ -25,37 +26,40 @@ namespace Prism m_Context = scene; } + void SceneHierarchyPanel::SetSelected(Entity entity) + { + m_SelectionContext = entity; + } + void SceneHierarchyPanel::OnImGuiRender() { ImGui::Begin("Scene Hierarchy"); uint32_t entityCount = 0, meshCount = 0; - auto& sceneEntities = m_Context->m_Entities; - for (const auto& entity : sceneEntities) + for(const auto entity : m_Context->m_Registry.view()) { - DrawEntityNode(entity, entityCount, meshCount); + DrawEntityNode(Entity(entity, m_Context.Raw())); } + + if (ImGui::BeginPopupContextWindow()) + { + if (ImGui::MenuItem("Create Empty Entity")) + { + m_Context->CreateEntity("Empty Entity"); + } + ImGui::EndPopup(); + } + + ImGui::End(); ImGui::Begin("Properties"); if (m_SelectionContext) { - /*auto mesh = m_SelectionContext; + DrawComponents(m_SelectionContext); - { - auto [translation, rotation, scale] = GetTransformDecomposition(transform); - ImGui::Text("World Transform"); - ImGui::Text(" Translation: %.2f, %.2f, %.2f", translation.x, translation.y, translation.z); - ImGui::Text(" Scale: %.2f, %.2f, %.2f", scale.x, scale.y, scale.z); - } - { - auto [translation, rotation, scale] = GetTransformDecomposition(localTransform); - ImGui::Text("Local Transform"); - ImGui::Text(" Translation: %.2f, %.2f, %.2f", translation.x, translation.y, translation.z); - ImGui::Text(" Scale: %.2f, %.2f, %.2f", scale.x, scale.y, scale.z); - }*/ } ImGui::End(); @@ -82,23 +86,46 @@ namespace Prism } - void SceneHierarchyPanel::DrawEntityNode(Entity* entity, uint32_t& imguiEntityID, uint32_t& imguiMeshID) + void SceneHierarchyPanel::DrawEntityNode(Entity entity) { - const char* name = entity->GetName().c_str(); - static char imguiName[128] = {}; - memset(imguiName, 0, 128); - snprintf(imguiName, sizeof(imguiName), "%s##%d", name, imguiEntityID++); - if (ImGui::TreeNode(imguiName)) - { - auto mesh = entity->GetMesh(); - auto material = entity->GetMaterial(); - const auto& transform = entity->GetTransform(); + const char* name = "Unnamed Entity"; + if (entity.HasComponent()) + name = entity.GetComponent().Tag.c_str(); - if (mesh) - DrawMeshNode(mesh, imguiMeshID); + const ImGuiTreeNodeFlags node_flags = (entity == m_SelectionContext ? ImGuiTreeNodeFlags_Selected : 0) | ImGuiTreeNodeFlags_OpenOnArrow; + const bool opened = ImGui::TreeNodeEx((void*)(uint32_t)entity, node_flags, name); + if (ImGui::IsItemClicked()) + m_SelectionContext = entity; + + bool entityDeleted = false; + if (ImGui::BeginPopupContextItem()) + { + if (ImGui::MenuItem("Delete")) + entityDeleted = true; + + ImGui::EndPopup(); + } + if (opened) + { + if (entity.HasComponent()) + { + auto mesh = entity.GetComponent().Mesh; + // if (mesh) + // DrawMeshNode(mesh); + } ImGui::TreePop(); } + + // Defer deletion until end of node UI + if (entityDeleted) + { + m_Context->DestroyEntity(entity); + if (entity == m_SelectionContext) + m_SelectionContext = {}; + } + + } static std::tuple GetTransformDecomposition(const glm::mat4& transform) @@ -127,7 +154,6 @@ namespace Prism } - void SceneHierarchyPanel::MeshNodeHierarchy(const Ref& mesh, aiNode* node, const glm::mat4& parentTransform, uint32_t level) { glm::mat4 localTransform = Mat4FromAssimpMat4(node->mTransformation); @@ -162,4 +188,296 @@ namespace Prism } } + + static int s_UIContextID = 0; + static uint32_t s_Counter = 0; + static char s_IDBuffer[16]; + + static void PushID() + { + ImGui::PushID(s_UIContextID++); + s_Counter = 0; + } + + static void PopID() + { + ImGui::PopID(); + s_UIContextID--; + } + + static void BeginPropertyGrid() + { + PushID(); + ImGui::Columns(2); + } + + static bool Property(const char* label, std::string& value) + { + bool modified = false; + + ImGui::Text(label); + ImGui::NextColumn(); + ImGui::PushItemWidth(-1); + + char buffer[256]; + snprintf(buffer, sizeof(buffer), "%s", value.c_str()); + + s_IDBuffer[0] = '#'; + s_IDBuffer[1] = '#'; + memset(s_IDBuffer + 2, 0, 14); + itoa(s_Counter++, s_IDBuffer + 2, 16); + if (ImGui::InputText(s_IDBuffer, buffer, 256)) + { + value = buffer; + modified = true; + } + + ImGui::PopItemWidth(); + ImGui::NextColumn(); + + return modified; + } + + static void Property(const char* label, const char* value) + { + ImGui::Text(label); + ImGui::NextColumn(); + ImGui::PushItemWidth(-1); + + s_IDBuffer[0] = '#'; + s_IDBuffer[1] = '#'; + memset(s_IDBuffer + 2, 0, 14); + itoa(s_Counter++, s_IDBuffer + 2, 16); + ImGui::InputText(s_IDBuffer, (char*)value, 256, ImGuiInputTextFlags_ReadOnly); + + ImGui::PopItemWidth(); + ImGui::NextColumn(); + } + + static bool Property(const char* label, int& value) + { + bool modified = false; + + ImGui::Text(label); + ImGui::NextColumn(); + ImGui::PushItemWidth(-1); + + s_IDBuffer[0] = '#'; + s_IDBuffer[1] = '#'; + memset(s_IDBuffer + 2, 0, 14); + itoa(s_Counter++, s_IDBuffer + 2, 16); + if (ImGui::DragInt(s_IDBuffer, &value)) + modified = true; + + ImGui::PopItemWidth(); + ImGui::NextColumn(); + + return modified; + } + + static bool Property(const char* label, float& value, float delta = 0.1f) + { + bool modified = false; + + ImGui::Text(label); + ImGui::NextColumn(); + ImGui::PushItemWidth(-1); + + s_IDBuffer[0] = '#'; + s_IDBuffer[1] = '#'; + memset(s_IDBuffer + 2, 0, 14); + itoa(s_Counter++, s_IDBuffer + 2, 16); + if (ImGui::DragFloat(s_IDBuffer, &value, delta)) + modified = true; + + ImGui::PopItemWidth(); + ImGui::NextColumn(); + + return modified; + } + + static bool Property(const char* label, glm::vec2& value, float delta = 0.1f) + { + bool modified = false; + + ImGui::Text(label); + ImGui::NextColumn(); + ImGui::PushItemWidth(-1); + + s_IDBuffer[0] = '#'; + s_IDBuffer[1] = '#'; + memset(s_IDBuffer + 2, 0, 14); + itoa(s_Counter++, s_IDBuffer + 2, 16); + if (ImGui::DragFloat2(s_IDBuffer, glm::value_ptr(value), delta)) + modified = true; + + ImGui::PopItemWidth(); + ImGui::NextColumn(); + + return modified; + } + + static void EndPropertyGrid() + { + ImGui::Columns(1); + PopID(); + } + + void SceneHierarchyPanel::DrawComponents(Entity entity) + { + ImGui::AlignTextToFramePadding(); + + if (entity.HasComponent()) + { + auto& tag = entity.GetComponent().Tag; + char buffer[256]; + memset(buffer, 0, 256); + memcpy(buffer, tag.c_str(), tag.length()); + if (ImGui::InputText("##Tag", buffer, 256)) + { + tag = std::string(buffer); + } + + ImGui::Separator(); + } + + if (entity.HasComponent()) + { + auto& tc = entity.GetComponent(); + if (ImGui::TreeNodeEx((void*)((uint32_t)entity | typeid(MeshComponent).hash_code()), ImGuiTreeNodeFlags_DefaultOpen, "Transform")) + { + auto [translation, rotation, scale] = GetTransformDecomposition(tc); + + ImGui::Columns(2); + ImGui::Text("Translation"); + ImGui::NextColumn(); + ImGui::PushItemWidth(-1); + + if (ImGui::DragFloat3("##translation", glm::value_ptr(translation), 0.25f)) + { + tc.Transform[3] = glm::vec4(translation, 1.0f); + } + + ImGui::PopItemWidth(); + ImGui::NextColumn(); + + ImGui::Text("Scale"); + ImGui::NextColumn(); + ImGui::PushItemWidth(-1); + + if (ImGui::DragFloat3("##scale", glm::value_ptr(scale), 0.25f)) + { + + } + + ImGui::PopItemWidth(); + ImGui::NextColumn(); + + ImGui::Columns(1); + + // ImGui::Text("Translation: %.2f, %.2f, %.2f", translation.x, translation.y, translation.z); + // ImGui::Text("Scale: %.2f, %.2f, %.2f", scale.x, scale.y, scale.z); + ImGui::TreePop(); + } + ImGui::Separator(); + } + + + if (entity.HasComponent()) + { + auto& mc = entity.GetComponent(); + if (ImGui::TreeNodeEx((void*)((uint32_t)entity | typeid(TransformComponent).hash_code()), ImGuiTreeNodeFlags_DefaultOpen, "Mesh")) + { + if (mc.Mesh) + ImGui::InputText("File Path", (char*)mc.Mesh->GetFilePath().c_str(), 256, ImGuiInputTextFlags_ReadOnly); + else + ImGui::InputText("File Path", (char*)"Null", 256, ImGuiInputTextFlags_ReadOnly); + ImGui::TreePop(); + } + ImGui::Separator(); + } + + if (entity.HasComponent()) + { + auto& cc = entity.GetComponent(); + if (ImGui::TreeNodeEx((void*)((uint32_t)entity | typeid(CameraComponent).hash_code()), ImGuiTreeNodeFlags_DefaultOpen, "Camera")) + { + + ImGui::TreePop(); + } + ImGui::Separator(); + } + + if (entity.HasComponent()) + { + auto& src = entity.GetComponent(); + if (ImGui::TreeNodeEx((void*)((uint32_t)entity | typeid(SpriteRendererComponent).hash_code()), ImGuiTreeNodeFlags_DefaultOpen, "Sprite Renderer")) + { + + ImGui::TreePop(); + } + ImGui::Separator(); + } + + if (entity.HasComponent()) + { + auto& sc = entity.GetComponent(); + if (ImGui::TreeNodeEx((void*)((uint32_t)entity | typeid(ScriptComponent).hash_code()), ImGuiTreeNodeFlags_DefaultOpen, "Script")) + { + BeginPropertyGrid(); + Property("Module Name", sc.ModuleName.c_str()); + + // Public Fields + auto& fieldMap = ScriptEngine::GetFieldMap(); + if (fieldMap.find(sc.ModuleName) != fieldMap.end()) + { + auto& publicFields = fieldMap.at(sc.ModuleName); + for (auto& field : publicFields) + { + switch (field.Type) + { + case FieldType::Int: + { + int value = field.GetValue(); + if (Property(field.Name.c_str(), value)) + { + field.SetValue(value); + } + break; + } + case FieldType::Float: + { + float value = field.GetValue(); + if (Property(field.Name.c_str(), value, 0.2f)) + { + field.SetValue(value); + } + break; + } + case FieldType::Vec2: + { + glm::vec2 value = field.GetValue(); + if (Property(field.Name.c_str(), value, 0.2f)) + { + field.SetValue(value); + } + break; + } + } + } + } + + EndPropertyGrid(); + if (ImGui::Button("Run Script")) + { + ScriptEngine::OnCreateEntity(entity); + } + ImGui::TreePop(); + } + ImGui::Separator(); + } + + } + + } diff --git a/Prism/src/Prism/Editor/SceneHierachyPanel.h b/Prism/src/Prism/Editor/SceneHierachyPanel.h index 27845c2..1fff2b8 100644 --- a/Prism/src/Prism/Editor/SceneHierachyPanel.h +++ b/Prism/src/Prism/Editor/SceneHierachyPanel.h @@ -4,6 +4,8 @@ #ifndef SCENEHIERACHYPANEL_H #define SCENEHIERACHYPANEL_H +#include "Prism/Renderer/Mesh.h" +#include "Prism/Scene/Entity.h" #include "Prism/Scene/Scene.h" @@ -15,15 +17,17 @@ namespace Prism SceneHierarchyPanel(const Ref& context); void SetContext(const Ref& scene); + void SetSelected(Entity entity); void OnImGuiRender(); private: - void DrawEntityNode(Entity* entity, uint32_t& imguiEntityID, uint32_t& imguiMeshID); + void DrawEntityNode(Entity entity); void DrawMeshNode(const Ref& mesh, uint32_t& imguiMeshID); + void DrawComponents(Entity entity); void MeshNodeHierarchy(const Ref& mesh, aiNode* node, const glm::mat4& parentTransform = glm::mat4(1.0f), uint32_t level = 0); private: Ref m_Context; - Ref m_SelectionContext; + Entity m_SelectionContext; }; } diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLBuffer.cpp b/Prism/src/Prism/Platform/OpenGL/OpenGLBuffer.cpp index 70142e6..ff3793b 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLBuffer.cpp +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLBuffer.cpp @@ -28,18 +28,20 @@ namespace Prism { m_LocalData = Buffer::Copy(data, size); - Renderer::Submit([=](){ - glCreateBuffers(1, &m_RendererID); - glNamedBufferData(m_RendererID, m_Size, m_LocalData.Data, OpenGLUsage(m_Usage)); + Ref instance = this; + Renderer::Submit([instance]() mutable { + glCreateBuffers(1, &instance->m_RendererID); + glNamedBufferData(instance->m_RendererID, instance->m_Size, instance->m_LocalData.Data, OpenGLUsage(instance->m_Usage)); }); } OpenGLVertexBuffer::OpenGLVertexBuffer(const uint32_t size, const VertexBufferUsage usage) : m_Size(size), m_Usage(usage) { - Renderer::Submit([this](){ - glCreateBuffers(1, &m_RendererID); - glNamedBufferData(m_RendererID, m_Size, nullptr, OpenGLUsage(m_Usage)); + Ref instance = this; + Renderer::Submit([instance]() mutable { + glCreateBuffers(1, &instance->m_RendererID); + glNamedBufferData(instance->m_RendererID, instance->m_Size, nullptr, OpenGLUsage(instance->m_Usage)); }); } @@ -59,8 +61,9 @@ namespace Prism { m_LocalData = Buffer::Copy(buffer, size); m_Size = size; - Renderer::Submit([this, offset]() { - glNamedBufferSubData(m_RendererID, offset, m_Size, m_LocalData.Data); + Ref instance = this; + Renderer::Submit([instance, offset]() { + glNamedBufferSubData(instance->m_RendererID, offset, instance->m_Size, instance->m_LocalData.Data); }); } @@ -77,7 +80,7 @@ namespace Prism } - OpenGLIndexBuffer::OpenGLIndexBuffer(uint32_t size) + OpenGLIndexBuffer::OpenGLIndexBuffer(const uint32_t size) : m_Size(size) { Renderer::Submit([this]() @@ -95,9 +98,11 @@ namespace Prism { m_LocalData = Buffer::Copy(data, size); - Renderer::Submit([this](){ - glCreateBuffers(1, &m_RendererID); - glNamedBufferData(m_RendererID, m_Size, m_LocalData.Data, GL_STATIC_DRAW); + + Ref instance = this; + Renderer::Submit([instance]() mutable { + glCreateBuffers(1, &instance->m_RendererID); + glNamedBufferData(instance->m_RendererID, instance->m_Size, instance->m_LocalData.Data, GL_STATIC_DRAW); }); } @@ -123,8 +128,10 @@ namespace Prism void OpenGLIndexBuffer::Bind() const { - Renderer::Submit([this](){ - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_RendererID); + + Ref instance = this; + Renderer::Submit([instance]() { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, instance->m_RendererID); }); } } diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.cpp b/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.cpp index ea5826d..0ffe6a7 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.cpp +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.cpp @@ -7,7 +7,7 @@ namespace Prism { OpenGLRenderPass::OpenGLRenderPass(const RenderPassSpecification& spec) - : m_spec(spec) + : m_Spec(spec) { } diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.h b/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.h index c0104b3..90c66d3 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.h +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLRenderPass.h @@ -15,10 +15,11 @@ namespace Prism OpenGLRenderPass(const RenderPassSpecification& spec); virtual ~OpenGLRenderPass(); - virtual RenderPassSpecification& GetSpecification() override { return m_spec; } + virtual RenderPassSpecification& GetSpecification() override { return m_Spec; } + virtual const RenderPassSpecification& GetSpecification() const { return m_Spec; } private: - RenderPassSpecification m_spec; + RenderPassSpecification m_Spec; }; } diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLRendererAPI.cpp b/Prism/src/Prism/Platform/OpenGL/OpenGLRendererAPI.cpp index d7effd5..4b0b5b4 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLRendererAPI.cpp +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLRendererAPI.cpp @@ -71,6 +71,7 @@ namespace Prism { case GL_DEBUG_SEVERITY_HIGH: PM_CORE_ERROR("[OpenGL HIGH] Source: {0}, Type: {1}, ID: {2}\nMessage: {3}", sourceStr, typeStr, id, message); + PM_CORE_ASSERT(false); break; case GL_DEBUG_SEVERITY_MEDIUM: diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLShader.cpp b/Prism/src/Prism/Platform/OpenGL/OpenGLShader.cpp index 9307b85..3ae8eef 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLShader.cpp +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLShader.cpp @@ -125,6 +125,14 @@ namespace Prism }); } + void OpenGLShader::SetFloat3(const std::string& name, const glm::vec3& value) + { + Renderer::Submit([=]() + { + UploadUniformFloat3(name, value); + }); + } + void OpenGLShader::SetInt(const std::string& name, int value) { Renderer::Submit([=]() { @@ -336,8 +344,8 @@ namespace Prism m_Resources.clear(); m_Structs.clear(); - m_VSMaterialUniformBuffer.reset(); - m_PSMaterialUniformBuffer.reset(); + m_VSMaterialUniformBuffer.Reset(); + m_PSMaterialUniformBuffer.Reset(); auto& vertexSource = m_ShaderSource[GL_VERTEX_SHADER]; auto& fragmentSource = m_ShaderSource[GL_FRAGMENT_SHADER]; @@ -450,14 +458,14 @@ namespace Prism if (domain == ShaderDomain::Vertex) { if (!m_VSMaterialUniformBuffer) - m_VSMaterialUniformBuffer.reset(new OpenGLShaderUniformBufferDeclaration("", domain)); + m_VSMaterialUniformBuffer.Reset(new OpenGLShaderUniformBufferDeclaration("", domain)); m_VSMaterialUniformBuffer->PushUniform(declaration); } else if (domain == ShaderDomain::Pixel) { if (!m_PSMaterialUniformBuffer) - m_PSMaterialUniformBuffer.reset(new OpenGLShaderUniformBufferDeclaration("", domain)); + m_PSMaterialUniformBuffer.Reset(new OpenGLShaderUniformBufferDeclaration("", domain)); m_PSMaterialUniformBuffer->PushUniform(declaration); } @@ -772,7 +780,7 @@ namespace Prism PM_CORE_WARN("Uniform '{0}' not found!", name); } - void OpenGLShader::ResolveAndSetUniforms(const Scope& decl, Buffer buffer) + void OpenGLShader::ResolveAndSetUniforms(const Ref& decl, Buffer buffer) { const ShaderUniformList& uniforms = decl->GetUniformDeclarations(); for (size_t i = 0; i < uniforms.size(); i++) diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLShader.h b/Prism/src/Prism/Platform/OpenGL/OpenGLShader.h index cfaed54..8a2c9fb 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLShader.h +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLShader.h @@ -28,6 +28,7 @@ namespace Prism virtual void AddShaderReloadedCallback(const ShaderReloadedCallback& callback) override; virtual void SetFloat(const std::string& name, float value) override; + virtual void SetFloat3(const std::string& name, const glm::vec3& value) override; virtual void SetInt(const std::string& name, int value) override; virtual void SetMat4(const std::string& name, const glm::mat4& value) override; @@ -68,7 +69,7 @@ namespace Prism void UploadUniformFloat4(const std::string& name, const glm::vec4& values) const; void UploadUniformMat4(const std::string& name, const glm::mat4& values) const; - void ResolveAndSetUniforms(const Scope& decl, Buffer buffer); + void ResolveAndSetUniforms(const Ref& decl, Buffer buffer); void ResolveAndSetUniform(OpenGLShaderUniformDeclaration* uniform, Buffer buffer); void ResolveAndSetUniformArray(OpenGLShaderUniformDeclaration* uniform, Buffer buffer); void ResolveAndSetUniformField(const OpenGLShaderUniformDeclaration& field, byte* data, int32_t offset); @@ -106,8 +107,8 @@ namespace Prism ShaderUniformBufferList m_VSRendererUniformBuffers; ShaderUniformBufferList m_PSRendererUniformBuffers; - Scope m_VSMaterialUniformBuffer; - Scope m_PSMaterialUniformBuffer; + Ref m_VSMaterialUniformBuffer; + Ref m_PSMaterialUniformBuffer; ShaderResourceList m_Resources; ShaderStructList m_Structs; diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLTexture.cpp b/Prism/src/Prism/Platform/OpenGL/OpenGLTexture.cpp index 927a525..0d60e5e 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLTexture.cpp +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLTexture.cpp @@ -30,18 +30,19 @@ namespace Prism OpenGLTexture2D::OpenGLTexture2D(TextureFormat format, uint32_t width, uint32_t height, TextureWrap wrap) : m_Format(format), m_Width(width), m_Height(height), m_Wrap(wrap) { - Renderer::Submit([this]() { - glGenTextures(1, &m_RendererID); - glBindTexture(GL_TEXTURE_2D, m_RendererID); + Ref instance = this; + Renderer::Submit([instance]() mutable { + glGenTextures(1, &instance->m_RendererID); + glBindTexture(GL_TEXTURE_2D, instance->m_RendererID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - const GLint wrap = m_Wrap == TextureWrap::Clamp ? GL_CLAMP_TO_EDGE : GL_REPEAT; + const GLint wrap = instance->m_Wrap == TextureWrap::Clamp ? GL_CLAMP_TO_EDGE : GL_REPEAT; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap); - glTextureParameterf(m_RendererID, GL_TEXTURE_MAX_ANISOTROPY, RendererAPI::GetCapabilities().MaxAnisotropy); + glTextureParameterf(instance->m_RendererID, GL_TEXTURE_MAX_ANISOTROPY, RendererAPI::GetCapabilities().MaxAnisotropy); - glTexImage2D(GL_TEXTURE_2D, 0, PrismToOpenGLTextureFormat(m_Format), (GLint)m_Width, (GLint)m_Height, 0, Prism::PrismToOpenGLTextureFormat(m_Format), GL_UNSIGNED_BYTE, nullptr); + glTexImage2D(GL_TEXTURE_2D, 0, PrismToOpenGLTextureFormat(instance->m_Format), (GLint)instance->m_Width, (GLint)instance->m_Height, 0, Prism::PrismToOpenGLTextureFormat(instance->m_Format), GL_UNSIGNED_BYTE, nullptr); // glGenerateMipmap(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); @@ -77,23 +78,24 @@ namespace Prism m_Width = width; m_Height = height; - Renderer::Submit([=]() { + Ref instance = this; + Renderer::Submit([instance, srgb]() mutable { // TODO: Consolidate properly if (srgb) { - glCreateTextures(GL_TEXTURE_2D, 1, &m_RendererID); - const auto levels = (GLint)CalculateMipMapCount(m_Width, m_Height); - glTextureStorage2D(m_RendererID, levels, GL_SRGB8, (GLint)m_Width, (GLint)m_Height); - glTextureParameteri(m_RendererID, GL_TEXTURE_MIN_FILTER, levels > 1 ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR); - glTextureParameteri(m_RendererID, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glCreateTextures(GL_TEXTURE_2D, 1, &instance->m_RendererID); + const auto levels = (GLint)CalculateMipMapCount(instance->m_Width, instance->m_Height); + glTextureStorage2D(instance->m_RendererID, levels, GL_SRGB8, (GLint)instance->m_Width, (GLint)instance->m_Height); + glTextureParameteri(instance->m_RendererID, GL_TEXTURE_MIN_FILTER, levels > 1 ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR); + glTextureParameteri(instance->m_RendererID, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTextureSubImage2D(m_RendererID, 0, 0, 0, (GLint)m_Width, (GLint)m_Height, GL_RGB, GL_UNSIGNED_BYTE, m_ImageData.Data); - glGenerateTextureMipmap(m_RendererID); + glTextureSubImage2D(instance->m_RendererID, 0, 0, 0, (GLint)instance->m_Width, (GLint)instance->m_Height, GL_RGB, GL_UNSIGNED_BYTE, instance->m_ImageData.Data); + glGenerateTextureMipmap(instance->m_RendererID); } else { - glGenTextures(1, &m_RendererID); - glBindTexture(GL_TEXTURE_2D, m_RendererID); + glGenTextures(1, &instance->m_RendererID); + glBindTexture(GL_TEXTURE_2D, instance->m_RendererID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -101,16 +103,16 @@ namespace Prism glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - GLenum internalFormat = PrismToOpenGLTextureFormat(m_Format); - GLenum format = srgb ? GL_SRGB8 : (m_IsHDR ? GL_RGB : PrismToOpenGLTextureFormat(m_Format)); // HDR = GL_RGB for now + GLenum internalFormat = PrismToOpenGLTextureFormat(instance->m_Format); + GLenum format = srgb ? GL_SRGB8 : (instance->m_IsHDR ? GL_RGB : PrismToOpenGLTextureFormat(instance->m_Format)); // HDR = GL_RGB for now GLenum type = internalFormat == GL_RGBA16F ? GL_FLOAT : GL_UNSIGNED_BYTE; - glTexImage2D(GL_TEXTURE_2D, 0, (GLint)internalFormat, (GLint)m_Width, (GLint)m_Height, 0, format, type, m_ImageData.Data); + glTexImage2D(GL_TEXTURE_2D, 0, (GLint)internalFormat, (GLint)instance->m_Width, (GLint)instance->m_Height, 0, format, type, instance->m_ImageData.Data); glGenerateMipmap(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); } - stbi_image_free(m_ImageData.Data); + stbi_image_free(instance->m_ImageData.Data); }); } @@ -119,16 +121,18 @@ namespace Prism #ifdef __MINGW32__ glDeleteTextures(1, &m_RendererID); #else - Renderer::Submit([this](){ - glDeleteTextures(1, &m_RendererID); + GLuint rendererID = m_RendererID; + Renderer::Submit([rendererID](){ + glDeleteTextures(1, &rendererID); }); #endif } void OpenGLTexture2D::Bind(uint32_t slot) const { - Renderer::Submit([this, slot]() { - glBindTextureUnit(slot, m_RendererID); + Ref instance = this; + Renderer::Submit([instance, slot]() { + glBindTextureUnit(slot, instance->m_RendererID); }); } @@ -145,8 +149,9 @@ namespace Prism void OpenGLTexture2D::Unlock() { m_Locked = false; - Renderer::Submit([this](){ - glTextureSubImage2D(m_RendererID, 0, 0, 0, m_Width, m_Height, PrismToOpenGLTextureFormat(m_Format), GL_UNSIGNED_BYTE, m_ImageData.Data); + Ref instance = this; + Renderer::Submit([instance](){ + glTextureSubImage2D(instance->m_RendererID, 0, 0, 0, instance->m_Width, instance->m_Height, PrismToOpenGLTextureFormat(instance->m_Format), GL_UNSIGNED_BYTE, instance->m_ImageData.Data); }); } @@ -175,12 +180,12 @@ namespace Prism m_Format = format; const GLint levels = CalculateMipMapCount(width, height); - - Renderer::Submit([=]() { - glCreateTextures(GL_TEXTURE_CUBE_MAP, 1, &m_RendererID); - glTextureStorage2D(m_RendererID, levels, PrismToOpenGLTextureFormat(m_Format), width, height); - glTextureParameteri(m_RendererID, GL_TEXTURE_MIN_FILTER, levels > 1 ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR); - glTextureParameteri(m_RendererID, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + Ref instance = this; + Renderer::Submit([instance, levels]() mutable { + glCreateTextures(GL_TEXTURE_CUBE_MAP, 1, &instance->m_RendererID); + glTextureStorage2D(instance->m_RendererID, levels, PrismToOpenGLTextureFormat(instance->m_Format), instance->m_Width, instance->m_Height); + glTextureParameteri(instance->m_RendererID, GL_TEXTURE_MIN_FILTER, levels > 1 ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR); + glTextureParameteri(instance->m_RendererID, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); @@ -203,9 +208,9 @@ namespace Prism const uint32_t faceHeight = m_Height / 3; PM_CORE_ASSERT(faceWidth == faceHeight, "Non-square faces!"); - std::array faces; + std::array faces; for (size_t i = 0; i < faces.size(); i++) - faces[i] = new unsigned char[faceWidth * faceHeight * 3]; // 3 BPP + faces[i] = new uint8_t[faceWidth * faceHeight * 3]; // 3 BPP int faceIndex = 0; @@ -244,9 +249,11 @@ namespace Prism } faceIndex++; } - Renderer::Submit([=]() { - glGenTextures(1, &m_RendererID); - glBindTexture(GL_TEXTURE_CUBE_MAP, m_RendererID); + + Ref instance = this; + Renderer::Submit([instance, faceWidth, faceHeight, faces]() mutable { + glGenTextures(1, &instance->m_RendererID); + glBindTexture(GL_TEXTURE_CUBE_MAP, instance->m_RendererID); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -254,9 +261,9 @@ namespace Prism glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glTextureParameterf(m_RendererID, GL_TEXTURE_MAX_ANISOTROPY, RendererAPI::GetCapabilities().MaxAnisotropy); + glTextureParameterf(instance->m_RendererID, GL_TEXTURE_MAX_ANISOTROPY, RendererAPI::GetCapabilities().MaxAnisotropy); - auto format = PrismToOpenGLTextureFormat(m_Format); + auto format = PrismToOpenGLTextureFormat(instance->m_Format); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, format, faceWidth, faceHeight, 0, format, GL_UNSIGNED_BYTE, faces[2]); glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, format, faceWidth, faceHeight, 0, format, GL_UNSIGNED_BYTE, faces[0]); @@ -273,25 +280,27 @@ namespace Prism for (size_t i = 0; i < faces.size(); i++) delete[] faces[i]; - stbi_image_free(m_ImageData); + stbi_image_free(instance->m_ImageData); }); } OpenGLTextureCube::~OpenGLTextureCube() { #ifdef __MINGW32__ - glDeleteTextures(1, &m_RendererID); + glDeleteTextures(1, &m_RendererID); #else - Renderer::Submit([this]() { - glDeleteTextures(1, &m_RendererID); + GLuint rendererID = m_RendererID; + Renderer::Submit([rendererID]() { + glDeleteTextures(1, &rendererID); }); #endif } void OpenGLTextureCube::Bind(uint32_t slot) const { - Renderer::Submit([this, slot]() { - glBindTextureUnit(slot, m_RendererID); + Ref instance = this; + Renderer::Submit([instance, slot]() { + glBindTextureUnit(slot, instance->m_RendererID); }); } diff --git a/Prism/src/Prism/Platform/OpenGL/OpenGLVertexArray.cpp b/Prism/src/Prism/Platform/OpenGL/OpenGLVertexArray.cpp index 7632c39..f453064 100644 --- a/Prism/src/Prism/Platform/OpenGL/OpenGLVertexArray.cpp +++ b/Prism/src/Prism/Platform/OpenGL/OpenGLVertexArray.cpp @@ -49,8 +49,9 @@ namespace Prism void OpenGLVertexArray::Bind() const { - Renderer::Submit([this](){ - glBindVertexArray(m_RendererID); + Ref instance = this; + Renderer::Submit([instance](){ + glBindVertexArray(instance->m_RendererID); }); } @@ -68,16 +69,16 @@ namespace Prism Bind(); vertexBuffer->Bind(); - - Renderer::Submit([this, vertexBuffer](){ + Ref instance = this; + Renderer::Submit([instance, vertexBuffer]() mutable { const auto& layout = vertexBuffer->GetLayout(); for (const auto& element : layout) { auto glBaseType = ShaderDataTypeToOpenGLBaseType(element.Type); - glEnableVertexAttribArray(m_VertexBufferIndex); + glEnableVertexAttribArray(instance->m_VertexBufferIndex); if (glBaseType == GL_INT) { - glVertexAttribIPointer(m_VertexBufferIndex, + glVertexAttribIPointer(instance->m_VertexBufferIndex, element.GetComponentCount(), glBaseType, layout.GetStride(), @@ -85,14 +86,14 @@ namespace Prism } else { - glVertexAttribPointer(m_VertexBufferIndex, + glVertexAttribPointer(instance->m_VertexBufferIndex, element.GetComponentCount(), glBaseType, element.Normalized ? GL_TRUE : GL_FALSE, layout.GetStride(), (const void*)(intptr_t)element.Offset); } - m_VertexBufferIndex++; + instance->m_VertexBufferIndex++; } }); m_VertexBuffers.push_back(vertexBuffer); diff --git a/Prism/src/Prism/Renderer/FrameBuffer.h b/Prism/src/Prism/Renderer/FrameBuffer.h index f9f9a8c..5355716 100644 --- a/Prism/src/Prism/Renderer/FrameBuffer.h +++ b/Prism/src/Prism/Renderer/FrameBuffer.h @@ -61,6 +61,7 @@ namespace Prism void Add(const Ref& framebuffer); std::vector>& GetAll() { return m_Pool; } + const std::vector>& GetAll() const { return m_Pool; } static FrameBufferPool* GetGlobal(); diff --git a/Prism/src/Prism/Renderer/Mesh.cpp b/Prism/src/Prism/Renderer/Mesh.cpp index d54e1f2..9c4f429 100644 --- a/Prism/src/Prism/Renderer/Mesh.cpp +++ b/Prism/src/Prism/Renderer/Mesh.cpp @@ -20,7 +20,7 @@ namespace Prism { -#define MESH_DEBUG_LOG 1 +#define MESH_DEBUG_LOG 0 #ifdef MESH_DEBUG_LOG #define PM_MESH_LOG(...) PM_CORE_TRACE(__VA_ARGS__) #elif @@ -44,7 +44,7 @@ namespace Prism if (Assimp::DefaultLogger::isNullLogger()) { Assimp::DefaultLogger::create("", Assimp::Logger::VERBOSE); - Assimp::DefaultLogger::get()->attachStream(new LogStream, Assimp::Logger::Err | Assimp::Logger::Warn); + Assimp::DefaultLogger::get()->attachStream(new LogStream, Assimp::Logger::Err); } } diff --git a/Prism/src/Prism/Renderer/Renderer.cpp b/Prism/src/Prism/Renderer/Renderer.cpp index 3fe9b6d..6da71fe 100644 --- a/Prism/src/Prism/Renderer/Renderer.cpp +++ b/Prism/src/Prism/Renderer/Renderer.cpp @@ -18,7 +18,7 @@ namespace Prism { Ref m_ActiveRenderPass; RenderCommandQueue m_CommandQueue; - Scope m_ShaderLibrary; + Ref m_ShaderLibrary; Ref m_FullscreenQuadVertexArray; }; @@ -26,7 +26,7 @@ namespace Prism void Renderer::Init() { - s_Data.m_ShaderLibrary = std::make_unique(); + s_Data.m_ShaderLibrary = Ref::Create(); Submit([](){ RendererAPI::Init(); }); GetShaderLibrary()->Load("assets/shaders/PBRShader_Static.glsl"); @@ -87,7 +87,7 @@ namespace Prism - const Scope& Renderer::GetShaderLibrary() + Ref Renderer::GetShaderLibrary() { return s_Data.m_ShaderLibrary; } diff --git a/Prism/src/Prism/Renderer/Renderer.h b/Prism/src/Prism/Renderer/Renderer.h index 1e3a91a..3eaf274 100644 --- a/Prism/src/Prism/Renderer/Renderer.h +++ b/Prism/src/Prism/Renderer/Renderer.h @@ -23,7 +23,7 @@ namespace Prism static void Clear(float r, float g, float b, float a = 1.0f); static void SetClearColor(float r, float g, float b, float a); - static const Scope& GetShaderLibrary(); + static Ref GetShaderLibrary(); static void DrawIndexed(uint32_t count, PrimitiveType type, bool depthTest = true); // For OpenGL diff --git a/Prism/src/Prism/Renderer/Renderer2D.cpp b/Prism/src/Prism/Renderer/Renderer2D.cpp index c549e50..ed9941e 100644 --- a/Prism/src/Prism/Renderer/Renderer2D.cpp +++ b/Prism/src/Prism/Renderer/Renderer2D.cpp @@ -217,6 +217,73 @@ namespace Prism #endif } + void Renderer2D::DrawQuad(const glm::mat4& transform, const glm::vec4& color) + { + constexpr size_t quadVertexCount = 4; + const float textureIndex = 0.0f; // White Texture + constexpr float tilingFactor = 1.0f; + + if (s_Data.QuadIndexCount >= Renderer2DData::MaxIndices) + FlushAndReset(); + + for (size_t i = 0; i < quadVertexCount; i++) + { + s_Data.QuadVertexBufferPtr->Position = transform * s_Data.QuadVertexPositions[i]; + s_Data.QuadVertexBufferPtr->Color = color; + s_Data.QuadVertexBufferPtr->TexCoord = defaultTexCoords[i]; + s_Data.QuadVertexBufferPtr->TexIndex = textureIndex; + s_Data.QuadVertexBufferPtr->TilingFactor = tilingFactor; + s_Data.QuadVertexBufferPtr++; + } + + s_Data.QuadIndexCount += 6; + + s_Data.Stats.QuadCount++; + } + + void Renderer2D::DrawQuad(const glm::mat4& transform, const Ref& texture, float tilingFactor, const glm::vec4& tintColor) + { + constexpr size_t quadVertexCount = 4; + constexpr glm::vec4 color = { 1.0f, 1.0f, 1.0f, 1.0f }; + + if (s_Data.QuadIndexCount >= Renderer2DData::MaxIndices) + FlushAndReset(); + + float textureIndex = 0.0f; + for (uint32_t i = 1; i < s_Data.TextureSlotIndex; i++) + { + if (*s_Data.TextureSlots[i].Raw() == *texture.Raw()) + { + textureIndex = (float)i; + break; + } + } + + if (textureIndex == 0.0f) + { + if (s_Data.TextureSlotIndex >= Renderer2DData::MaxTextureSlots) + FlushAndReset(); + + textureIndex = (float)s_Data.TextureSlotIndex; + s_Data.TextureSlots[s_Data.TextureSlotIndex] = texture; + s_Data.TextureSlotIndex++; + } + + for (size_t i = 0; i < quadVertexCount; i++) + { + s_Data.QuadVertexBufferPtr->Position = transform * s_Data.QuadVertexPositions[i]; + s_Data.QuadVertexBufferPtr->Color = color; + s_Data.QuadVertexBufferPtr->TexCoord = defaultTexCoords[i]; + s_Data.QuadVertexBufferPtr->TexIndex = textureIndex; + s_Data.QuadVertexBufferPtr->TilingFactor = tilingFactor; + s_Data.QuadVertexBufferPtr++; + } + + s_Data.QuadIndexCount += 6; + + s_Data.Stats.QuadCount++; + } + void Renderer2D::DrawQuad(const glm::vec2& position, const glm::vec2& size, const glm::vec4& color) { DrawQuad({ position.x, position.y, 0.0f }, size, color); diff --git a/Prism/src/Prism/Renderer/Renderer2D.h b/Prism/src/Prism/Renderer/Renderer2D.h index 6ca6892..05d12c2 100644 --- a/Prism/src/Prism/Renderer/Renderer2D.h +++ b/Prism/src/Prism/Renderer/Renderer2D.h @@ -22,6 +22,9 @@ namespace Prism static void Flush(); // Primitives + static void DrawQuad(const glm::mat4& transform, const glm::vec4& color); + static void DrawQuad(const glm::mat4& transform, const Ref& texture, float tilingFactor = 1.0f, const glm::vec4& tintColor = glm::vec4(1.0f)); + static void DrawQuad(const glm::vec2& position, const glm::vec2& size, const glm::vec4& color); static void DrawQuad(const glm::vec3& position, const glm::vec2& size, const glm::vec4& color); static void DrawQuad(const glm::vec2& position, const glm::vec2& size, const Ref& texture, float tilingFactor = 1.0f, const glm::vec4& tintColor = glm::vec4(1.0f)); diff --git a/Prism/src/Prism/Renderer/SceneRenderer.cpp b/Prism/src/Prism/Renderer/SceneRenderer.cpp index d855307..c4050fd 100644 --- a/Prism/src/Prism/Renderer/SceneRenderer.cpp +++ b/Prism/src/Prism/Renderer/SceneRenderer.cpp @@ -93,13 +93,13 @@ namespace Prism s_Data.CompositePass->GetSpecification().TargetFramebuffer->Resize(width, height); } - void SceneRenderer::BeginScene(const Scene* scene) + void SceneRenderer::BeginScene(const Scene* scene, const Camera& camera) { PM_CORE_ASSERT(!s_Data.ActiveScene); s_Data.ActiveScene = scene; - s_Data.SceneData.SceneCamera = scene->m_Camera; + s_Data.SceneData.SceneCamera = camera; s_Data.SceneData.SkyboxMaterial = scene->m_SkyboxMaterial; s_Data.SceneData.SceneEnvironment = scene->m_Environment; s_Data.SceneData.ActiveLight = scene->m_Light; @@ -114,15 +114,11 @@ namespace Prism FlushDrawList(); } - void SceneRenderer::SubmitEntity(Entity* entity) + void SceneRenderer::SubmitMesh(const Ref& mesh, const glm::mat4& transform, const Ref& overrideMaterial) { // TODO: Culling, sorting, etc. - auto mesh = entity->GetMesh(); - if (!mesh) - return; - - s_Data.DrawList.push_back({ mesh, entity->GetMaterial(), entity->GetTransform() }); + s_Data.DrawList.push_back({ mesh, overrideMaterial, transform }); } diff --git a/Prism/src/Prism/Renderer/SceneRenderer.h b/Prism/src/Prism/Renderer/SceneRenderer.h index 224c2af..8d081c7 100644 --- a/Prism/src/Prism/Renderer/SceneRenderer.h +++ b/Prism/src/Prism/Renderer/SceneRenderer.h @@ -4,6 +4,7 @@ #ifndef SCENERENDERER_H #define SCENERENDERER_H +#include "Mesh.h" #include "RenderPass.h" #include "Texture.h" #include "Prism/Scene/Scene.h" @@ -24,10 +25,10 @@ namespace Prism static void SetViewportSize(uint32_t width, uint32_t height); - static void BeginScene(const Scene* scene); + static void BeginScene(const Scene* scene, const Camera& camera); static void EndScene(); - static void SubmitEntity(Entity* entity); + static void SubmitMesh(const Ref& mesh, const glm::mat4& transform = glm::mat4(1.0f), const Ref& overrideMaterial = nullptr); static std::pair, Ref> CreateEnvironmentMap(const std::string& filepath); diff --git a/Prism/src/Prism/Renderer/Shader.cpp b/Prism/src/Prism/Renderer/Shader.cpp index aa57131..d368cf2 100644 --- a/Prism/src/Prism/Renderer/Shader.cpp +++ b/Prism/src/Prism/Renderer/Shader.cpp @@ -75,9 +75,9 @@ namespace Prism m_Shaders[name] = Ref(Shader::Create(path)); } - Ref& ShaderLibrary::Get(const std::string& name) + const Ref& ShaderLibrary::Get(const std::string& name) const { PM_CORE_ASSERT(m_Shaders.find(name) != m_Shaders.end()); - return m_Shaders[name]; + return m_Shaders.at(name); } } diff --git a/Prism/src/Prism/Renderer/Shader.h b/Prism/src/Prism/Renderer/Shader.h index 3992d08..43dcedf 100644 --- a/Prism/src/Prism/Renderer/Shader.h +++ b/Prism/src/Prism/Renderer/Shader.h @@ -111,6 +111,7 @@ namespace Prism virtual void UploadUniformBuffer(const UniformBufferBase& uniformBuffer) = 0; virtual void SetFloat(const std::string& name, float value) = 0; + virtual void SetFloat3(const std::string& name, const glm::vec3& value) = 0; virtual void SetInt(const std::string& name, int value) = 0; virtual void SetMat4(const std::string& name, const glm::mat4& value) = 0; virtual void SetMat4FromRenderThread(const std::string& name, const glm::mat4& value, bool bind = true) = 0; @@ -139,7 +140,7 @@ namespace Prism static std::vector> s_AllShaders; }; - class ShaderLibrary + class ShaderLibrary : public RefCounted { public: ShaderLibrary(); @@ -149,7 +150,7 @@ namespace Prism void Load(const std::string& path); void Load(const std::string& name, const std::string& path); - Ref& Get(const std::string& name); + const Ref& Get(const std::string& name) const; private: std::unordered_map> m_Shaders; }; diff --git a/Prism/src/Prism/Renderer/ShaderUniform.h b/Prism/src/Prism/Renderer/ShaderUniform.h index dd4f182..8775cee 100644 --- a/Prism/src/Prism/Renderer/ShaderUniform.h +++ b/Prism/src/Prism/Renderer/ShaderUniform.h @@ -4,6 +4,7 @@ #ifndef SHADERUNIFORM_H #define SHADERUNIFORM_H +#include "Prism/Core/Ref.h" namespace Prism { @@ -30,7 +31,7 @@ namespace Prism typedef std::vector ShaderUniformList; - class PRISM_API ShaderUniformBufferDeclaration + class PRISM_API ShaderUniformBufferDeclaration : public RefCounted { public: virtual const std::string& GetName() const = 0; diff --git a/Prism/src/Prism/Scene/Components.h b/Prism/src/Prism/Scene/Components.h new file mode 100644 index 0000000..de87460 --- /dev/null +++ b/Prism/src/Prism/Scene/Components.h @@ -0,0 +1,71 @@ +// +// Created by sfd on 25-12-6. +// + +#ifndef COMPONENTS_H +#define COMPONENTS_H + +#include + +#include "glm/glm.hpp" +#include "Prism/Core/Ref.h" +#include "Prism/Renderer/Camera.h" +#include "Prism/Renderer/Mesh.h" + +namespace Prism +{ + + struct TagComponent + { + std::string Tag; + + explicit operator std::string& () { return Tag; } + explicit operator const std::string& () const { return Tag; } + }; + + + struct TransformComponent + { + glm::mat4 Transform; + + operator glm::mat4& () { return Transform; } + operator const glm::mat4& () const { return Transform; } + }; + + + struct MeshComponent + { + Ref Mesh; + + operator Ref () { return Mesh; } + }; + + + struct ScriptComponent + { + // TODO: C# script + std::string ModuleName; + }; + + + struct CameraComponent + { + //OrthographicCamera Camera; + Prism::Camera Camera; + bool Primary = true; + + explicit operator Prism::Camera& () { return Camera; } + explicit operator const Prism::Camera& () const { return Camera; } + }; + + + struct SpriteRendererComponent + { + glm::vec4 Color = { 1.0f, 1.0f, 1.0f, 1.0f }; + Ref Texture; + float TilingFactor = 1.0f; + }; +} + + +#endif //COMPONENTS_H diff --git a/Prism/src/Prism/Scene/Entity.cpp b/Prism/src/Prism/Scene/Entity.cpp index 3337188..c6fbb05 100644 --- a/Prism/src/Prism/Scene/Entity.cpp +++ b/Prism/src/Prism/Scene/Entity.cpp @@ -6,12 +6,4 @@ namespace Prism { - Entity::~Entity() - { - } - - Entity::Entity(const std::string& name) - : m_Name(name), m_Transform(glm::mat4(1.0f)) - { - } } diff --git a/Prism/src/Prism/Scene/Entity.h b/Prism/src/Prism/Scene/Entity.h index 43fe888..8a1bebf 100644 --- a/Prism/src/Prism/Scene/Entity.h +++ b/Prism/src/Prism/Scene/Entity.h @@ -6,39 +6,64 @@ #define ENTITY_H #include "glm/glm.hpp" #include "Prism/Renderer/Mesh.h" +#include "Prism/Scene/Scene.h" +#include "Components.h" namespace Prism { + class PRISM_API Entity { public: - ~Entity(); + Entity() = default; + Entity(entt::entity handle, Scene* scene) + : m_EntityHandle(handle), m_Scene(scene) {} - // TODO: Move to Component - void SetMesh(const Ref& mesh) { m_Mesh = mesh; } - Ref GetMesh() { return m_Mesh; } + ~Entity() = default; - void SetMaterial(const Ref& material) { m_Material = material; } - Ref GetMaterial() { return m_Material; } + template + T& AddComponent(Args&&... args) + { + return m_Scene->m_Registry.emplace(m_EntityHandle, std::forward(args)...); + } - const glm::mat4& GetTransform() const { return m_Transform; } - glm::mat4& Transform() { return m_Transform; } + template + T& GetComponent() + { + return m_Scene->m_Registry.get(m_EntityHandle); + } + template + bool HasComponent() const + { + return m_Scene->m_Registry.storage().contains(m_EntityHandle); + } - const std::string& GetName() const { return m_Name; } + glm::mat4& Transform() { return m_Scene->m_Registry.get(m_EntityHandle); } + const glm::mat4& Transform() const { return m_Scene->m_Registry.get(m_EntityHandle); } + + operator uint32_t () const { return (uint32_t)m_EntityHandle; } + operator bool () const { return (uint32_t)m_EntityHandle && m_Scene; } + + bool operator==(const Entity& other) const + { + return m_EntityHandle == other.m_EntityHandle && m_Scene == other.m_Scene; + } + + bool operator!=(const Entity& other) const + { + return !(*this == other); + } private: - Entity(const std::string& name); + explicit Entity(const std::string& name); private: - std::string m_Name; - glm::mat4 m_Transform; - - // TODO: Temp - Ref m_Mesh; - Ref m_Material; + entt::entity m_EntityHandle = entt::null; + Scene* m_Scene = nullptr; private: friend class Scene; + friend class ScriptEngine; }; } diff --git a/Prism/src/Prism/Scene/Scene.cpp b/Prism/src/Prism/Scene/Scene.cpp index 886a423..53c3cf2 100644 --- a/Prism/src/Prism/Scene/Scene.cpp +++ b/Prism/src/Prism/Scene/Scene.cpp @@ -4,10 +4,41 @@ #include "Scene.h" +#include "Components.h" +#include "Entity.h" #include "Prism/Renderer/SceneRenderer.h" +#include "Prism/Script/ScriptEngine.h" namespace Prism { + std::unordered_map s_ActiveScenes; + + static uint32_t s_SceneIDCounter = 0; + + struct SceneComponent + { + uint32_t SceneID; + }; + + void OnTransformConstruct(entt::registry& registry, entt::entity entity) + { + // HZ_CORE_TRACE("Transform Component constructed!"); + } + + void OnScriptComponentConstruct(entt::registry& registry, entt::entity entity) + { + // Note: there should be exactly one scene component per registry + auto view = registry.view(); + uint32_t sceneID = 0; + for (const auto aEntity : view) + { + const auto& scene = registry.get(aEntity); + sceneID = scene.SceneID; + } + + ScriptEngine::OnInitEntity(registry.get(entity), (uint32_t)entity, sceneID); + } + Environment Environment::Load(const std::string& filepath) { auto [radiance, irradiance] = SceneRenderer::CreateEnvironmentMap(filepath); @@ -15,15 +46,24 @@ namespace Prism } Scene::Scene(const std::string& debugName) - : m_DebugName(debugName) + : m_SceneID(++s_SceneIDCounter), m_DebugName(debugName) { + m_Registry.on_construct().connect<&OnTransformConstruct>(); + m_Registry.on_construct().connect<&OnScriptComponentConstruct>(); + + m_SceneEntity = m_Registry.create(); + m_Registry.emplace(m_SceneEntity, m_SceneID); + + s_ActiveScenes[m_SceneID] = this; + Init(); } Scene::~Scene() { - for (const Entity* entity : m_Entities) - delete entity; + m_Registry.clear(); + + s_ActiveScenes.erase(m_SceneID); } void Scene::Init() @@ -35,23 +75,72 @@ namespace Prism void Scene::OnUpdate(TimeStep ts) { - m_SkyboxMaterial->Set("u_TextureLod", m_SkyboxLod); - // Update all entities - for (auto entity : m_Entities) + Camera* camera = nullptr; { - auto mesh = entity->GetMesh(); - if (mesh) - mesh->OnUpdate(ts); + auto view = m_Registry.view(); + for (auto entity : view) + { + auto& comp = view.get(entity); + camera = &comp.Camera; + break; + } } - SceneRenderer::BeginScene(this); + PM_CORE_ASSERT(camera, "Scene does not contain any cameras!"); + camera->OnUpdate(ts); - // Render entities - for (auto entity : m_Entities) + // Update all entities { - // TODO: Should we render (logically) - SceneRenderer::SubmitEntity(entity); + auto view = m_Registry.view(); + for (auto entity : view) + ScriptEngine::OnUpdateEntity((uint32_t)entity, ts); + } + +#if 0 + + // Render all sprites + Renderer2D::BeginScene(*camera); + { + auto group = m_Registry.group(entt::get); + for (auto entity : group) + { + auto [transformComponent, spriteRendererComponent] = group.get(entity); + if (spriteRendererComponent.Texture) + Renderer2D::DrawQuad(transformComponent.Transform, spriteRendererComponent.Texture, spriteRendererComponent.TilingFactor); + else + Renderer2D::DrawQuad(transformComponent.Transform, spriteRendererComponent.Color); + } + } + + Renderer2D::EndScene(); +#endif + + ///////////////////////////////////////////////////////////////////// + // RENDER 3D SCENE // + ///////////////////////////////////////////////////////////////////// + + m_SkyboxMaterial->Set("u_TextureLod", m_SkyboxLod); + + auto entities = m_Registry.view(); + for (auto entity : entities) + { + auto meshComponent = m_Registry.try_get(entity); + } + + + auto group = m_Registry.group(entt::get); + SceneRenderer::BeginScene(this, *camera); + for (auto entity : group) + { + auto [transformComponent, meshComponent] = group.get(entity); + if (meshComponent.Mesh) + { + meshComponent.Mesh->OnUpdate(ts); + + // TODO: Should we render (logically) + SceneRenderer::SubmitMesh(meshComponent, transformComponent, nullptr); + } } SceneRenderer::EndScene(); @@ -59,14 +148,16 @@ namespace Prism void Scene::OnEvent(Event& e) { + const auto view = m_Registry.view(); + for (const auto entity : view) + { + auto& comp = view.get(entity); + comp.Camera.OnEvent(e); + break; + } m_Camera.OnEvent(e); } - void Scene::SetCamera(const Camera& camera) - { - m_Camera = camera; - } - void Scene::SetEnvironment(const Environment& environment) { m_Environment = environment; @@ -84,13 +175,17 @@ namespace Prism m_Entities.push_back(entity); } - static const std::string DefaultEntityName = "Entity"; - - Entity* Scene::CreateEntity(const std::string& name) + Entity Scene::CreateEntity(const std::string& name) { - const std::string& entityName = name.empty() ? DefaultEntityName : name; - const auto entity = new Entity(entityName); - AddEntity(entity); + auto entity = Entity{ m_Registry.create(), this }; + entity.AddComponent(glm::mat4(1.0f)); + if (!name.empty()) + entity.AddComponent(name); return entity; } + + void Scene::DestroyEntity(const Entity entity) + { + m_Registry.destroy(entity.m_EntityHandle); + } } diff --git a/Prism/src/Prism/Scene/Scene.h b/Prism/src/Prism/Scene/Scene.h index 7a6b1a4..c1aa3ef 100644 --- a/Prism/src/Prism/Scene/Scene.h +++ b/Prism/src/Prism/Scene/Scene.h @@ -4,11 +4,12 @@ #ifndef SCENE_H #define SCENE_H -#include "Entity.h" + #include "Prism/Core/Events/Event.h" #include "Prism/Renderer/Camera.h" #include "Prism/Renderer/Material.h" +#include namespace Prism { @@ -29,6 +30,8 @@ namespace Prism float Multiplier = 1.0f; }; + class Entity; + class PRISM_API Scene : public RefCounted { public: @@ -40,8 +43,6 @@ namespace Prism void OnUpdate(TimeStep ts); void OnEvent(Event& e); - void SetCamera(const Camera& camera); - Camera& GetCamera() { return m_Camera; } void SetEnvironment(const Environment& environment); void SetSkybox(const Ref& skybox); @@ -50,9 +51,20 @@ namespace Prism float& GetSkyboxLod() { return m_SkyboxLod; } void AddEntity(Entity* entity); - Entity* CreateEntity(const std::string& name = ""); + Entity CreateEntity(const std::string& name = ""); + void DestroyEntity(Entity entity); + + template + auto GetAllEntitiesWith() + { + return m_Registry.view(); + } private: + uint32_t m_SceneID; + entt::entity m_SceneEntity; + entt::registry m_Registry; + std::string m_DebugName; std::vector m_Entities; Camera m_Camera; @@ -67,6 +79,7 @@ namespace Prism float m_SkyboxLod = 1.0f; private: + friend class Entity; friend class SceneRenderer; friend class SceneHierarchyPanel; }; diff --git a/Prism/src/Prism/Script/ScriptEngine.cpp b/Prism/src/Prism/Script/ScriptEngine.cpp new file mode 100644 index 0000000..7cc4f65 --- /dev/null +++ b/Prism/src/Prism/Script/ScriptEngine.cpp @@ -0,0 +1,374 @@ +// +// Created by sfd on 25-12-6. +// + +#include "ScriptEngine.h" + +#include + +#include "ScriptEngineRegistry.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace Prism +{ + static MonoDomain* s_MonoDomain = nullptr; + static std::string s_AssemblyPath; + + static ScriptModuleFieldMap s_PublicFields; + + static MonoMethod* GetMethod(MonoImage* image, const std::string& methodDesc); + + struct EntityScriptClass + { + std::string FullName; + std::string ClassName; + std::string NamespaceName; + + MonoClass* Class; + MonoMethod* OnCreateMethod; + MonoMethod* OnDestroyMethod; + MonoMethod* OnUpdateMethod; + + void InitClassMethods(MonoImage* image) + { + OnCreateMethod = GetMethod(image, FullName + ":OnCreate()"); + OnUpdateMethod = GetMethod(image, FullName + ":OnUpdate(single)"); + } + }; + + struct EntityInstance + { + EntityScriptClass* ScriptClass; + + uint32_t Handle; + Scene* SceneInstance; + + MonoObject* GetInstance() + { + return mono_gchandle_get_target(Handle); + } + }; + + static std::unordered_map s_EntityClassMap; + static std::unordered_map s_EntityInstanceMap; + + + MonoAssembly* LoadAssemblyFromFile(const char* filepath) + { + if (!filepath) { + return nullptr; + } + + std::ifstream file(filepath, std::ios::binary | std::ios::ate); + if (!file.is_open()) { + return nullptr; + } + + std::streamsize size = file.tellg(); + if (size <= 0) { + return nullptr; + } + + file.seekg(0, std::ios::beg); + + std::vector buffer(size); + + if (!file.read(buffer.data(), size)) { + return nullptr; + } + + + MonoImageOpenStatus status; + MonoImage* image = mono_image_open_from_data_full( + buffer.data(), + static_cast(size), + 1, + &status, + 0 + ); + + if (status != MONO_IMAGE_OK || !image) { + return nullptr; + } + + MonoAssembly* assembly = mono_assembly_load_from_full( + image, + filepath, + &status, + 0 + ); + + mono_image_close(image); + + return assembly; + + } + + static void InitMono() + { + mono_set_dirs("library/mono/net8.0", ""); + // mono_set_assemblies_path("mono/lib"); + // mono_jit_set_trace_options("--verbose"); + + auto domain = mono_jit_init("Prism"); + + char* name = (char*)"PrismRuntime"; + s_MonoDomain = mono_domain_create_appdomain(name, nullptr); + } + + static MonoAssembly* LoadAssembly(const std::string& path) + { + MonoAssembly* assembly = LoadAssemblyFromFile(path.c_str()); //mono_domain_assembly_open(s_MonoDomain, path.c_str()); + + if (!assembly) + std::cout << "Could not load assembly: " << path << std::endl; + else + std::cout << "Successfully loaded assembly: " << path << std::endl; + + return assembly; + } + + static MonoImage* GetAssemblyImage(MonoAssembly* assembly) + { + MonoImage* image = mono_assembly_get_image(assembly); + if (!image) + std::cout << "mono_assembly_get_image failed" << std::endl; + + return image; + } + + static MonoClass* GetClass(MonoImage* image, const EntityScriptClass& scriptClass) + { + MonoClass* monoClass = mono_class_from_name(image, scriptClass.NamespaceName.c_str(), scriptClass.ClassName.c_str()); + if (!monoClass) + std::cout << "mono_class_from_name failed" << std::endl; + + return monoClass; + } + + static uint32_t Instantiate(EntityScriptClass& scriptClass) + { + MonoObject* instance = mono_object_new(s_MonoDomain, scriptClass.Class); + if (!instance) + std::cout << "mono_object_new failed" << std::endl; + + mono_runtime_object_init(instance); + uint32_t handle = mono_gchandle_new(instance, false); + return handle; + } + + static MonoMethod* GetMethod(MonoImage* image, const std::string& methodDesc) + { + MonoMethodDesc* desc = mono_method_desc_new(methodDesc.c_str(), NULL); + if (!desc) + std::cout << "mono_method_desc_new failed" << std::endl; + + MonoMethod* method = mono_method_desc_search_in_image(desc, image); + if (!method) + std::cout << "mono_method_desc_search_in_image failed" << std::endl; + + return method; + } + + static MonoObject* CallMethod(MonoObject* object, MonoMethod* method, void** params = nullptr) + { + MonoObject* pException = NULL; + MonoObject* result = mono_runtime_invoke(method, object, params, &pException); + return result; + } + + static void PrintClassMethods(MonoClass* monoClass) + { + MonoMethod* iter; + void* ptr = 0; + while ((iter = mono_class_get_methods(monoClass, &ptr)) != NULL) + { + printf("--------------------------------\n"); + const char* name = mono_method_get_name(iter); + MonoMethodDesc* methodDesc = mono_method_desc_from_method(iter); + + const char* paramNames = ""; + mono_method_get_param_names(iter, ¶mNames); + + printf("Name: %s\n", name); + printf("Full name: %s\n", mono_method_full_name(iter, true)); + } + } + + static void PrintClassProperties(MonoClass* monoClass) + { + MonoProperty* iter; + void* ptr = 0; + while ((iter = mono_class_get_properties(monoClass, &ptr)) != NULL) + { + printf("--------------------------------\n"); + const char* name = mono_property_get_name(iter); + + printf("Name: %s\n", name); + } + } + + static MonoAssembly* s_AppAssembly = nullptr; + static MonoAssembly* s_CoreAssembly = nullptr; + MonoImage* s_AppAssemblyImage = nullptr; + MonoImage* s_CoreAssemblyImage = nullptr; + + static void LoadPrismRuntimeAssembly(const std::string& path) + { + if (s_AppAssembly) + { + mono_domain_unload(s_MonoDomain); + mono_assembly_close(s_AppAssembly); + + char* name = (char*)"PrismRuntime"; + s_MonoDomain = mono_domain_create_appdomain(name, nullptr); + + } + + s_CoreAssembly = LoadAssembly("assets/scripts/Prism-ScriptCore.dll"); + s_CoreAssemblyImage = GetAssemblyImage(s_CoreAssembly); + + s_AppAssembly = LoadAssembly(path); + s_AppAssemblyImage = GetAssemblyImage(s_AppAssembly); + ScriptEngineRegistry::RegisterAll(); + } + + void ScriptEngine::Init(const std::string& assemblyPath) + { + s_AssemblyPath = assemblyPath; + + InitMono(); + + LoadPrismRuntimeAssembly(s_AssemblyPath); + } + + void ScriptEngine::Shutdown() + { + // shutdown mono + } + + void ScriptEngine::OnCreateEntity(Entity entity) + { + EntityInstance& entityInstance = s_EntityInstanceMap[(uint32_t)entity.m_EntityHandle]; + if (entityInstance.ScriptClass->OnCreateMethod) + CallMethod(entityInstance.GetInstance(), entityInstance.ScriptClass->OnCreateMethod); + } + + void ScriptEngine::OnUpdateEntity(uint32_t entityID, TimeStep ts) + { + PM_CORE_ASSERT(s_EntityInstanceMap.find(entityID) != s_EntityInstanceMap.end(), "Could not find entity in instance map!"); + + auto& entity = s_EntityInstanceMap[entityID]; + + if (entity.ScriptClass->OnUpdateMethod) + { + void* args[] = { &ts }; + CallMethod(entity.GetInstance(), entity.ScriptClass->OnUpdateMethod, args); + } + } + + static FieldType GetPrismFieldType(MonoType* monoType) + { + int type = mono_type_get_type(monoType); + switch (type) + { + case MONO_TYPE_R4: return FieldType::Float; + case MONO_TYPE_I4: return FieldType::Int; + case MONO_TYPE_U4: return FieldType::UnsignedInt; + case MONO_TYPE_STRING: return FieldType::String; + case MONO_TYPE_VALUETYPE: + { + char* name = mono_type_get_name(monoType); + if (strcmp(name, "Prism.Vector2") == 0) return FieldType::Vec2; + if (strcmp(name, "Prism.Vector3") == 0) return FieldType::Vec3; + if (strcmp(name, "Prism.Vector4") == 0) return FieldType::Vec4; + } + } + return FieldType::None; + } + + void ScriptEngine::OnInitEntity(ScriptComponent& script, uint32_t entityID, uint32_t sceneID) + { + EntityScriptClass& scriptClass = s_EntityClassMap[script.ModuleName]; + scriptClass.FullName = script.ModuleName; + if (script.ModuleName.find('.') != std::string::npos) + { + scriptClass.NamespaceName = script.ModuleName.substr(0, script.ModuleName.find_last_of('.')); + scriptClass.ClassName = script.ModuleName.substr(script.ModuleName.find_last_of('.') + 1); + } + else + { + scriptClass.ClassName = script.ModuleName; + } + + scriptClass.Class = GetClass(s_AppAssemblyImage, scriptClass); + scriptClass.InitClassMethods(s_AppAssemblyImage); + + EntityInstance& entityInstance = s_EntityInstanceMap[entityID]; + entityInstance.ScriptClass = &scriptClass; + entityInstance.Handle = Instantiate(scriptClass); + + MonoProperty* entityIDPropery = mono_class_get_property_from_name(scriptClass.Class, "EntityID"); + mono_property_get_get_method(entityIDPropery); + MonoMethod* entityIDSetMethod = mono_property_get_set_method(entityIDPropery); + void* param[] = { &entityID }; + CallMethod(entityInstance.GetInstance(), entityIDSetMethod, param); + + MonoProperty* sceneIDPropery = mono_class_get_property_from_name(scriptClass.Class, "SceneID"); + mono_property_get_get_method(sceneIDPropery); + MonoMethod* sceneIDSetMethod = mono_property_get_set_method(sceneIDPropery); + param[0] = { &sceneID }; + CallMethod(entityInstance.GetInstance(), sceneIDSetMethod, param); + + if (scriptClass.OnCreateMethod) + CallMethod(entityInstance.GetInstance(), scriptClass.OnCreateMethod); + + // Retrieve public fields + { + MonoClassField* iter; + void* ptr = 0; + while ((iter = mono_class_get_fields(scriptClass.Class, &ptr)) != NULL) + { + const char* name = mono_field_get_name(iter); + const uint32_t flags = mono_field_get_flags(iter); + if ((flags & MONO_FIELD_ATTR_PUBLIC )== 0) + continue; + + MonoType* fieldType = mono_field_get_type(iter); + FieldType hazelFieldType = GetPrismFieldType(fieldType); + + // TODO: Attributes + // MonoCustomAttrInfo* attr = mono_custom_attrs_from_field(scriptClass.Class, iter); + + auto& publicField = s_PublicFields[script.ModuleName].emplace_back(name, hazelFieldType); + publicField.m_EntityInstance = &entityInstance; + publicField.m_MonoClassField = iter; + // mono_field_set_value(entityInstance.Instance, iter, ) + } + } + } + + const ScriptModuleFieldMap& ScriptEngine::GetFieldMap() + { + return s_PublicFields; + } + + void PublicField::SetValue_Internal(void* value) const + { + mono_field_set_value(m_EntityInstance->GetInstance(), m_MonoClassField, value); + } + + void PublicField::GetValue_Internal(void* outValue) const + { + mono_field_get_value(m_EntityInstance->GetInstance(), m_MonoClassField, outValue); + } +} diff --git a/Prism/src/Prism/Script/ScriptEngine.h b/Prism/src/Prism/Script/ScriptEngine.h new file mode 100644 index 0000000..3da1864 --- /dev/null +++ b/Prism/src/Prism/Script/ScriptEngine.h @@ -0,0 +1,76 @@ +// +// Created by sfd on 25-12-6. +// + +#ifndef SCRIPTENGINE_H +#define SCRIPTENGINE_H +#include "Prism/Scene/Components.h" +#include "Prism/Scene/Entity.h" + +extern "C" { + typedef struct _MonoObject MonoObject; + typedef struct _MonoClassField MonoClassField; +} + +namespace Prism +{ + enum class FieldType + { + None = 0, Float, Int, UnsignedInt, String, Vec2, Vec3, Vec4 + }; + + struct EntityInstance; + + struct PublicField + { + std::string Name; + FieldType Type; + + PublicField(const std::string& name, FieldType type) + : Name(name), Type(type) + { + } + + template + T GetValue() const + { + T value; + GetValue_Internal(&value); + return value; + } + + template + void SetValue(T value) const + { + SetValue_Internal(&value); + } + + private: + EntityInstance* m_EntityInstance; + MonoClassField* m_MonoClassField; + + void SetValue_Internal(void* value) const; + void GetValue_Internal(void* outValue) const; + + friend class ScriptEngine; + }; + + using ScriptModuleFieldMap = std::unordered_map>; + + class ScriptEngine + { + public: + static void Init(const std::string& assemblyPath); + static void Shutdown(); + + static void OnCreateEntity(Entity entity); + static void OnUpdateEntity(uint32_t entityID, TimeStep ts); + + static void OnInitEntity(ScriptComponent& script, uint32_t entityID, uint32_t sceneID); + + static const ScriptModuleFieldMap& GetFieldMap(); + }; +} + + +#endif //SCRIPTENGINE_H diff --git a/Prism/src/Prism/Script/ScriptEngineRegistry.cpp b/Prism/src/Prism/Script/ScriptEngineRegistry.cpp new file mode 100644 index 0000000..61f573b --- /dev/null +++ b/Prism/src/Prism/Script/ScriptEngineRegistry.cpp @@ -0,0 +1,87 @@ +// +// Created by sfd on 25-12-6. +// + +#include "ScriptEngineRegistry.h" + +#include "ScriptWarppers.h" +#include "Prism/Scene/Entity.h" + +#include "mono/metadata/reflection.h" +#include + +namespace Prism +{ + + std::unordered_map> s_HasComponentFuncs; + std::unordered_map> s_CreateComponentFuncs; + + extern MonoImage* s_CoreAssemblyImage; + +#define Component_RegisterType(Type) \ + {\ + MonoType* type = mono_reflection_type_from_name((char*)("Prism." #Type), s_CoreAssemblyImage);\ + if (type) {\ + uint32_t id = mono_type_get_type(type);\ + s_HasComponentFuncs[type] = [](Entity& entity) { return entity.HasComponent(); };\ + s_CreateComponentFuncs[type] = [](Entity& entity) { entity.AddComponent(); };\ + } else {\ + PM_CORE_ERROR("No C# component class found for " #Type "!");\ + }\ + } + + static void InitComponentTypes() + { + Component_RegisterType(TagComponent); + Component_RegisterType(TransformComponent); + Component_RegisterType(MeshComponent); + Component_RegisterType(ScriptComponent); + Component_RegisterType(CameraComponent); + Component_RegisterType(SpriteRendererComponent); + } + + void ScriptEngineRegistry::RegisterAll() + { + InitComponentTypes(); + + mono_add_internal_call("Prism.Noise::PerlinNoise_Native", Prism::Script::Prism_Noise_PerlinNoise); + + mono_add_internal_call("Prism.Entity::GetTransform_Native", Prism::Script::Prism_Entity_GetTransform); + mono_add_internal_call("Prism.Entity::SetTransform_Native", Prism::Script::Prism_Entity_SetTransform); + mono_add_internal_call("Prism.Entity::CreateComponent_Native", Prism::Script::Prism_Entity_CreateComponent); + mono_add_internal_call("Prism.Entity::HasComponent_Native", Prism::Script::Prism_Entity_HasComponent); + + mono_add_internal_call("Prism.MeshComponent::GetMesh_Native", Prism::Script::Prism_MeshComponent_GetMesh); + mono_add_internal_call("Prism.MeshComponent::SetMesh_Native", Prism::Script::Prism_MeshComponent_SetMesh); + + mono_add_internal_call("Prism.Input::IsKeyPressed_Native", Prism::Script::Prism_Input_IsKeyPressed); + + mono_add_internal_call("Prism.Texture2D::Constructor_Native", Prism::Script::Prism_Texture2D_Constructor); + mono_add_internal_call("Prism.Texture2D::Destructor_Native", Prism::Script::Prism_Texture2D_Destructor); + mono_add_internal_call("Prism.Texture2D::SetData_Native", Prism::Script::Prism_Texture2D_SetData); + + mono_add_internal_call("Prism.Material::Destructor_Native", Prism::Script::Prism_Material_Destructor); + mono_add_internal_call("Prism.Material::SetFloat_Native", Prism::Script::Prism_Material_SetFloat); + mono_add_internal_call("Prism.Material::SetTexture_Native", Prism::Script::Prism_Material_SetTexture); + + mono_add_internal_call("Prism.MaterialInstance::Destructor_Native", Prism::Script::Prism_MaterialInstance_Destructor); + mono_add_internal_call("Prism.MaterialInstance::SetFloat_Native", Prism::Script::Prism_MaterialInstance_SetFloat); + mono_add_internal_call("Prism.MaterialInstance::SetVector3_Native", Prism::Script::Prism_MaterialInstance_SetVector3); + mono_add_internal_call("Prism.MaterialInstance::SetTexture_Native", Prism::Script::Prism_MaterialInstance_SetTexture); + + mono_add_internal_call("Prism.Mesh::Constructor_Native", Prism::Script::Prism_Mesh_Constructor); + mono_add_internal_call("Prism.Mesh::Destructor_Native", Prism::Script::Prism_Mesh_Destructor); + mono_add_internal_call("Prism.Mesh::GetMaterial_Native", Prism::Script::Prism_Mesh_GetMaterial); + mono_add_internal_call("Prism.Mesh::GetMaterialByIndex_Native", Prism::Script::Prism_Mesh_GetMaterialByIndex); + mono_add_internal_call("Prism.Mesh::GetMaterialCount_Native", Prism::Script::Prism_Mesh_GetMaterialCount); + + mono_add_internal_call("Prism.MeshFactory::CreatePlane_Native", Prism::Script::Prism_MeshFactory_CreatePlane); + + // static bool IsKeyPressed(KeyCode key) { return s_Instance->IsKeyPressedImpl(key); } + // + // static bool IsMouseButtonPressed(MouseCode button) { return s_Instance->IsMouseButtonPressedImpl(button); } + // static std::pair GetMousePosition() { return s_Instance->GetMousePositionImpl(); } + // static float GetMouseX() { return s_Instance->GetMouseXImpl(); } + // static float GetMouseY() { return s_Instance->GetMouseYImpl(); } + } +} diff --git a/Prism/src/Prism/Script/ScriptEngineRegistry.h b/Prism/src/Prism/Script/ScriptEngineRegistry.h new file mode 100644 index 0000000..2ffe3c0 --- /dev/null +++ b/Prism/src/Prism/Script/ScriptEngineRegistry.h @@ -0,0 +1,18 @@ +// +// Created by sfd on 25-12-6. +// + +#ifndef SCRIPTENGINEREGISTRY_H +#define SCRIPTENGINEREGISTRY_H + + +namespace Prism +{ + class ScriptEngineRegistry + { + public: + static void RegisterAll(); + }; +} + +#endif //SCRIPTENGINEREGISTRY_H diff --git a/Prism/src/Prism/Script/ScriptWarppers.cpp b/Prism/src/Prism/Script/ScriptWarppers.cpp new file mode 100644 index 0000000..1c1aa8e --- /dev/null +++ b/Prism/src/Prism/Script/ScriptWarppers.cpp @@ -0,0 +1,238 @@ +// +// Created by sfd on 25-12-6. +// + +#include "ScriptWarppers.h" + +#include "mono/metadata/metadata.h" +#include "mono/metadata/object.h" +#include "mono/metadata/reflection.h" +#include "Prism/Core/Input.h" +#include "Prism/Core/Math/Noise.h" +#include "Prism/Scene/Entity.h" +#include "Prism/Scene/Scene.h" + + +namespace Prism { + extern std::unordered_map s_ActiveScenes; + extern std::unordered_map> s_HasComponentFuncs; + extern std::unordered_map> s_CreateComponentFuncs; +} + +namespace Prism { namespace Script { + + enum class ComponentID + { + None = 0, + Transform = 1, + Mesh = 2, + Script = 3, + SpriteRenderer = 4 + }; + + + + //////////////////////////////////////////////////////////////// + // Math //////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////// + + float Prism_Noise_PerlinNoise(float x, float y) + { + return Noise::PerlinNoise(x, y); + } + + //////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////// + // Input /////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////// + + bool Prism_Input_IsKeyPressed(KeyCode key) + { + return Input::IsKeyPressed(key); + } + + //////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////// + // Entity ////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////// + + void Prism_Entity_GetTransform(uint32_t sceneID, uint32_t entityID, glm::mat4* outTransform) + { + PM_CORE_ASSERT(s_ActiveScenes.find(sceneID) != s_ActiveScenes.end(), "Invalid Scene ID!"); + + Scene* scene = s_ActiveScenes[sceneID]; + Entity entity((entt::entity)entityID, scene); + auto& transformComponent = entity.GetComponent(); + memcpy(outTransform, glm::value_ptr(transformComponent.Transform), sizeof(glm::mat4)); + } + + void Prism_Entity_SetTransform(uint32_t sceneID, uint32_t entityID, glm::mat4* inTransform) + { + PM_CORE_ASSERT(s_ActiveScenes.find(sceneID) != s_ActiveScenes.end(), "Invalid Scene ID!"); + + Scene* scene = s_ActiveScenes[sceneID]; + Entity entity((entt::entity)entityID, scene); + auto& transformComponent = entity.GetComponent(); + memcpy(glm::value_ptr(transformComponent.Transform), inTransform, sizeof(glm::mat4)); + } + + void Prism_Entity_CreateComponent(uint32_t sceneID, uint32_t entityID, void* type) + { + PM_CORE_ASSERT(s_ActiveScenes.find(sceneID) != s_ActiveScenes.end(), "Invalid Scene ID!"); + MonoType* monoType = mono_reflection_type_get_type((MonoReflectionType*)type); + + Scene* scene = s_ActiveScenes[sceneID]; + Entity entity((entt::entity)entityID, scene); + s_CreateComponentFuncs[monoType](entity); + } + + bool Prism_Entity_HasComponent(uint32_t sceneID, uint32_t entityID, void* type) + { + PM_CORE_ASSERT(s_ActiveScenes.find(sceneID) != s_ActiveScenes.end(), "Invalid Scene ID!"); + MonoType* monoType = mono_reflection_type_get_type((MonoReflectionType*)type); + + Scene* scene = s_ActiveScenes[sceneID]; + Entity entity((entt::entity)entityID, scene); + bool result = s_HasComponentFuncs[monoType](entity); + return result; + } + + void* Prism_MeshComponent_GetMesh(uint32_t sceneID, uint32_t entityID) + { + PM_CORE_ASSERT(s_ActiveScenes.find(sceneID) != s_ActiveScenes.end(), "Invalid Scene ID!"); + + Scene* scene = s_ActiveScenes[sceneID]; + Entity entity((entt::entity)entityID, scene); + auto& meshComponent = entity.GetComponent(); + return new Ref(meshComponent.Mesh); + } + + void Prism_MeshComponent_SetMesh(uint32_t sceneID, uint32_t entityID, Ref* inMesh) + { + PM_CORE_ASSERT(s_ActiveScenes.find(sceneID) != s_ActiveScenes.end(), "Invalid Scene ID!"); + + Scene* scene = s_ActiveScenes[sceneID]; + Entity entity((entt::entity)entityID, scene); + auto& meshComponent = entity.GetComponent(); + meshComponent.Mesh = inMesh ? *inMesh : nullptr; + } + + Ref* Prism_Mesh_Constructor(MonoString* filepath) + { + return new Ref(new Mesh(mono_string_to_utf8(filepath))); + } + + void Prism_Mesh_Destructor(Ref* _this) + { + Ref* instance = (Ref*)_this; + delete _this; + } + + Ref* Prism_Mesh_GetMaterial(Ref* inMesh) + { + Ref& mesh = *(Ref*)inMesh; + return new Ref(mesh->GetMaterial()); + } + + Ref* Prism_Mesh_GetMaterialByIndex(Ref* inMesh, int index) + { + Ref& mesh = *(Ref*)inMesh; + const auto& materials = mesh->GetMaterials(); + + PM_CORE_ASSERT(index < materials.size()); + return new Ref(materials[index]); + } + + int Prism_Mesh_GetMaterialCount(Ref* inMesh) + { + Ref& mesh = *(Ref*)inMesh; + const auto& materials = mesh->GetMaterials(); + return (int)materials.size(); + } + + void* Prism_Texture2D_Constructor(uint32_t width, uint32_t height) + { + auto result = Texture2D::Create(TextureFormat::RGBA, width, height); + return new Ref(result); + } + + void Prism_Texture2D_Destructor(Ref* _this) + { + delete _this; + } + + void Prism_Texture2D_SetData(Ref* _this, MonoArray* inData, int32_t count) + { + Ref& instance = *_this; + + uint32_t dataSize = count * sizeof(glm::vec4) / 4; + + instance->Lock(); + Buffer buffer = instance->GetWriteableBuffer(); + PM_CORE_ASSERT(dataSize <= buffer.Size); + // Convert RGBA32F color to RGBA8 + uint8_t* pixels = (uint8_t*)buffer.Data; + uint32_t index = 0; + for (uint32_t i = 0; i < instance->GetWidth() * instance->GetHeight(); i++) + { + glm::vec4& value = mono_array_get(inData, glm::vec4, i); + *pixels++ = (uint32_t)(value.x * 255.0f); + *pixels++ = (uint32_t)(value.y * 255.0f); + *pixels++ = (uint32_t)(value.z * 255.0f); + *pixels++ = (uint32_t)(value.w * 255.0f); + } + + instance->Unlock(); + } + + void Prism_Material_Destructor(Ref* _this) + { + delete _this; + } + + void Prism_Material_SetFloat(Ref* _this, MonoString* uniform, float value) + { + Ref& instance = *(Ref*)_this; + instance->Set(mono_string_to_utf8(uniform), value); + } + + void Prism_Material_SetTexture(Ref* _this, MonoString* uniform, Ref* texture) + { + Ref& instance = *(Ref*)_this; + instance->Set(mono_string_to_utf8(uniform), *texture); + } + + void Prism_MaterialInstance_Destructor(Ref* _this) + { + delete _this; + } + + void Prism_MaterialInstance_SetFloat(Ref* _this, MonoString* uniform, float value) + { + Ref& instance = *(Ref*)_this; + instance->Set(mono_string_to_utf8(uniform), value); + } + + void Prism_MaterialInstance_SetVector3(Ref* _this, MonoString* uniform, glm::vec3* value) + { + Ref& instance = *(Ref*)_this; + instance->Set(mono_string_to_utf8(uniform), *value); + } + + void Prism_MaterialInstance_SetTexture(Ref* _this, MonoString* uniform, Ref* texture) + { + Ref& instance = *(Ref*)_this; + instance->Set(mono_string_to_utf8(uniform), *texture); + } + + void* Prism_MeshFactory_CreatePlane(float width, float height) + { + // TODO: Implement properly with MeshFactory class! + return new Ref(new Mesh("assets/models/Plane1m.obj")); + } + + //////////////////////////////////////////////////////////////// + +} } diff --git a/Prism/src/Prism/Script/ScriptWarppers.h b/Prism/src/Prism/Script/ScriptWarppers.h new file mode 100644 index 0000000..02824d0 --- /dev/null +++ b/Prism/src/Prism/Script/ScriptWarppers.h @@ -0,0 +1,62 @@ +// +// Created by sfd on 25-12-6. +// + +#ifndef SCRIPTWARPPERS_H +#define SCRIPTWARPPERS_H +#include "Prism/Core/KeyCodes.h" +#include "Prism/Core/Ref.h" +#include "Prism/Renderer/Material.h" +#include "Prism/Renderer/Mesh.h" +#include "Prism/Renderer/Texture.h" + +extern "C" { + typedef struct _MonoString MonoString; + typedef struct _MonoArray MonoArray; +} + +namespace Prism { namespace Script { + + // Math + float Prism_Noise_PerlinNoise(float x, float y); + + // Input + bool Prism_Input_IsKeyPressed(KeyCode key); + + // Entity + void Prism_Entity_GetTransform(uint32_t sceneID, uint32_t entityID, glm::mat4* outTransform); + void Prism_Entity_SetTransform(uint32_t sceneID, uint32_t entityID, glm::mat4* inTransform); + void Prism_Entity_CreateComponent(uint32_t sceneID, uint32_t entityID, void* type); + bool Prism_Entity_HasComponent(uint32_t sceneID, uint32_t entityID, void* type); + + void* Prism_MeshComponent_GetMesh(uint32_t sceneID, uint32_t entityID); + void Prism_MeshComponent_SetMesh(uint32_t sceneID, uint32_t entityID, Ref* inMesh); + + // Renderer + // Texture2D + void* Prism_Texture2D_Constructor(uint32_t width, uint32_t height); + void Prism_Texture2D_Destructor(Ref* _this); + void Prism_Texture2D_SetData(Ref* _this, MonoArray* inData, int32_t count); + + // Material + void Prism_Material_Destructor(Ref* _this); + void Prism_Material_SetFloat(Ref* _this, MonoString* uniform, float value); + void Prism_Material_SetTexture(Ref* _this, MonoString* uniform, Ref* texture); + + void Prism_MaterialInstance_Destructor(Ref* _this); + void Prism_MaterialInstance_SetFloat(Ref* _this, MonoString* uniform, float value); + void Prism_MaterialInstance_SetVector3(Ref* _this, MonoString* uniform, glm::vec3* value); + void Prism_MaterialInstance_SetTexture(Ref* _this, MonoString* uniform, Ref* texture); + + // Mesh + Ref* Prism_Mesh_Constructor(MonoString* filepath); + void Prism_Mesh_Destructor(Ref* _this); + Ref* Prism_Mesh_GetMaterial(Ref* inMesh); + Ref* Prism_Mesh_GetMaterialByIndex(Ref* inMesh, int index); + int Prism_Mesh_GetMaterialCount(Ref* inMesh); + + void* Prism_MeshFactory_CreatePlane(float width, float height); +} } + + +#endif //SCRIPTWARPPERS_H diff --git a/Prism/vendor/EnTT b/Prism/vendor/EnTT new file mode 160000 index 0000000..b4e58bd --- /dev/null +++ b/Prism/vendor/EnTT @@ -0,0 +1 @@ +Subproject commit b4e58bdd364ad72246c123a0c28538eab3252672 diff --git a/Prism/vendor/FastNoise/CMakeLists.txt b/Prism/vendor/FastNoise/CMakeLists.txt new file mode 100644 index 0000000..c4f6f83 --- /dev/null +++ b/Prism/vendor/FastNoise/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(FastNoise STATIC FastNoise.cpp) + +target_include_directories(FastNoise PUBLIC ./) diff --git a/Prism/vendor/FastNoise/FastNoise.cpp b/Prism/vendor/FastNoise/FastNoise.cpp new file mode 100644 index 0000000..f3edf9a --- /dev/null +++ b/Prism/vendor/FastNoise/FastNoise.cpp @@ -0,0 +1,2250 @@ +// FastNoise.cpp +// +// MIT License +// +// Copyright(c) 2017 Jordan Peck +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// The developer's email is jorzixdan.me2@gzixmail.com (for great email, take +// off every 'zix'.) +// + +#include "FastNoise.h" + +#include +#include + +#include +#include + +const FN_DECIMAL GRAD_X[] = +{ + 1, -1, 1, -1, + 1, -1, 1, -1, + 0, 0, 0, 0 +}; +const FN_DECIMAL GRAD_Y[] = +{ + 1, 1, -1, -1, + 0, 0, 0, 0, + 1, -1, 1, -1 +}; +const FN_DECIMAL GRAD_Z[] = +{ + 0, 0, 0, 0, + 1, 1, -1, -1, + 1, 1, -1, -1 +}; + +const FN_DECIMAL GRAD_4D[] = +{ + 0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1, + 0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1, + 1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1, + -1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1, + 1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1, + -1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1, + 1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0, + -1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0 +}; + +const FN_DECIMAL VAL_LUT[] = +{ + FN_DECIMAL(0.3490196078), FN_DECIMAL(0.4352941176), FN_DECIMAL(-0.4509803922), FN_DECIMAL(0.6392156863), FN_DECIMAL(0.5843137255), FN_DECIMAL(-0.1215686275), FN_DECIMAL(0.7176470588), FN_DECIMAL(-0.1058823529), FN_DECIMAL(0.3960784314), FN_DECIMAL(0.0431372549), FN_DECIMAL(-0.03529411765), FN_DECIMAL(0.3176470588), FN_DECIMAL(0.7254901961), FN_DECIMAL(0.137254902), FN_DECIMAL(0.8588235294), FN_DECIMAL(-0.8196078431), + FN_DECIMAL(-0.7960784314), FN_DECIMAL(-0.3333333333), FN_DECIMAL(-0.6705882353), FN_DECIMAL(-0.3882352941), FN_DECIMAL(0.262745098), FN_DECIMAL(0.3254901961), FN_DECIMAL(-0.6470588235), FN_DECIMAL(-0.9215686275), FN_DECIMAL(-0.5294117647), FN_DECIMAL(0.5294117647), FN_DECIMAL(-0.4666666667), FN_DECIMAL(0.8117647059), FN_DECIMAL(0.3803921569), FN_DECIMAL(0.662745098), FN_DECIMAL(0.03529411765), FN_DECIMAL(-0.6156862745), + FN_DECIMAL(-0.01960784314), FN_DECIMAL(-0.3568627451), FN_DECIMAL(-0.09019607843), FN_DECIMAL(0.7490196078), FN_DECIMAL(0.8352941176), FN_DECIMAL(-0.4039215686), FN_DECIMAL(-0.7490196078), FN_DECIMAL(0.9529411765), FN_DECIMAL(-0.0431372549), FN_DECIMAL(-0.9294117647), FN_DECIMAL(-0.6549019608), FN_DECIMAL(0.9215686275), FN_DECIMAL(-0.06666666667), FN_DECIMAL(-0.4431372549), FN_DECIMAL(0.4117647059), FN_DECIMAL(-0.4196078431), + FN_DECIMAL(-0.7176470588), FN_DECIMAL(-0.8117647059), FN_DECIMAL(-0.2549019608), FN_DECIMAL(0.4901960784), FN_DECIMAL(0.9137254902), FN_DECIMAL(0.7882352941), FN_DECIMAL(-1.0), FN_DECIMAL(-0.4745098039), FN_DECIMAL(0.7960784314), FN_DECIMAL(0.8509803922), FN_DECIMAL(-0.6784313725), FN_DECIMAL(0.4588235294), FN_DECIMAL(1.0), FN_DECIMAL(-0.1843137255), FN_DECIMAL(0.4509803922), FN_DECIMAL(0.1450980392), + FN_DECIMAL(-0.231372549), FN_DECIMAL(-0.968627451), FN_DECIMAL(-0.8588235294), FN_DECIMAL(0.4274509804), FN_DECIMAL(0.003921568627), FN_DECIMAL(-0.003921568627), FN_DECIMAL(0.2156862745), FN_DECIMAL(0.5058823529), FN_DECIMAL(0.7647058824), FN_DECIMAL(0.2078431373), FN_DECIMAL(-0.5921568627), FN_DECIMAL(0.5764705882), FN_DECIMAL(-0.1921568627), FN_DECIMAL(-0.937254902), FN_DECIMAL(0.08235294118), FN_DECIMAL(-0.08235294118), + FN_DECIMAL(0.9058823529), FN_DECIMAL(0.8274509804), FN_DECIMAL(0.02745098039), FN_DECIMAL(-0.168627451), FN_DECIMAL(-0.7803921569), FN_DECIMAL(0.1137254902), FN_DECIMAL(-0.9450980392), FN_DECIMAL(0.2), FN_DECIMAL(0.01960784314), FN_DECIMAL(0.5607843137), FN_DECIMAL(0.2705882353), FN_DECIMAL(0.4431372549), FN_DECIMAL(-0.9607843137), FN_DECIMAL(0.6156862745), FN_DECIMAL(0.9294117647), FN_DECIMAL(-0.07450980392), + FN_DECIMAL(0.3098039216), FN_DECIMAL(0.9921568627), FN_DECIMAL(-0.9137254902), FN_DECIMAL(-0.2941176471), FN_DECIMAL(-0.3411764706), FN_DECIMAL(-0.6235294118), FN_DECIMAL(-0.7647058824), FN_DECIMAL(-0.8901960784), FN_DECIMAL(0.05882352941), FN_DECIMAL(0.2392156863), FN_DECIMAL(0.7333333333), FN_DECIMAL(0.6549019608), FN_DECIMAL(0.2470588235), FN_DECIMAL(0.231372549), FN_DECIMAL(-0.3960784314), FN_DECIMAL(-0.05098039216), + FN_DECIMAL(-0.2235294118), FN_DECIMAL(-0.3725490196), FN_DECIMAL(0.6235294118), FN_DECIMAL(0.7019607843), FN_DECIMAL(-0.8274509804), FN_DECIMAL(0.4196078431), FN_DECIMAL(0.07450980392), FN_DECIMAL(0.8666666667), FN_DECIMAL(-0.537254902), FN_DECIMAL(-0.5058823529), FN_DECIMAL(-0.8039215686), FN_DECIMAL(0.09019607843), FN_DECIMAL(-0.4823529412), FN_DECIMAL(0.6705882353), FN_DECIMAL(-0.7882352941), FN_DECIMAL(0.09803921569), + FN_DECIMAL(-0.6078431373), FN_DECIMAL(0.8039215686), FN_DECIMAL(-0.6), FN_DECIMAL(-0.3254901961), FN_DECIMAL(-0.4117647059), FN_DECIMAL(-0.01176470588), FN_DECIMAL(0.4823529412), FN_DECIMAL(0.168627451), FN_DECIMAL(0.8745098039), FN_DECIMAL(-0.3647058824), FN_DECIMAL(-0.1607843137), FN_DECIMAL(0.568627451), FN_DECIMAL(-0.9921568627), FN_DECIMAL(0.9450980392), FN_DECIMAL(0.5137254902), FN_DECIMAL(0.01176470588), + FN_DECIMAL(-0.1450980392), FN_DECIMAL(-0.5529411765), FN_DECIMAL(-0.5764705882), FN_DECIMAL(-0.1137254902), FN_DECIMAL(0.5215686275), FN_DECIMAL(0.1607843137), FN_DECIMAL(0.3725490196), FN_DECIMAL(-0.2), FN_DECIMAL(-0.7254901961), FN_DECIMAL(0.631372549), FN_DECIMAL(0.7098039216), FN_DECIMAL(-0.568627451), FN_DECIMAL(0.1294117647), FN_DECIMAL(-0.3098039216), FN_DECIMAL(0.7411764706), FN_DECIMAL(-0.8509803922), + FN_DECIMAL(0.2549019608), FN_DECIMAL(-0.6392156863), FN_DECIMAL(-0.5607843137), FN_DECIMAL(-0.3176470588), FN_DECIMAL(0.937254902), FN_DECIMAL(0.9843137255), FN_DECIMAL(0.5921568627), FN_DECIMAL(0.6941176471), FN_DECIMAL(0.2862745098), FN_DECIMAL(-0.5215686275), FN_DECIMAL(0.1764705882), FN_DECIMAL(0.537254902), FN_DECIMAL(-0.4901960784), FN_DECIMAL(-0.4588235294), FN_DECIMAL(-0.2078431373), FN_DECIMAL(-0.2156862745), + FN_DECIMAL(0.7725490196), FN_DECIMAL(0.3647058824), FN_DECIMAL(-0.2392156863), FN_DECIMAL(0.2784313725), FN_DECIMAL(-0.8823529412), FN_DECIMAL(0.8980392157), FN_DECIMAL(0.1215686275), FN_DECIMAL(0.1058823529), FN_DECIMAL(-0.8745098039), FN_DECIMAL(-0.9843137255), FN_DECIMAL(-0.7019607843), FN_DECIMAL(0.9607843137), FN_DECIMAL(0.2941176471), FN_DECIMAL(0.3411764706), FN_DECIMAL(0.1529411765), FN_DECIMAL(0.06666666667), + FN_DECIMAL(-0.9764705882), FN_DECIMAL(0.3019607843), FN_DECIMAL(0.6470588235), FN_DECIMAL(-0.5843137255), FN_DECIMAL(0.05098039216), FN_DECIMAL(-0.5137254902), FN_DECIMAL(-0.137254902), FN_DECIMAL(0.3882352941), FN_DECIMAL(-0.262745098), FN_DECIMAL(-0.3019607843), FN_DECIMAL(-0.1764705882), FN_DECIMAL(-0.7568627451), FN_DECIMAL(0.1843137255), FN_DECIMAL(-0.5450980392), FN_DECIMAL(-0.4980392157), FN_DECIMAL(-0.2784313725), + FN_DECIMAL(-0.9529411765), FN_DECIMAL(-0.09803921569), FN_DECIMAL(0.8901960784), FN_DECIMAL(-0.2862745098), FN_DECIMAL(-0.3803921569), FN_DECIMAL(0.5529411765), FN_DECIMAL(0.7803921569), FN_DECIMAL(-0.8352941176), FN_DECIMAL(0.6862745098), FN_DECIMAL(0.7568627451), FN_DECIMAL(0.4980392157), FN_DECIMAL(-0.6862745098), FN_DECIMAL(-0.8980392157), FN_DECIMAL(-0.7725490196), FN_DECIMAL(-0.7098039216), FN_DECIMAL(-0.2470588235), + FN_DECIMAL(-0.9058823529), FN_DECIMAL(0.9764705882), FN_DECIMAL(0.1921568627), FN_DECIMAL(0.8431372549), FN_DECIMAL(-0.05882352941), FN_DECIMAL(0.3568627451), FN_DECIMAL(0.6078431373), FN_DECIMAL(0.5450980392), FN_DECIMAL(0.4039215686), FN_DECIMAL(-0.7333333333), FN_DECIMAL(-0.4274509804), FN_DECIMAL(0.6), FN_DECIMAL(0.6784313725), FN_DECIMAL(-0.631372549), FN_DECIMAL(-0.02745098039), FN_DECIMAL(-0.1294117647), + FN_DECIMAL(0.3333333333), FN_DECIMAL(-0.8431372549), FN_DECIMAL(0.2235294118), FN_DECIMAL(-0.3490196078), FN_DECIMAL(-0.6941176471), FN_DECIMAL(0.8823529412), FN_DECIMAL(0.4745098039), FN_DECIMAL(0.4666666667), FN_DECIMAL(-0.7411764706), FN_DECIMAL(-0.2705882353), FN_DECIMAL(0.968627451), FN_DECIMAL(0.8196078431), FN_DECIMAL(-0.662745098), FN_DECIMAL(-0.4352941176), FN_DECIMAL(-0.8666666667), FN_DECIMAL(-0.1529411765), +}; + +const FN_DECIMAL CELL_2D_X[] = +{ + FN_DECIMAL(-0.6440658039), FN_DECIMAL(-0.08028078721), FN_DECIMAL(0.9983546168), FN_DECIMAL(0.9869492062), FN_DECIMAL(0.9284746418), FN_DECIMAL(0.6051097552), FN_DECIMAL(-0.794167404), FN_DECIMAL(-0.3488667991), FN_DECIMAL(-0.943136526), FN_DECIMAL(-0.9968171318), FN_DECIMAL(0.8740961579), FN_DECIMAL(0.1421139764), FN_DECIMAL(0.4282553608), FN_DECIMAL(-0.9986665833), FN_DECIMAL(0.9996760121), FN_DECIMAL(-0.06248383632), + FN_DECIMAL(0.7120139305), FN_DECIMAL(0.8917660409), FN_DECIMAL(0.1094842955), FN_DECIMAL(-0.8730880804), FN_DECIMAL(0.2594811489), FN_DECIMAL(-0.6690063346), FN_DECIMAL(-0.9996834972), FN_DECIMAL(-0.8803608671), FN_DECIMAL(-0.8166554937), FN_DECIMAL(0.8955599676), FN_DECIMAL(-0.9398321388), FN_DECIMAL(0.07615451399), FN_DECIMAL(-0.7147270565), FN_DECIMAL(0.8707354457), FN_DECIMAL(-0.9580008579), FN_DECIMAL(0.4905965632), + FN_DECIMAL(0.786775944), FN_DECIMAL(0.1079711577), FN_DECIMAL(0.2686638979), FN_DECIMAL(0.6113487322), FN_DECIMAL(-0.530770584), FN_DECIMAL(-0.7837268286), FN_DECIMAL(-0.8558691039), FN_DECIMAL(-0.5726093896), FN_DECIMAL(-0.9830740914), FN_DECIMAL(0.7087766359), FN_DECIMAL(0.6807027153), FN_DECIMAL(-0.08864708788), FN_DECIMAL(0.6704485923), FN_DECIMAL(-0.1350735482), FN_DECIMAL(-0.9381333003), FN_DECIMAL(0.9756655376), + FN_DECIMAL(0.4231433671), FN_DECIMAL(-0.4959787385), FN_DECIMAL(0.1005554325), FN_DECIMAL(-0.7645857281), FN_DECIMAL(-0.5859053796), FN_DECIMAL(-0.9751154306), FN_DECIMAL(-0.6972258572), FN_DECIMAL(0.7907012002), FN_DECIMAL(-0.9109899213), FN_DECIMAL(-0.9584307894), FN_DECIMAL(-0.8269529333), FN_DECIMAL(0.2608264719), FN_DECIMAL(-0.7773760119), FN_DECIMAL(0.7606456974), FN_DECIMAL(-0.8961083758), FN_DECIMAL(-0.9838134719), + FN_DECIMAL(0.7338893576), FN_DECIMAL(0.2161226729), FN_DECIMAL(0.673509891), FN_DECIMAL(-0.5512056873), FN_DECIMAL(0.6899744332), FN_DECIMAL(0.868004831), FN_DECIMAL(0.5897430311), FN_DECIMAL(-0.8950444221), FN_DECIMAL(-0.3595752773), FN_DECIMAL(0.8209486981), FN_DECIMAL(-0.2912360132), FN_DECIMAL(-0.9965011374), FN_DECIMAL(0.9766994634), FN_DECIMAL(0.738790822), FN_DECIMAL(-0.4730947722), FN_DECIMAL(0.8946479441), + FN_DECIMAL(-0.6943628971), FN_DECIMAL(-0.6620468182), FN_DECIMAL(-0.0887255502), FN_DECIMAL(-0.7512250855), FN_DECIMAL(-0.5322986898), FN_DECIMAL(0.5226295385), FN_DECIMAL(0.2296318375), FN_DECIMAL(0.7915307344), FN_DECIMAL(-0.2756485999), FN_DECIMAL(-0.6900234522), FN_DECIMAL(0.07090588086), FN_DECIMAL(0.5981278485), FN_DECIMAL(0.3033429312), FN_DECIMAL(-0.7253142797), FN_DECIMAL(-0.9855874307), FN_DECIMAL(-0.1761843396), + FN_DECIMAL(-0.6438468325), FN_DECIMAL(-0.9956136595), FN_DECIMAL(0.8541580762), FN_DECIMAL(-0.9999807666), FN_DECIMAL(-0.02152416253), FN_DECIMAL(-0.8705983095), FN_DECIMAL(-0.1197138014), FN_DECIMAL(-0.992107781), FN_DECIMAL(-0.9091181546), FN_DECIMAL(0.788610536), FN_DECIMAL(-0.994636402), FN_DECIMAL(0.4211256853), FN_DECIMAL(0.3110430857), FN_DECIMAL(-0.4031127839), FN_DECIMAL(0.7610684239), FN_DECIMAL(0.7685674467), + FN_DECIMAL(0.152271555), FN_DECIMAL(-0.9364648723), FN_DECIMAL(0.1681333739), FN_DECIMAL(-0.3567427907), FN_DECIMAL(-0.418445483), FN_DECIMAL(-0.98774778), FN_DECIMAL(0.8705250765), FN_DECIMAL(-0.8911701067), FN_DECIMAL(-0.7315350966), FN_DECIMAL(0.6030885658), FN_DECIMAL(-0.4149130821), FN_DECIMAL(0.7585339481), FN_DECIMAL(0.6963196535), FN_DECIMAL(0.8332685012), FN_DECIMAL(-0.8086815232), FN_DECIMAL(0.7518116724), + FN_DECIMAL(-0.3490535894), FN_DECIMAL(0.6972110903), FN_DECIMAL(-0.8795676928), FN_DECIMAL(-0.6442331882), FN_DECIMAL(0.6610236811), FN_DECIMAL(-0.9853565782), FN_DECIMAL(-0.590338458), FN_DECIMAL(0.09843602117), FN_DECIMAL(0.5646534882), FN_DECIMAL(-0.6023259233), FN_DECIMAL(-0.3539248861), FN_DECIMAL(0.5132728656), FN_DECIMAL(0.9380385118), FN_DECIMAL(-0.7599270056), FN_DECIMAL(-0.7425936564), FN_DECIMAL(-0.6679610562), + FN_DECIMAL(-0.3018497816), FN_DECIMAL(0.814478266), FN_DECIMAL(0.03777430269), FN_DECIMAL(-0.7514235086), FN_DECIMAL(0.9662556939), FN_DECIMAL(-0.4720194901), FN_DECIMAL(-0.435054126), FN_DECIMAL(0.7091901235), FN_DECIMAL(0.929379209), FN_DECIMAL(0.9997434357), FN_DECIMAL(0.8306320299), FN_DECIMAL(-0.9434019629), FN_DECIMAL(-0.133133759), FN_DECIMAL(0.5048413216), FN_DECIMAL(0.3711995273), FN_DECIMAL(0.98552091), + FN_DECIMAL(0.7401857005), FN_DECIMAL(-0.9999981398), FN_DECIMAL(-0.2144033253), FN_DECIMAL(0.4808624681), FN_DECIMAL(-0.413835885), FN_DECIMAL(0.644229305), FN_DECIMAL(0.9626648696), FN_DECIMAL(0.1833665934), FN_DECIMAL(0.5794129), FN_DECIMAL(0.01404446873), FN_DECIMAL(0.4388494993), FN_DECIMAL(0.5213612322), FN_DECIMAL(-0.5281609948), FN_DECIMAL(-0.9745306846), FN_DECIMAL(-0.9904373013), FN_DECIMAL(0.9100232252), + FN_DECIMAL(-0.9914057719), FN_DECIMAL(0.7892627765), FN_DECIMAL(0.3364421659), FN_DECIMAL(-0.9416099764), FN_DECIMAL(0.7802732656), FN_DECIMAL(0.886302871), FN_DECIMAL(0.6524471291), FN_DECIMAL(0.5762186726), FN_DECIMAL(-0.08987644664), FN_DECIMAL(-0.2177026782), FN_DECIMAL(-0.9720345052), FN_DECIMAL(-0.05722538858), FN_DECIMAL(0.8105983127), FN_DECIMAL(0.3410261032), FN_DECIMAL(0.6452309645), FN_DECIMAL(-0.7810612152), + FN_DECIMAL(0.9989395718), FN_DECIMAL(-0.808247815), FN_DECIMAL(0.6370177929), FN_DECIMAL(0.5844658772), FN_DECIMAL(0.2054070861), FN_DECIMAL(0.055960522), FN_DECIMAL(-0.995827561), FN_DECIMAL(0.893409165), FN_DECIMAL(-0.931516824), FN_DECIMAL(0.328969469), FN_DECIMAL(-0.3193837488), FN_DECIMAL(0.7314755657), FN_DECIMAL(-0.7913517714), FN_DECIMAL(-0.2204109786), FN_DECIMAL(0.9955900414), FN_DECIMAL(-0.7112353139), + FN_DECIMAL(-0.7935008741), FN_DECIMAL(-0.9961918204), FN_DECIMAL(-0.9714163995), FN_DECIMAL(-0.9566188669), FN_DECIMAL(0.2748495632), FN_DECIMAL(-0.4681743221), FN_DECIMAL(-0.9614449642), FN_DECIMAL(0.585194072), FN_DECIMAL(0.4532946061), FN_DECIMAL(-0.9916113176), FN_DECIMAL(0.942479587), FN_DECIMAL(-0.9813704753), FN_DECIMAL(-0.6538429571), FN_DECIMAL(0.2923335053), FN_DECIMAL(-0.2246660704), FN_DECIMAL(-0.1800781949), + FN_DECIMAL(-0.9581216256), FN_DECIMAL(0.552215082), FN_DECIMAL(-0.9296791922), FN_DECIMAL(0.643183699), FN_DECIMAL(0.9997325981), FN_DECIMAL(-0.4606920354), FN_DECIMAL(-0.2148721265), FN_DECIMAL(0.3482070809), FN_DECIMAL(0.3075517813), FN_DECIMAL(0.6274756393), FN_DECIMAL(0.8910881765), FN_DECIMAL(-0.6397771309), FN_DECIMAL(-0.4479080125), FN_DECIMAL(-0.5247665011), FN_DECIMAL(-0.8386507094), FN_DECIMAL(0.3901291416), + FN_DECIMAL(0.1458336921), FN_DECIMAL(0.01624613149), FN_DECIMAL(-0.8273199879), FN_DECIMAL(0.5611100679), FN_DECIMAL(-0.8380219841), FN_DECIMAL(-0.9856122234), FN_DECIMAL(-0.861398618), FN_DECIMAL(0.6398413916), FN_DECIMAL(0.2694510795), FN_DECIMAL(0.4327334514), FN_DECIMAL(-0.9960265354), FN_DECIMAL(-0.939570655), FN_DECIMAL(-0.8846996446), FN_DECIMAL(0.7642113189), FN_DECIMAL(-0.7002080528), FN_DECIMAL(0.664508256), +}; +const FN_DECIMAL CELL_2D_Y[] = +{ + FN_DECIMAL(0.7649700911), FN_DECIMAL(0.9967722885), FN_DECIMAL(0.05734160033), FN_DECIMAL(-0.1610318741), FN_DECIMAL(0.371395799), FN_DECIMAL(-0.7961420628), FN_DECIMAL(0.6076990492), FN_DECIMAL(-0.9371723195), FN_DECIMAL(0.3324056156), FN_DECIMAL(0.07972205329), FN_DECIMAL(-0.4857529277), FN_DECIMAL(-0.9898503007), FN_DECIMAL(0.9036577593), FN_DECIMAL(0.05162417479), FN_DECIMAL(-0.02545330525), FN_DECIMAL(-0.998045976), + FN_DECIMAL(-0.7021653386), FN_DECIMAL(-0.4524967717), FN_DECIMAL(-0.9939885256), FN_DECIMAL(-0.4875625128), FN_DECIMAL(-0.9657481729), FN_DECIMAL(-0.7432567015), FN_DECIMAL(0.02515761212), FN_DECIMAL(0.4743044842), FN_DECIMAL(0.5771254669), FN_DECIMAL(0.4449408324), FN_DECIMAL(0.3416365773), FN_DECIMAL(0.9970960285), FN_DECIMAL(0.6994034849), FN_DECIMAL(0.4917517499), FN_DECIMAL(0.286765333), FN_DECIMAL(0.8713868327), + FN_DECIMAL(0.6172387009), FN_DECIMAL(0.9941540269), FN_DECIMAL(0.9632339851), FN_DECIMAL(-0.7913613129), FN_DECIMAL(0.847515538), FN_DECIMAL(0.6211056739), FN_DECIMAL(0.5171924952), FN_DECIMAL(-0.8198283277), FN_DECIMAL(-0.1832084353), FN_DECIMAL(0.7054329737), FN_DECIMAL(0.7325597678), FN_DECIMAL(0.9960630973), FN_DECIMAL(0.7419559859), FN_DECIMAL(0.9908355749), FN_DECIMAL(-0.346274329), FN_DECIMAL(0.2192641299), + FN_DECIMAL(-0.9060627411), FN_DECIMAL(-0.8683346653), FN_DECIMAL(0.9949314574), FN_DECIMAL(-0.6445220433), FN_DECIMAL(-0.8103794704), FN_DECIMAL(-0.2216977607), FN_DECIMAL(0.7168515217), FN_DECIMAL(0.612202264), FN_DECIMAL(-0.412428616), FN_DECIMAL(0.285325116), FN_DECIMAL(0.56227115), FN_DECIMAL(-0.9653857009), FN_DECIMAL(-0.6290361962), FN_DECIMAL(0.6491672535), FN_DECIMAL(0.443835306), FN_DECIMAL(-0.1791955706), + FN_DECIMAL(-0.6792690269), FN_DECIMAL(-0.9763662173), FN_DECIMAL(0.7391782104), FN_DECIMAL(0.8343693968), FN_DECIMAL(0.7238337389), FN_DECIMAL(0.4965557504), FN_DECIMAL(0.8075909592), FN_DECIMAL(-0.4459769977), FN_DECIMAL(-0.9331160806), FN_DECIMAL(-0.5710019572), FN_DECIMAL(0.9566512346), FN_DECIMAL(-0.08357920318), FN_DECIMAL(0.2146116448), FN_DECIMAL(-0.6739348049), FN_DECIMAL(0.8810115417), FN_DECIMAL(0.4467718167), + FN_DECIMAL(-0.7196250184), FN_DECIMAL(-0.749462481), FN_DECIMAL(0.9960561112), FN_DECIMAL(0.6600461127), FN_DECIMAL(-0.8465566164), FN_DECIMAL(-0.8525598897), FN_DECIMAL(-0.9732775654), FN_DECIMAL(0.6111293616), FN_DECIMAL(-0.9612584717), FN_DECIMAL(-0.7237870097), FN_DECIMAL(-0.9974830104), FN_DECIMAL(-0.8014006968), FN_DECIMAL(0.9528814544), FN_DECIMAL(-0.6884178931), FN_DECIMAL(-0.1691668301), FN_DECIMAL(0.9843571905), + FN_DECIMAL(0.7651544003), FN_DECIMAL(-0.09355982605), FN_DECIMAL(-0.5200134429), FN_DECIMAL(-0.006202125807), FN_DECIMAL(-0.9997683284), FN_DECIMAL(0.4919944954), FN_DECIMAL(-0.9928084436), FN_DECIMAL(-0.1253880012), FN_DECIMAL(-0.4165383308), FN_DECIMAL(-0.6148930171), FN_DECIMAL(-0.1034332049), FN_DECIMAL(-0.9070022917), FN_DECIMAL(-0.9503958117), FN_DECIMAL(0.9151503065), FN_DECIMAL(-0.6486716073), FN_DECIMAL(0.6397687707), + FN_DECIMAL(-0.9883386937), FN_DECIMAL(0.3507613761), FN_DECIMAL(0.9857642561), FN_DECIMAL(-0.9342026446), FN_DECIMAL(-0.9082419159), FN_DECIMAL(0.1560587169), FN_DECIMAL(0.4921240607), FN_DECIMAL(-0.453669308), FN_DECIMAL(0.6818037859), FN_DECIMAL(0.7976742329), FN_DECIMAL(0.9098610522), FN_DECIMAL(0.651633524), FN_DECIMAL(0.7177318024), FN_DECIMAL(-0.5528685241), FN_DECIMAL(0.5882467118), FN_DECIMAL(0.6593778956), + FN_DECIMAL(0.9371027648), FN_DECIMAL(-0.7168658839), FN_DECIMAL(-0.4757737632), FN_DECIMAL(0.7648291307), FN_DECIMAL(0.7503650398), FN_DECIMAL(0.1705063456), FN_DECIMAL(-0.8071558121), FN_DECIMAL(-0.9951433815), FN_DECIMAL(-0.8253280792), FN_DECIMAL(-0.7982502628), FN_DECIMAL(0.9352738503), FN_DECIMAL(0.8582254747), FN_DECIMAL(-0.3465310238), FN_DECIMAL(0.65000842), FN_DECIMAL(-0.6697422351), FN_DECIMAL(0.7441962291), + FN_DECIMAL(-0.9533555), FN_DECIMAL(0.5801940659), FN_DECIMAL(-0.9992862963), FN_DECIMAL(-0.659820211), FN_DECIMAL(0.2575848092), FN_DECIMAL(0.881588113), FN_DECIMAL(-0.9004043022), FN_DECIMAL(-0.7050172826), FN_DECIMAL(0.369126382), FN_DECIMAL(-0.02265088836), FN_DECIMAL(0.5568217228), FN_DECIMAL(-0.3316515286), FN_DECIMAL(0.991098079), FN_DECIMAL(-0.863212164), FN_DECIMAL(-0.9285531277), FN_DECIMAL(0.1695539323), + FN_DECIMAL(-0.672402505), FN_DECIMAL(-0.001928841934), FN_DECIMAL(0.9767452145), FN_DECIMAL(-0.8767960349), FN_DECIMAL(0.9103515037), FN_DECIMAL(-0.7648324016), FN_DECIMAL(0.2706960452), FN_DECIMAL(-0.9830446035), FN_DECIMAL(0.8150341657), FN_DECIMAL(-0.9999013716), FN_DECIMAL(-0.8985605806), FN_DECIMAL(0.8533360801), FN_DECIMAL(0.8491442537), FN_DECIMAL(-0.2242541966), FN_DECIMAL(-0.1379635899), FN_DECIMAL(-0.4145572694), + FN_DECIMAL(0.1308227633), FN_DECIMAL(0.6140555916), FN_DECIMAL(0.9417041303), FN_DECIMAL(-0.336705587), FN_DECIMAL(-0.6254387508), FN_DECIMAL(0.4631060578), FN_DECIMAL(-0.7578342456), FN_DECIMAL(-0.8172955655), FN_DECIMAL(-0.9959529228), FN_DECIMAL(-0.9760151351), FN_DECIMAL(0.2348380732), FN_DECIMAL(-0.9983612848), FN_DECIMAL(0.5856025746), FN_DECIMAL(-0.9400538266), FN_DECIMAL(-0.7639875669), FN_DECIMAL(0.6244544645), + FN_DECIMAL(0.04604054566), FN_DECIMAL(0.5888424828), FN_DECIMAL(0.7708490978), FN_DECIMAL(-0.8114182882), FN_DECIMAL(0.9786766212), FN_DECIMAL(-0.9984329822), FN_DECIMAL(0.09125496582), FN_DECIMAL(-0.4492438803), FN_DECIMAL(-0.3636982357), FN_DECIMAL(0.9443405575), FN_DECIMAL(-0.9476254645), FN_DECIMAL(-0.6818676535), FN_DECIMAL(-0.6113610831), FN_DECIMAL(0.9754070948), FN_DECIMAL(-0.0938108173), FN_DECIMAL(-0.7029540015), + FN_DECIMAL(-0.6085691109), FN_DECIMAL(-0.08718862881), FN_DECIMAL(-0.237381926), FN_DECIMAL(0.2913423132), FN_DECIMAL(0.9614872426), FN_DECIMAL(0.8836361266), FN_DECIMAL(-0.2749974196), FN_DECIMAL(-0.8108932717), FN_DECIMAL(-0.8913607575), FN_DECIMAL(0.129255541), FN_DECIMAL(-0.3342637104), FN_DECIMAL(-0.1921249337), FN_DECIMAL(-0.7566302845), FN_DECIMAL(-0.9563164339), FN_DECIMAL(-0.9744358146), FN_DECIMAL(0.9836522982), + FN_DECIMAL(-0.2863615732), FN_DECIMAL(0.8337016872), FN_DECIMAL(0.3683701937), FN_DECIMAL(0.7657119102), FN_DECIMAL(-0.02312427772), FN_DECIMAL(0.8875600535), FN_DECIMAL(0.976642191), FN_DECIMAL(0.9374176384), FN_DECIMAL(0.9515313457), FN_DECIMAL(-0.7786361937), FN_DECIMAL(-0.4538302125), FN_DECIMAL(-0.7685604874), FN_DECIMAL(-0.8940796454), FN_DECIMAL(-0.8512462154), FN_DECIMAL(0.5446696133), FN_DECIMAL(0.9207601495), + FN_DECIMAL(-0.9893091197), FN_DECIMAL(-0.9998680229), FN_DECIMAL(0.5617309299), FN_DECIMAL(-0.8277411985), FN_DECIMAL(0.545636467), FN_DECIMAL(0.1690223212), FN_DECIMAL(-0.5079295433), FN_DECIMAL(0.7685069899), FN_DECIMAL(-0.9630140787), FN_DECIMAL(0.9015219132), FN_DECIMAL(0.08905695279), FN_DECIMAL(-0.3423550559), FN_DECIMAL(-0.4661614943), FN_DECIMAL(-0.6449659371), FN_DECIMAL(0.7139388509), FN_DECIMAL(0.7472809229), +}; +const FN_DECIMAL CELL_3D_X[] = +{ + FN_DECIMAL(0.3752498686), FN_DECIMAL(0.687188096), FN_DECIMAL(0.2248135212), FN_DECIMAL(0.6692006647), FN_DECIMAL(-0.4376476931), FN_DECIMAL(0.6139972552), FN_DECIMAL(0.9494563929), FN_DECIMAL(0.8065108882), FN_DECIMAL(-0.2218812853), FN_DECIMAL(0.8484661167), FN_DECIMAL(0.5551817596), FN_DECIMAL(0.2133903499), FN_DECIMAL(0.5195126593), FN_DECIMAL(-0.6440141975), FN_DECIMAL(-0.5192897331), FN_DECIMAL(-0.3697654077), + FN_DECIMAL(-0.07927779647), FN_DECIMAL(0.4187757321), FN_DECIMAL(-0.750078731), FN_DECIMAL(0.6579554632), FN_DECIMAL(-0.6859803838), FN_DECIMAL(-0.6878407087), FN_DECIMAL(0.9490848347), FN_DECIMAL(0.5795829433), FN_DECIMAL(-0.5325976529), FN_DECIMAL(-0.1363699466), FN_DECIMAL(0.417665879), FN_DECIMAL(-0.9108236468), FN_DECIMAL(0.4438605427), FN_DECIMAL(0.819294887), FN_DECIMAL(-0.4033873915), FN_DECIMAL(-0.2817317705), + FN_DECIMAL(0.3969665622), FN_DECIMAL(0.5323450134), FN_DECIMAL(-0.6833017297), FN_DECIMAL(0.3881436661), FN_DECIMAL(-0.7119144767), FN_DECIMAL(-0.2306979838), FN_DECIMAL(-0.9398873022), FN_DECIMAL(0.1701906676), FN_DECIMAL(-0.4261839496), FN_DECIMAL(-0.003712295499), FN_DECIMAL(-0.734675004), FN_DECIMAL(-0.3195046015), FN_DECIMAL(0.7345307424), FN_DECIMAL(0.9766246496), FN_DECIMAL(-0.02003735175), FN_DECIMAL(-0.4824156342), + FN_DECIMAL(0.4245892007), FN_DECIMAL(0.9072427669), FN_DECIMAL(0.593346808), FN_DECIMAL(-0.8911762541), FN_DECIMAL(-0.7657571834), FN_DECIMAL(-0.5268198896), FN_DECIMAL(-0.8801903279), FN_DECIMAL(-0.6296409617), FN_DECIMAL(-0.09492481344), FN_DECIMAL(-0.4920470525), FN_DECIMAL(0.7307666154), FN_DECIMAL(-0.2514540636), FN_DECIMAL(-0.3356210347), FN_DECIMAL(-0.3522787894), FN_DECIMAL(0.87847885), FN_DECIMAL(-0.7424096346), + FN_DECIMAL(0.5757585274), FN_DECIMAL(0.4519299338), FN_DECIMAL(0.6420368628), FN_DECIMAL(-0.1128478447), FN_DECIMAL(0.499874883), FN_DECIMAL(0.5291681739), FN_DECIMAL(-0.5098837195), FN_DECIMAL(0.5639583502), FN_DECIMAL(-0.8456386526), FN_DECIMAL(-0.9657134875), FN_DECIMAL(-0.576437342), FN_DECIMAL(-0.5666013014), FN_DECIMAL(0.5667702405), FN_DECIMAL(-0.481316582), FN_DECIMAL(0.7313389916), FN_DECIMAL(-0.3805628566), + FN_DECIMAL(-0.6512675909), FN_DECIMAL(-0.2787156951), FN_DECIMAL(0.8648059114), FN_DECIMAL(-0.9730216276), FN_DECIMAL(-0.8335820906), FN_DECIMAL(0.2673159641), FN_DECIMAL(0.231150148), FN_DECIMAL(0.01286214638), FN_DECIMAL(0.6774953261), FN_DECIMAL(0.6542885718), FN_DECIMAL(-0.02545450161), FN_DECIMAL(0.2101238586), FN_DECIMAL(-0.5572105885), FN_DECIMAL(0.813705672), FN_DECIMAL(-0.7546026951), FN_DECIMAL(-0.2502500006), + FN_DECIMAL(-0.9979289381), FN_DECIMAL(0.7024037039), FN_DECIMAL(0.08990874624), FN_DECIMAL(0.8170812432), FN_DECIMAL(0.4226980265), FN_DECIMAL(-0.2442153475), FN_DECIMAL(-0.9183326731), FN_DECIMAL(0.6068222411), FN_DECIMAL(0.818676691), FN_DECIMAL(-0.7236735282), FN_DECIMAL(-0.5383903295), FN_DECIMAL(-0.6269337242), FN_DECIMAL(-0.0939331121), FN_DECIMAL(0.9203878539), FN_DECIMAL(-0.7256396824), FN_DECIMAL(0.6292431149), + FN_DECIMAL(0.4234156978), FN_DECIMAL(0.006685688024), FN_DECIMAL(-0.2598694113), FN_DECIMAL(0.6408036421), FN_DECIMAL(0.05899871622), FN_DECIMAL(0.7090281418), FN_DECIMAL(-0.5905222072), FN_DECIMAL(0.3128214264), FN_DECIMAL(-0.691925826), FN_DECIMAL(0.3634019349), FN_DECIMAL(-0.6772511147), FN_DECIMAL(-0.3204583896), FN_DECIMAL(-0.3906740409), FN_DECIMAL(-0.3342190395), FN_DECIMAL(-0.517779592), FN_DECIMAL(-0.6817711267), + FN_DECIMAL(0.6422383105), FN_DECIMAL(0.4388482478), FN_DECIMAL(0.2968562611), FN_DECIMAL(-0.2019778353), FN_DECIMAL(0.6014865048), FN_DECIMAL(0.9519280722), FN_DECIMAL(0.3398889569), FN_DECIMAL(0.8179709354), FN_DECIMAL(0.2365522154), FN_DECIMAL(0.3262175096), FN_DECIMAL(-0.8060715954), FN_DECIMAL(-0.2068642503), FN_DECIMAL(0.6208057279), FN_DECIMAL(-0.5274282502), FN_DECIMAL(-0.3722334928), FN_DECIMAL(-0.8923412971), + FN_DECIMAL(0.5341834201), FN_DECIMAL(-0.3663701513), FN_DECIMAL(-0.6114600319), FN_DECIMAL(0.5026307556), FN_DECIMAL(0.8396151729), FN_DECIMAL(0.9245042467), FN_DECIMAL(-0.7994843957), FN_DECIMAL(-0.5357200589), FN_DECIMAL(-0.6283359739), FN_DECIMAL(-0.61351886), FN_DECIMAL(-0.875632008), FN_DECIMAL(-0.5278879423), FN_DECIMAL(0.9087491985), FN_DECIMAL(-0.03500215466), FN_DECIMAL(-0.261365798), FN_DECIMAL(-0.579523541), + FN_DECIMAL(-0.3765052689), FN_DECIMAL(-0.74398252), FN_DECIMAL(0.4257318052), FN_DECIMAL(-0.1214508921), FN_DECIMAL(0.8561809753), FN_DECIMAL(0.6802835104), FN_DECIMAL(-0.5452131039), FN_DECIMAL(-0.1997156478), FN_DECIMAL(0.4562348357), FN_DECIMAL(-0.811704301), FN_DECIMAL(0.67793962), FN_DECIMAL(-0.9237819106), FN_DECIMAL(0.6973511259), FN_DECIMAL(-0.5189506), FN_DECIMAL(0.5517320032), FN_DECIMAL(-0.396710831), + FN_DECIMAL(0.5493762815), FN_DECIMAL(-0.2507853002), FN_DECIMAL(0.4788634005), FN_DECIMAL(0.387333516), FN_DECIMAL(-0.2176515694), FN_DECIMAL(0.6749832419), FN_DECIMAL(0.2148283022), FN_DECIMAL(-0.7521815872), FN_DECIMAL(0.4697000159), FN_DECIMAL(0.7890593699), FN_DECIMAL(-0.7606162952), FN_DECIMAL(0.01083397843), FN_DECIMAL(0.5254091908), FN_DECIMAL(-0.6748025877), FN_DECIMAL(0.751091524), FN_DECIMAL(0.05259056135), + FN_DECIMAL(0.01889481232), FN_DECIMAL(-0.6037423727), FN_DECIMAL(-0.6542965129), FN_DECIMAL(0.08873301081), FN_DECIMAL(-0.6191345671), FN_DECIMAL(0.4331858488), FN_DECIMAL(-0.3858351946), FN_DECIMAL(-0.1429059747), FN_DECIMAL(0.4118221036), FN_DECIMAL(-0.6247153214), FN_DECIMAL(-0.611423014), FN_DECIMAL(0.5542939606), FN_DECIMAL(-0.9432768808), FN_DECIMAL(-0.4567870451), FN_DECIMAL(-0.7349133547), FN_DECIMAL(0.399304489), + FN_DECIMAL(-0.7474927672), FN_DECIMAL(0.02589419753), FN_DECIMAL(0.783915821), FN_DECIMAL(0.6138668752), FN_DECIMAL(0.4276376047), FN_DECIMAL(-0.4347886353), FN_DECIMAL(0.02947841302), FN_DECIMAL(-0.833742746), FN_DECIMAL(0.3817221742), FN_DECIMAL(-0.8743368359), FN_DECIMAL(-0.3823443796), FN_DECIMAL(-0.6829243811), FN_DECIMAL(-0.3681903049), FN_DECIMAL(-0.367626833), FN_DECIMAL(-0.434583373), FN_DECIMAL(0.235891995), + FN_DECIMAL(-0.6874880269), FN_DECIMAL(-0.5115661773), FN_DECIMAL(-0.5534962601), FN_DECIMAL(0.5632777056), FN_DECIMAL(0.686191532), FN_DECIMAL(-0.05095871588), FN_DECIMAL(-0.06865785057), FN_DECIMAL(-0.5975288531), FN_DECIMAL(-0.6429790056), FN_DECIMAL(-0.3729361548), FN_DECIMAL(0.2237917666), FN_DECIMAL(0.6046773225), FN_DECIMAL(-0.5041542295), FN_DECIMAL(-0.03972191174), FN_DECIMAL(0.7028828406), FN_DECIMAL(-0.5560856498), + FN_DECIMAL(0.5898328456), FN_DECIMAL(-0.9308076766), FN_DECIMAL(0.4617069864), FN_DECIMAL(0.3190983137), FN_DECIMAL(0.9116567753), FN_DECIMAL(-0.45029554), FN_DECIMAL(0.3346334459), FN_DECIMAL(0.8525005645), FN_DECIMAL(0.2528483381), FN_DECIMAL(-0.8306630147), FN_DECIMAL(-0.6880390622), FN_DECIMAL(0.7448684026), FN_DECIMAL(-0.1963355843), FN_DECIMAL(-0.5900257974), FN_DECIMAL(0.9097057294), FN_DECIMAL(-0.2509196808), +}; +const FN_DECIMAL CELL_3D_Y[] = +{ + FN_DECIMAL(-0.6760585049), FN_DECIMAL(-0.09136176499), FN_DECIMAL(0.1681325679), FN_DECIMAL(-0.6688468686), FN_DECIMAL(-0.4822753902), FN_DECIMAL(-0.7891068824), FN_DECIMAL(-0.1877509944), FN_DECIMAL(0.548470914), FN_DECIMAL(-0.463339443), FN_DECIMAL(-0.4050542082), FN_DECIMAL(0.3218158513), FN_DECIMAL(0.2546493823), FN_DECIMAL(-0.3753271935), FN_DECIMAL(0.4745384887), FN_DECIMAL(0.481254652), FN_DECIMAL(-0.8934416489), + FN_DECIMAL(-0.6737085076), FN_DECIMAL(0.7469917228), FN_DECIMAL(0.3826230411), FN_DECIMAL(0.6751013678), FN_DECIMAL(-0.7248119515), FN_DECIMAL(-0.3224276742), FN_DECIMAL(-0.02076190936), FN_DECIMAL(-0.6404268166), FN_DECIMAL(-0.5292028444), FN_DECIMAL(0.7151414636), FN_DECIMAL(-0.6144655059), FN_DECIMAL(-0.369912124), FN_DECIMAL(0.6942067212), FN_DECIMAL(-0.4481558248), FN_DECIMAL(-0.6366894559), FN_DECIMAL(0.5956568471), + FN_DECIMAL(0.564274539), FN_DECIMAL(0.7145584688), FN_DECIMAL(0.6871918316), FN_DECIMAL(0.5657918509), FN_DECIMAL(-0.6275978114), FN_DECIMAL(0.4146983062), FN_DECIMAL(0.2638993789), FN_DECIMAL(-0.792633138), FN_DECIMAL(0.5706133514), FN_DECIMAL(0.8606546462), FN_DECIMAL(0.6490900316), FN_DECIMAL(-0.8242699196), FN_DECIMAL(0.6765819124), FN_DECIMAL(0.1959534069), FN_DECIMAL(-0.8426769757), FN_DECIMAL(-0.5917672797), + FN_DECIMAL(0.7517364266), FN_DECIMAL(0.03252559226), FN_DECIMAL(0.0883617105), FN_DECIMAL(0.4475064813), FN_DECIMAL(-0.1418643552), FN_DECIMAL(0.7343428473), FN_DECIMAL(0.3870192548), FN_DECIMAL(-0.7716703522), FN_DECIMAL(0.4839898327), FN_DECIMAL(0.7437439055), FN_DECIMAL(-0.5989573348), FN_DECIMAL(-0.8357068955), FN_DECIMAL(0.6086049038), FN_DECIMAL(0.9194627258), FN_DECIMAL(0.4718297238), FN_DECIMAL(-0.2650335884), + FN_DECIMAL(-0.6470352599), FN_DECIMAL(-0.5555181303), FN_DECIMAL(0.1222351235), FN_DECIMAL(0.7802044684), FN_DECIMAL(-0.8636947022), FN_DECIMAL(-0.2341352163), FN_DECIMAL(0.683030874), FN_DECIMAL(-0.5005858287), FN_DECIMAL(0.2334616211), FN_DECIMAL(0.2576877608), FN_DECIMAL(0.6666816727), FN_DECIMAL(-0.7663996863), FN_DECIMAL(0.794201982), FN_DECIMAL(0.6189308788), FN_DECIMAL(0.6071033261), FN_DECIMAL(-0.4206058253), + FN_DECIMAL(-0.3957336915), FN_DECIMAL(-0.8170257484), FN_DECIMAL(-0.1043240417), FN_DECIMAL(0.0002167596213), FN_DECIMAL(0.1816339018), FN_DECIMAL(-0.6838094939), FN_DECIMAL(-0.2495341969), FN_DECIMAL(-0.7116756954), FN_DECIMAL(-0.03361673621), FN_DECIMAL(-0.3350836431), FN_DECIMAL(0.2137186039), FN_DECIMAL(0.2557996786), FN_DECIMAL(0.7490117093), FN_DECIMAL(0.4942936549), FN_DECIMAL(-0.352686853), FN_DECIMAL(-0.3952445435), + FN_DECIMAL(-0.0459964767), FN_DECIMAL(-0.7115787471), FN_DECIMAL(0.08022899756), FN_DECIMAL(0.5362268157), FN_DECIMAL(-0.8258613686), FN_DECIMAL(0.1114171723), FN_DECIMAL(0.3882823051), FN_DECIMAL(-0.7915404457), FN_DECIMAL(0.3250957662), FN_DECIMAL(0.6401346464), FN_DECIMAL(-0.2662724517), FN_DECIMAL(-0.6727907114), FN_DECIMAL(-0.994730818), FN_DECIMAL(-0.3596358977), FN_DECIMAL(0.2344610069), FN_DECIMAL(-0.6645215546), + FN_DECIMAL(-0.7107590611), FN_DECIMAL(-0.4646617327), FN_DECIMAL(0.6717191355), FN_DECIMAL(0.5101893498), FN_DECIMAL(0.1185768238), FN_DECIMAL(0.236005093), FN_DECIMAL(-0.7811024061), FN_DECIMAL(0.5089325193), FN_DECIMAL(0.6073187658), FN_DECIMAL(-0.7930732557), FN_DECIMAL(-0.6822767155), FN_DECIMAL(0.3201532885), FN_DECIMAL(0.7545302807), FN_DECIMAL(0.1072664448), FN_DECIMAL(0.6784033173), FN_DECIMAL(-0.6595924967), + FN_DECIMAL(0.7276509498), FN_DECIMAL(0.5586689436), FN_DECIMAL(-0.6498636788), FN_DECIMAL(0.6789333174), FN_DECIMAL(0.7105966551), FN_DECIMAL(-0.2872214155), FN_DECIMAL(0.496746217), FN_DECIMAL(-0.3880337977), FN_DECIMAL(0.7324070604), FN_DECIMAL(-0.9326634749), FN_DECIMAL(-0.5867839255), FN_DECIMAL(0.8003043651), FN_DECIMAL(-0.1631882481), FN_DECIMAL(-0.6796374681), FN_DECIMAL(-0.8066678503), FN_DECIMAL(0.4238177418), + FN_DECIMAL(0.7715863549), FN_DECIMAL(0.5455367347), FN_DECIMAL(-0.03205115397), FN_DECIMAL(-0.6005545066), FN_DECIMAL(-0.5423640002), FN_DECIMAL(0.3569205906), FN_DECIMAL(-0.582071752), FN_DECIMAL(0.6407354361), FN_DECIMAL(0.7777142984), FN_DECIMAL(-0.09956428618), FN_DECIMAL(0.1100002681), FN_DECIMAL(0.8136349123), FN_DECIMAL(0.2923431904), FN_DECIMAL(0.9735794425), FN_DECIMAL(0.8324974864), FN_DECIMAL(-0.6179617717), + FN_DECIMAL(-0.9248386523), FN_DECIMAL(-0.6448780771), FN_DECIMAL(-0.5274402761), FN_DECIMAL(-0.7862170565), FN_DECIMAL(0.2682099744), FN_DECIMAL(-0.5848777694), FN_DECIMAL(-0.6364561467), FN_DECIMAL(-0.7167402514), FN_DECIMAL(-0.8677012494), FN_DECIMAL(0.4205286707), FN_DECIMAL(-0.7007832749), FN_DECIMAL(0.243272451), FN_DECIMAL(-0.1899846085), FN_DECIMAL(-0.6146124977), FN_DECIMAL(-0.8093357692), FN_DECIMAL(-0.03545096987), + FN_DECIMAL(-0.7191590868), FN_DECIMAL(0.7478645848), FN_DECIMAL(0.3623517328), FN_DECIMAL(0.8436992512), FN_DECIMAL(-0.2445711729), FN_DECIMAL(0.6897356637), FN_DECIMAL(-0.1708070787), FN_DECIMAL(0.4639272368), FN_DECIMAL(-0.7917186656), FN_DECIMAL(0.02980025428), FN_DECIMAL(0.6334156172), FN_DECIMAL(-0.9815544807), FN_DECIMAL(-0.2307217304), FN_DECIMAL(0.1080823318), FN_DECIMAL(0.5167601798), FN_DECIMAL(-0.845120016), + FN_DECIMAL(0.441572562), FN_DECIMAL(0.5876789172), FN_DECIMAL(-0.6365908737), FN_DECIMAL(0.68350166), FN_DECIMAL(0.5849723959), FN_DECIMAL(0.1164114357), FN_DECIMAL(-0.7379813884), FN_DECIMAL(-0.9613237178), FN_DECIMAL(-0.9071943084), FN_DECIMAL(-0.7682111105), FN_DECIMAL(0.639074459), FN_DECIMAL(-0.619358298), FN_DECIMAL(0.2807257131), FN_DECIMAL(-0.01800868791), FN_DECIMAL(0.3776607289), FN_DECIMAL(0.7207567823), + FN_DECIMAL(0.5536661486), FN_DECIMAL(-0.9974053117), FN_DECIMAL(-0.02047200006), FN_DECIMAL(-0.6739453804), FN_DECIMAL(-0.5607471297), FN_DECIMAL(0.8815553192), FN_DECIMAL(0.8275977415), FN_DECIMAL(0.3928902456), FN_DECIMAL(0.550991396), FN_DECIMAL(0.4247623676), FN_DECIMAL(-0.3436948871), FN_DECIMAL(-0.3653537677), FN_DECIMAL(0.3181702902), FN_DECIMAL(-0.6067173171), FN_DECIMAL(-0.8984128477), FN_DECIMAL(0.4220839766), + FN_DECIMAL(0.7238407199), FN_DECIMAL(-0.7766913695), FN_DECIMAL(0.6460037842), FN_DECIMAL(0.2544775664), FN_DECIMAL(0.6488840578), FN_DECIMAL(0.805016833), FN_DECIMAL(-0.9183807036), FN_DECIMAL(0.4144046357), FN_DECIMAL(0.270587208), FN_DECIMAL(-0.8813684494), FN_DECIMAL(0.6985971877), FN_DECIMAL(-0.7795603017), FN_DECIMAL(-0.8624480731), FN_DECIMAL(0.5532697017), FN_DECIMAL(0.711179521), FN_DECIMAL(-0.7798160574), + FN_DECIMAL(0.5225859041), FN_DECIMAL(0.1261859368), FN_DECIMAL(0.3398033582), FN_DECIMAL(-0.7472173667), FN_DECIMAL(-0.4032647119), FN_DECIMAL(-0.4246578154), FN_DECIMAL(0.8481212377), FN_DECIMAL(-0.2144838537), FN_DECIMAL(0.3431714491), FN_DECIMAL(0.5310188231), FN_DECIMAL(0.6682978632), FN_DECIMAL(0.3110433206), FN_DECIMAL(0.9263293599), FN_DECIMAL(-0.6155600569), FN_DECIMAL(0.07169784399), FN_DECIMAL(0.8985888773), +}; +const FN_DECIMAL CELL_3D_Z[] = +{ + FN_DECIMAL(-0.6341391283), FN_DECIMAL(-0.7207118346), FN_DECIMAL(0.9597866014), FN_DECIMAL(0.3237504235), FN_DECIMAL(-0.7588642466), FN_DECIMAL(-0.01782410481), FN_DECIMAL(0.2515593809), FN_DECIMAL(0.2207257205), FN_DECIMAL(-0.8579541106), FN_DECIMAL(0.3406410681), FN_DECIMAL(0.7669470462), FN_DECIMAL(-0.9431957648), FN_DECIMAL(0.7676171537), FN_DECIMAL(-0.6000491115), FN_DECIMAL(-0.7062096948), FN_DECIMAL(0.2550207115), + FN_DECIMAL(0.7347325213), FN_DECIMAL(0.5163625202), FN_DECIMAL(-0.5394270162), FN_DECIMAL(0.3336656285), FN_DECIMAL(-0.0638635111), FN_DECIMAL(-0.6503195787), FN_DECIMAL(0.3143356798), FN_DECIMAL(-0.5039217245), FN_DECIMAL(0.6605180464), FN_DECIMAL(-0.6855479011), FN_DECIMAL(-0.6693185756), FN_DECIMAL(0.1832083647), FN_DECIMAL(-0.5666258437), FN_DECIMAL(0.3576482138), FN_DECIMAL(-0.6571949095), FN_DECIMAL(-0.7522101635), + FN_DECIMAL(-0.7238865886), FN_DECIMAL(0.4538887323), FN_DECIMAL(0.2467106257), FN_DECIMAL(0.7274778869), FN_DECIMAL(0.3151170655), FN_DECIMAL(-0.8802293764), FN_DECIMAL(-0.2167232729), FN_DECIMAL(0.5854637865), FN_DECIMAL(0.7019741052), FN_DECIMAL(0.5091756071), FN_DECIMAL(0.1973189533), FN_DECIMAL(0.46743546), FN_DECIMAL(0.05197599597), FN_DECIMAL(0.088354718), FN_DECIMAL(0.5380464843), FN_DECIMAL(-0.6458224544), + FN_DECIMAL(-0.5045952393), FN_DECIMAL(0.419347884), FN_DECIMAL(0.8000823542), FN_DECIMAL(-0.07445020656), FN_DECIMAL(-0.6272881641), FN_DECIMAL(-0.428020311), FN_DECIMAL(-0.2747382083), FN_DECIMAL(-0.08987283726), FN_DECIMAL(0.8699098354), FN_DECIMAL(0.4524761885), FN_DECIMAL(-0.3274603257), FN_DECIMAL(0.4882262167), FN_DECIMAL(-0.7189983256), FN_DECIMAL(0.1746079907), FN_DECIMAL(0.0751772698), FN_DECIMAL(-0.6152927202), + FN_DECIMAL(0.4998474673), FN_DECIMAL(-0.6979677227), FN_DECIMAL(0.7568667263), FN_DECIMAL(-0.6152612058), FN_DECIMAL(0.06447140991), FN_DECIMAL(-0.8155744872), FN_DECIMAL(-0.5229602449), FN_DECIMAL(0.6567836838), FN_DECIMAL(-0.4799905631), FN_DECIMAL(0.03153534591), FN_DECIMAL(0.4724992466), FN_DECIMAL(-0.3026458097), FN_DECIMAL(-0.2191225827), FN_DECIMAL(-0.620692287), FN_DECIMAL(0.3107552588), FN_DECIMAL(0.8235670294), + FN_DECIMAL(0.6474915988), FN_DECIMAL(-0.5047637941), FN_DECIMAL(0.4911488878), FN_DECIMAL(-0.2307138167), FN_DECIMAL(-0.5216800015), FN_DECIMAL(0.6789305939), FN_DECIMAL(0.9403734863), FN_DECIMAL(0.702390397), FN_DECIMAL(0.7347584625), FN_DECIMAL(0.6779567958), FN_DECIMAL(0.9765635805), FN_DECIMAL(-0.9436177661), FN_DECIMAL(-0.358465925), FN_DECIMAL(-0.3058706624), FN_DECIMAL(0.5533414464), FN_DECIMAL(-0.8838306897), + FN_DECIMAL(0.04496841812), FN_DECIMAL(0.01687374963), FN_DECIMAL(-0.9927133148), FN_DECIMAL(-0.211752318), FN_DECIMAL(0.3732015249), FN_DECIMAL(0.9632990593), FN_DECIMAL(-0.07682417004), FN_DECIMAL(-0.07232213047), FN_DECIMAL(0.4733721775), FN_DECIMAL(0.2579229713), FN_DECIMAL(0.7995216286), FN_DECIMAL(0.3928189967), FN_DECIMAL(0.04107517667), FN_DECIMAL(0.1534542912), FN_DECIMAL(0.6468965045), FN_DECIMAL(0.4030684878), + FN_DECIMAL(-0.5617300988), FN_DECIMAL(-0.885463029), FN_DECIMAL(0.693729985), FN_DECIMAL(-0.5736527866), FN_DECIMAL(-0.9911905409), FN_DECIMAL(-0.66451538), FN_DECIMAL(0.2028855685), FN_DECIMAL(0.8019541421), FN_DECIMAL(-0.3903877149), FN_DECIMAL(-0.4888495114), FN_DECIMAL(-0.2753714057), FN_DECIMAL(-0.8915202143), FN_DECIMAL(0.5273119089), FN_DECIMAL(0.9363714773), FN_DECIMAL(-0.5212228249), FN_DECIMAL(-0.31642672), + FN_DECIMAL(0.2409440761), FN_DECIMAL(-0.703776404), FN_DECIMAL(-0.6996810411), FN_DECIMAL(-0.7058714505), FN_DECIMAL(-0.3650566783), FN_DECIMAL(0.1064744278), FN_DECIMAL(0.7985729102), FN_DECIMAL(0.424680257), FN_DECIMAL(-0.6384535592), FN_DECIMAL(0.1540161646), FN_DECIMAL(-0.07702731943), FN_DECIMAL(-0.5627789132), FN_DECIMAL(-0.7667919169), FN_DECIMAL(-0.509815999), FN_DECIMAL(0.4590525092), FN_DECIMAL(0.1552595611), + FN_DECIMAL(0.345402042), FN_DECIMAL(0.7537656024), FN_DECIMAL(0.7906259247), FN_DECIMAL(-0.6218493452), FN_DECIMAL(0.02979350071), FN_DECIMAL(-0.1337893489), FN_DECIMAL(-0.1483818606), FN_DECIMAL(0.549965562), FN_DECIMAL(0.01882482408), FN_DECIMAL(-0.7833783002), FN_DECIMAL(0.4702855809), FN_DECIMAL(0.2435827372), FN_DECIMAL(0.2978428332), FN_DECIMAL(0.2256499906), FN_DECIMAL(0.4885036897), FN_DECIMAL(0.5312962584), + FN_DECIMAL(0.05401156992), FN_DECIMAL(0.1749922158), FN_DECIMAL(-0.7352273018), FN_DECIMAL(0.6058980284), FN_DECIMAL(0.4416079111), FN_DECIMAL(0.4417378638), FN_DECIMAL(0.5455879807), FN_DECIMAL(-0.6681295324), FN_DECIMAL(0.1973431441), FN_DECIMAL(0.4053292055), FN_DECIMAL(0.2220375492), FN_DECIMAL(0.2957118467), FN_DECIMAL(0.6910913512), FN_DECIMAL(0.5940890106), FN_DECIMAL(-0.2014135283), FN_DECIMAL(-0.9172588213), + FN_DECIMAL(-0.4254361401), FN_DECIMAL(-0.6146586825), FN_DECIMAL(-0.7996193253), FN_DECIMAL(-0.3716777111), FN_DECIMAL(-0.9448876842), FN_DECIMAL(-0.2620349924), FN_DECIMAL(0.9615995749), FN_DECIMAL(-0.4679683524), FN_DECIMAL(0.3905937144), FN_DECIMAL(0.613593722), FN_DECIMAL(0.1422937358), FN_DECIMAL(0.1908754211), FN_DECIMAL(0.8189704912), FN_DECIMAL(-0.7300408736), FN_DECIMAL(-0.4108776451), FN_DECIMAL(-0.5319834504), + FN_DECIMAL(-0.8970265651), FN_DECIMAL(-0.5386359045), FN_DECIMAL(0.4082255906), FN_DECIMAL(0.7245356676), FN_DECIMAL(0.5239080873), FN_DECIMAL(-0.8937552226), FN_DECIMAL(-0.553637673), FN_DECIMAL(0.2354455182), FN_DECIMAL(-0.0860293075), FN_DECIMAL(-0.1399373318), FN_DECIMAL(-0.4666323327), FN_DECIMAL(0.5560157407), FN_DECIMAL(0.1772619533), FN_DECIMAL(-0.8893937725), FN_DECIMAL(-0.5632714576), FN_DECIMAL(-0.5666264959), + FN_DECIMAL(-0.3670263736), FN_DECIMAL(-0.06717242579), FN_DECIMAL(0.6205295181), FN_DECIMAL(-0.4110536264), FN_DECIMAL(0.7090054553), FN_DECIMAL(0.183899597), FN_DECIMAL(-0.5605470555), FN_DECIMAL(0.3879565548), FN_DECIMAL(0.7420893903), FN_DECIMAL(-0.2347595118), FN_DECIMAL(-0.8577217497), FN_DECIMAL(0.6325590203), FN_DECIMAL(-0.8736152276), FN_DECIMAL(0.7048011129), FN_DECIMAL(-0.06317948268), FN_DECIMAL(0.8753285574), + FN_DECIMAL(-0.05843650473), FN_DECIMAL(-0.3674922622), FN_DECIMAL(-0.5256624401), FN_DECIMAL(0.7861039337), FN_DECIMAL(0.3287714416), FN_DECIMAL(0.5910593099), FN_DECIMAL(-0.3896960134), FN_DECIMAL(0.6864605361), FN_DECIMAL(0.7164918431), FN_DECIMAL(-0.290014277), FN_DECIMAL(-0.6796169617), FN_DECIMAL(0.1632515592), FN_DECIMAL(0.04485347486), FN_DECIMAL(0.8320545697), FN_DECIMAL(0.01339408056), FN_DECIMAL(-0.2874989857), + FN_DECIMAL(0.615630723), FN_DECIMAL(0.3430367014), FN_DECIMAL(0.8193658136), FN_DECIMAL(-0.5829600957), FN_DECIMAL(0.07911697781), FN_DECIMAL(0.7854296063), FN_DECIMAL(-0.4107442306), FN_DECIMAL(0.4766964066), FN_DECIMAL(-0.9045999527), FN_DECIMAL(-0.1673856787), FN_DECIMAL(0.2828077348), FN_DECIMAL(-0.5902737632), FN_DECIMAL(-0.321506229), FN_DECIMAL(-0.5224513133), FN_DECIMAL(-0.4090169985), FN_DECIMAL(-0.3599685311), +}; + +static int FastFloor(FN_DECIMAL f) { return (f >= 0 ? (int)f : (int)f - 1); } +static int FastRound(FN_DECIMAL f) { return (f >= 0) ? (int)(f + FN_DECIMAL(0.5)) : (int)(f - FN_DECIMAL(0.5)); } +static int FastAbs(int i) { return abs(i); } +static FN_DECIMAL FastAbs(FN_DECIMAL f) { return fabs(f); } +static FN_DECIMAL Lerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL t) { return a + t * (b - a); } +static FN_DECIMAL InterpHermiteFunc(FN_DECIMAL t) { return t*t*(3 - 2 * t); } +static FN_DECIMAL InterpQuinticFunc(FN_DECIMAL t) { return t*t*t*(t*(t * 6 - 15) + 10); } +static FN_DECIMAL CubicLerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL c, FN_DECIMAL d, FN_DECIMAL t) +{ + FN_DECIMAL p = (d - c) - (a - b); + return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; +} + +void FastNoise::SetSeed(int seed) +{ + m_seed = seed; + + std::mt19937_64 gen(seed); + + for (int i = 0; i < 256; i++) + m_perm[i] = i; + + for (int j = 0; j < 256; j++) + { + int rng = (int)(gen() % (256 - j)); + int k = rng + j; + int l = m_perm[j]; + m_perm[j] = m_perm[j + 256] = m_perm[k]; + m_perm[k] = l; + m_perm12[j] = m_perm12[j + 256] = m_perm[j] % 12; + } +} + +void FastNoise::CalculateFractalBounding() +{ + FN_DECIMAL amp = m_gain; + FN_DECIMAL ampFractal = 1.0f; + for (int i = 1; i < m_octaves; i++) + { + ampFractal += amp; + amp *= m_gain; + } + m_fractalBounding = 1.0f / ampFractal; +} + +void FastNoise::SetCellularDistance2Indices(int cellularDistanceIndex0, int cellularDistanceIndex1) +{ + m_cellularDistanceIndex0 = std::min(cellularDistanceIndex0, cellularDistanceIndex1); + m_cellularDistanceIndex1 = std::max(cellularDistanceIndex0, cellularDistanceIndex1); + + m_cellularDistanceIndex0 = std::min(std::max(m_cellularDistanceIndex0, 0), FN_CELLULAR_INDEX_MAX); + m_cellularDistanceIndex1 = std::min(std::max(m_cellularDistanceIndex1, 0), FN_CELLULAR_INDEX_MAX); +} + +void FastNoise::GetCellularDistance2Indices(int& cellularDistanceIndex0, int& cellularDistanceIndex1) const +{ + cellularDistanceIndex0 = m_cellularDistanceIndex0; + cellularDistanceIndex1 = m_cellularDistanceIndex1; +} + +unsigned char FastNoise::Index2D_12(unsigned char offset, int x, int y) const +{ + return m_perm12[(x & 0xff) + m_perm[(y & 0xff) + offset]]; +} +unsigned char FastNoise::Index3D_12(unsigned char offset, int x, int y, int z) const +{ + return m_perm12[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + offset]]]; +} +unsigned char FastNoise::Index4D_32(unsigned char offset, int x, int y, int z, int w) const +{ + return m_perm[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + m_perm[(w & 0xff) + offset]]]] & 31; +} +unsigned char FastNoise::Index2D_256(unsigned char offset, int x, int y) const +{ + return m_perm[(x & 0xff) + m_perm[(y & 0xff) + offset]]; +} +unsigned char FastNoise::Index3D_256(unsigned char offset, int x, int y, int z) const +{ + return m_perm[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + offset]]]; +} +unsigned char FastNoise::Index4D_256(unsigned char offset, int x, int y, int z, int w) const +{ + return m_perm[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + m_perm[(w & 0xff) + offset]]]]; +} + +// Hashing +#define X_PRIME 1619 +#define Y_PRIME 31337 +#define Z_PRIME 6971 +#define W_PRIME 1013 + +static FN_DECIMAL ValCoord2D(int seed, int x, int y) +{ + int n = seed; + n ^= X_PRIME * x; + n ^= Y_PRIME * y; + + return (n * n * n * 60493) / FN_DECIMAL(2147483648); +} +static FN_DECIMAL ValCoord3D(int seed, int x, int y, int z) +{ + int n = seed; + n ^= X_PRIME * x; + n ^= Y_PRIME * y; + n ^= Z_PRIME * z; + + return (n * n * n * 60493) / FN_DECIMAL(2147483648); +} +static FN_DECIMAL ValCoord4D(int seed, int x, int y, int z, int w) +{ + int n = seed; + n ^= X_PRIME * x; + n ^= Y_PRIME * y; + n ^= Z_PRIME * z; + n ^= W_PRIME * w; + + return (n * n * n * 60493) / FN_DECIMAL(2147483648); +} + +FN_DECIMAL FastNoise::ValCoord2DFast(unsigned char offset, int x, int y) const +{ + return VAL_LUT[Index2D_256(offset, x, y)]; +} +FN_DECIMAL FastNoise::ValCoord3DFast(unsigned char offset, int x, int y, int z) const +{ + return VAL_LUT[Index3D_256(offset, x, y, z)]; +} + +FN_DECIMAL FastNoise::GradCoord2D(unsigned char offset, int x, int y, FN_DECIMAL xd, FN_DECIMAL yd) const +{ + unsigned char lutPos = Index2D_12(offset, x, y); + + return xd*GRAD_X[lutPos] + yd*GRAD_Y[lutPos]; +} +FN_DECIMAL FastNoise::GradCoord3D(unsigned char offset, int x, int y, int z, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd) const +{ + unsigned char lutPos = Index3D_12(offset, x, y, z); + + return xd*GRAD_X[lutPos] + yd*GRAD_Y[lutPos] + zd*GRAD_Z[lutPos]; +} +FN_DECIMAL FastNoise::GradCoord4D(unsigned char offset, int x, int y, int z, int w, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd, FN_DECIMAL wd) const +{ + unsigned char lutPos = Index4D_32(offset, x, y, z, w) << 2; + + return xd*GRAD_4D[lutPos] + yd*GRAD_4D[lutPos + 1] + zd*GRAD_4D[lutPos + 2] + wd*GRAD_4D[lutPos + 3]; +} + +FN_DECIMAL FastNoise::GetNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + x *= m_frequency; + y *= m_frequency; + z *= m_frequency; + + switch (m_noiseType) + { + case Value: + return SingleValue(0, x, y, z); + case ValueFractal: + switch (m_fractalType) + { + case FBM: + return SingleValueFractalFBM(x, y, z); + case Billow: + return SingleValueFractalBillow(x, y, z); + case RigidMulti: + return SingleValueFractalRigidMulti(x, y, z); + default: + return 0; + } + case Perlin: + return SinglePerlin(0, x, y, z); + case PerlinFractal: + switch (m_fractalType) + { + case FBM: + return SinglePerlinFractalFBM(x, y, z); + case Billow: + return SinglePerlinFractalBillow(x, y, z); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y, z); + default: + return 0; + } + case Simplex: + return SingleSimplex(0, x, y, z); + case SimplexFractal: + switch (m_fractalType) + { + case FBM: + return SingleSimplexFractalFBM(x, y, z); + case Billow: + return SingleSimplexFractalBillow(x, y, z); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y, z); + default: + return 0; + } + case Cellular: + switch (m_cellularReturnType) + { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y, z); + default: + return SingleCellular2Edge(x, y, z); + } + case WhiteNoise: + return GetWhiteNoise(x, y, z); + case Cubic: + return SingleCubic(0, x, y, z); + case CubicFractal: + switch (m_fractalType) + { + case FBM: + return SingleCubicFractalFBM(x, y, z); + case Billow: + return SingleCubicFractalBillow(x, y, z); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y, z); + } + default: + return 0; + } +} + +FN_DECIMAL FastNoise::GetNoise(FN_DECIMAL x, FN_DECIMAL y) const +{ + x *= m_frequency; + y *= m_frequency; + + switch (m_noiseType) + { + case Value: + return SingleValue(0, x, y); + case ValueFractal: + switch (m_fractalType) + { + case FBM: + return SingleValueFractalFBM(x, y); + case Billow: + return SingleValueFractalBillow(x, y); + case RigidMulti: + return SingleValueFractalRigidMulti(x, y); + } + case Perlin: + return SinglePerlin(0, x, y); + case PerlinFractal: + switch (m_fractalType) + { + case FBM: + return SinglePerlinFractalFBM(x, y); + case Billow: + return SinglePerlinFractalBillow(x, y); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y); + } + case Simplex: + return SingleSimplex(0, x, y); + case SimplexFractal: + switch (m_fractalType) + { + case FBM: + return SingleSimplexFractalFBM(x, y); + case Billow: + return SingleSimplexFractalBillow(x, y); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y); + } + case Cellular: + switch (m_cellularReturnType) + { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y); + default: + return SingleCellular2Edge(x, y); + } + case WhiteNoise: + return GetWhiteNoise(x, y); + case Cubic: + return SingleCubic(0, x, y); + case CubicFractal: + switch (m_fractalType) + { + case FBM: + return SingleCubicFractalFBM(x, y); + case Billow: + return SingleCubicFractalBillow(x, y); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y); + } + } + return 0; +} + +// White Noise +FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const +{ + return ValCoord4D(m_seed, + *reinterpret_cast(&x) ^ (*reinterpret_cast(&x) >> 16), + *reinterpret_cast(&y) ^ (*reinterpret_cast(&y) >> 16), + *reinterpret_cast(&z) ^ (*reinterpret_cast(&z) >> 16), + *reinterpret_cast(&w) ^ (*reinterpret_cast(&w) >> 16)); +} + +FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + return ValCoord3D(m_seed, + *reinterpret_cast(&x) ^ (*reinterpret_cast(&x) >> 16), + *reinterpret_cast(&y) ^ (*reinterpret_cast(&y) >> 16), + *reinterpret_cast(&z) ^ (*reinterpret_cast(&z) >> 16)); +} + +FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y) const +{ + return ValCoord2D(m_seed, + *reinterpret_cast(&x) ^ (*reinterpret_cast(&x) >> 16), + *reinterpret_cast(&y) ^ (*reinterpret_cast(&y) >> 16)); +} + +FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y, int z, int w) const +{ + return ValCoord4D(m_seed, x, y, z, w); +} + +FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y, int z) const +{ + return ValCoord3D(m_seed, x, y, z); +} + +FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y) const +{ + return ValCoord2D(m_seed, x, y); +} + +// Value Noise +FN_DECIMAL FastNoise::GetValueFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + x *= m_frequency; + y *= m_frequency; + z *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SingleValueFractalFBM(x, y, z); + case Billow: + return SingleValueFractalBillow(x, y, z); + case RigidMulti: + return SingleValueFractalRigidMulti(x, y, z); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = SingleValue(m_perm[0], x, y, z); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += SingleValue(m_perm[i], x, y, z) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = FastAbs(SingleValue(m_perm[0], x, y, z)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += (FastAbs(SingleValue(m_perm[i], x, y, z)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = 1 - FastAbs(SingleValue(m_perm[0], x, y, z)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SingleValue(m_perm[i], x, y, z))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::GetValue(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + return SingleValue(0, x * m_frequency, y * m_frequency, z * m_frequency); +} + +FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int z0 = FastFloor(z); + int x1 = x0 + 1; + int y1 = y0 + 1; + int z1 = z0 + 1; + + FN_DECIMAL xs, ys, zs; + switch (m_interp) + { + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + zs = z - (FN_DECIMAL)z0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + zs = InterpHermiteFunc(z - (FN_DECIMAL)z0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + zs = InterpQuinticFunc(z - (FN_DECIMAL)z0); + break; + } + + FN_DECIMAL xf00 = Lerp(ValCoord3DFast(offset, x0, y0, z0), ValCoord3DFast(offset, x1, y0, z0), xs); + FN_DECIMAL xf10 = Lerp(ValCoord3DFast(offset, x0, y1, z0), ValCoord3DFast(offset, x1, y1, z0), xs); + FN_DECIMAL xf01 = Lerp(ValCoord3DFast(offset, x0, y0, z1), ValCoord3DFast(offset, x1, y0, z1), xs); + FN_DECIMAL xf11 = Lerp(ValCoord3DFast(offset, x0, y1, z1), ValCoord3DFast(offset, x1, y1, z1), xs); + + FN_DECIMAL yf0 = Lerp(xf00, xf10, ys); + FN_DECIMAL yf1 = Lerp(xf01, xf11, ys); + + return Lerp(yf0, yf1, zs); +} + +FN_DECIMAL FastNoise::GetValueFractal(FN_DECIMAL x, FN_DECIMAL y) const +{ + x *= m_frequency; + y *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SingleValueFractalFBM(x, y); + case Billow: + return SingleValueFractalBillow(x, y); + case RigidMulti: + return SingleValueFractalRigidMulti(x, y); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = SingleValue(m_perm[0], x, y); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum += SingleValue(m_perm[i], x, y) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = FastAbs(SingleValue(m_perm[0], x, y)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + amp *= m_gain; + sum += (FastAbs(SingleValue(m_perm[i], x, y)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = 1 - FastAbs(SingleValue(m_perm[0], x, y)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SingleValue(m_perm[i], x, y))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::GetValue(FN_DECIMAL x, FN_DECIMAL y) const +{ + return SingleValue(0, x * m_frequency, y * m_frequency); +} + +FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const +{ + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int x1 = x0 + 1; + int y1 = y0 + 1; + + FN_DECIMAL xs, ys; + switch (m_interp) + { + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + break; + } + + FN_DECIMAL xf0 = Lerp(ValCoord2DFast(offset, x0, y0), ValCoord2DFast(offset, x1, y0), xs); + FN_DECIMAL xf1 = Lerp(ValCoord2DFast(offset, x0, y1), ValCoord2DFast(offset, x1, y1), xs); + + return Lerp(xf0, xf1, ys); +} + +// Perlin Noise +FN_DECIMAL FastNoise::GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + x *= m_frequency; + y *= m_frequency; + z *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SinglePerlinFractalFBM(x, y, z); + case Billow: + return SinglePerlinFractalBillow(x, y, z); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y, z); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = SinglePerlin(m_perm[0], x, y, z); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += SinglePerlin(m_perm[i], x, y, z) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = FastAbs(SinglePerlin(m_perm[0], x, y, z)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += (FastAbs(SinglePerlin(m_perm[i], x, y, z)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = 1 - FastAbs(SinglePerlin(m_perm[0], x, y, z)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SinglePerlin(m_perm[i], x, y, z))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::GetPerlin(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + return SinglePerlin(0, x * m_frequency, y * m_frequency, z * m_frequency); +} + +FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int z0 = FastFloor(z); + int x1 = x0 + 1; + int y1 = y0 + 1; + int z1 = z0 + 1; + + FN_DECIMAL xs, ys, zs; + switch (m_interp) + { + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + zs = z - (FN_DECIMAL)z0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + zs = InterpHermiteFunc(z - (FN_DECIMAL)z0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + zs = InterpQuinticFunc(z - (FN_DECIMAL)z0); + break; + } + + FN_DECIMAL xd0 = x - (FN_DECIMAL)x0; + FN_DECIMAL yd0 = y - (FN_DECIMAL)y0; + FN_DECIMAL zd0 = z - (FN_DECIMAL)z0; + FN_DECIMAL xd1 = xd0 - 1; + FN_DECIMAL yd1 = yd0 - 1; + FN_DECIMAL zd1 = zd0 - 1; + + FN_DECIMAL xf00 = Lerp(GradCoord3D(offset, x0, y0, z0, xd0, yd0, zd0), GradCoord3D(offset, x1, y0, z0, xd1, yd0, zd0), xs); + FN_DECIMAL xf10 = Lerp(GradCoord3D(offset, x0, y1, z0, xd0, yd1, zd0), GradCoord3D(offset, x1, y1, z0, xd1, yd1, zd0), xs); + FN_DECIMAL xf01 = Lerp(GradCoord3D(offset, x0, y0, z1, xd0, yd0, zd1), GradCoord3D(offset, x1, y0, z1, xd1, yd0, zd1), xs); + FN_DECIMAL xf11 = Lerp(GradCoord3D(offset, x0, y1, z1, xd0, yd1, zd1), GradCoord3D(offset, x1, y1, z1, xd1, yd1, zd1), xs); + + FN_DECIMAL yf0 = Lerp(xf00, xf10, ys); + FN_DECIMAL yf1 = Lerp(xf01, xf11, ys); + + return Lerp(yf0, yf1, zs); +} + +FN_DECIMAL FastNoise::GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y) const +{ + x *= m_frequency; + y *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SinglePerlinFractalFBM(x, y); + case Billow: + return SinglePerlinFractalBillow(x, y); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = SinglePerlin(m_perm[0], x, y); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum += SinglePerlin(m_perm[i], x, y) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = FastAbs(SinglePerlin(m_perm[0], x, y)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum += (FastAbs(SinglePerlin(m_perm[i], x, y)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = 1 - FastAbs(SinglePerlin(m_perm[0], x, y)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SinglePerlin(m_perm[i], x, y))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::GetPerlin(FN_DECIMAL x, FN_DECIMAL y) const +{ + return SinglePerlin(0, x * m_frequency, y * m_frequency); +} + +FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const +{ + int x0 = FastFloor(x); + int y0 = FastFloor(y); + int x1 = x0 + 1; + int y1 = y0 + 1; + + FN_DECIMAL xs, ys; + switch (m_interp) + { + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + break; + } + + FN_DECIMAL xd0 = x - (FN_DECIMAL)x0; + FN_DECIMAL yd0 = y - (FN_DECIMAL)y0; + FN_DECIMAL xd1 = xd0 - 1; + FN_DECIMAL yd1 = yd0 - 1; + + FN_DECIMAL xf0 = Lerp(GradCoord2D(offset, x0, y0, xd0, yd0), GradCoord2D(offset, x1, y0, xd1, yd0), xs); + FN_DECIMAL xf1 = Lerp(GradCoord2D(offset, x0, y1, xd0, yd1), GradCoord2D(offset, x1, y1, xd1, yd1), xs); + + return Lerp(xf0, xf1, ys); +} + +// Simplex Noise + +FN_DECIMAL FastNoise::GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + x *= m_frequency; + y *= m_frequency; + z *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SingleSimplexFractalFBM(x, y, z); + case Billow: + return SingleSimplexFractalBillow(x, y, z); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y, z); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = SingleSimplex(m_perm[0], x, y, z); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += SingleSimplex(m_perm[i], x, y, z) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = FastAbs(SingleSimplex(m_perm[0], x, y, z)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += (FastAbs(SingleSimplex(m_perm[i], x, y, z)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = 1 - FastAbs(SingleSimplex(m_perm[0], x, y, z)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SingleSimplex(m_perm[i], x, y, z))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + return SingleSimplex(0, x * m_frequency, y * m_frequency, z * m_frequency); +} + +static const FN_DECIMAL F3 = 1 / FN_DECIMAL(3); +static const FN_DECIMAL G3 = 1 / FN_DECIMAL(6); + +FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL t = (x + y + z) * F3; + int i = FastFloor(x + t); + int j = FastFloor(y + t); + int k = FastFloor(z + t); + + t = (i + j + k) * G3; + FN_DECIMAL X0 = i - t; + FN_DECIMAL Y0 = j - t; + FN_DECIMAL Z0 = k - t; + + FN_DECIMAL x0 = x - X0; + FN_DECIMAL y0 = y - Y0; + FN_DECIMAL z0 = z - Z0; + + int i1, j1, k1; + int i2, j2, k2; + + if (x0 >= y0) + { + if (y0 >= z0) + { + i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 1; k2 = 0; + } + else if (x0 >= z0) + { + i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 0; k2 = 1; + } + else // x0 < z0 + { + i1 = 0; j1 = 0; k1 = 1; i2 = 1; j2 = 0; k2 = 1; + } + } + else // x0 < y0 + { + if (y0 < z0) + { + i1 = 0; j1 = 0; k1 = 1; i2 = 0; j2 = 1; k2 = 1; + } + else if (x0 < z0) + { + i1 = 0; j1 = 1; k1 = 0; i2 = 0; j2 = 1; k2 = 1; + } + else // x0 >= z0 + { + i1 = 0; j1 = 1; k1 = 0; i2 = 1; j2 = 1; k2 = 0; + } + } + + FN_DECIMAL x1 = x0 - i1 + G3; + FN_DECIMAL y1 = y0 - j1 + G3; + FN_DECIMAL z1 = z0 - k1 + G3; + FN_DECIMAL x2 = x0 - i2 + 2*G3; + FN_DECIMAL y2 = y0 - j2 + 2*G3; + FN_DECIMAL z2 = z0 - k2 + 2*G3; + FN_DECIMAL x3 = x0 - 1 + 3*G3; + FN_DECIMAL y3 = y0 - 1 + 3*G3; + FN_DECIMAL z3 = z0 - 1 + 3*G3; + + FN_DECIMAL n0, n1, n2, n3; + + t = FN_DECIMAL(0.6) - x0*x0 - y0*y0 - z0*z0; + if (t < 0) n0 = 0; + else + { + t *= t; + n0 = t*t*GradCoord3D(offset, i, j, k, x0, y0, z0); + } + + t = FN_DECIMAL(0.6) - x1*x1 - y1*y1 - z1*z1; + if (t < 0) n1 = 0; + else + { + t *= t; + n1 = t*t*GradCoord3D(offset, i + i1, j + j1, k + k1, x1, y1, z1); + } + + t = FN_DECIMAL(0.6) - x2*x2 - y2*y2 - z2*z2; + if (t < 0) n2 = 0; + else + { + t *= t; + n2 = t*t*GradCoord3D(offset, i + i2, j + j2, k + k2, x2, y2, z2); + } + + t = FN_DECIMAL(0.6) - x3*x3 - y3*y3 - z3*z3; + if (t < 0) n3 = 0; + else + { + t *= t; + n3 = t*t*GradCoord3D(offset, i + 1, j + 1, k + 1, x3, y3, z3); + } + + return 32 * (n0 + n1 + n2 + n3); +} + +FN_DECIMAL FastNoise::GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y) const +{ + x *= m_frequency; + y *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SingleSimplexFractalFBM(x, y); + case Billow: + return SingleSimplexFractalBillow(x, y); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = SingleSimplex(m_perm[0], x, y); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum += SingleSimplex(m_perm[i], x, y) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = FastAbs(SingleSimplex(m_perm[0], x, y)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum += (FastAbs(SingleSimplex(m_perm[i], x, y)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = 1 - FastAbs(SingleSimplex(m_perm[0], x, y)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SingleSimplex(m_perm[i], x, y))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::SingleSimplexFractalBlend(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = SingleSimplex(m_perm[0], x, y); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum *= SingleSimplex(m_perm[i], x, y) * amp + 1; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y) const +{ + return SingleSimplex(0, x * m_frequency, y * m_frequency); +} + +//static const FN_DECIMAL F2 = 1 / FN_DECIMAL(2); +//static const FN_DECIMAL G2 = 1 / FN_DECIMAL(4); + +static const FN_DECIMAL SQRT3 = FN_DECIMAL(1.7320508075688772935274463415059); +static const FN_DECIMAL F2 = FN_DECIMAL(0.5) * (SQRT3 - FN_DECIMAL(1.0)); +static const FN_DECIMAL G2 = (FN_DECIMAL(3.0) - SQRT3) / FN_DECIMAL(6.0); + +FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL t = (x + y) * F2; + int i = FastFloor(x + t); + int j = FastFloor(y + t); + + t = (i + j) * G2; + FN_DECIMAL X0 = i - t; + FN_DECIMAL Y0 = j - t; + + FN_DECIMAL x0 = x - X0; + FN_DECIMAL y0 = y - Y0; + + int i1, j1; + if (x0 > y0) + { + i1 = 1; j1 = 0; + } + else + { + i1 = 0; j1 = 1; + } + + FN_DECIMAL x1 = x0 - (FN_DECIMAL)i1 + G2; + FN_DECIMAL y1 = y0 - (FN_DECIMAL)j1 + G2; + FN_DECIMAL x2 = x0 - 1 + 2*G2; + FN_DECIMAL y2 = y0 - 1 + 2*G2; + + FN_DECIMAL n0, n1, n2; + + t = FN_DECIMAL(0.5) - x0*x0 - y0*y0; + if (t < 0) n0 = 0; + else + { + t *= t; + n0 = t * t * GradCoord2D(offset, i, j, x0, y0); + } + + t = FN_DECIMAL(0.5) - x1*x1 - y1*y1; + if (t < 0) n1 = 0; + else + { + t *= t; + n1 = t*t*GradCoord2D(offset, i + i1, j + j1, x1, y1); + } + + t = FN_DECIMAL(0.5) - x2*x2 - y2*y2; + if (t < 0) n2 = 0; + else + { + t *= t; + n2 = t*t*GradCoord2D(offset, i + 1, j + 1, x2, y2); + } + + return 70 * (n0 + n1 + n2); +} + +FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const +{ + return SingleSimplex(0, x * m_frequency, y * m_frequency, z * m_frequency, w * m_frequency); +} + +static const FN_DECIMAL F4 = (sqrt(FN_DECIMAL(5)) - 1) / 4; +static const FN_DECIMAL G4 = (5 - sqrt(FN_DECIMAL(5))) / 20; + +FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const +{ + FN_DECIMAL n0, n1, n2, n3, n4; + FN_DECIMAL t = (x + y + z + w) * F4; + int i = FastFloor(x + t); + int j = FastFloor(y + t); + int k = FastFloor(z + t); + int l = FastFloor(w + t); + t = (i + j + k + l) * G4; + FN_DECIMAL X0 = i - t; + FN_DECIMAL Y0 = j - t; + FN_DECIMAL Z0 = k - t; + FN_DECIMAL W0 = l - t; + FN_DECIMAL x0 = x - X0; + FN_DECIMAL y0 = y - Y0; + FN_DECIMAL z0 = z - Z0; + FN_DECIMAL w0 = w - W0; + + int rankx = 0; + int ranky = 0; + int rankz = 0; + int rankw = 0; + + if (x0 > y0) rankx++; else ranky++; + if (x0 > z0) rankx++; else rankz++; + if (x0 > w0) rankx++; else rankw++; + if (y0 > z0) ranky++; else rankz++; + if (y0 > w0) ranky++; else rankw++; + if (z0 > w0) rankz++; else rankw++; + + int i1 = rankx >= 3 ? 1 : 0; + int j1 = ranky >= 3 ? 1 : 0; + int k1 = rankz >= 3 ? 1 : 0; + int l1 = rankw >= 3 ? 1 : 0; + + int i2 = rankx >= 2 ? 1 : 0; + int j2 = ranky >= 2 ? 1 : 0; + int k2 = rankz >= 2 ? 1 : 0; + int l2 = rankw >= 2 ? 1 : 0; + + int i3 = rankx >= 1 ? 1 : 0; + int j3 = ranky >= 1 ? 1 : 0; + int k3 = rankz >= 1 ? 1 : 0; + int l3 = rankw >= 1 ? 1 : 0; + + FN_DECIMAL x1 = x0 - i1 + G4; + FN_DECIMAL y1 = y0 - j1 + G4; + FN_DECIMAL z1 = z0 - k1 + G4; + FN_DECIMAL w1 = w0 - l1 + G4; + FN_DECIMAL x2 = x0 - i2 + 2*G4; + FN_DECIMAL y2 = y0 - j2 + 2*G4; + FN_DECIMAL z2 = z0 - k2 + 2*G4; + FN_DECIMAL w2 = w0 - l2 + 2*G4; + FN_DECIMAL x3 = x0 - i3 + 3*G4; + FN_DECIMAL y3 = y0 - j3 + 3*G4; + FN_DECIMAL z3 = z0 - k3 + 3*G4; + FN_DECIMAL w3 = w0 - l3 + 3*G4; + FN_DECIMAL x4 = x0 - 1 + 4*G4; + FN_DECIMAL y4 = y0 - 1 + 4*G4; + FN_DECIMAL z4 = z0 - 1 + 4*G4; + FN_DECIMAL w4 = w0 - 1 + 4*G4; + + t = FN_DECIMAL(0.6) - x0*x0 - y0*y0 - z0*z0 - w0*w0; + if (t < 0) n0 = 0; + else { + t *= t; + n0 = t * t * GradCoord4D(offset, i, j, k, l, x0, y0, z0, w0); + } + t = FN_DECIMAL(0.6) - x1*x1 - y1*y1 - z1*z1 - w1*w1; + if (t < 0) n1 = 0; + else { + t *= t; + n1 = t * t * GradCoord4D(offset, i + i1, j + j1, k + k1, l + l1, x1, y1, z1, w1); + } + t = FN_DECIMAL(0.6) - x2*x2 - y2*y2 - z2*z2 - w2*w2; + if (t < 0) n2 = 0; + else { + t *= t; + n2 = t * t * GradCoord4D(offset, i + i2, j + j2, k + k2, l + l2, x2, y2, z2, w2); + } + t = FN_DECIMAL(0.6) - x3*x3 - y3*y3 - z3*z3 - w3*w3; + if (t < 0) n3 = 0; + else { + t *= t; + n3 = t * t * GradCoord4D(offset, i + i3, j + j3, k + k3, l + l3, x3, y3, z3, w3); + } + t = FN_DECIMAL(0.6) - x4*x4 - y4*y4 - z4*z4 - w4*w4; + if (t < 0) n4 = 0; + else { + t *= t; + n4 = t * t * GradCoord4D(offset, i + 1, j + 1, k + 1, l + 1, x4, y4, z4, w4); + } + + return 27 * (n0 + n1 + n2 + n3 + n4); +} + +// Cubic Noise +FN_DECIMAL FastNoise::GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + x *= m_frequency; + y *= m_frequency; + z *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SingleCubicFractalFBM(x, y, z); + case Billow: + return SingleCubicFractalBillow(x, y, z); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y, z); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = SingleCubic(m_perm[0], x, y, z); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += SingleCubic(m_perm[i], x, y, z) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = FastAbs(SingleCubic(m_perm[0], x, y, z)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum += (FastAbs(SingleCubic(m_perm[i], x, y, z)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + FN_DECIMAL sum = 1 - FastAbs(SingleCubic(m_perm[0], x, y, z)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + z *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SingleCubic(m_perm[i], x, y, z))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::GetCubic(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + return SingleCubic(0, x * m_frequency, y * m_frequency, z * m_frequency); +} + +const FN_DECIMAL CUBIC_3D_BOUNDING = 1 / (FN_DECIMAL(1.5) * FN_DECIMAL(1.5) * FN_DECIMAL(1.5)); + +FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + int x1 = FastFloor(x); + int y1 = FastFloor(y); + int z1 = FastFloor(z); + + int x0 = x1 - 1; + int y0 = y1 - 1; + int z0 = z1 - 1; + int x2 = x1 + 1; + int y2 = y1 + 1; + int z2 = z1 + 1; + int x3 = x1 + 2; + int y3 = y1 + 2; + int z3 = z1 + 2; + + FN_DECIMAL xs = x - (FN_DECIMAL)x1; + FN_DECIMAL ys = y - (FN_DECIMAL)y1; + FN_DECIMAL zs = z - (FN_DECIMAL)z1; + + return CubicLerp( + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z0), ValCoord3DFast(offset, x1, y0, z0), ValCoord3DFast(offset, x2, y0, z0), ValCoord3DFast(offset, x3, y0, z0), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z0), ValCoord3DFast(offset, x1, y1, z0), ValCoord3DFast(offset, x2, y1, z0), ValCoord3DFast(offset, x3, y1, z0), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z0), ValCoord3DFast(offset, x1, y2, z0), ValCoord3DFast(offset, x2, y2, z0), ValCoord3DFast(offset, x3, y2, z0), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z0), ValCoord3DFast(offset, x1, y3, z0), ValCoord3DFast(offset, x2, y3, z0), ValCoord3DFast(offset, x3, y3, z0), xs), + ys), + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z1), ValCoord3DFast(offset, x1, y0, z1), ValCoord3DFast(offset, x2, y0, z1), ValCoord3DFast(offset, x3, y0, z1), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z1), ValCoord3DFast(offset, x1, y1, z1), ValCoord3DFast(offset, x2, y1, z1), ValCoord3DFast(offset, x3, y1, z1), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z1), ValCoord3DFast(offset, x1, y2, z1), ValCoord3DFast(offset, x2, y2, z1), ValCoord3DFast(offset, x3, y2, z1), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z1), ValCoord3DFast(offset, x1, y3, z1), ValCoord3DFast(offset, x2, y3, z1), ValCoord3DFast(offset, x3, y3, z1), xs), + ys), + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z2), ValCoord3DFast(offset, x1, y0, z2), ValCoord3DFast(offset, x2, y0, z2), ValCoord3DFast(offset, x3, y0, z2), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z2), ValCoord3DFast(offset, x1, y1, z2), ValCoord3DFast(offset, x2, y1, z2), ValCoord3DFast(offset, x3, y1, z2), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z2), ValCoord3DFast(offset, x1, y2, z2), ValCoord3DFast(offset, x2, y2, z2), ValCoord3DFast(offset, x3, y2, z2), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z2), ValCoord3DFast(offset, x1, y3, z2), ValCoord3DFast(offset, x2, y3, z2), ValCoord3DFast(offset, x3, y3, z2), xs), + ys), + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z3), ValCoord3DFast(offset, x1, y0, z3), ValCoord3DFast(offset, x2, y0, z3), ValCoord3DFast(offset, x3, y0, z3), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z3), ValCoord3DFast(offset, x1, y1, z3), ValCoord3DFast(offset, x2, y1, z3), ValCoord3DFast(offset, x3, y1, z3), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z3), ValCoord3DFast(offset, x1, y2, z3), ValCoord3DFast(offset, x2, y2, z3), ValCoord3DFast(offset, x3, y2, z3), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z3), ValCoord3DFast(offset, x1, y3, z3), ValCoord3DFast(offset, x2, y3, z3), ValCoord3DFast(offset, x3, y3, z3), xs), + ys), + zs) * CUBIC_3D_BOUNDING; +} + + +FN_DECIMAL FastNoise::GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y) const +{ + x *= m_frequency; + y *= m_frequency; + + switch (m_fractalType) + { + case FBM: + return SingleCubicFractalFBM(x, y); + case Billow: + return SingleCubicFractalBillow(x, y); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y); + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = SingleCubic(m_perm[0], x, y); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum += SingleCubic(m_perm[i], x, y) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = FastAbs(SingleCubic(m_perm[0], x, y)) * 2 - 1; + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum += (FastAbs(SingleCubic(m_perm[i], x, y)) * 2 - 1) * amp; + } + + return sum * m_fractalBounding; +} + +FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const +{ + FN_DECIMAL sum = 1 - FastAbs(SingleCubic(m_perm[0], x, y)); + FN_DECIMAL amp = 1; + int i = 0; + + while (++i < m_octaves) + { + x *= m_lacunarity; + y *= m_lacunarity; + + amp *= m_gain; + sum -= (1 - FastAbs(SingleCubic(m_perm[i], x, y))) * amp; + } + + return sum; +} + +FN_DECIMAL FastNoise::GetCubic(FN_DECIMAL x, FN_DECIMAL y) const +{ + x *= m_frequency; + y *= m_frequency; + + return SingleCubic(0, x, y); +} + +const FN_DECIMAL CUBIC_2D_BOUNDING = 1 / (FN_DECIMAL(1.5) * FN_DECIMAL(1.5)); + +FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const +{ + int x1 = FastFloor(x); + int y1 = FastFloor(y); + + int x0 = x1 - 1; + int y0 = y1 - 1; + int x2 = x1 + 1; + int y2 = y1 + 1; + int x3 = x1 + 2; + int y3 = y1 + 2; + + FN_DECIMAL xs = x - (FN_DECIMAL)x1; + FN_DECIMAL ys = y - (FN_DECIMAL)y1; + + return CubicLerp( + CubicLerp(ValCoord2DFast(offset, x0, y0), ValCoord2DFast(offset, x1, y0), ValCoord2DFast(offset, x2, y0), ValCoord2DFast(offset, x3, y0), xs), + CubicLerp(ValCoord2DFast(offset, x0, y1), ValCoord2DFast(offset, x1, y1), ValCoord2DFast(offset, x2, y1), ValCoord2DFast(offset, x3, y1), xs), + CubicLerp(ValCoord2DFast(offset, x0, y2), ValCoord2DFast(offset, x1, y2), ValCoord2DFast(offset, x2, y2), ValCoord2DFast(offset, x3, y2), xs), + CubicLerp(ValCoord2DFast(offset, x0, y3), ValCoord2DFast(offset, x1, y3), ValCoord2DFast(offset, x2, y3), ValCoord2DFast(offset, x3, y3), xs), + ys) * CUBIC_2D_BOUNDING; +} + +// Cellular Noise +FN_DECIMAL FastNoise::GetCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + x *= m_frequency; + y *= m_frequency; + z *= m_frequency; + + switch (m_cellularReturnType) + { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y, z); + default: + return SingleCellular2Edge(x, y, z); + } +} + +FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + int xr = FastRound(x); + int yr = FastRound(y); + int zr = FastRound(z); + + FN_DECIMAL distance = 999999; + int xc, yc, zc; + + switch (m_cellularDistanceFunction) + { + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + for (int zi = zr - 1; zi <= zr + 1; zi++) + { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); + + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; + + if (newDistance < distance) + { + distance = newDistance; + xc = xi; + yc = yi; + zc = zi; + } + } + } + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + for (int zi = zr - 1; zi <= zr + 1; zi++) + { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); + + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); + + if (newDistance < distance) + { + distance = newDistance; + xc = xi; + yc = yi; + zc = zi; + } + } + } + } + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + for (int zi = zr - 1; zi <= zr + 1; zi++) + { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); + + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); + + if (newDistance < distance) + { + distance = newDistance; + xc = xi; + yc = yi; + zc = zi; + } + } + } + } + break; + default: + break; + } + + unsigned char lutPos; + switch (m_cellularReturnType) + { + case CellValue: + return ValCoord3D(m_seed, xc, yc, zc); + + case NoiseLookup: + assert(m_cellularNoiseLookup); + + lutPos = Index3D_256(0, xc, yc, zc); + return m_cellularNoiseLookup->GetNoise(xc + CELL_3D_X[lutPos] * m_cellularJitter, yc + CELL_3D_Y[lutPos] * m_cellularJitter, zc + CELL_3D_Z[lutPos] * m_cellularJitter); + + case Distance: + return distance; + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const +{ + int xr = FastRound(x); + int yr = FastRound(y); + int zr = FastRound(z); + + FN_DECIMAL distance[FN_CELLULAR_INDEX_MAX+1] = { 999999,999999,999999,999999 }; + + switch (m_cellularDistanceFunction) + { + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + for (int zi = zr - 1; zi <= zr + 1; zi++) + { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); + + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; + + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } + } + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + for (int zi = zr - 1; zi <= zr + 1; zi++) + { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); + + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); + + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } + } + } + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + for (int zi = zr - 1; zi <= zr + 1; zi++) + { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); + + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); + + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } + } + } + break; + default: + break; + } + + switch (m_cellularReturnType) + { + case Distance2: + return distance[m_cellularDistanceIndex1]; + case Distance2Add: + return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; + case Distance2Sub: + return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; + case Distance2Mul: + return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; + case Distance2Div: + return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; + default: + return 0; + } +} + +FN_DECIMAL FastNoise::GetCellular(FN_DECIMAL x, FN_DECIMAL y) const +{ + x *= m_frequency; + y *= m_frequency; + + switch (m_cellularReturnType) + { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y); + default: + return SingleCellular2Edge(x, y); + } +} + +FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y) const +{ + int xr = FastRound(x); + int yr = FastRound(y); + + FN_DECIMAL distance = 999999; + int xc, yc; + + switch (m_cellularDistanceFunction) + { + default: + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + unsigned char lutPos = Index2D_256(0, xi, yi); + + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; + + if (newDistance < distance) + { + distance = newDistance; + xc = xi; + yc = yi; + } + } + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + unsigned char lutPos = Index2D_256(0, xi, yi); + + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)); + + if (newDistance < distance) + { + distance = newDistance; + xc = xi; + yc = yi; + } + } + } + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + unsigned char lutPos = Index2D_256(0, xi, yi); + + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)) + (vecX * vecX + vecY * vecY); + + if (newDistance < distance) + { + distance = newDistance; + xc = xi; + yc = yi; + } + } + } + break; + } + + unsigned char lutPos; + switch (m_cellularReturnType) + { + case CellValue: + return ValCoord2D(m_seed, xc, yc); + + case NoiseLookup: + assert(m_cellularNoiseLookup); + + lutPos = Index2D_256(0, xc, yc); + return m_cellularNoiseLookup->GetNoise(xc + CELL_2D_X[lutPos] * m_cellularJitter, yc + CELL_2D_Y[lutPos] * m_cellularJitter); + + case Distance: + return distance; + default: + return 0; + } +} + +FN_DECIMAL FastNoise::SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y) const +{ + int xr = FastRound(x); + int yr = FastRound(y); + + FN_DECIMAL distance[FN_CELLULAR_INDEX_MAX + 1] = { 999999,999999,999999,999999 }; + + switch (m_cellularDistanceFunction) + { + default: + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + unsigned char lutPos = Index2D_256(0, xi, yi); + + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; + + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } + } + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + unsigned char lutPos = Index2D_256(0, xi, yi); + + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY); + + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } + } + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) + { + for (int yi = yr - 1; yi <= yr + 1; yi++) + { + unsigned char lutPos = Index2D_256(0, xi, yi); + + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)) + (vecX * vecX + vecY * vecY); + + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } + } + break; + } + + switch (m_cellularReturnType) + { + case Distance2: + return distance[m_cellularDistanceIndex1]; + case Distance2Add: + return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; + case Distance2Sub: + return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; + case Distance2Mul: + return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; + case Distance2Div: + return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; + default: + return 0; + } +} + +void FastNoise::GradientPerturb(FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const +{ + SingleGradientPerturb(0, m_gradientPerturbAmp, m_frequency, x, y, z); +} + +void FastNoise::GradientPerturbFractal(FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const +{ + FN_DECIMAL amp = m_gradientPerturbAmp * m_fractalBounding; + FN_DECIMAL freq = m_frequency; + int i = 0; + + SingleGradientPerturb(m_perm[0], amp, m_frequency, x, y, z); + + while (++i < m_octaves) + { + freq *= m_lacunarity; + amp *= m_gain; + SingleGradientPerturb(m_perm[i], amp, freq, x, y, z); + } +} + +void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const +{ + FN_DECIMAL xf = x * frequency; + FN_DECIMAL yf = y * frequency; + FN_DECIMAL zf = z * frequency; + + int x0 = FastFloor(xf); + int y0 = FastFloor(yf); + int z0 = FastFloor(zf); + int x1 = x0 + 1; + int y1 = y0 + 1; + int z1 = z0 + 1; + + FN_DECIMAL xs, ys, zs; + switch (m_interp) + { + default: + case Linear: + xs = xf - (FN_DECIMAL)x0; + ys = yf - (FN_DECIMAL)y0; + zs = zf - (FN_DECIMAL)z0; + break; + case Hermite: + xs = InterpHermiteFunc(xf - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(yf - (FN_DECIMAL)y0); + zs = InterpHermiteFunc(zf - (FN_DECIMAL)z0); + break; + case Quintic: + xs = InterpQuinticFunc(xf - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(yf - (FN_DECIMAL)y0); + zs = InterpQuinticFunc(zf - (FN_DECIMAL)z0); + break; + } + + int lutPos0 = Index3D_256(offset, x0, y0, z0); + int lutPos1 = Index3D_256(offset, x1, y0, z0); + + FN_DECIMAL lx0x = Lerp(CELL_3D_X[lutPos0], CELL_3D_X[lutPos1], xs); + FN_DECIMAL ly0x = Lerp(CELL_3D_Y[lutPos0], CELL_3D_Y[lutPos1], xs); + FN_DECIMAL lz0x = Lerp(CELL_3D_Z[lutPos0], CELL_3D_Z[lutPos1], xs); + + lutPos0 = Index3D_256(offset, x0, y1, z0); + lutPos1 = Index3D_256(offset, x1, y1, z0); + + FN_DECIMAL lx1x = Lerp(CELL_3D_X[lutPos0], CELL_3D_X[lutPos1], xs); + FN_DECIMAL ly1x = Lerp(CELL_3D_Y[lutPos0], CELL_3D_Y[lutPos1], xs); + FN_DECIMAL lz1x = Lerp(CELL_3D_Z[lutPos0], CELL_3D_Z[lutPos1], xs); + + FN_DECIMAL lx0y = Lerp(lx0x, lx1x, ys); + FN_DECIMAL ly0y = Lerp(ly0x, ly1x, ys); + FN_DECIMAL lz0y = Lerp(lz0x, lz1x, ys); + + lutPos0 = Index3D_256(offset, x0, y0, z1); + lutPos1 = Index3D_256(offset, x1, y0, z1); + + lx0x = Lerp(CELL_3D_X[lutPos0], CELL_3D_X[lutPos1], xs); + ly0x = Lerp(CELL_3D_Y[lutPos0], CELL_3D_Y[lutPos1], xs); + lz0x = Lerp(CELL_3D_Z[lutPos0], CELL_3D_Z[lutPos1], xs); + + lutPos0 = Index3D_256(offset, x0, y1, z1); + lutPos1 = Index3D_256(offset, x1, y1, z1); + + lx1x = Lerp(CELL_3D_X[lutPos0], CELL_3D_X[lutPos1], xs); + ly1x = Lerp(CELL_3D_Y[lutPos0], CELL_3D_Y[lutPos1], xs); + lz1x = Lerp(CELL_3D_Z[lutPos0], CELL_3D_Z[lutPos1], xs); + + x += Lerp(lx0y, Lerp(lx0x, lx1x, ys), zs) * warpAmp; + y += Lerp(ly0y, Lerp(ly0x, ly1x, ys), zs) * warpAmp; + z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * warpAmp; +} + +void FastNoise::GradientPerturb(FN_DECIMAL& x, FN_DECIMAL& y) const +{ + SingleGradientPerturb(0, m_gradientPerturbAmp, m_frequency, x, y); +} + +void FastNoise::GradientPerturbFractal(FN_DECIMAL& x, FN_DECIMAL& y) const +{ + FN_DECIMAL amp = m_gradientPerturbAmp * m_fractalBounding; + FN_DECIMAL freq = m_frequency; + int i = 0; + + SingleGradientPerturb(m_perm[0], amp, m_frequency, x, y); + + while (++i < m_octaves) + { + freq *= m_lacunarity; + amp *= m_gain; + SingleGradientPerturb(m_perm[i], amp, freq, x, y); + } +} + +void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL& x, FN_DECIMAL& y) const +{ + FN_DECIMAL xf = x * frequency; + FN_DECIMAL yf = y * frequency; + + int x0 = FastFloor(xf); + int y0 = FastFloor(yf); + int x1 = x0 + 1; + int y1 = y0 + 1; + + FN_DECIMAL xs, ys; + switch (m_interp) + { + default: + case Linear: + xs = xf - (FN_DECIMAL)x0; + ys = yf - (FN_DECIMAL)y0; + break; + case Hermite: + xs = InterpHermiteFunc(xf - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(yf - (FN_DECIMAL)y0); + break; + case Quintic: + xs = InterpQuinticFunc(xf - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(yf - (FN_DECIMAL)y0); + break; + } + + int lutPos0 = Index2D_256(offset, x0, y0); + int lutPos1 = Index2D_256(offset, x1, y0); + + FN_DECIMAL lx0x = Lerp(CELL_2D_X[lutPos0], CELL_2D_X[lutPos1], xs); + FN_DECIMAL ly0x = Lerp(CELL_2D_Y[lutPos0], CELL_2D_Y[lutPos1], xs); + + lutPos0 = Index2D_256(offset, x0, y1); + lutPos1 = Index2D_256(offset, x1, y1); + + FN_DECIMAL lx1x = Lerp(CELL_2D_X[lutPos0], CELL_2D_X[lutPos1], xs); + FN_DECIMAL ly1x = Lerp(CELL_2D_Y[lutPos0], CELL_2D_Y[lutPos1], xs); + + x += Lerp(lx0x, lx1x, ys) * warpAmp; + y += Lerp(ly0x, ly1x, ys) * warpAmp; +} diff --git a/Prism/vendor/FastNoise/FastNoise.h b/Prism/vendor/FastNoise/FastNoise.h new file mode 100644 index 0000000..f6c8d21 --- /dev/null +++ b/Prism/vendor/FastNoise/FastNoise.h @@ -0,0 +1,311 @@ +// FastNoise.h +// +// MIT License +// +// Copyright(c) 2017 Jordan Peck +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// The developer's email is jorzixdan.me2@gzixmail.com (for great email, take +// off every 'zix'.) +// + +// VERSION: 0.4.1 + +#ifndef FASTNOISE_H +#define FASTNOISE_H + +// Uncomment the line below to use doubles throughout FastNoise instead of floats +//#define FN_USE_DOUBLES + +#define FN_CELLULAR_INDEX_MAX 3 + +#ifdef FN_USE_DOUBLES +typedef double FN_DECIMAL; +#else +typedef float FN_DECIMAL; +#endif + +class FastNoise +{ +public: + explicit FastNoise(int seed = 1337) { SetSeed(seed); CalculateFractalBounding(); } + + enum NoiseType { Value, ValueFractal, Perlin, PerlinFractal, Simplex, SimplexFractal, Cellular, WhiteNoise, Cubic, CubicFractal }; + enum Interp { Linear, Hermite, Quintic }; + enum FractalType { FBM, Billow, RigidMulti }; + enum CellularDistanceFunction { Euclidean, Manhattan, Natural }; + enum CellularReturnType { CellValue, NoiseLookup, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div }; + + // Sets seed used for all noise types + // Default: 1337 + void SetSeed(int seed); + + // Returns seed used for all noise types + int GetSeed() const { return m_seed; } + + // Sets frequency for all noise types + // Default: 0.01 + void SetFrequency(FN_DECIMAL frequency) { m_frequency = frequency; } + + // Returns frequency used for all noise types + FN_DECIMAL GetFrequency() const { return m_frequency; } + + // Changes the interpolation method used to smooth between noise values + // Possible interpolation methods (lowest to highest quality) : + // - Linear + // - Hermite + // - Quintic + // Used in Value, Perlin Noise and Position Warping + // Default: Quintic + void SetInterp(Interp interp) { m_interp = interp; } + + // Returns interpolation method used for supported noise types + Interp GetInterp() const { return m_interp; } + + // Sets noise return type of GetNoise(...) + // Default: Simplex + void SetNoiseType(NoiseType noiseType) { m_noiseType = noiseType; } + + // Returns the noise type used by GetNoise + NoiseType GetNoiseType() const { return m_noiseType; } + + // Sets octave count for all fractal noise types + // Default: 3 + void SetFractalOctaves(int octaves) { m_octaves = octaves; CalculateFractalBounding(); } + + // Returns octave count for all fractal noise types + int GetFractalOctaves() const { return m_octaves; } + + // Sets octave lacunarity for all fractal noise types + // Default: 2.0 + void SetFractalLacunarity(FN_DECIMAL lacunarity) { m_lacunarity = lacunarity; } + + // Returns octave lacunarity for all fractal noise types + FN_DECIMAL GetFractalLacunarity() const { return m_lacunarity; } + + // Sets octave gain for all fractal noise types + // Default: 0.5 + void SetFractalGain(FN_DECIMAL gain) { m_gain = gain; CalculateFractalBounding(); } + + // Returns octave gain for all fractal noise types + FN_DECIMAL GetFractalGain() const { return m_gain; } + + // Sets method for combining octaves in all fractal noise types + // Default: FBM + void SetFractalType(FractalType fractalType) { m_fractalType = fractalType; } + + // Returns method for combining octaves in all fractal noise types + FractalType GetFractalType() const { return m_fractalType; } + + + // Sets distance function used in cellular noise calculations + // Default: Euclidean + void SetCellularDistanceFunction(CellularDistanceFunction cellularDistanceFunction) { m_cellularDistanceFunction = cellularDistanceFunction; } + + // Returns the distance function used in cellular noise calculations + CellularDistanceFunction GetCellularDistanceFunction() const { return m_cellularDistanceFunction; } + + // Sets return type from cellular noise calculations + // Note: NoiseLookup requires another FastNoise object be set with SetCellularNoiseLookup() to function + // Default: CellValue + void SetCellularReturnType(CellularReturnType cellularReturnType) { m_cellularReturnType = cellularReturnType; } + + // Returns the return type from cellular noise calculations + CellularReturnType GetCellularReturnType() const { return m_cellularReturnType; } + + // Noise used to calculate a cell value if cellular return type is NoiseLookup + // The lookup value is acquired through GetNoise() so ensure you SetNoiseType() on the noise lookup, value, Perlin or simplex is recommended + void SetCellularNoiseLookup(FastNoise* noise) { m_cellularNoiseLookup = noise; } + + // Returns the noise used to calculate a cell value if the cellular return type is NoiseLookup + FastNoise* GetCellularNoiseLookup() const { return m_cellularNoiseLookup; } + + // Sets the 2 distance indices used for distance2 return types + // Default: 0, 1 + // Note: index0 should be lower than index1 + // Both indices must be >= 0, index1 must be < 4 + void SetCellularDistance2Indices(int cellularDistanceIndex0, int cellularDistanceIndex1); + + // Returns the 2 distance indices used for distance2 return types + void GetCellularDistance2Indices(int& cellularDistanceIndex0, int& cellularDistanceIndex1) const; + + // Sets the maximum distance a cellular point can move from its grid position + // Setting this high will make artifacts more common + // Default: 0.45 + void SetCellularJitter(FN_DECIMAL cellularJitter) { m_cellularJitter = cellularJitter; } + + // Returns the maximum distance a cellular point can move from its grid position + FN_DECIMAL GetCellularJitter() const { return m_cellularJitter; } + + // Sets the maximum warp distance from original location when using GradientPerturb{Fractal}(...) + // Default: 1.0 + void SetGradientPerturbAmp(FN_DECIMAL gradientPerturbAmp) { m_gradientPerturbAmp = gradientPerturbAmp; } + + // Returns the maximum warp distance from original location when using GradientPerturb{Fractal}(...) + FN_DECIMAL GetGradientPerturbAmp() const { return m_gradientPerturbAmp; } + + //2D + FN_DECIMAL GetValue(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL GetValueFractal(FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL GetPerlin(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL GetSimplex(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL GetCellular(FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL GetWhiteNoiseInt(int x, int y) const; + + FN_DECIMAL GetCubic(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL GetNoise(FN_DECIMAL x, FN_DECIMAL y) const; + + void GradientPerturb(FN_DECIMAL& x, FN_DECIMAL& y) const; + void GradientPerturbFractal(FN_DECIMAL& x, FN_DECIMAL& y) const; + + //3D + FN_DECIMAL GetValue(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL GetValueFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL GetPerlin(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL GetCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL GetWhiteNoiseInt(int x, int y, int z) const; + + FN_DECIMAL GetCubic(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL GetNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + void GradientPerturb(FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const; + void GradientPerturbFractal(FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const; + + //4D + FN_DECIMAL GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const; + + FN_DECIMAL GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const; + FN_DECIMAL GetWhiteNoiseInt(int x, int y, int z, int w) const; + +private: + unsigned char m_perm[512]; + unsigned char m_perm12[512]; + + int m_seed = 1337; + FN_DECIMAL m_frequency = FN_DECIMAL(0.01); + Interp m_interp = Quintic; + NoiseType m_noiseType = Simplex; + + int m_octaves = 3; + FN_DECIMAL m_lacunarity = FN_DECIMAL(2); + FN_DECIMAL m_gain = FN_DECIMAL(0.5); + FractalType m_fractalType = FBM; + FN_DECIMAL m_fractalBounding; + + CellularDistanceFunction m_cellularDistanceFunction = Euclidean; + CellularReturnType m_cellularReturnType = CellValue; + FastNoise* m_cellularNoiseLookup = nullptr; + int m_cellularDistanceIndex0 = 0; + int m_cellularDistanceIndex1 = 1; + FN_DECIMAL m_cellularJitter = FN_DECIMAL(0.45); + + FN_DECIMAL m_gradientPerturbAmp = FN_DECIMAL(1); + + void CalculateFractalBounding(); + + //2D + FN_DECIMAL SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleSimplexFractalBlend(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const; + + FN_DECIMAL SingleCellular(FN_DECIMAL x, FN_DECIMAL y) const; + FN_DECIMAL SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y) const; + + void SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL& x, FN_DECIMAL& y) const; + + //3D + FN_DECIMAL SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + FN_DECIMAL SingleCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + FN_DECIMAL SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const; + + void SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const; + + //4D + FN_DECIMAL SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const; + + inline unsigned char Index2D_12(unsigned char offset, int x, int y) const; + inline unsigned char Index3D_12(unsigned char offset, int x, int y, int z) const; + inline unsigned char Index4D_32(unsigned char offset, int x, int y, int z, int w) const; + inline unsigned char Index2D_256(unsigned char offset, int x, int y) const; + inline unsigned char Index3D_256(unsigned char offset, int x, int y, int z) const; + inline unsigned char Index4D_256(unsigned char offset, int x, int y, int z, int w) const; + + inline FN_DECIMAL ValCoord2DFast(unsigned char offset, int x, int y) const; + inline FN_DECIMAL ValCoord3DFast(unsigned char offset, int x, int y, int z) const; + inline FN_DECIMAL GradCoord2D(unsigned char offset, int x, int y, FN_DECIMAL xd, FN_DECIMAL yd) const; + inline FN_DECIMAL GradCoord3D(unsigned char offset, int x, int y, int z, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd) const; + inline FN_DECIMAL GradCoord4D(unsigned char offset, int x, int y, int z, int w, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd, FN_DECIMAL wd) const; +}; +#endif diff --git a/Prism/vendor/FastNoise/LICENSE b/Prism/vendor/FastNoise/LICENSE new file mode 100644 index 0000000..5ee8678 --- /dev/null +++ b/Prism/vendor/FastNoise/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Jordan Peck + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Prism/vendor/FastNoise/README.md b/Prism/vendor/FastNoise/README.md new file mode 100644 index 0000000..10a32f9 --- /dev/null +++ b/Prism/vendor/FastNoise/README.md @@ -0,0 +1,87 @@ +# FastNoise + +FastNoise is an open source noise generation library with a large collection of different noise algorithms. This library has been designed for realtime usage from the ground up, so has been optimised for speed without sacrificing noise quality. + +This project started when my search to find a good noise library for procedural terrain generation concluded without an obvious choice. I enjoyed the options and customisation of Accidental Noise Library and the speed of LibNoise, so many of the techniques from these libraries and the knowledge I gained from reading through their source has gone into creating FastNoise. + +I have now also created [FastNoise SIMD](https://github.com/Auburns/FastNoiseSIMD), which utilises SIMD CPU instructions to gain huge performance boosts. It is slightly less flexible and cannot be converted to other languages, but if you can I would highly suggest using this for heavy noise generation loads. + +### Features +- Value Noise 2D, 3D +- Perlin Noise 2D, 3D +- Simplex Noise 2D, 3D, 4D +- Cubic Noise 2D, 3D +- Gradient Perturb 2D, 3D +- Multiple fractal options for all of the above +- Cellular (Voronoi) Noise 2D, 3D +- White Noise 2D, 3D, 4D +- Supports floats or doubles + +### Wiki +Usage and documentation available in wiki + +[Wiki Link](https://github.com/Auburns/FastNoise/wiki) + +### Related repositories + - [FastNoise C#](https://github.com/Auburns/FastNoise_CSharp) + - [FastNoise Java](https://github.com/Auburns/FastNoise_Java) + - [FastNoise SIMD](https://github.com/Auburns/FastNoiseSIMD) + - [FastNoise Unity](https://www.assetstore.unity3d.com/en/#!/content/70706) + - [Unreal FastNoise](https://github.com/midgen/UnrealFastNoise) + +Credit to [CubicNoise](https://github.com/jobtalle/CubicNoise) for the cubic noise algorithm + +## FastNoise Preview + +I have written a compact testing application for all the features included in FastNoise with a visual representation. I use this for development purposes and testing noise settings used in terrain generation. + +Download links can be found in the [Releases Section](https://github.com/Auburns/FastNoise/releases). + +![FastNoise Preview](http://i.imgur.com/uG7Vepc.png) + + +# Performance Comparisons +Using default noise settings on FastNoise and matching those settings across the other libraries where possible. + +Timings below are x1000 ns to generate 32x32x32 points of noise on a single thread. + +- CPU: Intel Xeon Skylake @ 2.0Ghz +- Compiler: Intel 17.0 x64 + +| Noise Type | FastNoise | FastNoiseSIMD AVX2 | LibNoise | FastNoise 2D | +|-------------|-----------|--------------------|----------|--------------| +| White Noise | 141 | 9 | | 111 | +| Value | 642 | 152 | | 361 | +| Perlin | 1002 | 324 | 1368 | 473 | +| Simplex | 1194 | 294 | | 883 | +| Cellular | 2979 | 1283 | 58125 | 1074 | +| Cubic | 2979 | 952 | | 858 | + +Comparision of fractal performance [here](https://github.com/Auburns/FastNoiseSIMD/wiki/In-depth-SIMD-level). + +# Examples +## Cellular Noise +![Cellular Noise](http://i.imgur.com/quAic8M.png) + +![Cellular Noise](http://i.imgur.com/gAd9Y2t.png) + +![Cellular Noise](http://i.imgur.com/7kJd4fA.png) + +## Fractal Noise +![Fractal Noise](http://i.imgur.com/XqSD7eR.png) + +## Value Noise +![Value Noise](http://i.imgur.com/X2lbFZR.png) + +## White Noise +![White Noise](http://i.imgur.com/QIlYvyQ.png) + +## Gradient Perturb +![Gradient Perturb](http://i.imgur.com/gOjc1u1.png) + +![Gradient Perturb](http://i.imgur.com/ui045Bk.png) + +![Gradient Perturb](http://i.imgur.com/JICFypT.png) + + +# Any suggestions or questions welcome diff --git a/Prism/vendor/mono/CMakeLists.txt b/Prism/vendor/mono/CMakeLists.txt new file mode 100644 index 0000000..d4bf485 --- /dev/null +++ b/Prism/vendor/mono/CMakeLists.txt @@ -0,0 +1,14 @@ +add_library(mono INTERFACE) + +get_filename_component(PARENT_BINARY_DIR ${CMAKE_BINARY_DIR} DIRECTORY) + +target_include_directories(mono INTERFACE + include +) + +file(GLOB MONO_DLL bin/*.dll) +file(COPY ${MONO_DLL} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + +file(GLOB_RECURSE MONO_LIBRARY lib/*.lib) + +target_link_libraries(mono INTERFACE ${MONO_LIBRARY}) \ No newline at end of file diff --git a/Prism/vendor/mono/include/mono/jit/details/jit-functions.h b/Prism/vendor/mono/include/mono/jit/details/jit-functions.h new file mode 100644 index 0000000..34b2260 --- /dev/null +++ b/Prism/vendor/mono/include/mono/jit/details/jit-functions.h @@ -0,0 +1,50 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init, (const char *root_domain_name)) + +/** + * This function is deprecated, use mono_jit_init instead. Ignores runtime_version parameter. + */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init_version, (const char *root_domain_name, const char *runtime_version)) + +MONO_API_FUNCTION(MonoDomain *, mono_jit_init_version_for_test_only, (const char *root_domain_name, const char *runtime_version)) + +MONO_API_FUNCTION(int, mono_jit_exec, (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])) +MONO_API_FUNCTION(void, mono_jit_cleanup, (MonoDomain *domain)) + +MONO_API_FUNCTION(mono_bool, mono_jit_set_trace_options, (const char* options)) + +MONO_API_FUNCTION(void, mono_set_signal_chaining, (mono_bool chain_signals)) + +MONO_API_FUNCTION(void, mono_set_crash_chaining, (mono_bool chain_signals)) + +/** + * This function is deprecated, use mono_jit_set_aot_mode instead. + */ +MONO_API_FUNCTION(void, mono_jit_set_aot_only, (mono_bool aot_only)) + +MONO_API_FUNCTION(void, mono_jit_set_aot_mode, (MonoAotMode mode)) + +/* + * Returns whether the runtime was invoked for the purpose of AOT-compiling an + * assembly, i.e. no managed code will run. + */ +MONO_API_FUNCTION(mono_bool, mono_jit_aot_compiling, (void)) + +MONO_API_FUNCTION(void, mono_set_break_policy, (MonoBreakPolicyFunc policy_callback)) + +MONO_API_FUNCTION(void, mono_jit_parse_options, (int argc, char * argv[])) + +MONO_API_FUNCTION(char*, mono_get_runtime_build_info, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_set_use_llvm, (mono_bool use_llvm)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_aot_register_module, (void **aot_info)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_jit_thread_attach, (MonoDomain *domain)) diff --git a/Prism/vendor/mono/include/mono/jit/details/jit-types.h b/Prism/vendor/mono/include/mono/jit/details/jit-types.h new file mode 100644 index 0000000..53b7c3d --- /dev/null +++ b/Prism/vendor/mono/include/mono/jit/details/jit-types.h @@ -0,0 +1,61 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_JIT_TYPES_H +#define _MONO_JIT_TYPES_H + +#include + +MONO_BEGIN_DECLS + +/** + * Allows control over our AOT (Ahead-of-time) compilation mode. + */ +typedef enum { + /* Disables AOT mode */ + MONO_AOT_MODE_NONE, + /* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */ + MONO_AOT_MODE_NORMAL, + /* Enables hybrid AOT mode, JIT can still be used for wrappers */ + MONO_AOT_MODE_HYBRID, + /* Enables full AOT mode, JIT is disabled and not allowed, + * equivalent to mono_jit_set_aot_only (true) */ + MONO_AOT_MODE_FULL, + /* Same as LLVMONLY_INTERP */ + MONO_AOT_MODE_LLVMONLY, + /* + * Use interpreter only, no native code is generated + * at runtime. Trampolines are loaded from corlib aot image. + */ + MONO_AOT_MODE_INTERP, + /* Same as INTERP, but use only llvm compiled code */ + MONO_AOT_MODE_INTERP_LLVMONLY, + /* Use only llvm compiled code, fall back to the interpreter */ + MONO_AOT_MODE_LLVMONLY_INTERP, + /* Same as --interp */ + MONO_AOT_MODE_INTERP_ONLY, + /* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */ + MONO_AOT_MODE_LAST = 1000, +} MonoAotMode; + +/* Allow embedders to decide wherther to actually obey breakpoint instructions + * in specific methods (works for both break IL instructions and Debugger.Break () + * method calls). + */ +typedef enum { + /* the default is to always obey the breakpoint */ + MONO_BREAK_POLICY_ALWAYS, + /* a nop is inserted instead of a breakpoint */ + MONO_BREAK_POLICY_NEVER, + /* the breakpoint is executed only if the program has ben started under + * the debugger (that is if a debugger was attached at the time the method + * was compiled). + */ + MONO_BREAK_POLICY_ON_DBG +} MonoBreakPolicy; + +typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method); + +MONO_END_DECLS + +#endif /* _MONO_JIT_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/jit/details/mono-private-unstable-functions.h b/Prism/vendor/mono/include/mono/jit/details/mono-private-unstable-functions.h new file mode 100644 index 0000000..04076d5 --- /dev/null +++ b/Prism/vendor/mono/include/mono/jit/details/mono-private-unstable-functions.h @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +/** + * + * Private unstable APIs. + * + * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at + * any time. + * + */ +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_load_aot_data_hook, (MonoLoadAotDataFunc load_func, MonoFreeAotDataFunc free_func, void* user_data)) + +MONO_API_FUNCTION(int, monovm_initialize, (int propertyCount, const char **propertyKeys, const char **propertyValues)) + +MONO_API_FUNCTION(int, monovm_runtimeconfig_initialize, (MonovmRuntimeConfigArguments *arg, MonovmRuntimeConfigArgumentsCleanup cleanup_fn, void *user_data)) + +// The wrapper MonoCoreRuntimeProperties struct can be stack-allocated or freed, but the structs inside it _must_ be heap-allocated and never freed, as they are not copied to avoid extra allocations +MONO_API_FUNCTION(int, monovm_initialize_preparsed, (MonoCoreRuntimeProperties *parsed_properties, int propertyCount, const char **propertyKeys, const char **propertyValues)) + +//#ifdef HOST_WASM +MONO_API_FUNCTION(void, mono_wasm_install_get_native_to_interp_tramp, (MonoWasmGetNativeToInterpTramp cb)) +//#endif diff --git a/Prism/vendor/mono/include/mono/jit/details/mono-private-unstable-types.h b/Prism/vendor/mono/include/mono/jit/details/mono-private-unstable-types.h new file mode 100644 index 0000000..6439889 --- /dev/null +++ b/Prism/vendor/mono/include/mono/jit/details/mono-private-unstable-types.h @@ -0,0 +1,71 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +/** + * + * Private unstable APIs. + * + * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at + * any time. + * + */ +#ifndef _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H +#define _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H + +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef struct { + uint32_t kind; // 0 = Path of runtimeconfig.blob, 1 = pointer to image data, >= 2 undefined + union { + struct { + const char *path; + } name; + struct { + const char *data; + uint32_t data_len; + } data; + } runtimeconfig; +} MonovmRuntimeConfigArguments; + +typedef void (*MonovmRuntimeConfigArgumentsCleanup) (MonovmRuntimeConfigArguments *args, void *user_data); + +typedef struct { + uint32_t assembly_count; + char **basenames; /* Foo.dll */ + uint32_t *basename_lens; + char **assembly_filepaths; /* /blah/blah/blah/Foo.dll */ +} MonoCoreTrustedPlatformAssemblies; + +typedef struct { + uint32_t dir_count; + char **dirs; +} MonoCoreLookupPaths; + +typedef struct { + MonoCoreTrustedPlatformAssemblies *trusted_platform_assemblies; + MonoCoreLookupPaths *app_paths; + MonoCoreLookupPaths *native_dll_search_directories; + PInvokeOverrideFn pinvoke_override; +} MonoCoreRuntimeProperties; + +/* These are used to load the AOT data for aot images compiled with MONO_AOT_FILE_FLAG_SEPARATE_DATA */ +/* + * Return the AOT data for ASSEMBLY. SIZE is the size of the data. OUT_HANDLE should be set to a handle which is later + * passed to the free function. + */ +typedef unsigned char* (*MonoLoadAotDataFunc) (MonoAssembly *assembly, int size, void* user_data, void **out_handle); +/* Not yet used */ +typedef void (*MonoFreeAotDataFunc) (MonoAssembly *assembly, int size, void* user_data, void *handle); + +//#ifdef HOST_WASM +typedef void* (*MonoWasmGetNativeToInterpTramp) (MonoMethod *method, void *extra_arg); +typedef void* (*MonoWasmNativeToInterpCallback) (char * cookie); +//#endif + +MONO_END_DECLS + +#endif /* _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/jit/jit.h b/Prism/vendor/mono/include/mono/jit/jit.h new file mode 100644 index 0000000..8c5323f --- /dev/null +++ b/Prism/vendor/mono/include/mono/jit/jit.h @@ -0,0 +1,22 @@ +/** + * \file + * Author: + * Dietmar Maurer (dietmar@ximian.com) + * + * (C) 2001, 2002, 2003 Ximian, Inc. + */ + +#ifndef _MONO_JIT_JIT_H_ +#define _MONO_JIT_JIT_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif diff --git a/Prism/vendor/mono/include/mono/jit/mono-private-unstable.h b/Prism/vendor/mono/include/mono/jit/mono-private-unstable.h new file mode 100644 index 0000000..006c0cf --- /dev/null +++ b/Prism/vendor/mono/include/mono/jit/mono-private-unstable.h @@ -0,0 +1,25 @@ +/** + * \file + * + * Private unstable APIs. + * + * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at + * any time. + * + */ + + +#ifndef __MONO_JIT_MONO_PRIVATE_UNSTABLE_H__ +#define __MONO_JIT_MONO_PRIVATE_UNSTABLE_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /*__MONO_JIT_MONO_PRIVATE_UNSTABLE_H__*/ diff --git a/Prism/vendor/mono/include/mono/metadata/appdomain.h b/Prism/vendor/mono/include/mono/metadata/appdomain.h new file mode 100644 index 0000000..db135f1 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/appdomain.h @@ -0,0 +1,25 @@ +/** + * \file + * AppDomain functions + * + * Author: + * Dietmar Maurer (dietmar@ximian.com) + * + * (C) 2001 Ximian, Inc. + */ + +#ifndef _MONO_METADATA_APPDOMAIN_H_ +#define _MONO_METADATA_APPDOMAIN_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* _MONO_METADATA_APPDOMAIN_H_ */ + diff --git a/Prism/vendor/mono/include/mono/metadata/assembly.h b/Prism/vendor/mono/include/mono/metadata/assembly.h new file mode 100644 index 0000000..b528dc9 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/assembly.h @@ -0,0 +1,19 @@ +/** + * \file + */ + +#ifndef _MONONET_METADATA_ASSEMBLY_H_ +#define _MONONET_METADATA_ASSEMBLY_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif + diff --git a/Prism/vendor/mono/include/mono/metadata/attrdefs.h b/Prism/vendor/mono/include/mono/metadata/attrdefs.h new file mode 100644 index 0000000..a3a4749 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/attrdefs.h @@ -0,0 +1,274 @@ +/** + * \file + * This file contains the various definitions for constants + * found on the metadata tables + * + * Author: + * Miguel de Icaza (miguel@ximian.com) + * Paolo Molaro (lupus@ximian.com) + * + * (C) 2001 Ximian, Inc. + * (C) 2006 Novell, Inc. + * + * From the ECMA documentation + */ + +#ifndef _MONO_METADATA_ATTRDEFS_H_ +#define _MONO_METADATA_ATTRDEFS_H_ + +/* + * 23.1.1 Values for AssemblyHashAlgorithm + */ +enum { + MONO_ASSEMBLY_HASH_NONE, + MONO_ASSEMBLY_HASH_MD5 = 0x8003, + MONO_ASSEMBLY_HASH_SHA1 = 0x8004 +}; + +/* + * 23.1.2 AssemblyRefs + */ +enum { + MONO_ASSEMBLYREF_FULL_PUBLIC_KEY = 0x0001, + MONO_ASSEMBLYREF_RETARGETABLE = 0x0100, + MONO_ASSEMBLYREF_JIT_TRACKING = 0x8000, + MONO_ASSEMBLYREF_NO_JIT_OPT = 0x4000 +}; + +/* + * 23.1.4 Flags for Event.EventAttributes + */ +enum { + MONO_EVENT_SPECIALNAME = 0x0200, + MONO_EVENT_RTSPECIALNAME = 0x0400 +}; + +/* + * Field Attributes (23.1.5). + */ +enum { + MONO_FIELD_ATTR_FIELD_ACCESS_MASK = 0x0007, + MONO_FIELD_ATTR_COMPILER_CONTROLLED = 0x0000, + MONO_FIELD_ATTR_PRIVATE = 0x0001, + MONO_FIELD_ATTR_FAM_AND_ASSEM = 0x0002, + MONO_FIELD_ATTR_ASSEMBLY = 0x0003, + MONO_FIELD_ATTR_FAMILY = 0x0004, + MONO_FIELD_ATTR_FAM_OR_ASSEM = 0x0005, + MONO_FIELD_ATTR_PUBLIC = 0x0006, + + MONO_FIELD_ATTR_STATIC = 0x0010, + MONO_FIELD_ATTR_INIT_ONLY = 0x0020, + MONO_FIELD_ATTR_LITERAL = 0x0040, + MONO_FIELD_ATTR_NOT_SERIALIZED = 0x0080, + MONO_FIELD_ATTR_SPECIAL_NAME = 0x0200, + MONO_FIELD_ATTR_PINVOKE_IMPL = 0x2000, + +/* For runtime use only */ + MONO_FIELD_ATTR_RESERVED_MASK = 0x9500, + MONO_FIELD_ATTR_RT_SPECIAL_NAME = 0x0400, + MONO_FIELD_ATTR_HAS_MARSHAL = 0x1000, + MONO_FIELD_ATTR_HAS_DEFAULT = 0x8000, + MONO_FIELD_ATTR_HAS_RVA = 0x0100 +}; + +/* + * 23.1.6 Flags for FileAttributes + */ +enum { + MONO_FILE_HAS_METADATA = 0, + MONO_FILE_HAS_NO_METADATA = 1 +}; + +/* + * 23.1.7 Flags for generic parameters + */ +enum { + MONO_GEN_PARAM_VARIANCE_MASK = 0x0003, + MONO_GEN_PARAM_NON_VARIANT = 0x0000, + MONO_GEN_PARAM_VARIANT = 0x0001, + MONO_GEN_PARAM_COVARIANT = 0x0002, + MONO_GEN_PARAM_CONSTRAINT_MASK = 0x001c, + MONO_GEN_PARAM_CONSTRAINT_CLASS = 0x0004, + MONO_GEN_PARAM_CONSTRAINT_VTYPE = 0x0008, + MONO_GEN_PARAM_CONSTRAINT_DCTOR = 0x0010 +}; + +/* + * 23.1.8 Flags for ImplMap [PInvokeAttributes] + */ +enum { + MONO_PINVOKE_NO_MANGLE = 0x0001, + MONO_PINVOKE_CHAR_SET_MASK = 0x0006, + MONO_PINVOKE_CHAR_SET_NOT_SPEC = 0x0000, + MONO_PINVOKE_CHAR_SET_ANSI = 0x0002, + MONO_PINVOKE_CHAR_SET_UNICODE = 0x0004, + MONO_PINVOKE_CHAR_SET_AUTO = 0x0006, + MONO_PINVOKE_BEST_FIT_ENABLED = 0x0010, + MONO_PINVOKE_BEST_FIT_DISABLED = 0x0020, + MONO_PINVOKE_BEST_FIT_MASK = 0x0030, + MONO_PINVOKE_SUPPORTS_LAST_ERROR = 0x0040, + MONO_PINVOKE_CALL_CONV_MASK = 0x0700, + MONO_PINVOKE_CALL_CONV_WINAPI = 0x0100, + MONO_PINVOKE_CALL_CONV_CDECL = 0x0200, + MONO_PINVOKE_CALL_CONV_STDCALL = 0x0300, + MONO_PINVOKE_CALL_CONV_THISCALL = 0x0400, + MONO_PINVOKE_CALL_CONV_FASTCALL = 0x0500, + MONO_PINVOKE_THROW_ON_UNMAPPABLE_ENABLED = 0x1000, + MONO_PINVOKE_THROW_ON_UNMAPPABLE_DISABLED = 0x2000, + MONO_PINVOKE_THROW_ON_UNMAPPABLE_MASK = 0x3000, + MONO_PINVOKE_CALL_CONV_GENERIC = 0x0010, + MONO_PINVOKE_CALL_CONV_GENERICINST = 0x000a +}; + +/* + * 23.1.9 Flags for ManifestResource + */ +enum { + MONO_MANIFEST_RESOURCE_VISIBILITY_MASK = 0x00000007, + MONO_MANIFEST_RESOURCE_PUBLIC = 0x00000001, + MONO_MANIFEST_RESOURCE_PRIVATE = 0x00000002 +}; + +/* + * Method Attributes (23.1.10) + */ +enum { + MONO_METHOD_ATTR_ACCESS_MASK = 0x0007, + MONO_METHOD_ATTR_COMPILER_CONTROLLED = 0x0000, + MONO_METHOD_ATTR_PRIVATE = 0x0001, + MONO_METHOD_ATTR_FAM_AND_ASSEM = 0x0002, + MONO_METHOD_ATTR_ASSEM = 0x0003, + MONO_METHOD_ATTR_FAMILY = 0x0004, + MONO_METHOD_ATTR_FAM_OR_ASSEM = 0x0005, + MONO_METHOD_ATTR_PUBLIC = 0x0006, + + MONO_METHOD_ATTR_STATIC = 0x0010, + MONO_METHOD_ATTR_FINAL = 0x0020, + MONO_METHOD_ATTR_VIRTUAL = 0x0040, + MONO_METHOD_ATTR_HIDE_BY_SIG = 0x0080, + + MONO_METHOD_ATTR_VTABLE_LAYOUT_MASK = 0x0100, + MONO_METHOD_ATTR_REUSE_SLOT = 0x0000, + MONO_METHOD_ATTR_NEW_SLOT = 0x0100, + MONO_METHOD_ATTR_STRICT = 0x0200, + MONO_METHOD_ATTR_ABSTRACT = 0x0400, + + MONO_METHOD_ATTR_SPECIAL_NAME = 0x0800, + + MONO_METHOD_ATTR_PINVOKE_IMPL = 0x2000, + MONO_METHOD_ATTR_UNMANAGED_EXPORT = 0x0008, + +/* + * For runtime use only + */ + MONO_METHOD_ATTR_RESERVED_MASK = 0xd000, + MONO_METHOD_ATTR_RT_SPECIAL_NAME = 0x1000, + MONO_METHOD_ATTR_HAS_SECURITY = 0x4000, + MONO_METHOD_ATTR_REQUIRE_SEC_OBJECT = 0x8000 +}; + +/* + * Method Impl Attributes (23.1.11) + */ +enum { + MONO_METHOD_IMPL_ATTR_CODE_TYPE_MASK = 0x0003, + MONO_METHOD_IMPL_ATTR_IL = 0x0000, + MONO_METHOD_IMPL_ATTR_NATIVE = 0x0001, + MONO_METHOD_IMPL_ATTR_OPTIL = 0x0002, + MONO_METHOD_IMPL_ATTR_RUNTIME = 0x0003, + + MONO_METHOD_IMPL_ATTR_MANAGED_MASK = 0x0004, + MONO_METHOD_IMPL_ATTR_UNMANAGED = 0x0004, + MONO_METHOD_IMPL_ATTR_MANAGED = 0x0000, + + MONO_METHOD_IMPL_ATTR_FORWARD_REF = 0x0010, + MONO_METHOD_IMPL_ATTR_PRESERVE_SIG = 0x0080, + MONO_METHOD_IMPL_ATTR_INTERNAL_CALL = 0x1000, + MONO_METHOD_IMPL_ATTR_SYNCHRONIZED = 0x0020, + MONO_METHOD_IMPL_ATTR_NOINLINING = 0x0008, + MONO_METHOD_IMPL_ATTR_NOOPTIMIZATION = 0x0040, + MONO_METHOD_IMPL_ATTR_MAX_METHOD_IMPL_VAL = 0xffff +}; + +/* + * Method Semantics ([MethodSemanticAttributes]) 23.1.12, + */ +enum { + MONO_METHOD_SEMANTIC_SETTER = 0x0001, + MONO_METHOD_SEMANTIC_GETTER = 0x0002, + MONO_METHOD_SEMANTIC_OTHER = 0x0004, + MONO_METHOD_SEMANTIC_ADD_ON = 0x0008, + MONO_METHOD_SEMANTIC_REMOVE_ON = 0x0010, + MONO_METHOD_SEMANTIC_FIRE = 0x0020 +}; + +/* + * Flags for Params (23.1.13) + */ +enum { + MONO_PARAM_ATTR_IN = 0x0001, + MONO_PARAM_ATTR_OUT = 0x0002, + MONO_PARAM_ATTR_OPTIONAL = 0x0010, + MONO_PARAM_ATTR_RESERVED_MASK = 0xf000, + MONO_PARAM_ATTR_HAS_DEFAULT = 0x1000, + MONO_PARAM_ATTR_HAS_MARSHAL = 0x2000, + MONO_PARAM_ATTR_UNUSED = 0xcfe0 +}; + +/* + * 23.1.14 PropertyAttributes + */ +enum { + MONO_PROPERTY_ATTR_SPECIAL_NAME = 0x0200, + MONO_PROPERTY_ATTR_RESERVED_MASK = 0xf400, + MONO_PROPERTY_ATTR_RT_SPECIAL_NAME = 0x0400, + MONO_PROPERTY_ATTR_HAS_DEFAULT = 0x1000, + MONO_PROPERTY_ATTR_UNUSED = 0xe9ff +}; + +/* + * Type Attributes (23.1.15). + */ +enum { + MONO_TYPE_ATTR_VISIBILITY_MASK = 0x00000007, + MONO_TYPE_ATTR_NOT_PUBLIC = 0x00000000, + MONO_TYPE_ATTR_PUBLIC = 0x00000001, + MONO_TYPE_ATTR_NESTED_PUBLIC = 0x00000002, + MONO_TYPE_ATTR_NESTED_PRIVATE = 0x00000003, + MONO_TYPE_ATTR_NESTED_FAMILY = 0x00000004, + MONO_TYPE_ATTR_NESTED_ASSEMBLY = 0x00000005, + MONO_TYPE_ATTR_NESTED_FAM_AND_ASSEM = 0x00000006, + MONO_TYPE_ATTR_NESTED_FAM_OR_ASSEM = 0x00000007, + + MONO_TYPE_ATTR_LAYOUT_MASK = 0x00000018, + MONO_TYPE_ATTR_AUTO_LAYOUT = 0x00000000, + MONO_TYPE_ATTR_SEQUENTIAL_LAYOUT = 0x00000008, + MONO_TYPE_ATTR_EXPLICIT_LAYOUT = 0x00000010, + + MONO_TYPE_ATTR_CLASS_SEMANTIC_MASK = 0x00000020, + MONO_TYPE_ATTR_CLASS = 0x00000000, + MONO_TYPE_ATTR_INTERFACE = 0x00000020, + + MONO_TYPE_ATTR_ABSTRACT = 0x00000080, + MONO_TYPE_ATTR_SEALED = 0x00000100, + MONO_TYPE_ATTR_SPECIAL_NAME = 0x00000400, + + MONO_TYPE_ATTR_IMPORT = 0x00001000, + MONO_TYPE_ATTR_SERIALIZABLE = 0x00002000, + + MONO_TYPE_ATTR_STRING_FORMAT_MASK = 0x00030000, + MONO_TYPE_ATTR_ANSI_CLASS = 0x00000000, + MONO_TYPE_ATTR_UNICODE_CLASS = 0x00010000, + MONO_TYPE_ATTR_AUTO_CLASS = 0x00020000, + MONO_TYPE_ATTR_CUSTOM_CLASS = 0x00030000, + MONO_TYPE_ATTR_CUSTOM_MASK = 0x00c00000, + + MONO_TYPE_ATTR_BEFORE_FIELD_INIT = 0x00100000, + MONO_TYPE_ATTR_FORWARDER = 0x00200000, + + MONO_TYPE_ATTR_RESERVED_MASK = 0x00040800, + MONO_TYPE_ATTR_RT_SPECIAL_NAME = 0x00000800, + MONO_TYPE_ATTR_HAS_SECURITY = 0x00040000 +}; + +#endif diff --git a/Prism/vendor/mono/include/mono/metadata/blob.h b/Prism/vendor/mono/include/mono/metadata/blob.h new file mode 100644 index 0000000..7405d54 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/blob.h @@ -0,0 +1,118 @@ +/** + * \file + * Definitions used to pull information out of the Blob + * + */ +#ifndef _MONO_METADATA_BLOB_H_ +#define _MONO_METADATA_BLOB_H_ + +/* + * Encoding for type signatures used in the Metadata + */ +typedef enum { + MONO_TYPE_END = 0x00, /* End of List */ + MONO_TYPE_VOID = 0x01, + MONO_TYPE_BOOLEAN = 0x02, + MONO_TYPE_CHAR = 0x03, + MONO_TYPE_I1 = 0x04, + MONO_TYPE_U1 = 0x05, + MONO_TYPE_I2 = 0x06, + MONO_TYPE_U2 = 0x07, + MONO_TYPE_I4 = 0x08, + MONO_TYPE_U4 = 0x09, + MONO_TYPE_I8 = 0x0a, + MONO_TYPE_U8 = 0x0b, + MONO_TYPE_R4 = 0x0c, + MONO_TYPE_R8 = 0x0d, + MONO_TYPE_STRING = 0x0e, + MONO_TYPE_PTR = 0x0f, /* arg: token */ + MONO_TYPE_BYREF = 0x10, /* arg: token */ + MONO_TYPE_VALUETYPE = 0x11, /* arg: token */ + MONO_TYPE_CLASS = 0x12, /* arg: token */ + MONO_TYPE_VAR = 0x13, /* number */ + MONO_TYPE_ARRAY = 0x14, /* type, rank, boundsCount, bound1, loCount, lo1 */ + MONO_TYPE_GENERICINST= 0x15, /* \x{2026} */ + MONO_TYPE_TYPEDBYREF = 0x16, + MONO_TYPE_I = 0x18, + MONO_TYPE_U = 0x19, + MONO_TYPE_FNPTR = 0x1b, /* arg: full method signature */ + MONO_TYPE_OBJECT = 0x1c, + MONO_TYPE_SZARRAY = 0x1d, /* 0-based one-dim-array */ + MONO_TYPE_MVAR = 0x1e, /* number */ + MONO_TYPE_CMOD_REQD = 0x1f, /* arg: typedef or typeref token */ + MONO_TYPE_CMOD_OPT = 0x20, /* optional arg: typedef or typref token */ + MONO_TYPE_INTERNAL = 0x21, /* CLR internal type */ + + MONO_TYPE_MODIFIER = 0x40, /* Or with the following types */ + MONO_TYPE_SENTINEL = 0x41, /* Sentinel for varargs method signature */ + MONO_TYPE_PINNED = 0x45, /* Local var that points to pinned object */ + + MONO_TYPE_ENUM = 0x55 /* an enumeration */ +} MonoTypeEnum; + +typedef enum { + MONO_TABLE_MODULE, + MONO_TABLE_TYPEREF, + MONO_TABLE_TYPEDEF, + MONO_TABLE_FIELD_POINTER, + MONO_TABLE_FIELD, + MONO_TABLE_METHOD_POINTER, + MONO_TABLE_METHOD, + MONO_TABLE_PARAM_POINTER, + MONO_TABLE_PARAM, + MONO_TABLE_INTERFACEIMPL, + MONO_TABLE_MEMBERREF, /* 0xa */ + MONO_TABLE_CONSTANT, + MONO_TABLE_CUSTOMATTRIBUTE, + MONO_TABLE_FIELDMARSHAL, + MONO_TABLE_DECLSECURITY, + MONO_TABLE_CLASSLAYOUT, + MONO_TABLE_FIELDLAYOUT, /* 0x10 */ + MONO_TABLE_STANDALONESIG, + MONO_TABLE_EVENTMAP, + MONO_TABLE_EVENT_POINTER, + MONO_TABLE_EVENT, + MONO_TABLE_PROPERTYMAP, + MONO_TABLE_PROPERTY_POINTER, + MONO_TABLE_PROPERTY, + MONO_TABLE_METHODSEMANTICS, + MONO_TABLE_METHODIMPL, + MONO_TABLE_MODULEREF, /* 0x1a */ + MONO_TABLE_TYPESPEC, + MONO_TABLE_IMPLMAP, + MONO_TABLE_FIELDRVA, + MONO_TABLE_ENCLOG, + MONO_TABLE_ENCMAP, + MONO_TABLE_ASSEMBLY, /* 0x20 */ + MONO_TABLE_ASSEMBLYPROCESSOR, + MONO_TABLE_ASSEMBLYOS, + MONO_TABLE_ASSEMBLYREF, + MONO_TABLE_ASSEMBLYREFPROCESSOR, + MONO_TABLE_ASSEMBLYREFOS, + MONO_TABLE_FILE, + MONO_TABLE_EXPORTEDTYPE, + MONO_TABLE_MANIFESTRESOURCE, + MONO_TABLE_NESTEDCLASS, + MONO_TABLE_GENERICPARAM, /* 0x2a */ + MONO_TABLE_METHODSPEC, + MONO_TABLE_GENERICPARAMCONSTRAINT, + MONO_TABLE_UNUSED8, + MONO_TABLE_UNUSED9, + MONO_TABLE_UNUSED10, + /* Portable PDB tables */ + MONO_TABLE_DOCUMENT, /* 0x30 */ + MONO_TABLE_METHODBODY, + MONO_TABLE_LOCALSCOPE, + MONO_TABLE_LOCALVARIABLE, + MONO_TABLE_LOCALCONSTANT, + MONO_TABLE_IMPORTSCOPE, + MONO_TABLE_STATEMACHINEMETHOD, + MONO_TABLE_CUSTOMDEBUGINFORMATION + +#define MONO_TABLE_LAST MONO_TABLE_CUSTOMDEBUGINFORMATION +#define MONO_TABLE_NUM (MONO_TABLE_LAST + 1) + +} MonoMetaTableEnum; + +#endif + diff --git a/Prism/vendor/mono/include/mono/metadata/class.h b/Prism/vendor/mono/include/mono/metadata/class.h new file mode 100644 index 0000000..f343542 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/class.h @@ -0,0 +1,23 @@ +/** + * \file + */ + +#ifndef _MONO_CLI_CLASS_H_ +#define _MONO_CLI_CLASS_H_ + +#include +#include +#include +#include + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* _MONO_CLI_CLASS_H_ */ diff --git a/Prism/vendor/mono/include/mono/metadata/debug-helpers.h b/Prism/vendor/mono/include/mono/metadata/debug-helpers.h new file mode 100644 index 0000000..4f0bde1 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/debug-helpers.h @@ -0,0 +1,19 @@ +/** + * \file + */ + +#ifndef __MONO_DEBUG_HELPERS_H__ +#define __MONO_DEBUG_HELPERS_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_DEBUG_HELPERS_H__ */ + diff --git a/Prism/vendor/mono/include/mono/metadata/debug-mono-symfile.h b/Prism/vendor/mono/include/mono/metadata/debug-mono-symfile.h new file mode 100644 index 0000000..cebc943 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/debug-mono-symfile.h @@ -0,0 +1,114 @@ +/** + * \file + * This header is only installed for use by the debugger: + * the structures and the API declared here are not supported. + * Copyright 2012 Xamarin Inc (http://www.xamarin.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. + */ + +#ifndef __MONO_DEBUG_MONO_SYMFILE_H__ +#define __MONO_DEBUG_MONO_SYMFILE_H__ + +#include +#include +#include +#include +#include + +typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable; +typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry; +typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress; +typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable; +typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry; +typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry; + +/* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */ +struct MonoSymbolFileOffsetTable { + uint32_t _total_file_size; + uint32_t _data_section_offset; + uint32_t _data_section_size; + uint32_t _compile_unit_count; + uint32_t _compile_unit_table_offset; + uint32_t _compile_unit_table_size; + uint32_t _source_count; + uint32_t _source_table_offset; + uint32_t _source_table_size; + uint32_t _method_count; + uint32_t _method_table_offset; + uint32_t _method_table_size; + uint32_t _type_count; + uint32_t _anonymous_scope_count; + uint32_t _anonymous_scope_table_offset; + uint32_t _anonymous_scope_table_size; + uint32_t _line_number_table_line_base; + uint32_t _line_number_table_line_range; + uint32_t _line_number_table_opcode_base; + uint32_t _is_aspx_source; +}; + +struct MonoSymbolFileSourceEntry { + uint32_t _index; + uint32_t _data_offset; +}; + +struct MonoSymbolFileMethodEntry { + uint32_t _token; + uint32_t _data_offset; + uint32_t _line_number_table; +}; + +struct MonoSymbolFileMethodAddress { + uint32_t size; + const uint8_t *start_address; + const uint8_t *end_address; + const uint8_t *method_start_address; + const uint8_t *method_end_address; + const uint8_t *wrapper_address; + uint32_t has_this; + uint32_t num_params; + uint32_t variable_table_offset; + uint32_t type_table_offset; + uint32_t num_line_numbers; + uint32_t line_number_offset; + uint8_t data [MONO_ZERO_LEN_ARRAY]; +}; + +#define MONO_SYMBOL_FILE_MAJOR_VERSION 50 +#define MONO_SYMBOL_FILE_MINOR_VERSION 0 +#define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL + +MONO_BEGIN_DECLS + +MONO_API MonoSymbolFile * +mono_debug_open_mono_symbols (MonoDebugHandle *handle, + const uint8_t *raw_contents, + int size, + mono_bool in_the_debugger); + +MONO_API void +mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile); + +MONO_API mono_bool +mono_debug_symfile_is_loaded (MonoSymbolFile *symfile); + +MONO_API MonoDebugSourceLocation * +mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo, + uint32_t offset); + +MONO_API void +mono_debug_symfile_free_location (MonoDebugSourceLocation *location); + +MONO_API MonoDebugMethodInfo * +mono_debug_symfile_lookup_method (MonoDebugHandle *handle, + MonoMethod *method); + +MONO_API MonoDebugLocalsInfo* +mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo); + +void +mono_debug_symfile_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points); + +MONO_END_DECLS + +#endif /* __MONO_SYMFILE_H__ */ + diff --git a/Prism/vendor/mono/include/mono/metadata/details/appdomain-functions.h b/Prism/vendor/mono/include/mono/metadata/details/appdomain-functions.h new file mode 100644 index 0000000..ea290eb --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/appdomain-functions.h @@ -0,0 +1,146 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MonoDomain*, mono_init, (const char *root_domain_name)) + +/** + * This function is deprecated, use mono_init instead. Ignores filename parameter. + */ +MONO_API_FUNCTION(MonoDomain *, mono_init_from_assembly, (const char *root_domain_name, const char *filename)) + +/** + * This function is deprecated, use mono_init instead. Ignores version parameter. + */ +MONO_API_FUNCTION(MonoDomain *, mono_init_version, (const char *root_domain_name, const char *version)) + +MONO_API_FUNCTION(MonoDomain*, mono_get_root_domain, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_init, (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_cleanup, (MonoDomain *domain)) + +MONO_API_FUNCTION(void, mono_install_runtime_cleanup, (MonoDomainFunc func)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_quit, (void)) + +MONO_API_FUNCTION(void, mono_runtime_set_shutting_down, (void)) + +MONO_API_FUNCTION(mono_bool, mono_runtime_is_shutting_down, (void)) + +MONO_API_FUNCTION(const char*, mono_check_corlib_version, (void)) + +MONO_API_FUNCTION(MonoDomain *, mono_domain_create, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_create_appdomain, (char *friendly_name, char *configuration_file)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_set_config, (MonoDomain *domain, const char *base_dir, const char *config_file_name)) + +MONO_API_FUNCTION(MonoDomain *, mono_domain_get, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_get_by_id, (int32_t domainid)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int32_t, mono_domain_get_id, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char *, mono_domain_get_friendly_name, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_set, (MonoDomain *domain, mono_bool force)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_set_internal, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_unload, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_try_unload, (MonoDomain *domain, MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_is_unloading, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_from_appdomain, (MonoAppDomain *appdomain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_foreach, (MonoDomainFunc func, void* user_data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_domain_assembly_open, (MonoDomain *domain, const char *name)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_ensure_entry_assembly, (MonoDomain *domain, MonoAssembly *assembly)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_finalize, (MonoDomain *domain, uint32_t timeout)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_free, (MonoDomain *domain, mono_bool force)) + +MONO_API_FUNCTION(mono_bool, mono_domain_has_type_resolve, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly *, mono_domain_try_type_resolve, (MonoDomain *domain, char *name, MonoObject *tb)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_owns_vtable_slot, (MonoDomain *domain, void* vtable_slot)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_context_init, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_context_set, (MonoAppContext *new_context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAppContext *, mono_context_get, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_id, (MonoAppContext *context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_domain_id, (MonoAppContext *context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoJitInfo *, mono_jit_info_table_find, (MonoDomain *domain, void* addr)) + +/* MonoJitInfo accessors */ + +MONO_API_FUNCTION(void*, mono_jit_info_get_code_start, (MonoJitInfo* ji)) + +MONO_API_FUNCTION(int, mono_jit_info_get_code_size, (MonoJitInfo* ji)) + +MONO_API_FUNCTION(MonoMethod*, mono_jit_info_get_method, (MonoJitInfo* ji)) + + +MONO_API_FUNCTION(MonoImage*, mono_get_corlib, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_object_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_byte_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_void_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_boolean_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_sbyte_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_int16_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_uint16_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_int32_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_uint32_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_intptr_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_uintptr_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_int64_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_uint64_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_single_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_double_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_char_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_string_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_enum_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_array_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_thread_class, (void)) + +MONO_API_FUNCTION(MonoClass*, mono_get_exception_class, (void)) + +MONO_API_FUNCTION(void, mono_security_enable_core_clr, (void)) + +MONO_API_FUNCTION(void, mono_security_set_core_clr_platform_callback, (MonoCoreClrPlatformCB callback)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/appdomain-types.h b/Prism/vendor/mono/include/mono/metadata/details/appdomain-types.h new file mode 100644 index 0000000..b30eb3d --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/appdomain-types.h @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_APPDOMAIN_TYPES_H +#define _MONO_APPDOMAIN_TYPES_H + +#include +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef void (*MonoThreadStartCB) (intptr_t tid, void* stack_start, + void* func); +typedef void (*MonoThreadAttachCB) (intptr_t tid, void* stack_start); + +typedef struct _MonoAppDomain MonoAppDomain; + +typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data); + +typedef mono_bool (*MonoCoreClrPlatformCB) (const char *image_name); + +MONO_END_DECLS + +#endif /* _MONO_APPDOMAIN_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/assembly-functions.h b/Prism/vendor/mono/include/mono/metadata/details/assembly-functions.h new file mode 100644 index 0000000..df752b6 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/assembly-functions.h @@ -0,0 +1,84 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(void, mono_assemblies_init, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_assemblies_cleanup, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open, (const char *filename, MonoImageOpenStatus *status)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open_full, (const char *filename, MonoImageOpenStatus *status, mono_bool refonly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_full, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status, mono_bool refonly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from, (MonoImage *image, const char *fname, MonoImageOpenStatus *status)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from_full, (MonoImage *image, const char *fname, MonoImageOpenStatus *status, mono_bool refonly)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_with_partial_name, (const char *name, MonoImageOpenStatus *status)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded, (MonoAssemblyName *aname)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded_full, (MonoAssemblyName *aname, mono_bool refonly)) +MONO_API_FUNCTION(void, mono_assembly_get_assemblyref, (MonoImage *image, int index, MonoAssemblyName *aname)) +MONO_API_FUNCTION(void, mono_assembly_load_reference, (MonoImage *image, int index)) +MONO_API_FUNCTION(void, mono_assembly_load_references, (MonoImage *image, MonoImageOpenStatus *status)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage*, mono_assembly_load_module, (MonoAssembly *assembly, uint32_t idx)) +MONO_API_FUNCTION(void, mono_assembly_close, (MonoAssembly *assembly)) +MONO_API_FUNCTION(void, mono_assembly_foreach, (MonoFunc func, void* user_data)) +MONO_API_FUNCTION(void, mono_assembly_set_main, (MonoAssembly *assembly)) +MONO_API_FUNCTION(MonoAssembly *, mono_assembly_get_main, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_assembly_get_image, (MonoAssembly *assembly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssemblyName *, mono_assembly_get_name, (MonoAssembly *assembly)) +MONO_API_FUNCTION(mono_bool, mono_assembly_fill_assembly_name, (MonoImage *image, MonoAssemblyName *aname)) +MONO_API_FUNCTION(mono_bool, mono_assembly_names_equal, (MonoAssemblyName *l, MonoAssemblyName *r)) +MONO_API_FUNCTION(char*, mono_stringify_assembly_name, (MonoAssemblyName *aname)) + + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_load_hook, (MonoAssemblyLoadFunc func, void* user_data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_search_hook, (MonoAssemblySearchFunc func, void* user_data)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_invoke_search_hook, (MonoAssemblyName *aname)) + +/* + * Installs a new search function which is used as a last resort when loading + * an assembly fails. This could invoke AssemblyResolve events. + */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_search_hook, (MonoAssemblySearchFunc func, void* user_data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data)) + + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_assembly_invoke_load_hook, (MonoAssembly *ass)) + +MONO_API_FUNCTION(MonoAssemblyName*, mono_assembly_name_new, (const char *name)) +MONO_API_FUNCTION(const char*, mono_assembly_name_get_name, (MonoAssemblyName *aname)) +MONO_API_FUNCTION(const char*, mono_assembly_name_get_culture, (MonoAssemblyName *aname)) +MONO_API_FUNCTION(uint16_t, mono_assembly_name_get_version, (MonoAssemblyName *aname, uint16_t *minor, uint16_t *build, uint16_t *revision)) +MONO_API_FUNCTION(mono_byte*, mono_assembly_name_get_pubkeytoken, (MonoAssemblyName *aname)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_assembly_name_free, (MonoAssemblyName *aname)) + +MONO_API_FUNCTION(void, mono_register_bundled_assemblies, (const MonoBundledAssembly **assemblies)) +MONO_API_FUNCTION(void, mono_register_symfile_for_assembly, (const char* assembly_name, const mono_byte *raw_contents, int size)) +MONO_API_FUNCTION(const mono_byte *, mono_get_symfile_bytes_from_bundle, (const char* assembly_name, int *size)) + +MONO_API_FUNCTION(void, mono_set_assemblies_path, (const char* path)) + +/** + * These functions are deprecated. + */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_set_rootdir, (void)) // no-ops +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_set_dirs, (const char *assembly_dir, const char *config_dir)) // ignores config_dir parameter, use mono_set_assemblies_path instead +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY char *, mono_native_getrootdir, (void)) // returns the same value as mono_assembly_getrootdir +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_assembly_setrootdir, (const char *root_dir)) // use mono_set_assemblies_path instead +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MONO_CONST_RETURN char *, mono_assembly_getrootdir, (void)) + +/** + * These functions are deprecated and no-ops since app.config/machine.config handling is not available in dotnet/runtime. + */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_register_config_for_assembly, (const char* assembly_name, const char* config_xml)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_register_machine_config, (const char *config_xml)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/assembly-types.h b/Prism/vendor/mono/include/mono/metadata/details/assembly-types.h new file mode 100644 index 0000000..cfe8f43 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/assembly-types.h @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_ASSEMBLY_TYPES_H +#define _MONO_ASSEMBLY_TYPES_H + +#include +#include + +MONO_BEGIN_DECLS + +/* Installs a function which is called each time a new assembly is loaded. */ +typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, void* user_data); + +/* + * Installs a new function which is used to search the list of loaded + * assemblies for a given assembly name. + */ +typedef MonoAssembly *(*MonoAssemblySearchFunc) (MonoAssemblyName *aname, void* user_data); + +/* Installs a function which is called before a new assembly is loaded + * The hook are invoked from last hooked to first. If any of them returns + * a non-null value, that will be the value returned in mono_assembly_load */ +typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname, + char **assemblies_path, + void* user_data); + +typedef struct { + const char *name; + const unsigned char *data; + unsigned int size; +} MonoBundledAssembly; + + + +MONO_END_DECLS + +#endif /* _MONO_ASSEMBLY_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/class-functions.h b/Prism/vendor/mono/include/mono/metadata/details/class-functions.h new file mode 100644 index 0000000..3d71d16 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/class-functions.h @@ -0,0 +1,181 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get, (MonoImage *image, uint32_t type_token)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get_full, (MonoImage *image, uint32_t type_token, MonoGenericContext *context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_init, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoVTable *, mono_class_vtable, (MonoDomain *domain, MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name, (MonoImage *image, const char* name_space, const char *name)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name_case, (MonoImage *image, const char* name_space, const char *name)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name_flags, (MonoClass *klass, const char *name, int param_count, int flags)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_typeref, (MonoImage *image, uint32_t type_token)) + +MONO_API_FUNCTION(MonoClass *, mono_class_from_typeref_checked, (MonoImage *image, uint32_t type_token, MonoError *error)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_generic_parameter, (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_inflate_generic_type, (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_class_inflate_generic_method, (MonoMethod *method, MonoGenericContext *context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_inflated_method, (MonoMethod *method)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_field_from_token, (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_bounded_array_class_get, (MonoClass *element_class, uint32_t rank, mono_bool bounded)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_array_class_get, (MonoClass *element_class, uint32_t rank)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_ptr_class_get, (MonoType *type)) + +MONO_API_FUNCTION(MonoClassField *, mono_class_get_field, (MonoClass *klass, uint32_t field_token)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClassField *, mono_class_get_field_from_name, (MonoClass *klass, const char *name)) + +MONO_API_FUNCTION(uint32_t, mono_class_get_field_token, (MonoClassField *field)) + +MONO_API_FUNCTION(uint32_t, mono_class_get_event_token, (MonoEvent *event)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoProperty *, mono_class_get_property_from_name, (MonoClass *klass, const char *name)) + +MONO_API_FUNCTION(uint32_t, mono_class_get_property_token, (MonoProperty *prop)) + +MONO_API_FUNCTION(int32_t, mono_array_element_size, (MonoClass *ac)) + +MONO_API_FUNCTION(int32_t, mono_class_instance_size, (MonoClass *klass)) + +MONO_API_FUNCTION(int32_t, mono_class_array_element_size, (MonoClass *klass)) + +MONO_API_FUNCTION(int32_t, mono_class_data_size, (MonoClass *klass)) + +MONO_API_FUNCTION(int32_t, mono_class_value_size, (MonoClass *klass, uint32_t *align)) + +MONO_API_FUNCTION(int32_t, mono_class_min_align, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_mono_type, (MonoType *type)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_subclass_of, (MonoClass *klass, MonoClass *klassc, mono_bool check_interfaces)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_assignable_from, (MonoClass *klass, MonoClass *oklass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_ldtoken, (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context)) + +MONO_API_FUNCTION(char *, mono_type_get_name_full, (MonoType *type, MonoTypeNameFormat format)) + +MONO_API_FUNCTION(char*, mono_type_get_name, (MonoType *type)) + +MONO_API_FUNCTION(MonoType*, mono_type_get_underlying_type, (MonoType *type)) + +/* MonoClass accessors */ +MONO_API_FUNCTION(MonoImage*, mono_class_get_image, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_element_class, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_valuetype, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_enum, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_enum_basetype, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_parent, (MonoClass *klass)) + +MONO_API_FUNCTION(MonoClass*, mono_class_get_nesting_type, (MonoClass *klass)) + +MONO_API_FUNCTION(int, mono_class_get_rank, (MonoClass *klass)) + +MONO_API_FUNCTION(uint32_t, mono_class_get_flags, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_name, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_namespace, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_get_type, (MonoClass *klass)) + +MONO_API_FUNCTION(uint32_t, mono_class_get_type_token, (MonoClass *klass)) + +MONO_API_FUNCTION(MonoType*, mono_class_get_byref_type, (MonoClass *klass)) + +MONO_API_FUNCTION(int, mono_class_num_fields, (MonoClass *klass)) + +MONO_API_FUNCTION(int, mono_class_num_methods, (MonoClass *klass)) + +MONO_API_FUNCTION(int, mono_class_num_properties, (MonoClass *klass)) + +MONO_API_FUNCTION(int, mono_class_num_events, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_class_get_fields, (MonoClass* klass, void **iter)) + +MONO_API_FUNCTION(MonoMethod*, mono_class_get_methods, (MonoClass* klass, void **iter)) + +MONO_API_FUNCTION(MonoProperty*, mono_class_get_properties, (MonoClass* klass, void **iter)) + +MONO_API_FUNCTION(MonoEvent*, mono_class_get_events, (MonoClass* klass, void **iter)) + +MONO_API_FUNCTION(MonoClass*, mono_class_get_interfaces, (MonoClass* klass, void **iter)) + +MONO_API_FUNCTION(MonoClass*, mono_class_get_nested_types, (MonoClass* klass, void **iter)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_delegate, (MonoClass* klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_implements_interface, (MonoClass* klass, MonoClass* iface)) + +/* MonoClassField accessors */ +MONO_API_FUNCTION(const char*, mono_field_get_name, (MonoClassField *field)) + +MONO_API_FUNCTION(MonoType*, mono_field_get_type, (MonoClassField *field)) + +MONO_API_FUNCTION(MonoClass*, mono_field_get_parent, (MonoClassField *field)) + +MONO_API_FUNCTION(uint32_t, mono_field_get_flags, (MonoClassField *field)) + +MONO_API_FUNCTION(uint32_t, mono_field_get_offset, (MonoClassField *field)) + +MONO_API_FUNCTION(const char *, mono_field_get_data, (MonoClassField *field)) + +/* MonoProperty accessors */ +MONO_API_FUNCTION(const char*, mono_property_get_name, (MonoProperty *prop)) + +MONO_API_FUNCTION(MonoMethod*, mono_property_get_set_method, (MonoProperty *prop)) + +MONO_API_FUNCTION(MonoMethod*, mono_property_get_get_method, (MonoProperty *prop)) + +MONO_API_FUNCTION(MonoClass*, mono_property_get_parent, (MonoProperty *prop)) + +MONO_API_FUNCTION(uint32_t, mono_property_get_flags, (MonoProperty *prop)) + +/* MonoEvent accessors */ +MONO_API_FUNCTION(const char*, mono_event_get_name, (MonoEvent *event)) + +MONO_API_FUNCTION(MonoMethod*, mono_event_get_add_method, (MonoEvent *event)) + +MONO_API_FUNCTION(MonoMethod*, mono_event_get_remove_method, (MonoEvent *event)) + +MONO_API_FUNCTION(MonoMethod*, mono_event_get_raise_method, (MonoEvent *event)) + +MONO_API_FUNCTION(MonoClass*, mono_event_get_parent, (MonoEvent *event)) + +MONO_API_FUNCTION(uint32_t, mono_event_get_flags, (MonoEvent *event)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name, (MonoClass *klass, const char *name, int param_count)) + +MONO_API_FUNCTION(char *, mono_class_name_from_token, (MonoImage *image, uint32_t type_token)) + +MONO_API_FUNCTION(mono_bool, mono_method_can_access_field, (MonoMethod *method, MonoClassField *field)) + +MONO_API_FUNCTION(mono_bool, mono_method_can_access_method, (MonoMethod *method, MonoMethod *called)) + +MONO_API_FUNCTION(mono_bool, mono_class_is_nullable, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_nullable_param, (MonoClass *klass)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/class-types.h b/Prism/vendor/mono/include/mono/metadata/details/class-types.h new file mode 100644 index 0000000..716025e --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/class-types.h @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_CLASS_TYPES_H +#define _MONO_CLASS_TYPES_H + +#include +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef struct MonoVTable MonoVTable; + +typedef struct _MonoClassField MonoClassField; +typedef struct _MonoProperty MonoProperty; +typedef struct _MonoEvent MonoEvent; + +typedef enum { + MONO_TYPE_NAME_FORMAT_IL, + MONO_TYPE_NAME_FORMAT_REFLECTION, + MONO_TYPE_NAME_FORMAT_FULL_NAME, + MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED +} MonoTypeNameFormat; + +MONO_END_DECLS + +#endif /* _MONO_CLASS_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/debug-helpers-functions.h b/Prism/vendor/mono/include/mono/metadata/details/debug-helpers-functions.h new file mode 100644 index 0000000..de0ca6e --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/debug-helpers-functions.h @@ -0,0 +1,32 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(char*, mono_disasm_code_one, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte** endp)) +MONO_API_FUNCTION(char*, mono_disasm_code, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte* end)) + +MONO_API_FUNCTION(char*, mono_type_full_name, (MonoType *type)) + +MONO_API_FUNCTION(char*, mono_signature_get_desc, (MonoMethodSignature *sig, mono_bool include_namespace)) + +MONO_API_FUNCTION(char*, mono_context_get_desc, (MonoGenericContext *context)) + +MONO_API_FUNCTION(MonoMethodDesc*, mono_method_desc_new, (const char *name, mono_bool include_namespace)) +MONO_API_FUNCTION(MonoMethodDesc*, mono_method_desc_from_method, (MonoMethod *method)) +MONO_API_FUNCTION(void, mono_method_desc_free, (MonoMethodDesc *desc)) +MONO_API_FUNCTION(mono_bool, mono_method_desc_match, (MonoMethodDesc *desc, MonoMethod *method)) +MONO_API_FUNCTION(mono_bool, mono_method_desc_is_full, (MonoMethodDesc *desc)) +MONO_API_FUNCTION(mono_bool, mono_method_desc_full_match, (MonoMethodDesc *desc, MonoMethod *method)) +MONO_API_FUNCTION(MonoMethod*, mono_method_desc_search_in_class, (MonoMethodDesc *desc, MonoClass *klass)) +MONO_API_FUNCTION(MonoMethod*, mono_method_desc_search_in_image, (MonoMethodDesc *desc, MonoImage *image)) + +MONO_API_FUNCTION(char*, mono_method_full_name, (MonoMethod *method, mono_bool signature)) +MONO_API_FUNCTION(char*, mono_method_get_reflection_name, (MonoMethod *method)) + +MONO_API_FUNCTION(char*, mono_field_full_name, (MonoClassField *field)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_debugger_agent_unhandled_exception, (MonoException *e)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/debug-helpers-types.h b/Prism/vendor/mono/include/mono/metadata/details/debug-helpers-types.h new file mode 100644 index 0000000..ee73181 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/debug-helpers-types.h @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_DEBUG_HELPERS_TYPES_H +#define _MONO_DEBUG_HELPERS_TYPES_H + +#include + +MONO_BEGIN_DECLS + +typedef struct MonoDisHelper MonoDisHelper; + +typedef char* (*MonoDisIndenter) (MonoDisHelper *dh, MonoMethod *method, uint32_t ip_offset); +typedef char* (*MonoDisTokener) (MonoDisHelper *dh, MonoMethod *method, uint32_t token); + +struct MonoDisHelper { + const char *newline; + const char *label_format; + const char *label_target; + MonoDisIndenter indenter; + MonoDisTokener tokener; + void* user_data; +}; + +typedef struct MonoMethodDesc MonoMethodDesc; + +MONO_END_DECLS + +#endif /* _MONO_DEBUG_HELPERS_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/environment-functions.h b/Prism/vendor/mono/include/mono/metadata/details/environment-functions.h new file mode 100644 index 0000000..afdd61b --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/environment-functions.h @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(int32_t, mono_environment_exitcode_get, (void)) +MONO_API_FUNCTION(void, mono_environment_exitcode_set, (int32_t value)) + diff --git a/Prism/vendor/mono/include/mono/metadata/details/exception-functions.h b/Prism/vendor/mono/include/mono/metadata/details/exception-functions.h new file mode 100644 index 0000000..0644779 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/exception-functions.h @@ -0,0 +1,99 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MonoException *, mono_exception_from_name, (MonoImage *image, const char* name_space, const char *name)) + +MONO_API_FUNCTION(MonoException *, mono_exception_from_token, (MonoImage *image, uint32_t token)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_name_two_strings, (MonoImage *image, const char *name_space, const char *name, MonoString *a1, MonoString *a2)) + +MONO_API_FUNCTION(MonoException *, mono_exception_from_name_msg, (MonoImage *image, const char *name_space, const char *name, const char *msg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_token_two_strings, (MonoImage *image, uint32_t token, MonoString *a1, MonoString *a2)) + +MONO_API_FUNCTION(MonoException *, mono_exception_from_name_domain, (MonoDomain *domain, MonoImage *image, const char* name_space, const char *name)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_divide_by_zero, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_security, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_arithmetic, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_overflow, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_null_reference, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_execution_engine, (const char *msg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_thread_abort, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_state, (const char *msg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_interrupted, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_serialization, (const char *msg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_invalid_cast, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_invalid_operation, (const char *msg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_index_out_of_range, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_array_type_mismatch, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_type_load, (MonoString *class_name, char *assembly_name)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_method, (const char *class_name, const char *member_name)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_field, (const char *class_name, const char *member_name)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_not_implemented, (const char *msg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_not_supported, (const char *msg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException*, mono_get_exception_argument_null, (const char *arg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_argument, (const char *arg, const char *msg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_argument_out_of_range, (const char *arg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_io, (const char *msg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found, (MonoString *fname)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found2, (const char *msg, MonoString *fname)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_type_initialization, (const char *type_name, MonoException *inner)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_synchronization_lock, (const char *msg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_cannot_unload_appdomain, (const char *msg)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_appdomain_unloaded, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_bad_image_format, (const char *msg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_bad_image_format2, (const char *msg, MonoString *fname)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_stack_overflow, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_out_of_memory, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_field_access, (void)) + +MONO_API_FUNCTION(MonoException *, mono_get_exception_method_access, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_reflection_type_load, (MonoArray *types, MonoArray *exceptions)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_runtime_wrapped, (MonoObject *wrapped_exception)) + +/* Installs a function which is called when the runtime encounters an unhandled exception. + * This hook isn't expected to return. + * If no hook has been installed, the runtime will print a message before aborting. + */ +MONO_API_FUNCTION(void, mono_install_unhandled_exception_hook, (MonoUnhandledExceptionFunc func, void *user_data)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/exception-types.h b/Prism/vendor/mono/include/mono/metadata/details/exception-types.h new file mode 100644 index 0000000..640bc95 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/exception-types.h @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_EXCEPTION_TYPES_H +#define _MONO_EXCEPTION_TYPES_H + +#include +#include +#include + + +MONO_BEGIN_DECLS + +typedef void (*MonoUnhandledExceptionFunc) (MonoObject *exc, void *user_data); + +MONO_END_DECLS + +#endif /* _MONO_EXCEPTION_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/image-functions.h b/Prism/vendor/mono/include/mono/metadata/details/image-functions.h new file mode 100644 index 0000000..b857533 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/image-functions.h @@ -0,0 +1,57 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(void, mono_images_init, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_images_cleanup, (void)) + +MONO_API_FUNCTION(MonoImage *, mono_image_open, (const char *fname, MonoImageOpenStatus *status)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_full, (const char *fname, MonoImageOpenStatus *status, mono_bool refonly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_pe_file_open, (const char *fname, MonoImageOpenStatus *status)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_full, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_with_name, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly, const char *name)) +MONO_API_FUNCTION(void, mono_image_fixup_vtable, (MonoImage *image)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded, (const char *name)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_full, (const char *name, mono_bool refonly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid, (const char *guid)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid_full, (const char *guid, mono_bool refonly)) +MONO_API_FUNCTION(void, mono_image_init, (MonoImage *image)) +MONO_API_FUNCTION(void, mono_image_close, (MonoImage *image)) +MONO_API_FUNCTION(void, mono_image_addref, (MonoImage *image)) +MONO_API_FUNCTION(const char *, mono_image_strerror, (MonoImageOpenStatus status)) + +MONO_API_FUNCTION(int, mono_image_ensure_section, (MonoImage *image, const char *section)) +MONO_API_FUNCTION(int, mono_image_ensure_section_idx, (MonoImage *image, int section)) + +MONO_API_FUNCTION(uint32_t, mono_image_get_entry_point, (MonoImage *image)) +MONO_API_FUNCTION(const char *, mono_image_get_resource, (MonoImage *image, uint32_t offset, uint32_t *size)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_file_for_image, (MonoImage *image, int fileidx)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_module, (MonoImage *image, int idx)) + +MONO_API_FUNCTION(const char*, mono_image_get_name, (MonoImage *image)) +MONO_API_FUNCTION(const char*, mono_image_get_filename, (MonoImage *image)) +MONO_API_FUNCTION(const char*, mono_image_get_guid, (MonoImage *image)) +MONO_API_FUNCTION(MonoAssembly*, mono_image_get_assembly, (MonoImage *image)) +MONO_API_FUNCTION(mono_bool, mono_image_is_dynamic, (MonoImage *image)) +MONO_API_FUNCTION(char*, mono_image_rva_map, (MonoImage *image, uint32_t rva)) + +MONO_API_FUNCTION(const MonoTableInfo *, mono_image_get_table_info, (MonoImage *image, int table_id)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_image_get_table_rows, (MonoImage *image, int table_id)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_table_info_get_rows, (const MonoTableInfo *table)) + +/* This actually returns a MonoPEResourceDataEntry *, but declaring it + * causes an include file loop. + */ +MONO_API_FUNCTION(void*, mono_image_lookup_resource, (MonoImage *image, uint32_t res_id, uint32_t lang_id, mono_unichar2 *name)) + +MONO_API_FUNCTION(const char*, mono_image_get_public_key, (MonoImage *image, uint32_t *size)) +MONO_API_FUNCTION(const char*, mono_image_get_strong_name, (MonoImage *image, uint32_t *size)) +MONO_API_FUNCTION(uint32_t, mono_image_strong_name_position, (MonoImage *image, uint32_t *size)) +MONO_API_FUNCTION(void, mono_image_add_to_name_cache, (MonoImage *image, const char *nspace, const char *name, uint32_t idx)) +MONO_API_FUNCTION(mono_bool, mono_image_has_authenticode_entry, (MonoImage *image)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/image-types.h b/Prism/vendor/mono/include/mono/metadata/details/image-types.h new file mode 100644 index 0000000..5e0900b --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/image-types.h @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_IMAGE_TYPES_H +#define _MONO_IMAGE_TYPES_H + +#include +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef struct _MonoAssembly MonoAssembly; +typedef struct _MonoAssemblyName MonoAssemblyName; +typedef struct _MonoTableInfo MonoTableInfo; + +typedef enum { + MONO_IMAGE_OK, + MONO_IMAGE_ERROR_ERRNO, + MONO_IMAGE_MISSING_ASSEMBLYREF, + MONO_IMAGE_IMAGE_INVALID, + MONO_IMAGE_NOT_SUPPORTED, ///< \since net7 +} MonoImageOpenStatus; + + +MONO_END_DECLS + +#endif /* _MONO_IMAGE_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/loader-functions.h b/Prism/vendor/mono/include/mono/metadata/details/loader-functions.h new file mode 100644 index 0000000..11d86e7 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/loader-functions.h @@ -0,0 +1,64 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method, (MonoImage *image, uint32_t token, MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_full, (MonoImage *image, uint32_t token, MonoClass *klass, MonoGenericContext *context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_constrained, (MonoImage *image, uint32_t token, MonoClass *constrained_class, MonoGenericContext *context, MonoMethod **cil_method)) + +MONO_API_FUNCTION(void, mono_free_method, (MonoMethod *method)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature_full, (MonoMethod *method, MonoImage *image, uint32_t token, MonoGenericContext *context)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature, (MonoMethod *method, MonoImage *image, uint32_t token)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_signature, (MonoMethod *method)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodHeader*, mono_method_get_header, (MonoMethod *method)) + +MONO_API_FUNCTION(const char*, mono_method_get_name, (MonoMethod *method)) + +MONO_API_FUNCTION(MonoClass*, mono_method_get_class, (MonoMethod *method)) + +MONO_API_FUNCTION(uint32_t, mono_method_get_token, (MonoMethod *method)) + +MONO_API_FUNCTION(uint32_t, mono_method_get_flags, (MonoMethod *method, uint32_t *iflags)) + +MONO_API_FUNCTION(uint32_t, mono_method_get_index, (MonoMethod *method)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_add_internal_call, (const char *name, const void* method)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_dangerous_add_raw_internal_call, (const char *name, const void* method)) + +MONO_API_FUNCTION(void*, mono_lookup_internal_call, (MonoMethod *method)) + +MONO_API_FUNCTION(const char*, mono_lookup_icall_symbol, (MonoMethod *m)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_dllmap_insert, (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_lookup_pinvoke_call, (MonoMethod *method, const char **exc_class, const char **exc_arg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_method_get_param_names, (MonoMethod *method, const char **names)) + +MONO_API_FUNCTION(uint32_t, mono_method_get_param_token, (MonoMethod *method, int idx)) + +MONO_API_FUNCTION(void, mono_method_get_marshal_info, (MonoMethod *method, MonoMarshalSpec **mspecs)) + +MONO_API_FUNCTION(mono_bool, mono_method_has_marshal_info, (MonoMethod *method)) + +MONO_API_FUNCTION(MonoMethod*, mono_method_get_last_managed, (void)) + +MONO_API_FUNCTION(void, mono_stack_walk, (MonoStackWalk func, void* user_data)) + +/* Use this if the IL offset is not needed: it's faster */ +MONO_API_FUNCTION(void, mono_stack_walk_no_il, (MonoStackWalk func, void* user_data)) + +MONO_API_FUNCTION(void, mono_stack_walk_async_safe, (MonoStackWalkAsyncSafe func, void *initial_sig_context, void* user_data)) + +MONO_API_FUNCTION(MonoMethodHeader*, mono_method_get_header_checked, (MonoMethod *method, MonoError *error)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/loader-types.h b/Prism/vendor/mono/include/mono/metadata/details/loader-types.h new file mode 100644 index 0000000..9e266d4 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/loader-types.h @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_LOADER_TYPES_H +#define _MONO_LOADER_TYPES_H + +#include +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef mono_bool (*MonoStackWalk) (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data); + +typedef mono_bool (*MonoStackWalkAsyncSafe) (MonoMethod *method, MonoDomain *domain, void *base_address, int offset, void* data); + +MONO_END_DECLS + +#endif /* _MONO_LOADER_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/metadata-functions.h b/Prism/vendor/mono/include/mono/metadata/details/metadata-functions.h new file mode 100644 index 0000000..3b665f2 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/metadata-functions.h @@ -0,0 +1,159 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + + +MONO_API_FUNCTION(void, mono_metadata_init, (void)) + +MONO_API_FUNCTION(void, mono_metadata_decode_row, (const MonoTableInfo *t, int idx, uint32_t *res, int res_size)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_decode_row_col, (const MonoTableInfo *t, int idx, unsigned int col)) + +MONO_API_FUNCTION(int, mono_metadata_compute_size, (MonoImage *meta, int tableindex, uint32_t *result_bitfield)) + +/* + * + */ +MONO_API_FUNCTION(const char *, mono_metadata_locate, (MonoImage *meta, int table, int idx)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char *, mono_metadata_locate_token, (MonoImage *meta, uint32_t token)) + +MONO_API_FUNCTION(const char *, mono_metadata_string_heap, (MonoImage *meta, uint32_t table_index)) +MONO_API_FUNCTION(const char *, mono_metadata_blob_heap, (MonoImage *meta, uint32_t table_index)) +MONO_API_FUNCTION(const char *, mono_metadata_user_string, (MonoImage *meta, uint32_t table_index)) +MONO_API_FUNCTION(const char *, mono_metadata_guid_heap, (MonoImage *meta, uint32_t table_index)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_typedef_from_field, (MonoImage *meta, uint32_t table_index)) +MONO_API_FUNCTION(uint32_t, mono_metadata_typedef_from_method, (MonoImage *meta, uint32_t table_index)) +MONO_API_FUNCTION(uint32_t, mono_metadata_nested_in_typedef, (MonoImage *meta, uint32_t table_index)) +MONO_API_FUNCTION(uint32_t, mono_metadata_nesting_typedef, (MonoImage *meta, uint32_t table_index, uint32_t start_index)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass**, mono_metadata_interfaces_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *count)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_events_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end_idx)) +MONO_API_FUNCTION(uint32_t, mono_metadata_methods_from_event, (MonoImage *meta, uint32_t table_index, unsigned int *end)) +MONO_API_FUNCTION(uint32_t, mono_metadata_properties_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end)) +MONO_API_FUNCTION(uint32_t, mono_metadata_methods_from_property, (MonoImage *meta, uint32_t table_index, unsigned int *end)) +MONO_API_FUNCTION(uint32_t, mono_metadata_packing_from_typedef, (MonoImage *meta, uint32_t table_index, uint32_t *packing, uint32_t *size)) +MONO_API_FUNCTION(const char*, mono_metadata_get_marshal_info, (MonoImage *meta, uint32_t idx, mono_bool is_field)) +MONO_API_FUNCTION(uint32_t, mono_metadata_custom_attrs_from_index, (MonoImage *meta, uint32_t cattr_index)) + +MONO_API_FUNCTION(MonoMarshalSpec *, mono_metadata_parse_marshal_spec, (MonoImage *image, const char *ptr)) + +MONO_API_FUNCTION(void, mono_metadata_free_marshal_spec, (MonoMarshalSpec *spec)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_implmap_from_method, (MonoImage *meta, uint32_t method_idx)) + +MONO_API_FUNCTION(void, mono_metadata_field_info, (MonoImage *meta, uint32_t table_index, uint32_t *offset, uint32_t *rva, MonoMarshalSpec **marshal_spec)) +MONO_API_FUNCTION(uint32_t, mono_metadata_get_constant_index, (MonoImage *meta, uint32_t token, uint32_t hint)) + +/* + * Functions to extract information from the Blobs + */ +MONO_API_FUNCTION(uint32_t, mono_metadata_decode_value, (const char *ptr, const char **rptr)) +MONO_API_FUNCTION(int32_t, mono_metadata_decode_signed_value, (const char *ptr, const char **rptr)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_decode_blob_size, (const char *ptr, const char **rptr)) + +MONO_API_FUNCTION(void, mono_metadata_encode_value, (uint32_t value, char *bug, char **endbuf)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_type_is_byref, (MonoType *type)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_type_get_type, (MonoType *type)) + +/* For MONO_TYPE_FNPTR */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_type_get_signature, (MonoType *type)) + +/* For MONO_TYPE_CLASS, VALUETYPE */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_type_get_class, (MonoType *type)) + +MONO_API_FUNCTION(MonoArrayType*, mono_type_get_array_type, (MonoType *type)) + +/* For MONO_TYPE_PTR */ +MONO_API_FUNCTION(MonoType*, mono_type_get_ptr_type, (MonoType *type)) + +MONO_API_FUNCTION(MonoClass*, mono_type_get_modifiers, (MonoType *type, mono_bool *is_required, void **iter)) + +MONO_API_FUNCTION(mono_bool, mono_type_is_struct, (MonoType *type)) +MONO_API_FUNCTION(mono_bool, mono_type_is_void, (MonoType *type)) +MONO_API_FUNCTION(mono_bool, mono_type_is_pointer, (MonoType *type)) +MONO_API_FUNCTION(mono_bool, mono_type_is_reference, (MonoType *type)) +MONO_API_FUNCTION(mono_bool, mono_type_is_generic_parameter, (MonoType *type)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_return_type, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_params, (MonoMethodSignature *sig, void **iter)) + +MONO_API_FUNCTION(uint32_t, mono_signature_get_param_count, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(uint32_t, mono_signature_get_call_conv, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(int, mono_signature_vararg_start, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(mono_bool, mono_signature_is_instance, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(mono_bool, mono_signature_explicit_this, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(mono_bool, mono_signature_param_is_out, (MonoMethodSignature *sig, int param_num)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_parse_typedef_or_ref, (MonoImage *m, const char *ptr, const char **rptr)) +MONO_API_FUNCTION(int, mono_metadata_parse_custom_mod, (MonoImage *m, MonoCustomMod *dest, const char *ptr, const char **rptr)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArrayType *, mono_metadata_parse_array, (MonoImage *m, const char *ptr, const char **rptr)) +MONO_API_FUNCTION(void, mono_metadata_free_array, (MonoArrayType *array)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_type, (MonoImage *m, MonoParseTypeMode mode, short opt_attrs, const char *ptr, const char **rptr)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_param, (MonoImage *m, const char *ptr, const char **rptr)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_field_type, (MonoImage *m, short field_flags, const char *ptr, const char **rptr)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_type_create_from_typespec, (MonoImage *image, uint32_t type_spec)) +MONO_API_FUNCTION(void, mono_metadata_free_type, (MonoType *type)) +MONO_API_FUNCTION(int, mono_type_size, (MonoType *type, int *alignment)) +MONO_API_FUNCTION(int, mono_type_stack_size, (MonoType *type, int *alignment)) + +MONO_API_FUNCTION(mono_bool, mono_type_generic_inst_is_valuetype, (MonoType *type)) +MONO_API_FUNCTION(mono_bool, mono_metadata_generic_class_is_valuetype, (MonoGenericClass *gclass)) + +MONO_API_FUNCTION(unsigned int, mono_metadata_type_hash, (MonoType *t1)) +MONO_API_FUNCTION(mono_bool, mono_metadata_type_equal, (MonoType *t1, MonoType *t2)) + +MONO_API_FUNCTION(MonoMethodSignature *, mono_metadata_signature_alloc, (MonoImage *image, uint32_t nparams)) + +MONO_API_FUNCTION(MonoMethodSignature *, mono_metadata_signature_dup, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_signature, (MonoImage *image, uint32_t token)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_method_signature, (MonoImage *m, int def, const char *ptr, const char **rptr)) +MONO_API_FUNCTION(void, mono_metadata_free_method_signature, (MonoMethodSignature *method)) + +MONO_API_FUNCTION(mono_bool, mono_metadata_signature_equal, (MonoMethodSignature *sig1, MonoMethodSignature *sig2)) + +MONO_API_FUNCTION(unsigned int, mono_signature_hash, (MonoMethodSignature *sig)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodHeader *, mono_metadata_parse_mh, (MonoImage *m, const char *ptr)) +MONO_API_FUNCTION(void, mono_metadata_free_mh, (MonoMethodHeader *mh)) + +/* MonoMethodHeader accessors */ +MONO_API_FUNCTION(const unsigned char*, mono_method_header_get_code, (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack)) + +MONO_API_FUNCTION(MonoType**, mono_method_header_get_locals, (MonoMethodHeader *header, uint32_t* num_locals, mono_bool *init_locals)) + +MONO_API_FUNCTION(int, mono_method_header_get_num_clauses, (MonoMethodHeader *header)) + +MONO_API_FUNCTION(int, mono_method_header_get_clauses, (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause)) + +MONO_API_FUNCTION(uint32_t, mono_type_to_unmanaged, (MonoType *type, MonoMarshalSpec *mspec, mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_token_from_dor, (uint32_t dor_index)) + +MONO_API_FUNCTION(char *, mono_guid_to_string, (const uint8_t *guid)) + +MONO_API_FUNCTION(char *, mono_guid_to_string_minimal, (const uint8_t *guid)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_declsec_from_index, (MonoImage *meta, uint32_t idx)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_translate_token_index, (MonoImage *image, int table, uint32_t idx)) + +MONO_API_FUNCTION(void, mono_metadata_decode_table_row, (MonoImage *image, int table, int idx, uint32_t *res, int res_size)) + +MONO_API_FUNCTION(uint32_t, mono_metadata_decode_table_row_col, (MonoImage *image, int table, int idx, unsigned int col)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/metadata-types.h b/Prism/vendor/mono/include/mono/metadata/details/metadata-types.h new file mode 100644 index 0000000..7ae6ab2 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/metadata-types.h @@ -0,0 +1,257 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_METADATA_TYPES_H +#define _MONO_METADATA_TYPES_H + + +#include + +#include +#include +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef enum { + MONO_EXCEPTION_CLAUSE_NONE, + MONO_EXCEPTION_CLAUSE_FILTER, + MONO_EXCEPTION_CLAUSE_FINALLY, + MONO_EXCEPTION_CLAUSE_FAULT = 4 +} MonoExceptionEnum; + +typedef enum { + MONO_CALL_DEFAULT, + MONO_CALL_C, + MONO_CALL_STDCALL, + MONO_CALL_THISCALL, + MONO_CALL_FASTCALL, + MONO_CALL_VARARG = 0x05, + /* unused, */ + /* unused, */ + /* unused, */ + MONO_CALL_UNMANAGED_MD = 0x09, /* default unmanaged calling convention, with additional attributed encoded in modopts */ +} MonoCallConvention; + +/* ECMA lamespec: the old spec had more info... */ +typedef enum { + MONO_NATIVE_BOOLEAN = 0x02, /* 4 bytes, 0 is false, != 0 is true */ + MONO_NATIVE_I1 = 0x03, + MONO_NATIVE_U1 = 0x04, + MONO_NATIVE_I2 = 0x05, + MONO_NATIVE_U2 = 0x06, + MONO_NATIVE_I4 = 0x07, + MONO_NATIVE_U4 = 0x08, + MONO_NATIVE_I8 = 0x09, + MONO_NATIVE_U8 = 0x0a, + MONO_NATIVE_R4 = 0x0b, + MONO_NATIVE_R8 = 0x0c, + MONO_NATIVE_CURRENCY = 0x0f, + MONO_NATIVE_BSTR = 0x13, /* prefixed length, Unicode */ + MONO_NATIVE_LPSTR = 0x14, /* ANSI, null terminated */ + MONO_NATIVE_LPWSTR = 0x15, /* UNICODE, null terminated */ + MONO_NATIVE_LPTSTR = 0x16, /* platform dep., null terminated */ + MONO_NATIVE_BYVALTSTR = 0x17, + MONO_NATIVE_IUNKNOWN = 0x19, + MONO_NATIVE_IDISPATCH = 0x1a, + MONO_NATIVE_STRUCT = 0x1b, + MONO_NATIVE_INTERFACE = 0x1c, + MONO_NATIVE_SAFEARRAY = 0x1d, + MONO_NATIVE_BYVALARRAY = 0x1e, + MONO_NATIVE_INT = 0x1f, + MONO_NATIVE_UINT = 0x20, + MONO_NATIVE_VBBYREFSTR = 0x22, + MONO_NATIVE_ANSIBSTR = 0x23, /* prefixed length, ANSI */ + MONO_NATIVE_TBSTR = 0x24, /* prefixed length, platform dep. */ + MONO_NATIVE_VARIANTBOOL = 0x25, + MONO_NATIVE_FUNC = 0x26, + MONO_NATIVE_ASANY = 0x28, + MONO_NATIVE_LPARRAY = 0x2a, + MONO_NATIVE_LPSTRUCT = 0x2b, + MONO_NATIVE_CUSTOM = 0x2c, + MONO_NATIVE_ERROR = 0x2d, + // TODO: MONO_NATIVE_IINSPECTABLE = 0x2e + // TODO: MONO_NATIVE_HSTRING = 0x2f + MONO_NATIVE_UTF8STR = 0x30, + MONO_NATIVE_MAX = 0x50 /* no info */ +} MonoMarshalNative; + +/* Used only in context of SafeArray */ +typedef enum { + MONO_VARIANT_EMPTY = 0x00, + MONO_VARIANT_NULL = 0x01, + MONO_VARIANT_I2 = 0x02, + MONO_VARIANT_I4 = 0x03, + MONO_VARIANT_R4 = 0x04, + MONO_VARIANT_R8 = 0x05, + MONO_VARIANT_CY = 0x06, + MONO_VARIANT_DATE = 0x07, + MONO_VARIANT_BSTR = 0x08, + MONO_VARIANT_DISPATCH = 0x09, + MONO_VARIANT_ERROR = 0x0a, + MONO_VARIANT_BOOL = 0x0b, + MONO_VARIANT_VARIANT = 0x0c, + MONO_VARIANT_UNKNOWN = 0x0d, + MONO_VARIANT_DECIMAL = 0x0e, + MONO_VARIANT_I1 = 0x10, + MONO_VARIANT_UI1 = 0x11, + MONO_VARIANT_UI2 = 0x12, + MONO_VARIANT_UI4 = 0x13, + MONO_VARIANT_I8 = 0x14, + MONO_VARIANT_UI8 = 0x15, + MONO_VARIANT_INT = 0x16, + MONO_VARIANT_UINT = 0x17, + MONO_VARIANT_VOID = 0x18, + MONO_VARIANT_HRESULT = 0x19, + MONO_VARIANT_PTR = 0x1a, + MONO_VARIANT_SAFEARRAY = 0x1b, + MONO_VARIANT_CARRAY = 0x1c, + MONO_VARIANT_USERDEFINED = 0x1d, + MONO_VARIANT_LPSTR = 0x1e, + MONO_VARIANT_LPWSTR = 0x1f, + MONO_VARIANT_RECORD = 0x24, + MONO_VARIANT_FILETIME = 0x40, + MONO_VARIANT_BLOB = 0x41, + MONO_VARIANT_STREAM = 0x42, + MONO_VARIANT_STORAGE = 0x43, + MONO_VARIANT_STREAMED_OBJECT = 0x44, + MONO_VARIANT_STORED_OBJECT = 0x45, + MONO_VARIANT_BLOB_OBJECT = 0x46, + MONO_VARIANT_CF = 0x47, + MONO_VARIANT_CLSID = 0x48, + MONO_VARIANT_VECTOR = 0x1000, + MONO_VARIANT_ARRAY = 0x2000, + MONO_VARIANT_BYREF = 0x4000 +} MonoMarshalVariant; + +typedef enum { + MONO_MARSHAL_CONV_NONE, + MONO_MARSHAL_CONV_BOOL_VARIANTBOOL, + MONO_MARSHAL_CONV_BOOL_I4, + MONO_MARSHAL_CONV_STR_BSTR, + MONO_MARSHAL_CONV_STR_LPSTR, + MONO_MARSHAL_CONV_LPSTR_STR, + MONO_MARSHAL_CONV_LPTSTR_STR, + MONO_MARSHAL_CONV_STR_LPWSTR, + MONO_MARSHAL_CONV_LPWSTR_STR, + MONO_MARSHAL_CONV_STR_LPTSTR, + MONO_MARSHAL_CONV_STR_ANSIBSTR, + MONO_MARSHAL_CONV_STR_TBSTR, + MONO_MARSHAL_CONV_STR_BYVALSTR, + MONO_MARSHAL_CONV_STR_BYVALWSTR, + MONO_MARSHAL_CONV_SB_LPSTR, + MONO_MARSHAL_CONV_SB_LPTSTR, + MONO_MARSHAL_CONV_SB_LPWSTR, + MONO_MARSHAL_CONV_LPSTR_SB, + MONO_MARSHAL_CONV_LPTSTR_SB, + MONO_MARSHAL_CONV_LPWSTR_SB, + MONO_MARSHAL_CONV_ARRAY_BYVALARRAY, + MONO_MARSHAL_CONV_ARRAY_BYVALCHARARRAY, + MONO_MARSHAL_CONV_ARRAY_SAVEARRAY, + MONO_MARSHAL_CONV_ARRAY_LPARRAY, + MONO_MARSHAL_FREE_LPARRAY, + MONO_MARSHAL_CONV_OBJECT_INTERFACE, + MONO_MARSHAL_CONV_OBJECT_IDISPATCH, + MONO_MARSHAL_CONV_OBJECT_IUNKNOWN, + MONO_MARSHAL_CONV_OBJECT_STRUCT, + MONO_MARSHAL_CONV_DEL_FTN, + MONO_MARSHAL_CONV_FTN_DEL, + MONO_MARSHAL_FREE_ARRAY, + MONO_MARSHAL_CONV_BSTR_STR, + MONO_MARSHAL_CONV_SAFEHANDLE, + MONO_MARSHAL_CONV_HANDLEREF, + MONO_MARSHAL_CONV_STR_UTF8STR, + MONO_MARSHAL_CONV_SB_UTF8STR, + MONO_MARSHAL_CONV_UTF8STR_STR, + MONO_MARSHAL_CONV_UTF8STR_SB, + MONO_MARSHAL_CONV_FIXED_BUFFER, + MONO_MARSHAL_CONV_ANSIBSTR_STR, + MONO_MARSHAL_CONV_TBSTR_STR +} MonoMarshalConv; + +#define MONO_MARSHAL_CONV_INVALID ((MonoMarshalConv)-1) + +typedef struct { + MonoMarshalNative native; + union { + struct { + MonoMarshalNative elem_type; + int32_t num_elem; /* -1 if not set */ + int16_t param_num; /* -1 if not set */ + int16_t elem_mult; /* -1 if not set */ + } array_data; + struct { + char *custom_name; + char *cookie; + MonoImage *image; + } custom_data; + struct { + MonoMarshalVariant elem_type; + int32_t num_elem; + } safearray_data; + } data; +} MonoMarshalSpec; + +typedef struct { + uint32_t flags; + uint32_t try_offset; + uint32_t try_len; + uint32_t handler_offset; + uint32_t handler_len; + union { + uint32_t filter_offset; + MonoClass *catch_class; + } data; +} MonoExceptionClause; + +typedef struct _MonoType MonoType; +typedef struct _MonoGenericInst MonoGenericInst; +typedef struct _MonoGenericClass MonoGenericClass; +typedef struct _MonoGenericContext MonoGenericContext; +typedef struct _MonoGenericContainer MonoGenericContainer; +typedef struct _MonoGenericParam MonoGenericParam; +typedef struct _MonoArrayType MonoArrayType; +typedef struct _MonoMethodSignature MonoMethodSignature; + +/* FIXME: Keeping this name alive for now, since it is part of the exposed API, even though no entrypoint uses it. */ +typedef struct invalid_name MonoGenericMethod; + +typedef struct { + unsigned int required : 1; + unsigned int token : 31; +} MonoCustomMod; + +typedef struct _MonoCustomModContainer { + uint8_t count; /* max 64 modifiers follow at the end */ + MonoImage *image; /* Image containing types in modifiers array */ + MonoCustomMod modifiers [1]; /* Actual length is count */ +} MonoCustomModContainer; + +struct _MonoArrayType { + MonoClass *eklass; + // Number of dimensions of the array + uint8_t rank; + + // Arrays recording known upper and lower index bounds for each dimension + uint8_t numsizes; + uint8_t numlobounds; + int *sizes; + int *lobounds; +}; + +typedef struct _MonoMethodHeader MonoMethodHeader; + +typedef enum { + MONO_PARSE_TYPE, + MONO_PARSE_MOD_TYPE, + MONO_PARSE_LOCAL, + MONO_PARSE_PARAM, + MONO_PARSE_RET, + MONO_PARSE_FIELD +} MonoParseTypeMode; + +MONO_END_DECLS + +#endif /* _MONO_METADATA_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-config-functions.h b/Prism/vendor/mono/include/mono/metadata/details/mono-config-functions.h new file mode 100644 index 0000000..3f25e3b --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-config-functions.h @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(const char *, mono_config_get_os, (void)) +MONO_API_FUNCTION(const char *, mono_config_get_cpu, (void)) +MONO_API_FUNCTION(const char *, mono_config_get_wordsize, (void)) + +/** + * These functions are no-ops since app.config/machine.config handling is not available in dotnet/runtime. + */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char*, mono_get_config_dir, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_set_config_dir, (const char *dir)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char *, mono_get_machine_config, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_config_cleanup, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_config_parse, (const char *filename)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_config_for_assembly, (MonoImage *assembly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_config_parse_memory, (const char *buffer)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char*, mono_config_string_for_assembly_file, (const char *filename)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_config_set_server_mode, (mono_bool server_mode)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_config_is_server_mode, (void)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-config-types.h b/Prism/vendor/mono/include/mono/metadata/details/mono-config-types.h new file mode 100644 index 0000000..1832f5b --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-config-types.h @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_METADATA_CONFIG_TYPES_H +#define _MONO_METADATA_CONFIG_TYPES_H + +#include +#include + +MONO_BEGIN_DECLS + +MONO_END_DECLS + +#endif /* _MONO_METADATA_CONFIG_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-debug-functions.h b/Prism/vendor/mono/include/mono/metadata/details/mono-debug-functions.h new file mode 100644 index 0000000..1ef12f7 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-debug-functions.h @@ -0,0 +1,65 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(mono_bool, mono_debug_enabled, (void)) + +MONO_API_FUNCTION(void, mono_debug_init, (MonoDebugFormat format)) +MONO_API_FUNCTION(void, mono_debug_open_image_from_memory, (MonoImage *image, const mono_byte *raw_contents, int size)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_debug_cleanup, (void)) + +MONO_API_FUNCTION(void, mono_debug_close_image, (MonoImage *image)) + +MONO_API_FUNCTION(void, mono_debug_domain_unload, (MonoDomain *domain)) +MONO_API_FUNCTION(void, mono_debug_domain_create, (MonoDomain *domain)) + +MONO_API_FUNCTION(MonoDebugMethodAddress *, mono_debug_add_method, (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain)) + +MONO_API_FUNCTION(void, mono_debug_remove_method, (MonoMethod *method, MonoDomain *domain)) + +MONO_API_FUNCTION(MonoDebugMethodInfo *, mono_debug_lookup_method, (MonoMethod *method)) + +MONO_API_FUNCTION(MonoDebugMethodAddressList *, mono_debug_lookup_method_addresses, (MonoMethod *method)) + +MONO_API_FUNCTION(MonoDebugMethodJitInfo*, mono_debug_find_method, (MonoMethod *method, MonoDomain *domain)) + +MONO_API_FUNCTION(MonoDebugHandle *, mono_debug_get_handle, (MonoImage *image)) + +MONO_API_FUNCTION(void, mono_debug_free_method_jit_info, (MonoDebugMethodJitInfo *jit)) + + +MONO_API_FUNCTION(void, mono_debug_add_delegate_trampoline, (void* code, int size)) + +MONO_API_FUNCTION(MonoDebugLocalsInfo*, mono_debug_lookup_locals, (MonoMethod *method)) + +MONO_API_FUNCTION(MonoDebugMethodAsyncInfo*, mono_debug_lookup_method_async_debug_info, (MonoMethod *method)) + +MONO_API_FUNCTION(MonoDebugSourceLocation *, mono_debug_method_lookup_location, (MonoDebugMethodInfo *minfo, int il_offset)) + +/* + * Line number support. + */ + +MONO_API_FUNCTION(MonoDebugSourceLocation *, mono_debug_lookup_source_location, (MonoMethod *method, uint32_t address, MonoDomain *domain)) + +MONO_API_FUNCTION(int32_t, mono_debug_il_offset_from_address, (MonoMethod *method, MonoDomain *domain, uint32_t native_offset)) + +MONO_API_FUNCTION(void, mono_debug_free_source_location, (MonoDebugSourceLocation *location)) + +MONO_API_FUNCTION(char *, mono_debug_print_stack_frame, (MonoMethod *method, uint32_t native_offset, MonoDomain *domain)) + +/* + * Mono Debugger support functions + * + * These methods are used by the JIT while running inside the Mono Debugger. + */ + +MONO_API_FUNCTION(int, mono_debugger_method_has_breakpoint, (MonoMethod *method)) +MONO_API_FUNCTION(int, mono_debugger_insert_breakpoint, (const char *method_name, mono_bool include_namespace)) + +MONO_API_FUNCTION(void, mono_set_is_debugger_attached, (mono_bool attached)) +MONO_API_FUNCTION(mono_bool, mono_is_debugger_attached, (void)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-debug-types.h b/Prism/vendor/mono/include/mono/metadata/details/mono-debug-types.h new file mode 100644 index 0000000..197ec40 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-debug-types.h @@ -0,0 +1,154 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_MONO_DEBUG_TYPES_H +#define _MONO_MONO_DEBUG_TYPES_H + +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef struct _MonoSymbolTable MonoSymbolTable; +typedef struct _MonoDebugDataTable MonoDebugDataTable; + +typedef struct _MonoSymbolFile MonoSymbolFile; +typedef struct _MonoPPDBFile MonoPPDBFile; + +typedef struct _MonoDebugHandle MonoDebugHandle; + +typedef struct _MonoDebugLineNumberEntry MonoDebugLineNumberEntry; + +typedef struct _MonoDebugVarInfo MonoDebugVarInfo; +typedef struct _MonoDebugMethodJitInfo MonoDebugMethodJitInfo; +typedef struct _MonoDebugMethodAddress MonoDebugMethodAddress; +typedef struct _MonoDebugMethodAddressList MonoDebugMethodAddressList; +typedef struct _MonoDebugClassEntry MonoDebugClassEntry; + +typedef struct _MonoDebugMethodInfo MonoDebugMethodInfo; +typedef struct _MonoDebugLocalsInfo MonoDebugLocalsInfo; +typedef struct _MonoDebugMethodAsyncInfo MonoDebugMethodAsyncInfo; +typedef struct _MonoDebugSourceLocation MonoDebugSourceLocation; + +typedef struct _MonoDebugList MonoDebugList; + +typedef enum { + MONO_DEBUG_FORMAT_NONE, + MONO_DEBUG_FORMAT_MONO, + /* Deprecated, the mdb debugger is not longer supported. */ + MONO_DEBUG_FORMAT_DEBUGGER +} MonoDebugFormat; + +/* + * NOTE: + * We intentionally do not use GList here since the debugger needs to know about + * the layout of the fields. +*/ +struct _MonoDebugList { + MonoDebugList *next; + const void* data; +}; + +struct _MonoSymbolTable { + uint64_t magic; + uint32_t version; + uint32_t total_size; + + /* + * Corlib and metadata info. + */ + MonoDebugHandle *corlib; + MonoDebugDataTable *global_data_table; + MonoDebugList *data_tables; + + /* + * The symbol files. + */ + MonoDebugList *symbol_files; +}; + +struct _MonoDebugHandle { + uint32_t index; + char *image_file; + MonoImage *image; + MonoDebugDataTable *type_table; + MonoSymbolFile *symfile; + MonoPPDBFile *ppdb; +}; + +struct _MonoDebugMethodJitInfo { + const mono_byte *code_start; + uint32_t code_size; + uint32_t prologue_end; + uint32_t epilogue_begin; + const mono_byte *wrapper_addr; + uint32_t num_line_numbers; + MonoDebugLineNumberEntry *line_numbers; + uint32_t has_var_info; + uint32_t num_params; + MonoDebugVarInfo *this_var; + MonoDebugVarInfo *params; + uint32_t num_locals; + MonoDebugVarInfo *locals; + MonoDebugVarInfo *gsharedvt_info_var; + MonoDebugVarInfo *gsharedvt_locals_var; +}; + +struct _MonoDebugMethodAddressList { + uint32_t size; + uint32_t count; + mono_byte data [MONO_ZERO_LEN_ARRAY]; +}; + +struct _MonoDebugSourceLocation { + char *source_file; + uint32_t row, column; + uint32_t il_offset; +}; + +/* + * These bits of the MonoDebugLocalInfo's "index" field are flags specifying + * where the variable is actually stored. + * + * See relocate_variable() in debug-symfile.c for more info. + */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS 0xf0000000 + +/* The variable is in register "index". */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER 0 + +/* The variable is at offset "offset" from register "index". */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET 0x10000000 + +/* The variable is in the two registers "offset" and "index". */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS 0x20000000 + +/* The variable is dead. */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_DEAD 0x30000000 + +/* Same as REGOFFSET, but do an indirection */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR 0x40000000 + +/* gsharedvt local */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL 0x50000000 + +/* variable is a vt address */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR 0x60000000 + +struct _MonoDebugVarInfo { + uint32_t index; + uint32_t offset; + uint32_t size; + uint32_t begin_scope; + uint32_t end_scope; + MonoType *type; +}; + +#define MONO_DEBUGGER_MAJOR_VERSION 81 +#define MONO_DEBUGGER_MINOR_VERSION 6 +#define MONO_DEBUGGER_MAGIC 0x7aff65af4253d427ULL + +MONO_END_DECLS + +#endif /* _MONO_MONO_DEBUG_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-gc-functions.h b/Prism/vendor/mono/include/mono/metadata/details/mono-gc-functions.h new file mode 100644 index 0000000..6208110 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-gc-functions.h @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(void, mono_gc_collect, (int generation)) +MONO_API_FUNCTION(int, mono_gc_max_generation, (void)) +MONO_API_FUNCTION(int, mono_gc_get_generation, (MonoObject *object)) +MONO_API_FUNCTION(int, mono_gc_collection_count, (int generation)) +MONO_API_FUNCTION(int64_t, mono_gc_get_generation_size, (int generation)) +MONO_API_FUNCTION(int64_t, mono_gc_get_used_size, (void)) +MONO_API_FUNCTION(int64_t, mono_gc_get_heap_size, (void)) +MONO_API_FUNCTION(MonoBoolean, mono_gc_pending_finalizers, (void)) +MONO_API_FUNCTION(void, mono_gc_finalize_notify, (void)) +MONO_API_FUNCTION(int, mono_gc_invoke_finalizers, (void)) +/* heap walking is only valid in the pre-stop-world event callback */ +MONO_API_FUNCTION(int, mono_gc_walk_heap, (int flags, MonoGCReferences callback, void *data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_init_finalizer_thread, (void)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-gc-types.h b/Prism/vendor/mono/include/mono/metadata/details/mono-gc-types.h new file mode 100644 index 0000000..1675210 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-gc-types.h @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_METADATA_MONO_GC_TYPES_H +#define _MONO_METADATA_MONO_GC_TYPES_H + +#include + +MONO_BEGIN_DECLS + +typedef int (*MonoGCReferences) (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data); + +/** + * This enum is used by the profiler API when reporting root registration. + */ +typedef enum { + /** + * Roots external to Mono. Embedders may only use this value. + */ + MONO_ROOT_SOURCE_EXTERNAL = 0, + /** + * Thread call stack. + * + * The \c key parameter is a thread ID as a \c uintptr_t. + */ + MONO_ROOT_SOURCE_STACK = 1, + /** + * Roots in the finalizer queue. This is a pseudo-root. + */ + MONO_ROOT_SOURCE_FINALIZER_QUEUE = 2, + /** + * Managed \c static variables. + * + * The \c key parameter is a \c MonoVTable pointer. + */ + MONO_ROOT_SOURCE_STATIC = 3, + /** + * Managed \c static variables with \c ThreadStaticAttribute. + * + * The \c key parameter is a thread ID as a \c uintptr_t. + */ + MONO_ROOT_SOURCE_THREAD_STATIC = 4, + /** + * Managed \c static variables with \c ContextStaticAttribute. + * + * The \c key parameter is a \c MonoAppContext pointer. + */ + MONO_ROOT_SOURCE_CONTEXT_STATIC = 5, + /** + * \c GCHandle structures. + */ + MONO_ROOT_SOURCE_GC_HANDLE = 6, + /** + * Roots in the just-in-time compiler. + */ + MONO_ROOT_SOURCE_JIT = 7, + /** + * Roots in the threading subsystem. + * + * The \c key parameter, if not \c NULL, is a thread ID as a \c uintptr_t. + */ + MONO_ROOT_SOURCE_THREADING = 8, + /** + * Roots in application domains. + * + * The \c key parameter, if not \c NULL, is a \c MonoDomain pointer. + */ + MONO_ROOT_SOURCE_DOMAIN = 9, + /** + * Roots in reflection code. + * + * The \c key parameter, if not \c NULL, is a \c MonoVTable pointer. + */ + MONO_ROOT_SOURCE_REFLECTION = 10, + /** + * Roots from P/Invoke or other marshaling infrastructure. + */ + MONO_ROOT_SOURCE_MARSHAL = 11, + /** + * Roots in the thread pool data structures. + */ + MONO_ROOT_SOURCE_THREAD_POOL = 12, + /** + * Roots in the debugger agent. + */ + MONO_ROOT_SOURCE_DEBUGGER = 13, + /** + * Roots in the runtime handle stack. This is a pseudo-root. + * + * The \c key parameter is a thread ID as a \c uintptr_t. + */ + MONO_ROOT_SOURCE_HANDLE = 14, + /** + * Roots in the ephemeron arrays. This is a pseudo-root. + */ + MONO_ROOT_SOURCE_EPHEMERON = 15, + /** + * Roots in the toggleref arrays. This is a pseudo-root. + */ + MONO_ROOT_SOURCE_TOGGLEREF = 16, +} MonoGCRootSource; + +typedef enum { + MONO_GC_HANDLE_TYPE_MIN = 0, + MONO_GC_HANDLE_WEAK = MONO_GC_HANDLE_TYPE_MIN, + MONO_GC_HANDLE_WEAK_TRACK_RESURRECTION, + MONO_GC_HANDLE_NORMAL, + MONO_GC_HANDLE_PINNED, + MONO_GC_HANDLE_TYPE_MAX, +} MonoGCHandleType; + +MONO_END_DECLS + +#endif /* _MONO_METADATA_MONO_GC_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-private-unstable-functions.h b/Prism/vendor/mono/include/mono/metadata/details/mono-private-unstable-functions.h new file mode 100644 index 0000000..0eb931c --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-private-unstable-functions.h @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +/** + * + * Private unstable APIs. + * + * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at + * any time. + * + */ +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_load_full_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, const char *name)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook_v3, (MonoAssemblyPreLoadFuncV3 func, void *user_data, mono_bool append)) + +// This can point at NULL before the default ALC is initialized +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssemblyLoadContextGCHandle, mono_alc_get_default_gchandle, (void)) + +MONO_API_FUNCTION(void, mono_register_bundled_satellite_assemblies, (const MonoBundledSatelliteAssembly **assemblies)) + +MONO_API_FUNCTION(MonoBundledSatelliteAssembly *, mono_create_new_bundled_satellite_assembly, (const char *name, const char *culture, const unsigned char *data, unsigned int size)) + + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_method_get_unmanaged_callers_only_ftnptr, (MonoMethod *method, MonoError *error)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/mono-private-unstable-types.h b/Prism/vendor/mono/include/mono/metadata/details/mono-private-unstable-types.h new file mode 100644 index 0000000..c66bd78 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/mono-private-unstable-types.h @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +/** + * + * Private unstable APIs. + * + * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at + * any time. + * + */ +#ifndef _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H +#define _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H + +#include +#include + +MONO_BEGIN_DECLS + +typedef MonoGCHandle MonoAssemblyLoadContextGCHandle; + +typedef MonoAssembly * (*MonoAssemblyPreLoadFuncV3) (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, char **assemblies_path, void *user_data, MonoError *error); + +typedef struct _MonoBundledSatelliteAssembly MonoBundledSatelliteAssembly; + +typedef void * (*PInvokeOverrideFn) (const char *libraryName, const char *entrypointName); + +MONO_END_DECLS + +#endif /* _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/object-functions.h b/Prism/vendor/mono/include/mono/metadata/details/object-functions.h new file mode 100644 index 0000000..18b80f3 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/object-functions.h @@ -0,0 +1,223 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_chars, (MonoString *s)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_string_length, (MonoString *s)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new, (MonoDomain *domain, MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_specific, (MonoVTable *vtable)) + +/* can be used for classes without finalizer in non-profiling mode */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_fast, (MonoVTable *vtable)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_alloc_specific, (MonoVTable *vtable)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_from_token, (MonoDomain *domain, MonoImage *image, uint32_t token)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new, (MonoDomain *domain, MonoClass *eclass, uintptr_t n)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new_full, (MonoDomain *domain, MonoClass *array_class, uintptr_t *lengths, intptr_t *lower_bounds)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray *, mono_array_new_specific, (MonoVTable *vtable, uintptr_t n)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_clone, (MonoArray *array)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY char*, mono_array_addr_with_size, (MonoArray *array, int size, uintptr_t idx)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uintptr_t, mono_array_length, (MonoArray *array)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty, (MonoDomain *domain)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty_wrapper, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf16, (MonoDomain *domain, const mono_unichar2 *text, int32_t len)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_size, (MonoDomain *domain, int32_t len)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_ldstr, (MonoDomain *domain, MonoImage *image, uint32_t str_index)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_is_interned, (MonoString *str)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_intern, (MonoString *str)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new, (MonoDomain *domain, const char *text)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_wrapper, (const char *text)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_len, (MonoDomain *domain, const char *text, unsigned int length)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf32, (MonoDomain *domain, const mono_unichar4 *text, int32_t len)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8, (MonoString *string_obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8_checked, (MonoString *string_obj, MonoError *error)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_to_utf16, (MonoString *string_obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_unichar4 *, mono_string_to_utf32, (MonoString *string_obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf16, (/*const*/ mono_unichar2 *data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf32, (/*const*/ mono_unichar4 *data)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_string_equal, (MonoString *s1, MonoString *s2)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY unsigned int, mono_string_hash, (MonoString *s)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_object_hash, (MonoObject* obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString *, mono_object_to_string, (MonoObject *obj, MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_value_box, (MonoDomain *domain, MonoClass *klass, void* val)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_value_copy, (void* dest, /*const*/ void* src, MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_value_copy_array, (MonoArray *dest, int dest_idx, void* src, int count)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoVTable*, mono_object_get_vtable, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_object_get_domain, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_object_get_class, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_object_unbox, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_clone, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst, (MonoObject *obj, MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst_mbyref, (MonoObject *obj, MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_castclass_mbyref, (MonoObject *obj, MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_try_enter, (MonoObject *obj, uint32_t ms)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_enter, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_monitor_enter_v4, (MonoObject *obj, char *lock_taken)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY unsigned int, mono_object_get_size, (MonoObject *o)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_monitor_exit, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_raise_exception, (MonoException *ex)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_runtime_set_pending_exception, (MonoException *exc, mono_bool overwrite)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_reraise_exception, (MonoException *ex)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_object_init, (MonoObject *this_obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_class_init, (MonoVTable *vtable)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_vtable_domain, (MonoVTable *vtable)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_vtable_class, (MonoVTable *vtable)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_object_get_virtual_method, (MonoObject *obj, MonoMethod *method)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke, (MonoMethod *method, void *obj, void **params, MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_invoke, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_begin_invoke, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_end_invoke, (MonoClass *klass)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_delegate_invoke, (MonoObject *delegate, void **params, MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke_array, (MonoMethod *method, void *obj, MonoArray *params, MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_method_get_unmanaged_thunk, (MonoMethod *method)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_runtime_get_main_args, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_exec_managed_code, (MonoDomain *domain, MonoMainThreadFunc main_func, void* main_args)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_runtime_run_main, (MonoMethod *method, int argc, char* argv[],MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_runtime_exec_main, (MonoMethod *method, MonoArray *args, MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_runtime_set_main_args, (int argc, char* argv[])) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_load_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void **res)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_load_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void* val)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_unhandled_exception, (MonoObject *exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_print_unhandled_exception, (MonoObject *exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_compile_method, (MonoMethod *method)) + +/* accessors for fields and properties */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_set_value, (MonoObject *obj, MonoClassField *field, void *value)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_static_set_value, (MonoVTable *vt, MonoClassField *field, void *value)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_get_value, (MonoObject *obj, MonoClassField *field, void *value)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_static_get_value, (MonoVTable *vt, MonoClassField *field, void *value)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_field_get_value_object, (MonoDomain *domain, MonoClassField *field, MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_property_set_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_property_get_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc)) + +/* GC handles support + * + * A handle can be created to refer to a managed object and either prevent it + * from being garbage collected or moved or to be able to know if it has been + * collected or not (weak references). + * mono_gchandle_new () is used to prevent an object from being garbage collected + * until mono_gchandle_free() is called. Use a TRUE value for the pinned argument to + * prevent the object from being moved (this should be avoided as much as possible + * and this should be used only for shorts periods of time or performance will suffer). + * To create a weakref use mono_gchandle_new_weakref (): track_resurrection should + * usually be false (see the GC docs for more details). + * mono_gchandle_get_target () can be used to get the object referenced by both kinds + * of handle: for a weakref handle, if an object has been collected, it will return NULL. + */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new, (MonoObject *obj, mono_bool pinned)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new_weakref, (MonoObject *obj, mono_bool track_resurrection)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_gchandle_get_target, (uint32_t gchandle)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free, (uint32_t gchandle)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_v2, (MonoObject *obj, mono_bool pinned)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_weakref_v2, (MonoObject *obj, mono_bool track_resurrection)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_gchandle_get_target_v2, (MonoGCHandle gchandle)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free_v2, (MonoGCHandle gchandle)) + +/* Reference queue support + * + * A reference queue is used to get notifications of when objects are collected. + * Call mono_gc_reference_queue_new to create a new queue and pass the callback that + * will be invoked when registered objects are collected. + * Call mono_gc_reference_queue_add to register a pair of objects and data within a queue. + * The callback will be triggered once an object is both unreachable and finalized. + */ + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReferenceQueue*, mono_gc_reference_queue_new, (mono_reference_queue_callback callback)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_reference_queue_free, (MonoReferenceQueue *queue)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_gc_reference_queue_add, (MonoReferenceQueue *queue, MonoObject *obj, void *user_data)) + +/* GC write barriers support */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_field, (MonoObject *obj, void* field_ptr, MonoObject* value)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_arrayref, (MonoArray *arr, void* slot_ptr, MonoObject* value)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_arrayref_copy, (void* dest_ptr, /*const*/ void* src_ptr, int count)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store, (void* ptr, MonoObject* value)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store_atomic, (void *ptr, MonoObject *value)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_nostore, (void* ptr)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_value_copy, (void* dest, /*const*/ void* src, int count, MonoClass *klass)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_object_copy, (MonoObject* obj, MonoObject *src)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/object-types.h b/Prism/vendor/mono/include/mono/metadata/details/object-types.h new file mode 100644 index 0000000..e95e7ee --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/object-types.h @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_OBJECT_TYPES_H +#define _MONO_OBJECT_TYPES_H + +#include +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef struct _MonoString MONO_RT_MANAGED_ATTR MonoString; +typedef struct _MonoArray MONO_RT_MANAGED_ATTR MonoArray; +typedef struct _MonoReflectionMethod MONO_RT_MANAGED_ATTR MonoReflectionMethod; +typedef struct _MonoReflectionModule MONO_RT_MANAGED_ATTR MonoReflectionModule; +typedef struct _MonoReflectionField MONO_RT_MANAGED_ATTR MonoReflectionField; +typedef struct _MonoReflectionProperty MONO_RT_MANAGED_ATTR MonoReflectionProperty; +typedef struct _MonoReflectionEvent MONO_RT_MANAGED_ATTR MonoReflectionEvent; +typedef struct _MonoReflectionType MONO_RT_MANAGED_ATTR MonoReflectionType; +typedef struct _MonoDelegate MONO_RT_MANAGED_ATTR MonoDelegate; +typedef struct _MonoThreadsSync MonoThreadsSync; +typedef struct _MonoInternalThread MONO_RT_MANAGED_ATTR MonoThread; +typedef struct _MonoDynamicAssembly MonoDynamicAssembly; +typedef struct _MonoDynamicImage MonoDynamicImage; +typedef struct _MonoReflectionMethodBody MONO_RT_MANAGED_ATTR MonoReflectionMethodBody; +typedef struct _MonoAppContext MONO_RT_MANAGED_ATTR MonoAppContext; + +struct _MonoObject { + MonoVTable *vtable; + MonoThreadsSync *synchronisation; +}; + +typedef MonoObject* (*MonoInvokeFunc) (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error); +typedef void* (*MonoCompileFunc) (MonoMethod *method); +typedef void (*MonoMainThreadFunc) (void* user_data); + +typedef void (*mono_reference_queue_callback) (void *user_data); +typedef struct _MonoReferenceQueue MonoReferenceQueue; + +MONO_END_DECLS + +#endif /* _MONO_OBJECT_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/opcodes-functions.h b/Prism/vendor/mono/include/mono/metadata/details/opcodes-functions.h new file mode 100644 index 0000000..04444b8 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/opcodes-functions.h @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(const char*, mono_opcode_name, (int opcode)) + +MONO_API_FUNCTION(MonoOpcodeEnum, mono_opcode_value, (const mono_byte **ip, const mono_byte *end)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/opcodes-types.h b/Prism/vendor/mono/include/mono/metadata/details/opcodes-types.h new file mode 100644 index 0000000..7f923f2 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/opcodes-types.h @@ -0,0 +1,62 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_OPCODES_TYPES_H +#define _MONO_OPCODES_TYPES_H + +#include + +MONO_BEGIN_DECLS + +#define MONO_CUSTOM_PREFIX 0xf0 + +#define OPDEF(a,b,c,d,e,f,g,h,i,j) \ + MONO_ ## a, + +typedef enum MonoOpcodeEnum { + MonoOpcodeEnum_Invalid = -1, +#include "mono/cil/opcode.def" + MONO_CEE_LAST +} MonoOpcodeEnum; + +#undef OPDEF + +enum { + MONO_FLOW_NEXT, + MONO_FLOW_BRANCH, + MONO_FLOW_COND_BRANCH, + MONO_FLOW_ERROR, + MONO_FLOW_CALL, + MONO_FLOW_RETURN, + MONO_FLOW_META +}; + +enum { + MonoInlineNone = 0, + MonoInlineType = 1, + MonoInlineField = 2, + MonoInlineMethod = 3, + MonoInlineTok = 4, + MonoInlineString = 5, + MonoInlineSig = 6, + MonoInlineVar = 7, + MonoShortInlineVar = 8, + MonoInlineBrTarget = 9, + MonoShortInlineBrTarget = 10, + MonoInlineSwitch = 11, + MonoInlineR = 12, + MonoShortInlineR = 13, + MonoInlineI = 14, + MonoShortInlineI = 15, + MonoInlineI8 = 16, +}; + +typedef struct { + unsigned char argument; + unsigned char flow_type; + unsigned short opval; +} MonoOpcode; + +MONO_END_DECLS + +#endif /* _MONO_OPCODES_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/profiler-functions.h b/Prism/vendor/mono/include/mono/metadata/details/profiler-functions.h new file mode 100644 index 0000000..828ccb2 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/profiler-functions.h @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(void, mono_profiler_load, (const char *desc)) +MONO_API_FUNCTION(MonoProfilerHandle, mono_profiler_create, (MonoProfiler *prof)) +MONO_API_FUNCTION(void, mono_profiler_set_cleanup_callback, (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb)) + +MONO_API_FUNCTION(mono_bool, mono_profiler_enable_coverage, (void)) +MONO_API_FUNCTION(void, mono_profiler_set_coverage_filter_callback, (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb)) +MONO_API_FUNCTION(mono_bool, mono_profiler_get_coverage_data, (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb)) + +MONO_API_FUNCTION(mono_bool, mono_profiler_enable_sampling, (MonoProfilerHandle handle)) +MONO_API_FUNCTION(mono_bool, mono_profiler_set_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq)) +MONO_API_FUNCTION(mono_bool, mono_profiler_get_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq)) + +MONO_API_FUNCTION(mono_bool, mono_profiler_enable_allocations, (void)) +MONO_API_FUNCTION(mono_bool, mono_profiler_enable_clauses, (void)) + +MONO_API_FUNCTION(void, mono_profiler_set_call_instrumentation_filter_callback, (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb)) +MONO_API_FUNCTION(mono_bool, mono_profiler_enable_call_context_introspection, (void)) +MONO_API_FUNCTION(void *, mono_profiler_call_context_get_this, (MonoProfilerCallContext *context)) +MONO_API_FUNCTION(void *, mono_profiler_call_context_get_argument, (MonoProfilerCallContext *context, uint32_t position)) +MONO_API_FUNCTION(void *, mono_profiler_call_context_get_local, (MonoProfilerCallContext *context, uint32_t position)) +MONO_API_FUNCTION(void *, mono_profiler_call_context_get_result, (MonoProfilerCallContext *context)) +MONO_API_FUNCTION(void, mono_profiler_call_context_free_buffer, (void *buffer)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/profiler-types.h b/Prism/vendor/mono/include/mono/metadata/details/profiler-types.h new file mode 100644 index 0000000..966459e --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/profiler-types.h @@ -0,0 +1,131 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_PROFILER_TYPES_H +#define _MONO_PROFILER_TYPES_H + +#include +#include +#include +#include + +MONO_BEGIN_DECLS + +typedef struct _MonoProfiler MonoProfiler; +typedef struct _MonoProfilerDesc *MonoProfilerHandle; + +typedef void (*MonoProfilerCleanupCallback) (MonoProfiler *prof); + +typedef struct { + MonoMethod *method; + uint32_t il_offset; + uint32_t counter; + const char *file_name; + uint32_t line; + uint32_t column; +} MonoProfilerCoverageData; + +typedef mono_bool (*MonoProfilerCoverageFilterCallback) (MonoProfiler *prof, MonoMethod *method); +typedef void (*MonoProfilerCoverageCallback) (MonoProfiler *prof, const MonoProfilerCoverageData *data); + +typedef enum { + /** + * Do not perform sampling. Will make the sampling thread sleep until the + * sampling mode is changed to one of the below modes. + */ + MONO_PROFILER_SAMPLE_MODE_NONE = 0, + /** + * Try to base sampling frequency on process activity. Falls back to + * MONO_PROFILER_SAMPLE_MODE_REAL if such a clock is not available. + */ + MONO_PROFILER_SAMPLE_MODE_PROCESS = 1, + /** + * Base sampling frequency on wall clock time. Uses a monotonic clock when + * available (all major platforms). + */ + MONO_PROFILER_SAMPLE_MODE_REAL = 2, +} MonoProfilerSampleMode; + +typedef struct _MonoProfilerCallContext MonoProfilerCallContext; + +typedef enum { + /** + * Do not instrument calls. + */ + MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 0, + /** + * Instrument method entries. + */ + MONO_PROFILER_CALL_INSTRUMENTATION_ENTER = 1 << 1, + /** + * Also capture a call context for method entries. + */ + MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT = 1 << 2, + /** + * Instrument method exits. + */ + MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE = 1 << 3, + /** + * Also capture a call context for method exits. + */ + MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT = 1 << 4, + /** + * Instrument method exits as a result of a tail call. + */ + MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL = 1 << 5, + /** + * Instrument exceptional method exits. + */ + MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE = 1 << 6, +} MonoProfilerCallInstrumentationFlags; + +typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFilterCallback) (MonoProfiler *prof, MonoMethod *method); + +typedef enum { + /** + * The \c data parameter is a \c MonoMethod pointer. + */ + MONO_PROFILER_CODE_BUFFER_METHOD = 0, + /** + * \deprecated No longer used. + */ + MONO_PROFILER_CODE_BUFFER_METHOD_TRAMPOLINE = 1, + /** + * The \c data parameter is a \c MonoMethod pointer. + */ + MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE = 2, + MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE = 3, + MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE = 4, + /** + * The \c data parameter is a C string. + */ + MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE = 5, + MONO_PROFILER_CODE_BUFFER_HELPER = 6, + /** + * \deprecated No longer used. + */ + MONO_PROFILER_CODE_BUFFER_MONITOR = 7, + MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE = 8, + MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 9, +} MonoProfilerCodeBufferType; + +typedef enum { + MONO_GC_EVENT_PRE_STOP_WORLD = 6, + /** + * When this event arrives, the GC and suspend locks are acquired. + */ + MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10, + MONO_GC_EVENT_POST_STOP_WORLD = 7, + MONO_GC_EVENT_START = 0, + MONO_GC_EVENT_END = 5, + MONO_GC_EVENT_PRE_START_WORLD = 8, + /** + * When this event arrives, the GC and suspend locks are released. + */ + MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11, + MONO_GC_EVENT_POST_START_WORLD = 9, +} MonoProfilerGCEvent; + +MONO_END_DECLS + +#endif /* _MONO_PROFILER_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/reflection-functions.h b/Prism/vendor/mono/include/mono/metadata/details/reflection-functions.h new file mode 100644 index 0000000..718db5e --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/reflection-functions.h @@ -0,0 +1,64 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_reflection_parse_type, (char *name, MonoTypeNameParse *info)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_get_type, (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve)) +MONO_API_FUNCTION(void, mono_reflection_free_type_info, (MonoTypeNameParse *info)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_from_name, (char *name, MonoImage *image)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uint32_t, mono_reflection_get_token, (MonoObject *obj)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly*, mono_assembly_get_object, (MonoDomain *domain, MonoAssembly *assembly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_get_object, (MonoDomain *domain, MonoImage *image)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_file_get_object, (MonoDomain *domain, MonoImage *image, int table_index)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionType*, mono_type_get_object, (MonoDomain *domain, MonoType *type)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionMethod*, mono_method_get_object, (MonoDomain *domain, MonoMethod *method, MonoClass *refclass)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionField*, mono_field_get_object, (MonoDomain *domain, MonoClass *klass, MonoClassField *field)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionProperty*, mono_property_get_object, (MonoDomain *domain, MonoClass *klass, MonoProperty *property)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionEvent*, mono_event_get_object, (MonoDomain *domain, MonoClass *klass, MonoEvent *event)) +/* note: this one is slightly different: we keep the whole array of params in the cache */ +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_param_get_objects, (MonoDomain *domain, MonoMethod *method)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionMethodBody*, mono_method_body_get_object, (MonoDomain *domain, MonoMethod *method)) + +MONO_API_FUNCTION(MonoObject *, mono_get_dbnull_object, (MonoDomain *domain)) + +MONO_API_FUNCTION(MonoArray*, mono_reflection_get_custom_attrs_by_type, (MonoObject *obj, MonoClass *attr_klass, MonoError *error)) +MONO_API_FUNCTION(MonoArray*, mono_reflection_get_custom_attrs, (MonoObject *obj)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_data, (MonoObject *obj)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_blob, (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_reflection_get_custom_attrs_info, (MonoObject *obj)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_custom_attrs_construct, (MonoCustomAttrInfo *cinfo)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_index, (MonoImage *image, uint32_t idx)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_method, (MonoMethod *method)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_class, (MonoClass *klass)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_assembly, (MonoAssembly *assembly)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_property, (MonoClass *klass, MonoProperty *property)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_event, (MonoClass *klass, MonoEvent *event)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_field, (MonoClass *klass, MonoClassField *field)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_param, (MonoMethod *method, uint32_t param)) +MONO_API_FUNCTION(mono_bool, mono_custom_attrs_has_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_custom_attrs_get_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass)) +MONO_API_FUNCTION(void, mono_custom_attrs_free, (MonoCustomAttrInfo *ainfo)) + + +MONO_API_FUNCTION(uint32_t, mono_declsec_flags_from_method, (MonoMethod *method)) +MONO_API_FUNCTION(uint32_t, mono_declsec_flags_from_class, (MonoClass *klass)) +MONO_API_FUNCTION(uint32_t, mono_declsec_flags_from_assembly, (MonoAssembly *assembly)) + +MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_demands, (MonoMethod *callee, MonoDeclSecurityActions* demands)) +MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_linkdemands, (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* cmethod)) +MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_inheritdemands_class, (MonoClass *klass, MonoDeclSecurityActions* demands)) +MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_inheritdemands_method, (MonoMethod *callee, MonoDeclSecurityActions* demands)) + +MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_method_action, (MonoMethod *method, uint32_t action, MonoDeclSecurityEntry *entry)) +MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_class_action, (MonoClass *klass, uint32_t action, MonoDeclSecurityEntry *entry)) +MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_assembly_action, (MonoAssembly *assembly, uint32_t action, MonoDeclSecurityEntry *entry)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_get_type, (MonoReflectionType *reftype)) + +MONO_API_FUNCTION(MonoAssembly*, mono_reflection_assembly_get_assembly, (MonoReflectionAssembly *refassembly)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/reflection-types.h b/Prism/vendor/mono/include/mono/metadata/details/reflection-types.h new file mode 100644 index 0000000..b2b680e --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/reflection-types.h @@ -0,0 +1,88 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_REFLECTION_TYPES_H +#define _MONO_REFLECTION_TYPES_H + +#include +#include + +MONO_BEGIN_DECLS + +typedef struct MonoTypeNameParse MonoTypeNameParse; + +typedef struct { + MonoMethod *ctor; + uint32_t data_size; + const mono_byte* data; +} MonoCustomAttrEntry; + +typedef struct { + int num_attrs; + int cached; + MonoImage *image; + MonoCustomAttrEntry attrs [MONO_ZERO_LEN_ARRAY]; +} MonoCustomAttrInfo; + +#define MONO_SIZEOF_CUSTOM_ATTR_INFO (offsetof (MonoCustomAttrInfo, attrs)) + +/* + * Information which isn't in the MonoMethod structure is stored here for + * dynamic methods. + */ +typedef struct { + char **param_names; + MonoMarshalSpec **param_marshall; + MonoCustomAttrInfo **param_cattr; + uint8_t** param_defaults; + uint32_t *param_default_types; + char *dllentry, *dll; +} MonoReflectionMethodAux; + +typedef enum { + ResolveTokenError_OutOfRange, + ResolveTokenError_BadTable, + ResolveTokenError_Other +} MonoResolveTokenError; + +#define MONO_DECLSEC_ACTION_MIN 0x1 +#define MONO_DECLSEC_ACTION_MAX 0x12 + +enum { + MONO_DECLSEC_FLAG_REQUEST = 0x00000001, + MONO_DECLSEC_FLAG_DEMAND = 0x00000002, + MONO_DECLSEC_FLAG_ASSERT = 0x00000004, + MONO_DECLSEC_FLAG_DENY = 0x00000008, + MONO_DECLSEC_FLAG_PERMITONLY = 0x00000010, + MONO_DECLSEC_FLAG_LINKDEMAND = 0x00000020, + MONO_DECLSEC_FLAG_INHERITANCEDEMAND = 0x00000040, + MONO_DECLSEC_FLAG_REQUEST_MINIMUM = 0x00000080, + MONO_DECLSEC_FLAG_REQUEST_OPTIONAL = 0x00000100, + MONO_DECLSEC_FLAG_REQUEST_REFUSE = 0x00000200, + MONO_DECLSEC_FLAG_PREJIT_GRANT = 0x00000400, + MONO_DECLSEC_FLAG_PREJIT_DENY = 0x00000800, + MONO_DECLSEC_FLAG_NONCAS_DEMAND = 0x00001000, + MONO_DECLSEC_FLAG_NONCAS_LINKDEMAND = 0x00002000, + MONO_DECLSEC_FLAG_NONCAS_INHERITANCEDEMAND = 0x00004000, + MONO_DECLSEC_FLAG_LINKDEMAND_CHOICE = 0x00008000, + MONO_DECLSEC_FLAG_INHERITANCEDEMAND_CHOICE = 0x00010000, + MONO_DECLSEC_FLAG_DEMAND_CHOICE = 0x00020000 +}; + +/* this structure MUST be kept in synch with RuntimeDeclSecurityEntry + * located in /mcs/class/corlib/System.Security/SecurityFrame.cs */ +typedef struct { + char *blob; /* pointer to metadata blob */ + uint32_t size; /* size of the metadata blob */ + uint32_t index; +} MonoDeclSecurityEntry; + +typedef struct { + MonoDeclSecurityEntry demand; + MonoDeclSecurityEntry noncasdemand; + MonoDeclSecurityEntry demandchoice; +} MonoDeclSecurityActions; + +MONO_END_DECLS + +#endif /* _MONO_REFLECTION_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/sgen-bridge-functions.h b/Prism/vendor/mono/include/mono/metadata/details/sgen-bridge-functions.h new file mode 100644 index 0000000..dc1c552 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/sgen-bridge-functions.h @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +/* + * Note: This may be called at any time, but cannot be called concurrently + * with (during and on a separate thread from) sgen init. Callers are + * responsible for enforcing this. + */ +MONO_API_FUNCTION(void, mono_gc_register_bridge_callbacks, (MonoGCBridgeCallbacks *callbacks)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wait_for_bridge_processing, (void)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/sgen-bridge-types.h b/Prism/vendor/mono/include/mono/metadata/details/sgen-bridge-types.h new file mode 100644 index 0000000..cdb0be9 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/sgen-bridge-types.h @@ -0,0 +1,55 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_SGEN_BRIDGE_TYPES_H +#define _MONO_SGEN_BRIDGE_TYPES_H + +#include + +MONO_BEGIN_DECLS + +enum { + SGEN_BRIDGE_VERSION = 5 +}; + +typedef enum { + /* Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List*/ + GC_BRIDGE_TRANSPARENT_CLASS, + /* Instances of this class should not be scanned when computing the transitive dependency among bridges. E.g. String*/ + GC_BRIDGE_OPAQUE_CLASS, + /* Instances of this class should be bridged and have their dependency computed. */ + GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS, + /* Instances of this class should be bridged but no dependencies should not be calculated. */ + GC_BRIDGE_OPAQUE_BRIDGE_CLASS, +} MonoGCBridgeObjectKind; + +typedef struct { + mono_bool is_alive; /* to be set by the cross reference callback */ + int num_objs; + MonoObject *objs [MONO_ZERO_LEN_ARRAY]; +} MonoGCBridgeSCC; + +typedef struct { + int src_scc_index; + int dst_scc_index; +} MonoGCBridgeXRef; + +typedef struct { + int bridge_version; + /* + * Tells the runtime which classes to even consider when looking for + * bridged objects. If subclasses are to be considered as well, the + * subclass check must be done in the callback. + */ + MonoGCBridgeObjectKind (*bridge_class_kind) (MonoClass *klass); + /* + * This is only called on objects for whose classes + * `bridge_class_kind()` returned `XXX_BRIDGE_CLASS`. + */ + mono_bool (*is_bridge_object) (MonoObject *object); + void (*cross_references) (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs); +} MonoGCBridgeCallbacks; + +MONO_END_DECLS + +#endif /* _MONO_SGEN_BRIDGE_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/details/threads-functions.h b/Prism/vendor/mono/include/mono/metadata/details/threads-functions.h new file mode 100644 index 0000000..9fb3031 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/threads-functions.h @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(void, mono_thread_init, (MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_cleanup, (void)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_manage, (void)) + +MONO_API_FUNCTION(MonoThread *, mono_thread_current, (void)) + +MONO_API_FUNCTION(void, mono_thread_set_main, (MonoThread *thread)) +MONO_API_FUNCTION(MonoThread *, mono_thread_get_main, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_stop, (MonoThread *thread)) + +MONO_API_FUNCTION(void, mono_thread_new_init, (intptr_t tid, void* stack_start, void* func)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_create, (MonoDomain *domain, void* func, void* arg)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoThread *, mono_thread_attach, (MonoDomain *domain)) +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_detach, (MonoThread *thread)) +MONO_API_FUNCTION(void, mono_thread_exit, (void)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_threads_attach_tools_thread, (void)) + +MONO_API_FUNCTION(char *, mono_thread_get_name_utf8, (MonoThread *thread)) +MONO_API_FUNCTION(int32_t, mono_thread_get_managed_id, (MonoThread *thread)) + +MONO_API_FUNCTION(void, mono_thread_set_manage_callback, (MonoThread *thread, MonoThreadManageCallback func)) + +MONO_API_FUNCTION(void, mono_threads_set_default_stacksize, (uint32_t stacksize)) +MONO_API_FUNCTION(uint32_t, mono_threads_get_default_stacksize, (void)) + +MONO_API_FUNCTION(void, mono_threads_request_thread_dump, (void)) + +MONO_API_FUNCTION(mono_bool, mono_thread_is_foreign, (MonoThread *thread)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_thread_detach_if_exiting, (void)) diff --git a/Prism/vendor/mono/include/mono/metadata/details/threads-types.h b/Prism/vendor/mono/include/mono/metadata/details/threads-types.h new file mode 100644 index 0000000..d79d0ab --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/details/threads-types.h @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_METADATA_DETAILS_THREADS_TYPES_H +#define _MONO_METADATA_DETAILS_THREADS_TYPES_H + +#include +#include +#include + +MONO_BEGIN_DECLS + +/* This callback should return TRUE if the runtime must wait for the thread, FALSE otherwise */ +typedef mono_bool (*MonoThreadManageCallback) (MonoThread* thread); + +MONO_END_DECLS + +#endif /* _MONO_METADATA_DETAILS_THREADS_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/metadata/environment.h b/Prism/vendor/mono/include/mono/metadata/environment.h new file mode 100644 index 0000000..0ae5c05 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/environment.h @@ -0,0 +1,24 @@ +/** + * \file + * System.Environment support internal calls + * + * Author: + * Dick Porter (dick@ximian.com) + * + * (C) 2002 Ximian, Inc + */ + +#ifndef _MONO_METADATA_ENVIRONMENT_H_ +#define _MONO_METADATA_ENVIRONMENT_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* _MONO_METADATA_ENVIRONMENT_H_ */ diff --git a/Prism/vendor/mono/include/mono/metadata/exception.h b/Prism/vendor/mono/include/mono/metadata/exception.h new file mode 100644 index 0000000..25caa38 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/exception.h @@ -0,0 +1,20 @@ +/** + * \file + */ + +#ifndef _MONO_METADATA_EXCEPTION_H_ +#define _MONO_METADATA_EXCEPTION_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +void mono_invoke_unhandled_exception_hook (MonoObject *exc); + +MONO_END_DECLS + +#endif /* _MONO_METADATA_EXCEPTION_H_ */ diff --git a/Prism/vendor/mono/include/mono/metadata/image.h b/Prism/vendor/mono/include/mono/metadata/image.h new file mode 100644 index 0000000..5dd28b8 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/image.h @@ -0,0 +1,20 @@ +/** + * \file + */ + +#ifndef _MONONET_METADATA_IMAGE_H_ +#define _MONONET_METADATA_IMAGE_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +mono_bool mono_has_pdb_checksum (char *raw_data, uint32_t raw_data_len); + +MONO_END_DECLS + +#endif diff --git a/Prism/vendor/mono/include/mono/metadata/loader.h b/Prism/vendor/mono/include/mono/metadata/loader.h new file mode 100644 index 0000000..bb6b53c --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/loader.h @@ -0,0 +1,19 @@ +/** + * \file + */ + +#ifndef _MONO_METADATA_LOADER_H_ +#define _MONO_METADATA_LOADER_H_ 1 + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif + diff --git a/Prism/vendor/mono/include/mono/metadata/metadata.h b/Prism/vendor/mono/include/mono/metadata/metadata.h new file mode 100644 index 0000000..928f38f --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/metadata.h @@ -0,0 +1,59 @@ +/** + * \file + */ + +#ifndef __MONO_METADATA_H__ +#define __MONO_METADATA_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_TYPE_ISSTRUCT(t) mono_type_is_struct (t) +#define MONO_TYPE_IS_VOID(t) mono_type_is_void (t) +#define MONO_TYPE_IS_POINTER(t) mono_type_is_pointer (t) +#define MONO_TYPE_IS_REFERENCE(t) mono_type_is_reference (t) + +#define MONO_CLASS_IS_INTERFACE(c) ((mono_class_get_flags (c) & TYPE_ATTRIBUTE_INTERFACE) || mono_type_is_generic_parameter (mono_class_get_type (c))) + +#define MONO_CLASS_IS_IMPORT(c) ((mono_class_get_flags (c) & TYPE_ATTRIBUTE_IMPORT)) + +/* + * This macro is used to extract the size of the table encoded in + * the size_bitfield of MonoTableInfo. + */ +#define mono_metadata_table_size(bitfield,table) ((((bitfield) >> ((table)*2)) & 0x3) + 1) +#define mono_metadata_table_count(bitfield) ((bitfield) >> 24) + +#define MONO_OFFSET_IN_CLAUSE(clause,offset) \ + ((clause)->try_offset <= (offset) && (offset) < ((clause)->try_offset + (clause)->try_len)) +#define MONO_OFFSET_IN_HANDLER(clause,offset) \ + ((clause)->handler_offset <= (offset) && (offset) < ((clause)->handler_offset + (clause)->handler_len)) +#define MONO_OFFSET_IN_FILTER(clause,offset) \ + ((clause)->flags == MONO_EXCEPTION_CLAUSE_FILTER && (clause)->data.filter_offset <= (offset) && (offset) < ((clause)->handler_offset)) + +/* + * Makes a token based on a table and an index + */ +#define mono_metadata_make_token(table,idx) (((table) << 24)| (idx)) + +/* + * Returns the table index that this token encodes. + */ +#define mono_metadata_token_table(token) ((token) >> 24) + + /* + * Returns the index that a token refers to + */ +#define mono_metadata_token_index(token) ((token) & 0xffffff) + + +#define mono_metadata_token_code(token) ((token) & 0xff000000) + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_METADATA_H__ */ diff --git a/Prism/vendor/mono/include/mono/metadata/mono-config.h b/Prism/vendor/mono/include/mono/metadata/mono-config.h new file mode 100644 index 0000000..32028fb --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/mono-config.h @@ -0,0 +1,22 @@ +/** + * \file + * + * Author: Paolo Molaro (lupus@ximian.com) + * + * (C) 2002 Ximian, Inc. + */ +#ifndef __MONO_METADATA_CONFIG_H__ +#define __MONO_METADATA_CONFIG_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_METADATA_CONFIG_H__ */ + diff --git a/Prism/vendor/mono/include/mono/metadata/mono-debug.h b/Prism/vendor/mono/include/mono/metadata/mono-debug.h new file mode 100644 index 0000000..95f7970 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/mono-debug.h @@ -0,0 +1,20 @@ +/** + * \file + * This header is only installed for use by the debugger: + * the structures and the API declared here are not supported. + */ + +#ifndef __MONO_DEBUG_H__ +#define __MONO_DEBUG_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_DEBUG_H__ */ diff --git a/Prism/vendor/mono/include/mono/metadata/mono-gc.h b/Prism/vendor/mono/include/mono/metadata/mono-gc.h new file mode 100644 index 0000000..1905f17 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/mono-gc.h @@ -0,0 +1,20 @@ +/** + * \file + * GC related public interface + * + */ +#ifndef __METADATA_MONO_GC_H__ +#define __METADATA_MONO_GC_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __METADATA_MONO_GC_H__ */ + diff --git a/Prism/vendor/mono/include/mono/metadata/mono-private-unstable.h b/Prism/vendor/mono/include/mono/metadata/mono-private-unstable.h new file mode 100644 index 0000000..a13e53e --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/mono-private-unstable.h @@ -0,0 +1,28 @@ +/** + * \file + * + * Private unstable APIs. + * + * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at + * any time. + * + */ + + +#ifndef __MONO_METADATA_MONO_PRIVATE_UNSTABLE_H__ +#define __MONO_METADATA_MONO_PRIVATE_UNSTABLE_H__ + +#include +#include + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /*__MONO_METADATA_MONO_PRIVATE_UNSTABLE_H__*/ diff --git a/Prism/vendor/mono/include/mono/metadata/object-forward.h b/Prism/vendor/mono/include/mono/metadata/object-forward.h new file mode 100644 index 0000000..d8cca57 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/object-forward.h @@ -0,0 +1,22 @@ +/** + * \file + * + * Forward declarations of opaque types, and typedefs thereof. + * + */ + +#ifndef __MONO_OBJECT_FORWARD_H__ +#define __MONO_OBJECT_FORWARD_H__ + +#include + +typedef struct _MonoClass MonoClass; +typedef struct _MonoImage MonoImage; +typedef struct _MonoMethod MonoMethod; + +typedef struct _MonoObject MONO_RT_MANAGED_ATTR MonoObject; +typedef struct _MonoException MONO_RT_MANAGED_ATTR MonoException; +typedef struct _MonoReflectionAssembly MONO_RT_MANAGED_ATTR MonoReflectionAssembly; +typedef struct _MonoReflectionTypeBuilder MONO_RT_MANAGED_ATTR MonoReflectionTypeBuilder; + +#endif /* __MONO_OBJECT_FORWARD_H__ */ diff --git a/Prism/vendor/mono/include/mono/metadata/object.h b/Prism/vendor/mono/include/mono/metadata/object.h new file mode 100644 index 0000000..359fa51 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/object.h @@ -0,0 +1,48 @@ +/** + * \file + */ + +#ifndef _MONO_CLI_OBJECT_H_ +#define _MONO_CLI_OBJECT_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +#define MONO_OBJECT_SETREF(obj,fieldname,value) do { \ + mono_gc_wbarrier_set_field ((MonoObject*)(obj), &((obj)->fieldname), (MonoObject*)value); \ + /*(obj)->fieldname = (value);*/ \ + } while (0) + +/* This should be used if 's' can reside on the heap */ +#define MONO_STRUCT_SETREF(s,field,value) do { \ + mono_gc_wbarrier_generic_store (&((s)->field), (MonoObject*)(value)); \ + } while (0) + +#define mono_array_addr(array,type,index) ((type*)mono_array_addr_with_size ((array), sizeof (type), (index))) +#define mono_array_get(array,type,index) ( *(type*)mono_array_addr ((array), type, (index)) ) +#define mono_array_set(array,type,index,value) \ + do { \ + type *__p = (type *) mono_array_addr ((array), type, (index)); \ + *__p = (value); \ + } while (0) +#define mono_array_setref(array,index,value) \ + do { \ + void **__p = (void **) mono_array_addr ((array), void*, (index)); \ + mono_gc_wbarrier_set_arrayref ((array), __p, (MonoObject*)(value)); \ + /* *__p = (value);*/ \ + } while (0) +#define mono_array_memcpy_refs(dest,destidx,src,srcidx,count) \ + do { \ + void **__p = (void **) mono_array_addr ((dest), void*, (destidx)); \ + void **__s = mono_array_addr ((src), void*, (srcidx)); \ + mono_gc_wbarrier_arrayref_copy (__p, __s, (count)); \ + } while (0) + +MONO_END_DECLS + +#endif diff --git a/Prism/vendor/mono/include/mono/metadata/opcodes.h b/Prism/vendor/mono/include/mono/metadata/opcodes.h new file mode 100644 index 0000000..92dc15d --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/opcodes.h @@ -0,0 +1,28 @@ +/** + * \file + */ + +#ifndef __MONO_METADATA_OPCODES_H__ +#define __MONO_METADATA_OPCODES_H__ + +/* + * opcodes.h: CIL instruction information + * + * Author: + * Paolo Molaro (lupus@ximian.com) + * + * (C) 2002 Ximian, Inc. + */ + +#include + +MONO_BEGIN_DECLS +MONO_API_DATA const MonoOpcode mono_opcodes []; + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION +MONO_END_DECLS + +#endif /* __MONO_METADATA_OPCODES_H__ */ + diff --git a/Prism/vendor/mono/include/mono/metadata/profiler-events.h b/Prism/vendor/mono/include/mono/metadata/profiler-events.h new file mode 100644 index 0000000..20300bf --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/profiler-events.h @@ -0,0 +1,110 @@ +/* + * Licensed to the .NET Foundation under one or more agreements. + * The .NET Foundation licenses this file to you under the MIT license. + */ + +/* + * To #include this file, #define the following macros first: + * + * MONO_PROFILER_EVENT_0(name, type) + * MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name) + * MONO_PROFILER_EVENT_2(name, type, arg1_type, arg1_name, arg2_type, arg2_name) + * MONO_PROFILER_EVENT_3(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name) + * MONO_PROFILER_EVENT_4(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name) + * MONO_PROFILER_EVENT_5(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name, arg5_type, arg5_name) + * + * To add new callbacks to the API, simply add a line in this file and use + * MONO_PROFILER_RAISE to raise the event wherever. + * + * If you need more arguments then the current macros provide, add another + * macro and update all areas where the macros are used. Remember that this is + * a public header and not all users will be defining the newly added macro. So + * to prevent errors in existing code, you must add something like this at the + * beginning of this file: + * + * #ifndef MONO_PROFILER_EVENT_6 + * #define MONO_PROFILER_EVENT_6(...) # Do nothing. + * #endif + */ + +#ifndef MONO_PROFILER_EVENT_5 +#define MONO_PROFILER_EVENT_5(...) +#endif + +MONO_PROFILER_EVENT_0(runtime_initialized, RuntimeInitialized) +MONO_PROFILER_EVENT_0(runtime_shutdown_begin, RuntimeShutdownBegin) +MONO_PROFILER_EVENT_0(runtime_shutdown_end, RuntimeShutdownEnd) + +MONO_PROFILER_EVENT_1(context_loaded, ContextLoaded, MonoAppContext *, context) +MONO_PROFILER_EVENT_1(context_unloaded, ContextUnloaded, MonoAppContext *, context) + +MONO_PROFILER_EVENT_1(domain_loading, DomainLoading, MonoDomain *, domain) +MONO_PROFILER_EVENT_1(domain_loaded, DomainLoaded, MonoDomain *, domain) +MONO_PROFILER_EVENT_1(domain_unloading, DomainUnloading, MonoDomain *, domain) +MONO_PROFILER_EVENT_1(domain_unloaded, DomainUnloaded, MonoDomain *, domain) +MONO_PROFILER_EVENT_2(domain_name, DomainName, MonoDomain *, domain, const char *, name) + +MONO_PROFILER_EVENT_1(jit_begin, JitBegin, MonoMethod *, method) +MONO_PROFILER_EVENT_1(jit_failed, JitFailed, MonoMethod *, method) +MONO_PROFILER_EVENT_2(jit_done, JitDone, MonoMethod *, method, MonoJitInfo *, jinfo) +MONO_PROFILER_EVENT_2(jit_chunk_created, JitChunkCreated, const mono_byte *, chunk, uintptr_t, size) +MONO_PROFILER_EVENT_1(jit_chunk_destroyed, JitChunkDestroyed, const mono_byte *, chunk) +MONO_PROFILER_EVENT_4(jit_code_buffer, JitCodeBuffer, const mono_byte *, buffer, uint64_t, size, MonoProfilerCodeBufferType, type, const void *, data) + +MONO_PROFILER_EVENT_1(class_loading, ClassLoading, MonoClass *, klass) +MONO_PROFILER_EVENT_1(class_failed, ClassFailed, MonoClass *, klass) +MONO_PROFILER_EVENT_1(class_loaded, ClassLoaded, MonoClass *, klass) + +MONO_PROFILER_EVENT_1(vtable_loading, VTableLoading, MonoVTable *, vtable) +MONO_PROFILER_EVENT_1(vtable_failed, VTableFailed, MonoVTable *, vtable) +MONO_PROFILER_EVENT_1(vtable_loaded, VTableLoaded, MonoVTable *, vtable) + +MONO_PROFILER_EVENT_1(image_loading, ModuleLoading, MonoImage *, image) +MONO_PROFILER_EVENT_1(image_failed, ModuleFailed, MonoImage *, image) +MONO_PROFILER_EVENT_1(image_loaded, ModuleLoaded, MonoImage *, image) +MONO_PROFILER_EVENT_1(image_unloading, ModuleUnloading, MonoImage *, image) +MONO_PROFILER_EVENT_1(image_unloaded, ModuleUnloaded, MonoImage *, image) + +MONO_PROFILER_EVENT_1(assembly_loading, AssemblyLoading, MonoAssembly *, assembly) +MONO_PROFILER_EVENT_1(assembly_loaded, AssemblyLLoaded, MonoAssembly *, assembly) +MONO_PROFILER_EVENT_1(assembly_unloading, AssemblyLUnloading, MonoAssembly *, assembly) +MONO_PROFILER_EVENT_1(assembly_unloaded, AssemblyLUnloaded, MonoAssembly *, assembly) + +MONO_PROFILER_EVENT_2(method_enter, MethodEnter, MonoMethod *, method, MonoProfilerCallContext *, context) +MONO_PROFILER_EVENT_2(method_leave, MethodLeave, MonoMethod *, method, MonoProfilerCallContext *, context) +MONO_PROFILER_EVENT_2(method_tail_call, MethodTailCall, MonoMethod *, method, MonoMethod *, target) +MONO_PROFILER_EVENT_2(method_exception_leave, MethodExceptionLeave, MonoMethod *, method, MonoObject *, exception) +MONO_PROFILER_EVENT_1(method_free, MethodFree, MonoMethod *, method) +MONO_PROFILER_EVENT_1(method_begin_invoke, MethodBeginInvoke, MonoMethod *, method) +MONO_PROFILER_EVENT_1(method_end_invoke, MethodEndInvoke, MonoMethod *, method) + +MONO_PROFILER_EVENT_1(exception_throw, ExceptionThrow, MonoObject *, exception) +MONO_PROFILER_EVENT_4(exception_clause, ExceptionClause, MonoMethod *, method, uint32_t, index, MonoExceptionEnum, type, MonoObject *, exception) + +MONO_PROFILER_EVENT_3(gc_event, GCEvent2, MonoProfilerGCEvent, event, uint32_t, generation, mono_bool, is_serial) +MONO_PROFILER_EVENT_1(gc_allocation, GCAllocation, MonoObject *, object) +MONO_PROFILER_EVENT_2(gc_moves, GCMoves, MonoObject *const *, objects, uint64_t, count) +MONO_PROFILER_EVENT_1(gc_resize, GCResize, uintptr_t, size) +MONO_PROFILER_EVENT_3(gc_handle_created, GCHandleCreated, uint32_t, handle, MonoGCHandleType, type, MonoObject *, object) +MONO_PROFILER_EVENT_2(gc_handle_deleted, GCHandleDeleted, uint32_t, handle, MonoGCHandleType, type) +MONO_PROFILER_EVENT_0(gc_finalizing, GCFinalizing) +MONO_PROFILER_EVENT_0(gc_finalized, GCFinalized) +MONO_PROFILER_EVENT_1(gc_finalizing_object, GCFinalizingObject, MonoObject *, object) +MONO_PROFILER_EVENT_1(gc_finalized_object, GCFinalizedObject, MonoObject *, object) +MONO_PROFILER_EVENT_5(gc_root_register, RootRegister, const mono_byte *, start, uintptr_t, size, MonoGCRootSource, source, const void *, key, const char *, name) +MONO_PROFILER_EVENT_1(gc_root_unregister, RootUnregister, const mono_byte *, start) +MONO_PROFILER_EVENT_3(gc_roots, GCRoots, uint64_t, count, const mono_byte *const *, addresses, MonoObject *const *, objects) + +MONO_PROFILER_EVENT_1(monitor_contention, MonitorContention, MonoObject *, object) +MONO_PROFILER_EVENT_1(monitor_failed, MonitorFailed, MonoObject *, object) +MONO_PROFILER_EVENT_1(monitor_acquired, MonitorAcquired, MonoObject *, object) + +MONO_PROFILER_EVENT_1(thread_started, ThreadStarted, uintptr_t, tid) +MONO_PROFILER_EVENT_1(thread_stopping, ThreadStopping, uintptr_t, tid) +MONO_PROFILER_EVENT_1(thread_stopped, ThreadStopped, uintptr_t, tid) +MONO_PROFILER_EVENT_1(thread_exited, ThreadExited, uintptr_t, tid) +MONO_PROFILER_EVENT_2(thread_name, ThreadName, uintptr_t, tid, const char *, name) + +MONO_PROFILER_EVENT_2(sample_hit, SampleHit, const mono_byte *, ip, const void *, context) + +MONO_PROFILER_EVENT_2(inline_method, InlineMethod, MonoMethod *, method, MonoMethod *, inlined_method) diff --git a/Prism/vendor/mono/include/mono/metadata/profiler.h b/Prism/vendor/mono/include/mono/metadata/profiler.h new file mode 100644 index 0000000..13cf7bb --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/profiler.h @@ -0,0 +1,112 @@ +/* + * Licensed to the .NET Foundation under one or more agreements. + * The .NET Foundation licenses this file to you under the MIT license. + */ + +#ifndef __MONO_PROFILER_H__ +#define __MONO_PROFILER_H__ + +#include + +MONO_BEGIN_DECLS + +/** + * This value will be incremented whenever breaking changes to the profiler API + * are made. This macro is intended for use in profiler modules that wish to + * support older versions of the profiler API. + * + * Version 2: + * - Major overhaul of the profiler API. + * Version 3: + * - Added mono_profiler_enable_clauses (). This must now be called to enable + * raising exception_clause events. + * - The exception argument to exception_clause events can now be NULL for + * finally clauses invoked in the non-exceptional case. + * - The type argument to exception_clause events will now correctly indicate + * that the catch portion of the clause is being executed in the case of + * try-filter-catch clauses. + * - Removed the iomap_report event. + * - Removed the old gc_event event and renamed gc_event2 to gc_event. + */ +#define MONO_PROFILER_API_VERSION 3 + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +/* + * The macros below will generate the majority of the callback API. Refer to + * mono/metadata/profiler-events.h for a list of callbacks. They are expanded + * like so: + * + * typedef void (*MonoProfilerRuntimeInitializedCallback (MonoProfiler *prof); + * MONO_API void mono_profiler_set_runtime_initialized_callback (MonoProfiler *prof, MonoProfilerRuntimeInitializedCallback cb); + * + * typedef void (*MonoProfilerRuntimeShutdownCallback (MonoProfiler *prof); + * MONO_API void mono_profiler_set_runtime_shutdown_callback (MonoProfiler *prof, MonoProfilerRuntimeShutdownCallback cb); + * + * typedef void (*MonoProfilerContextLoadedCallback (MonoProfiler *prof); + * MONO_API void mono_profiler_set_context_loaded_callback (MonoProfiler *prof, MonoProfilerContextLoadedCallback cb); + * + * typedef void (*MonoProfilerContextUnloadedCallback (MonoProfiler *prof); + * MONO_API void mono_profiler_set_context_unloaded_callback (MonoProfiler *prof, MonoProfilerContextUnloadedCallback cb); + * + * Etc. + * + * To remove a callback, pass NULL instead of a valid function pointer. + * Callbacks can be changed at any point, but note that doing so is inherently + * racy with respect to threads that aren't suspended, i.e. you may still see a + * call from another thread right after you change a callback. + * + * These functions are async safe. + */ + +#define _MONO_PROFILER_EVENT(type, ...) \ + typedef void (*MonoProfiler ## type ## Callback) (__VA_ARGS__); +#define MONO_PROFILER_EVENT_0(name, type) \ + _MONO_PROFILER_EVENT(type, MonoProfiler *prof) +#define MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name) \ + _MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name) +#define MONO_PROFILER_EVENT_2(name, type, arg1_type, arg1_name, arg2_type, arg2_name) \ + _MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name) +#define MONO_PROFILER_EVENT_3(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name) \ + _MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name, arg3_type arg3_name) +#define MONO_PROFILER_EVENT_4(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name) \ + _MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name, arg3_type arg3_name, arg4_type arg4_name) +#define MONO_PROFILER_EVENT_5(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name, arg5_type, arg5_name) \ + _MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name, arg3_type arg3_name, arg4_type arg4_name, arg5_type arg5_name) +#include +#undef MONO_PROFILER_EVENT_0 +#undef MONO_PROFILER_EVENT_1 +#undef MONO_PROFILER_EVENT_2 +#undef MONO_PROFILER_EVENT_3 +#undef MONO_PROFILER_EVENT_4 +#undef MONO_PROFILER_EVENT_5 +#undef _MONO_PROFILER_EVENT + +#define _MONO_PROFILER_EVENT(name, type) \ + MONO_API void mono_profiler_set_ ## name ## _callback (MonoProfilerHandle handle, MonoProfiler ## type ## Callback cb); +#define MONO_PROFILER_EVENT_0(name, type) \ + _MONO_PROFILER_EVENT(name, type) +#define MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name) \ + _MONO_PROFILER_EVENT(name, type) +#define MONO_PROFILER_EVENT_2(name, type, arg1_type, arg1_name, arg2_type, arg2_name) \ + _MONO_PROFILER_EVENT(name, type) +#define MONO_PROFILER_EVENT_3(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name) \ + _MONO_PROFILER_EVENT(name, type) +#define MONO_PROFILER_EVENT_4(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name) \ + _MONO_PROFILER_EVENT(name, type) +#define MONO_PROFILER_EVENT_5(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name, arg5_type, arg5_name) \ + _MONO_PROFILER_EVENT(name, type) +#include +#undef MONO_PROFILER_EVENT_0 +#undef MONO_PROFILER_EVENT_1 +#undef MONO_PROFILER_EVENT_2 +#undef MONO_PROFILER_EVENT_3 +#undef MONO_PROFILER_EVENT_4 +#undef MONO_PROFILER_EVENT_5 +#undef _MONO_PROFILER_EVENT + +MONO_END_DECLS + +#endif // __MONO_PROFILER_H__ diff --git a/Prism/vendor/mono/include/mono/metadata/reflection.h b/Prism/vendor/mono/include/mono/metadata/reflection.h new file mode 100644 index 0000000..c8f62d4 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/reflection.h @@ -0,0 +1,18 @@ +/** + * \file + */ + +#ifndef __METADATA_REFLECTION_H__ +#define __METADATA_REFLECTION_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __METADATA_REFLECTION_H__ */ diff --git a/Prism/vendor/mono/include/mono/metadata/row-indexes.h b/Prism/vendor/mono/include/mono/metadata/row-indexes.h new file mode 100644 index 0000000..64534db --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/row-indexes.h @@ -0,0 +1,503 @@ +/** + * \file + */ + +#ifndef __MONO_METADATA_ROW_INDEXES_H__ +#define __MONO_METADATA_ROW_INDEXES_H__ + +/* + * The last entry in the enum is used to give the number + * of columns in the row. + */ + +enum { + MONO_ASSEMBLY_HASH_ALG, + MONO_ASSEMBLY_MAJOR_VERSION, + MONO_ASSEMBLY_MINOR_VERSION, + MONO_ASSEMBLY_BUILD_NUMBER, + MONO_ASSEMBLY_REV_NUMBER, + MONO_ASSEMBLY_FLAGS, + MONO_ASSEMBLY_PUBLIC_KEY, + MONO_ASSEMBLY_NAME, + MONO_ASSEMBLY_CULTURE, + MONO_ASSEMBLY_SIZE +}; + +enum { + MONO_ASSEMBLYOS_PLATFORM, + MONO_ASSEMBLYOS_MAJOR_VERSION, + MONO_ASSEMBLYOS_MINOR_VERSION, + MONO_ASSEMBLYOS_SIZE +}; + +enum { + MONO_ASSEMBLY_PROCESSOR, + MONO_ASSEMBLY_PROCESSOR_SIZE +}; + +enum { + MONO_ASSEMBLYREF_MAJOR_VERSION, + MONO_ASSEMBLYREF_MINOR_VERSION, + MONO_ASSEMBLYREF_BUILD_NUMBER, + MONO_ASSEMBLYREF_REV_NUMBER, + MONO_ASSEMBLYREF_FLAGS, + MONO_ASSEMBLYREF_PUBLIC_KEY, + MONO_ASSEMBLYREF_NAME, + MONO_ASSEMBLYREF_CULTURE, + MONO_ASSEMBLYREF_HASH_VALUE, + MONO_ASSEMBLYREF_SIZE +}; + +enum { + MONO_ASSEMBLYREFOS_PLATFORM, + MONO_ASSEMBLYREFOS_MAJOR_VERSION, + MONO_ASSEMBLYREFOS_MINOR_VERSION, + MONO_ASSEMBLYREFOS_ASSEMBLYREF, + MONO_ASSEMBLYREFOS_SIZE +}; + +enum { + MONO_ASSEMBLYREFPROC_PROCESSOR, + MONO_ASSEMBLYREFPROC_ASSEMBLYREF, + MONO_ASSEMBLYREFPROC_SIZE +}; + +enum { + MONO_CLASS_LAYOUT_PACKING_SIZE, + MONO_CLASS_LAYOUT_CLASS_SIZE, + MONO_CLASS_LAYOUT_PARENT, + MONO_CLASS_LAYOUT_SIZE +}; + +enum { + MONO_CONSTANT_TYPE, + MONO_CONSTANT_PADDING, + MONO_CONSTANT_PARENT, + MONO_CONSTANT_VALUE, + MONO_CONSTANT_SIZE +}; + +enum { + MONO_CUSTOM_ATTR_PARENT, + MONO_CUSTOM_ATTR_TYPE, + MONO_CUSTOM_ATTR_VALUE, + MONO_CUSTOM_ATTR_SIZE +}; + +enum { + MONO_DECL_SECURITY_ACTION, + MONO_DECL_SECURITY_PARENT, + MONO_DECL_SECURITY_PERMISSIONSET, + MONO_DECL_SECURITY_SIZE +}; + +enum { + MONO_EVENT_MAP_PARENT, + MONO_EVENT_MAP_EVENTLIST, + MONO_EVENT_MAP_SIZE +}; + +enum { + MONO_EVENT_FLAGS, + MONO_EVENT_NAME, + MONO_EVENT_TYPE, + MONO_EVENT_SIZE +}; + +enum { + MONO_EVENT_POINTER_EVENT, + MONO_EVENT_POINTER_SIZE +}; + +enum { + MONO_EXP_TYPE_FLAGS, + MONO_EXP_TYPE_TYPEDEF, + MONO_EXP_TYPE_NAME, + MONO_EXP_TYPE_NAMESPACE, + MONO_EXP_TYPE_IMPLEMENTATION, + MONO_EXP_TYPE_SIZE +}; + +enum { + MONO_FIELD_FLAGS, + MONO_FIELD_NAME, + MONO_FIELD_SIGNATURE, + MONO_FIELD_SIZE +}; + +enum { + MONO_FIELD_LAYOUT_OFFSET, + MONO_FIELD_LAYOUT_FIELD, + MONO_FIELD_LAYOUT_SIZE +}; + +enum { + MONO_FIELD_MARSHAL_PARENT, + MONO_FIELD_MARSHAL_NATIVE_TYPE, + MONO_FIELD_MARSHAL_SIZE +}; + +enum { + MONO_FIELD_POINTER_FIELD, + MONO_FIELD_POINTER_SIZE +}; + +enum { + MONO_FIELD_RVA_RVA, + MONO_FIELD_RVA_FIELD, + MONO_FIELD_RVA_SIZE +}; + +enum { + MONO_ENCLOG_TOKEN, + MONO_ENCLOG_FUNC_CODE, + MONO_ENCLOG_SIZE +}; + +enum { + MONO_ENCMAP_TOKEN, + MONO_ENCMAP_SIZE +}; + +enum { + MONO_FILE_FLAGS, + MONO_FILE_NAME, + MONO_FILE_HASH_VALUE, + MONO_FILE_SIZE +}; + +enum { + MONO_IMPLMAP_FLAGS, + MONO_IMPLMAP_MEMBER, + MONO_IMPLMAP_NAME, + MONO_IMPLMAP_SCOPE, + MONO_IMPLMAP_SIZE +}; + +enum { + MONO_INTERFACEIMPL_CLASS, + MONO_INTERFACEIMPL_INTERFACE, + MONO_INTERFACEIMPL_SIZE +}; + +enum { + MONO_MANIFEST_OFFSET, + MONO_MANIFEST_FLAGS, + MONO_MANIFEST_NAME, + MONO_MANIFEST_IMPLEMENTATION, + MONO_MANIFEST_SIZE +}; + +enum { + MONO_MEMBERREF_CLASS, + MONO_MEMBERREF_NAME, + MONO_MEMBERREF_SIGNATURE, + MONO_MEMBERREF_SIZE +}; + +enum { + MONO_METHOD_RVA, + MONO_METHOD_IMPLFLAGS, + MONO_METHOD_FLAGS, + MONO_METHOD_NAME, + MONO_METHOD_SIGNATURE, + MONO_METHOD_PARAMLIST, + MONO_METHOD_SIZE +}; + +enum { + MONO_METHODIMPL_CLASS, + MONO_METHODIMPL_BODY, + MONO_METHODIMPL_DECLARATION, + MONO_METHODIMPL_SIZE +}; + +enum { + MONO_METHOD_POINTER_METHOD, + MONO_METHOD_POINTER_SIZE +}; + +enum { + MONO_METHOD_SEMA_SEMANTICS, + MONO_METHOD_SEMA_METHOD, + MONO_METHOD_SEMA_ASSOCIATION, + MONO_METHOD_SEMA_SIZE +}; + +enum { + MONO_MODULE_GENERATION, + MONO_MODULE_NAME, + MONO_MODULE_MVID, + MONO_MODULE_ENC, + MONO_MODULE_ENCBASE, + MONO_MODULE_SIZE +}; + +enum { + MONO_MODULEREF_NAME, + MONO_MODULEREF_SIZE +}; + +enum { + MONO_NESTED_CLASS_NESTED, + MONO_NESTED_CLASS_ENCLOSING, + MONO_NESTED_CLASS_SIZE +}; + +enum { + MONO_PARAM_FLAGS, + MONO_PARAM_SEQUENCE, + MONO_PARAM_NAME, + MONO_PARAM_SIZE +}; + +enum { + MONO_PARAM_POINTER_PARAM, + MONO_PARAM_POINTER_SIZE +}; + +enum { + MONO_PROPERTY_FLAGS, + MONO_PROPERTY_NAME, + MONO_PROPERTY_TYPE, + MONO_PROPERTY_SIZE +}; + +enum { + MONO_PROPERTY_POINTER_PROPERTY, + MONO_PROPERTY_POINTER_SIZE +}; + +enum { + MONO_PROPERTY_MAP_PARENT, + MONO_PROPERTY_MAP_PROPERTY_LIST, + MONO_PROPERTY_MAP_SIZE +}; + +enum { + MONO_STAND_ALONE_SIGNATURE, + MONO_STAND_ALONE_SIGNATURE_SIZE +}; + +enum { + MONO_TYPEDEF_FLAGS, + MONO_TYPEDEF_NAME, + MONO_TYPEDEF_NAMESPACE, + MONO_TYPEDEF_EXTENDS, + MONO_TYPEDEF_FIELD_LIST, + MONO_TYPEDEF_METHOD_LIST, + MONO_TYPEDEF_SIZE +}; + +enum { + MONO_TYPEREF_SCOPE, + MONO_TYPEREF_NAME, + MONO_TYPEREF_NAMESPACE, + MONO_TYPEREF_SIZE +}; + +enum { + MONO_TYPESPEC_SIGNATURE, + MONO_TYPESPEC_SIZE +}; + +enum { + MONO_GENERICPARAM_NUMBER, + MONO_GENERICPARAM_FLAGS, + MONO_GENERICPARAM_OWNER, + MONO_GENERICPARAM_NAME, + + MONO_GENERICPARAM_SIZE +}; + +enum { + MONO_METHODSPEC_METHOD, + MONO_METHODSPEC_SIGNATURE, + MONO_METHODSPEC_SIZE +}; + +enum { + MONO_GENPARCONSTRAINT_GENERICPAR, + MONO_GENPARCONSTRAINT_CONSTRAINT, + MONO_GENPARCONSTRAINT_SIZE +}; + +enum { + MONO_DOCUMENT_NAME, + MONO_DOCUMENT_HASHALG, + MONO_DOCUMENT_HASH, + MONO_DOCUMENT_LANGUAGE, + MONO_DOCUMENT_SIZE +}; + +enum { + MONO_METHODBODY_DOCUMENT, + MONO_METHODBODY_SEQ_POINTS, + MONO_METHODBODY_SIZE +}; + +enum { + MONO_LOCALSCOPE_METHOD, + MONO_LOCALSCOPE_IMPORTSCOPE, + MONO_LOCALSCOPE_VARIABLELIST, + MONO_LOCALSCOPE_CONSTANTLIST, + MONO_LOCALSCOPE_STARTOFFSET, + MONO_LOCALSCOPE_LENGTH, + MONO_LOCALSCOPE_SIZE +}; + +enum { + MONO_LOCALVARIABLE_ATTRIBUTES, + MONO_LOCALVARIABLE_INDEX, + MONO_LOCALVARIABLE_NAME, + MONO_LOCALVARIABLE_SIZE +}; + +enum { + MONO_CUSTOMDEBUGINFORMATION_PARENT, + MONO_CUSTOMDEBUGINFORMATION_KIND, + MONO_CUSTOMDEBUGINFORMATION_VALUE, + MONO_CUSTOMDEBUGINFORMATION_SIZE +}; + +/* + * Coded Tokens + * The _BITS entry is for the bits used in the token. + * The _MASK entry is for mask the index out. + */ + +enum { + MONO_TYPEDEFORREF_TYPEDEF, + MONO_TYPEDEFORREF_TYPEREF, + MONO_TYPEDEFORREF_TYPESPEC, + MONO_TYPEDEFORREF_BITS = 2, + MONO_TYPEDEFORREF_MASK = 3 +}; + +enum { + MONO_HASCONSTANT_FIEDDEF, + MONO_HASCONSTANT_PARAM, + MONO_HASCONSTANT_PROPERTY, + MONO_HASCONSTANT_BITS = 2, + MONO_HASCONSTANT_MASK = 3 +}; + +enum { + MONO_CUSTOM_ATTR_METHODDEF, + MONO_CUSTOM_ATTR_FIELDDEF, + MONO_CUSTOM_ATTR_TYPEREF, + MONO_CUSTOM_ATTR_TYPEDEF, + MONO_CUSTOM_ATTR_PARAMDEF, + MONO_CUSTOM_ATTR_INTERFACE, + MONO_CUSTOM_ATTR_MEMBERREF, + MONO_CUSTOM_ATTR_MODULE, + MONO_CUSTOM_ATTR_PERMISSION, + MONO_CUSTOM_ATTR_PROPERTY, + MONO_CUSTOM_ATTR_EVENT, + MONO_CUSTOM_ATTR_SIGNATURE, + MONO_CUSTOM_ATTR_MODULEREF, + MONO_CUSTOM_ATTR_TYPESPEC, + MONO_CUSTOM_ATTR_ASSEMBLY, + MONO_CUSTOM_ATTR_ASSEMBLYREF, + MONO_CUSTOM_ATTR_FILE, + MONO_CUSTOM_ATTR_EXP_TYPE, + MONO_CUSTOM_ATTR_MANIFEST, + MONO_CUSTOM_ATTR_GENERICPAR, + MONO_CUSTOM_ATTR_GENERICPARAMCONSTRAINT, + MONO_CUSTOM_ATTR_BITS = 5, + MONO_CUSTOM_ATTR_MASK = 0x1F +}; + +enum { + MONO_HAS_FIELD_MARSHAL_FIELDSREF, + MONO_HAS_FIELD_MARSHAL_PARAMDEF, + MONO_HAS_FIELD_MARSHAL_BITS = 1, + MONO_HAS_FIELD_MARSHAL_MASK = 1 +}; + +enum { + MONO_HAS_DECL_SECURITY_TYPEDEF, + MONO_HAS_DECL_SECURITY_METHODDEF, + MONO_HAS_DECL_SECURITY_ASSEMBLY, + MONO_HAS_DECL_SECURITY_BITS = 2, + MONO_HAS_DECL_SECURITY_MASK = 3 +}; + +enum { + MONO_MEMBERREF_PARENT_TYPEDEF, /* not used */ + MONO_MEMBERREF_PARENT_TYPEREF, + MONO_MEMBERREF_PARENT_MODULEREF, + MONO_MEMBERREF_PARENT_METHODDEF, + MONO_MEMBERREF_PARENT_TYPESPEC, + MONO_MEMBERREF_PARENT_BITS = 3, + MONO_MEMBERREF_PARENT_MASK = 7 +}; + +enum { + MONO_HAS_SEMANTICS_EVENT, + MONO_HAS_SEMANTICS_PROPERTY, + MONO_HAS_SEMANTICS_BITS = 1, + MONO_HAS_SEMANTICS_MASK = 1 +}; + +enum { + MONO_METHODDEFORREF_METHODDEF, + MONO_METHODDEFORREF_METHODREF, + MONO_METHODDEFORREF_BITS = 1, + MONO_METHODDEFORREF_MASK = 1 +}; + +enum { + MONO_MEMBERFORWD_FIELDDEF, + MONO_MEMBERFORWD_METHODDEF, + MONO_MEMBERFORWD_BITS = 1, + MONO_MEMBERFORWD_MASK = 1 +}; + +enum { + MONO_IMPLEMENTATION_FILE, + MONO_IMPLEMENTATION_ASSEMBLYREF, + MONO_IMPLEMENTATION_EXP_TYPE, + MONO_IMPLEMENTATION_BITS = 2, + MONO_IMPLEMENTATION_MASK = 3 +}; + +enum { + MONO_CUSTOM_ATTR_TYPE_TYPEREF, /* not used */ + MONO_CUSTOM_ATTR_TYPE_TYPEDEF, /* not used */ + MONO_CUSTOM_ATTR_TYPE_METHODDEF, + MONO_CUSTOM_ATTR_TYPE_MEMBERREF, + MONO_CUSTOM_ATTR_TYPE_STRING, /* not used */ + MONO_CUSTOM_ATTR_TYPE_BITS = 3, + MONO_CUSTOM_ATTR_TYPE_MASK = 7 +}; + +enum { + MONO_RESOLUTION_SCOPE_MODULE, + MONO_RESOLUTION_SCOPE_MODULEREF, + MONO_RESOLUTION_SCOPE_ASSEMBLYREF, + MONO_RESOLUTION_SCOPE_TYPEREF, + MONO_RESOLUTION_SCOPE_BITS = 2, + MONO_RESOLUTION_SCOPE_MASK = 3 +}; + +/* Kept for compatibility since this is a public header file */ +enum { + MONO_RESOLTION_SCOPE_MODULE, + MONO_RESOLTION_SCOPE_MODULEREF, + MONO_RESOLTION_SCOPE_ASSEMBLYREF, + MONO_RESOLTION_SCOPE_TYPEREF, + MONO_RESOLTION_SCOPE_BITS = 2, + MONO_RESOLTION_SCOPE_MASK = 3 +}; + +enum { + MONO_TYPEORMETHOD_TYPE, + MONO_TYPEORMETHOD_METHOD, + MONO_TYPEORMETHOD_BITS = 1, + MONO_TYPEORMETHOD_MASK = 1 +}; + +#endif /* __MONO_METADATA_ROW_INDEXES_H__ */ + + diff --git a/Prism/vendor/mono/include/mono/metadata/sgen-bridge.h b/Prism/vendor/mono/include/mono/metadata/sgen-bridge.h new file mode 100644 index 0000000..bb119e5 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/sgen-bridge.h @@ -0,0 +1,65 @@ +/** + * \file + * Copyright 2011 Novell, Inc. + * + * Licensed under the MIT license. See LICENSE file in the project root for full license information. + */ + +/* + * The bridge is a mechanism for SGen to let clients override the death of some + * unreachable objects. We use it in monodroid to do garbage collection across + * the Mono and Java heaps. + * + * The client (Monodroid) can designate some objects as "bridged", which means + * that they participate in the bridge processing step once SGen considers them + * unreachable, i.e., dead. Bridged objects must be registered for + * finalization. + * + * When SGen is done marking, it puts together a list of all dead bridged + * objects. This is passed to the bridge processor, which does an analysis to + * simplify the graph: It replaces strongly-connected components with single + * nodes, and may remove nodes corresponding to components which do not contain + * bridged objects. + * + * The output of the SCC analysis is passed to the client's `cross_references()` + * callback. This consists of 2 arrays, an array of SCCs (MonoGCBridgeSCC), + * and an array of "xrefs" (edges between SCCs, MonoGCBridgeXRef). Edges are + * encoded as pairs of "API indices", ie indexes in the SCC array. The client + * is expected to set the `is_alive` flag on those strongly connected components + * that it wishes to be kept alive. + * + * In monodroid each bridged object has a corresponding Java mirror object. In + * the bridge callback it reifies the Mono object graph in the Java heap so that + * the full, combined object graph is now instantiated on the Java side. Then + * it triggers a Java GC, waits for it to finish, and checks which of the Java + * mirror objects are still alive. For those it sets the `is_alive` flag and + * returns from the callback. + * + * The SCC analysis is done while the world is stopped, but the callback is made + * with the world running again. Weak links to bridged objects and other + * objects reachable from them are kept until the callback returns, at which + * point all links to bridged objects that don't have `is_alive` set are nulled. + * Note that weak links to non-bridged objects reachable from bridged objects + * are not nulled. This might be considered a bug. + * + * There are three different implementations of the bridge processor, each of + * which implements 8 callbacks (see SgenBridgeProcessor). The implementations + * differ in the algorithm they use to compute the "simplified" SCC graph. + */ + +#ifndef _MONO_SGEN_BRIDGE_H_ +#define _MONO_SGEN_BRIDGE_H_ + +#include + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif diff --git a/Prism/vendor/mono/include/mono/metadata/threads.h b/Prism/vendor/mono/include/mono/metadata/threads.h new file mode 100644 index 0000000..3d11ade --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/threads.h @@ -0,0 +1,25 @@ +/** + * \file + * Threading API + * + * Author: + * Dick Porter (dick@ximian.com) + * Patrik Torstensson (patrik.torstensson@labs2.com) + * + * (C) 2001 Ximian, Inc + */ + +#ifndef _MONO_METADATA_THREADS_H_ +#define _MONO_METADATA_THREADS_H_ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* _MONO_METADATA_THREADS_H_ */ diff --git a/Prism/vendor/mono/include/mono/metadata/tokentype.h b/Prism/vendor/mono/include/mono/metadata/tokentype.h new file mode 100644 index 0000000..c7ae117 --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/tokentype.h @@ -0,0 +1,45 @@ +/** + * \file + */ + +#ifndef _MONO_METADATA_TOKENTYPE_H_ +#define _MONO_METADATA_TOKENTYPE_H_ + +/* + * These tokens match the table ID except for the last + * three (string, name and base type which are special) + */ + +typedef enum { + MONO_TOKEN_MODULE = 0x00000000, + MONO_TOKEN_TYPE_REF = 0x01000000, + MONO_TOKEN_TYPE_DEF = 0x02000000, + MONO_TOKEN_FIELD_DEF = 0x04000000, + MONO_TOKEN_METHOD_DEF = 0x06000000, + MONO_TOKEN_PARAM_DEF = 0x08000000, + MONO_TOKEN_INTERFACE_IMPL = 0x09000000, + MONO_TOKEN_MEMBER_REF = 0x0a000000, + MONO_TOKEN_CUSTOM_ATTRIBUTE = 0x0c000000, + MONO_TOKEN_PERMISSION = 0x0e000000, + MONO_TOKEN_SIGNATURE = 0x11000000, + MONO_TOKEN_EVENT = 0x14000000, + MONO_TOKEN_PROPERTY = 0x17000000, + MONO_TOKEN_MODULE_REF = 0x1a000000, + MONO_TOKEN_TYPE_SPEC = 0x1b000000, + MONO_TOKEN_ASSEMBLY = 0x20000000, + MONO_TOKEN_ASSEMBLY_REF = 0x23000000, + MONO_TOKEN_FILE = 0x26000000, + MONO_TOKEN_EXPORTED_TYPE = 0x27000000, + MONO_TOKEN_MANIFEST_RESOURCE = 0x28000000, + MONO_TOKEN_GENERIC_PARAM = 0x2a000000, + MONO_TOKEN_METHOD_SPEC = 0x2b000000, + + /* + * These do not match metadata tables directly + */ + MONO_TOKEN_STRING = 0x70000000, + MONO_TOKEN_NAME = 0x71000000, + MONO_TOKEN_BASE_TYPE = 0x72000000 +} MonoTokenType; + +#endif /* _MONO_METADATA_TOKENTYPE_H_ */ diff --git a/Prism/vendor/mono/include/mono/metadata/verify.h b/Prism/vendor/mono/include/mono/metadata/verify.h new file mode 100644 index 0000000..6efb0fd --- /dev/null +++ b/Prism/vendor/mono/include/mono/metadata/verify.h @@ -0,0 +1,66 @@ +/** + * \file + */ + +#ifndef __MONO_METADATA_VERIFY_H__ +#define __MONO_METADATA_VERIFY_H__ + +#include +#include +#include +#include /* GSList dep */ + +MONO_BEGIN_DECLS + +typedef enum { + MONO_VERIFY_OK, + MONO_VERIFY_ERROR, + MONO_VERIFY_WARNING, + MONO_VERIFY_CLS = 4, + MONO_VERIFY_ALL = 7, + + /* Status signaling code that is not verifiable.*/ + MONO_VERIFY_NOT_VERIFIABLE = 8, + + /*OR it with other flags*/ + + /* Abort the verification if the code is not verifiable. + * The standard behavior is to abort if the code is not valid. + * */ + MONO_VERIFY_FAIL_FAST = 16, + + + /* Perform less verification of the code. This flag should be used + * if one wants the verifier to be more compatible to the MS runtime. + * Mind that this is not to be more compatible with MS peverify, but + * with the runtime itself, that has a less strict verifier. + */ + MONO_VERIFY_NON_STRICT = 32, + + /*Skip all visibility related checks*/ + MONO_VERIFY_SKIP_VISIBILITY = 64, + + /*Skip all visibility related checks*/ + MONO_VERIFY_REPORT_ALL_ERRORS = 128 + +} MonoVerifyStatus; + +typedef struct { + char *message; + MonoVerifyStatus status; +} MonoVerifyInfo; + +typedef struct { + MonoVerifyInfo info; + int8_t exception_type; /*should be one of MONO_EXCEPTION_* */ +} MonoVerifyInfoExtended; + + +MONO_API MONO_RT_EXTERNAL_ONLY GSList* mono_method_verify (MonoMethod *method, int level); +MONO_API MONO_RT_EXTERNAL_ONLY void mono_free_verify_list (GSList *list); +MONO_API MONO_RT_EXTERNAL_ONLY char* mono_verify_corlib (void); + +MONO_END_DECLS + +#endif /* __MONO_METADATA_VERIFY_H__ */ + diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-counters-functions.h b/Prism/vendor/mono/include/mono/utils/details/mono-counters-functions.h new file mode 100644 index 0000000..73f8860 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-counters-functions.h @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +// WARNING: The functions in this header are no-ops and provided for source compatibility with older versions of mono only. + +MONO_API_FUNCTION(void, mono_counters_enable, (int section_mask)) +MONO_API_FUNCTION(void, mono_counters_init, (void)) + +/* + * register addr as the address of a counter of type type. + * It may be a function pointer if MONO_COUNTER_CALLBACK is specified: + * the function should return the value and take no arguments. + */ +MONO_API_FUNCTION(void, mono_counters_register, (const char* descr, int type, void *addr)) +MONO_API_FUNCTION(void, mono_counters_register_with_size, (const char *name, int type, void *addr, int size)) + +MONO_API_FUNCTION(void, mono_counters_on_register, (MonoCounterRegisterCallback callback)) + +/* + * Create a readable dump of the counters for section_mask sections (ORed section values) + */ +MONO_API_FUNCTION(void, mono_counters_dump, (int section_mask, FILE *outfile)) + +MONO_API_FUNCTION(void, mono_counters_cleanup, (void)) + +MONO_API_FUNCTION(void, mono_counters_foreach, (CountersEnumCallback cb, void *user_data)) + +MONO_API_FUNCTION(int, mono_counters_sample, (MonoCounter *counter, void *buffer, int buffer_size)) + +MONO_API_FUNCTION(const char*, mono_counter_get_name, (MonoCounter *name)) +MONO_API_FUNCTION(int, mono_counter_get_type, (MonoCounter *counter)) +MONO_API_FUNCTION(int, mono_counter_get_section, (MonoCounter *counter)) +MONO_API_FUNCTION(int, mono_counter_get_unit, (MonoCounter *counter)) +MONO_API_FUNCTION(int, mono_counter_get_variance, (MonoCounter *counter)) +MONO_API_FUNCTION(size_t, mono_counter_get_size, (MonoCounter *counter)) + +MONO_API_FUNCTION(int, mono_runtime_resource_limit, (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit)) +MONO_API_FUNCTION(void, mono_runtime_resource_set_callback, (MonoResourceCallback callback)) +MONO_API_FUNCTION(void, mono_runtime_resource_check_limit, (int resource_type, uintptr_t value)) diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-counters-types.h b/Prism/vendor/mono/include/mono/utils/details/mono-counters-types.h new file mode 100644 index 0000000..196cef6 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-counters-types.h @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_COUNTERS_TYPES_H +#define _MONO_COUNTERS_TYPES_H + +#include +#include + +MONO_BEGIN_DECLS + +enum { + /* Counter type, bits 0-7. */ + MONO_COUNTER_INT, /* 32 bit int */ + MONO_COUNTER_UINT, /* 32 bit uint */ + MONO_COUNTER_WORD, /* pointer-sized int */ + MONO_COUNTER_LONG, /* 64 bit int */ + MONO_COUNTER_ULONG, /* 64 bit uint */ + MONO_COUNTER_DOUBLE, + MONO_COUNTER_STRING, /* char* */ + MONO_COUNTER_TIME_INTERVAL, /* 64 bits signed int holding usecs. */ + MONO_COUNTER_TYPE_MASK = 0xf, + MONO_COUNTER_CALLBACK = 128, /* ORed with the other values */ + MONO_COUNTER_SECTION_MASK = 0x00ffff00, + /* Sections, bits 8-23 (16 bits) */ + MONO_COUNTER_JIT = 1 << 8, + MONO_COUNTER_GC = 1 << 9, + MONO_COUNTER_METADATA = 1 << 10, + MONO_COUNTER_GENERICS = 1 << 11, + MONO_COUNTER_SECURITY = 1 << 12, + MONO_COUNTER_RUNTIME = 1 << 13, + MONO_COUNTER_SYSTEM = 1 << 14, + MONO_COUNTER_PERFCOUNTERS = 1 << 15, + MONO_COUNTER_PROFILER = 1 << 16, + MONO_COUNTER_INTERP = 1 << 17, + MONO_COUNTER_TIERED = 1 << 18, + MONO_COUNTER_LAST_SECTION, + + /* Unit, bits 24-27 (4 bits) */ + MONO_COUNTER_UNIT_SHIFT = 24, + MONO_COUNTER_UNIT_MASK = 0xFu << MONO_COUNTER_UNIT_SHIFT, + MONO_COUNTER_RAW = 0 << 24, /* Raw value */ + MONO_COUNTER_BYTES = 1 << 24, /* Quantity of bytes. RSS, active heap, etc */ + MONO_COUNTER_TIME = 2 << 24, /* Time interval in 100ns units. Minor pause, JIT compilation*/ + MONO_COUNTER_COUNT = 3 << 24, /* Number of things (threads, queued jobs) or Number of events triggered (Major collections, Compiled methods).*/ + MONO_COUNTER_PERCENTAGE = 4 << 24, /* [0-1] Fraction Percentage of something. Load average. */ + + /* Monotonicity, bits 28-31 (4 bits) */ + MONO_COUNTER_VARIANCE_SHIFT = 28, + MONO_COUNTER_VARIANCE_MASK = 0xFu << MONO_COUNTER_VARIANCE_SHIFT, + MONO_COUNTER_MONOTONIC = 1 << 28, /* This counter value always increase/decreases over time. Reported by --stat. */ + MONO_COUNTER_CONSTANT = 1 << 29, /* Fixed value. Used by configuration data. */ + MONO_COUNTER_VARIABLE = 1 << 30, /* This counter value can be anything on each sampling. Only interesting when sampling. */ +}; + +typedef struct _MonoCounter MonoCounter; + +typedef void (*MonoCounterRegisterCallback) (MonoCounter*); + +typedef mono_bool (*CountersEnumCallback) (MonoCounter *counter, void *user_data); + +typedef enum { + MONO_RESOURCE_JIT_CODE, /* bytes */ + MONO_RESOURCE_METADATA, /* bytes */ + MONO_RESOURCE_GC_HEAP, /* bytes */ + MONO_RESOURCE_COUNT /* non-ABI value */ +} MonoResourceType; + +typedef void (*MonoResourceCallback) (int resource_type, uintptr_t value, int is_soft); + +MONO_END_DECLS + +#endif /* _MONO_COUNTERS_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-dl-fallback-functions.h b/Prism/vendor/mono/include/mono/utils/details/mono-dl-fallback-functions.h new file mode 100644 index 0000000..6c9cfac --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-dl-fallback-functions.h @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MonoDlFallbackHandler *, mono_dl_fallback_register, (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func, \ + MonoDlFallbackClose close_func, void *user_data)) +MONO_API_FUNCTION(void, mono_dl_fallback_unregister, (MonoDlFallbackHandler *handler)) diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-dl-fallback-types.h b/Prism/vendor/mono/include/mono/utils/details/mono-dl-fallback-types.h new file mode 100644 index 0000000..b4f5db8 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-dl-fallback-types.h @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_DL_FALLBACK_TYPES_H +#define _MONO_DL_FALLBACK_TYPES_H + +#include + +MONO_BEGIN_DECLS + +enum { + MONO_DL_EAGER = 0, + MONO_DL_LAZY = 1, + // If MONO_DL_LOCAL is set, it will trump MONO_DL_GLOBAL. + MONO_DL_LOCAL = 2, + // MONO_DL_MASK is unused internally and no longer a full mask on netcore, given the introduction of MONO_DL_GLOBAL. Avoid. + MONO_DL_MASK = 3, + // Only applicable when building Mono in netcore mode. + MONO_DL_GLOBAL = 4 +}; + +/* + * This is the dynamic loader fallback API + */ +typedef struct MonoDlFallbackHandler MonoDlFallbackHandler; + +/* + * The "err" variable contents must be allocated using g_malloc or g_strdup + */ +typedef void* (*MonoDlFallbackLoad) (const char *name, int flags, char **err, void *user_data); +typedef void* (*MonoDlFallbackSymbol) (void *handle, const char *name, char **err, void *user_data); +typedef void* (*MonoDlFallbackClose) (void *handle, void *user_data); + +MONO_END_DECLS + +#endif diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-error-functions.h b/Prism/vendor/mono/include/mono/utils/details/mono-error-functions.h new file mode 100644 index 0000000..696b32d --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-error-functions.h @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_error_init, (MonoError *error)) +MONO_API_FUNCTION(void, mono_error_init_flags, (MonoError *error, unsigned short flags)) + +MONO_API_FUNCTION(void, mono_error_cleanup, (MonoError *error)) + +MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_error_ok, (MonoError *error)) + +MONO_API_FUNCTION(unsigned short, mono_error_get_error_code, (MonoError *error)) + +MONO_API_FUNCTION(const char*, mono_error_get_message, (MonoError *error)) diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-error-types.h b/Prism/vendor/mono/include/mono/utils/details/mono-error-types.h new file mode 100644 index 0000000..97c69f2 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-error-types.h @@ -0,0 +1,82 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_ERROR_TYPES_H +#define _MONO_ERROR_TYPES_H + +#include + +enum { + /* + The supplied strings were dup'd by means of calling mono_error_dup_strings. + */ + MONO_ERROR_FREE_STRINGS = 0x0001, + + /* + Something happened while processing the error and the resulting message is incomplete. + */ + MONO_ERROR_INCOMPLETE = 0x0002, + /* + This MonoError is heap allocated in a mempool + */ + MONO_ERROR_MEMPOOL_BOXED = 0x0004 +}; + +enum { + MONO_ERROR_NONE = 0, + MONO_ERROR_MISSING_METHOD = 1, + MONO_ERROR_MISSING_FIELD = 2, + MONO_ERROR_TYPE_LOAD = 3, + MONO_ERROR_FILE_NOT_FOUND = 4, + MONO_ERROR_BAD_IMAGE = 5, + MONO_ERROR_OUT_OF_MEMORY = 6, + MONO_ERROR_ARGUMENT = 7, + MONO_ERROR_ARGUMENT_NULL = 11, + MONO_ERROR_ARGUMENT_OUT_OF_RANGE = 14, + MONO_ERROR_NOT_VERIFIABLE = 8, + MONO_ERROR_INVALID_PROGRAM = 12, + MONO_ERROR_MEMBER_ACCESS = 13, + + /* + * This is a generic error mechanism is you need to raise an arbitrary corlib exception. + * You must pass the exception name otherwise prepare_exception will fail with internal execution. + */ + MONO_ERROR_GENERIC = 9, + /* This one encapsulates a managed exception instance */ + MONO_ERROR_EXCEPTION_INSTANCE = 10, + + /* Not a valid error code - indicates that the error was cleaned up and reused */ + MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff +}; + +#ifdef _MSC_VER +__pragma(warning (push)) +__pragma(warning (disable:4201)) +#endif + +/*Keep in sync with MonoErrorInternal*/ +typedef union _MonoError { + // Merge two uint16 into one uint32 so it can be initialized + // with one instruction instead of two. + uint32_t init; + struct { + uint16_t error_code; + uint16_t private_flags; /*DON'T TOUCH */ + void *hidden_1 [12]; /*DON'T TOUCH */ + }; +} MonoErrorExternal; + +#ifdef _MSC_VER +__pragma(warning (pop)) +#endif + +#ifdef MONO_INSIDE_RUNTIME +typedef union _MonoErrorInternal MonoError; +#else +typedef MonoErrorExternal MonoError; +#endif + +/* Mempool-allocated MonoError.*/ +typedef struct _MonoErrorBoxed MonoErrorBoxed; + +#endif diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-logger-functions.h b/Prism/vendor/mono/include/mono/utils/details/mono-logger-functions.h new file mode 100644 index 0000000..d24100f --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-logger-functions.h @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(void, mono_trace_set_level_string, (const char *value)) + +MONO_API_FUNCTION(void, mono_trace_set_mask_string, (const char *value)) + +MONO_API_FUNCTION(void, mono_trace_set_log_handler, (MonoLogCallback callback, void *user_data)) + +MONO_API_FUNCTION(void, mono_trace_set_print_handler, (MonoPrintCallback callback)) + +MONO_API_FUNCTION(void, mono_trace_set_printerr_handler, (MonoPrintCallback callback)) diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-logger-types.h b/Prism/vendor/mono/include/mono/utils/details/mono-logger-types.h new file mode 100644 index 0000000..8b90088 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-logger-types.h @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_LOGGER_TYPES_H +#define _MONO_LOGGER_TYPES_H + +#include + +MONO_BEGIN_DECLS + +typedef void (*MonoPrintCallback) (const char *string, mono_bool is_stdout); +typedef void (*MonoLogCallback) (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data); + +MONO_END_DECLS + +#endif /* _MONO_LOGGER_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-publib-functions.h b/Prism/vendor/mono/include/mono/utils/details/mono-publib-functions.h new file mode 100644 index 0000000..d6186b0 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-publib-functions.h @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION +#ifndef MONO_API_FUNCTION +#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" +#endif + +MONO_API_FUNCTION(void, mono_free, (void*)) +MONO_API_FUNCTION(mono_bool, mono_set_allocator_vtable, (MonoAllocatorVTable* vtable)) + diff --git a/Prism/vendor/mono/include/mono/utils/details/mono-publib-types.h b/Prism/vendor/mono/include/mono/utils/details/mono-publib-types.h new file mode 100644 index 0000000..551cf0a --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/details/mono-publib-types.h @@ -0,0 +1,180 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#ifndef _MONO_PUBLIB_TYPES_H +#define _MONO_PUBLIB_TYPES_H + +/* + * Minimal general purpose header for use in public mono header files. + * We can't include config.h, so we use compiler-specific preprocessor + * directives where needed. + */ + +#ifdef __cplusplus +#define MONO_BEGIN_DECLS extern "C" { +#define MONO_END_DECLS } +#else +#define MONO_BEGIN_DECLS /* nothing */ +#define MONO_END_DECLS /* nothing */ +#endif + +MONO_BEGIN_DECLS + +/* VS 2010 and later have stdint.h */ +#if defined(_MSC_VER) + +#if _MSC_VER < 1600 + +typedef __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +#else + +#include + +#endif + +#define MONO_API_EXPORT __declspec(dllexport) +#define MONO_API_IMPORT __declspec(dllimport) + +#else + +#include + +#if defined (__clang__) || defined (__GNUC__) +#define MONO_API_EXPORT __attribute__ ((__visibility__ ("default"))) +#else +#define MONO_API_EXPORT +#endif +#define MONO_API_IMPORT + +#endif /* end of compiler-specific stuff */ + +#include + +#ifdef __cplusplus +#define MONO_EXTERN_C extern "C" +#else +#define MONO_EXTERN_C /* nothing */ +#endif + +#if defined(MONO_DLL_EXPORT) + #define MONO_API_NO_EXTERN_C MONO_API_EXPORT +#elif defined(MONO_DLL_IMPORT) + #define MONO_API_NO_EXTERN_C MONO_API_IMPORT +#else + #define MONO_API_NO_EXTERN_C /* nothing */ +#endif + +#define MONO_API MONO_EXTERN_C MONO_API_NO_EXTERN_C + +// Should (but not must) wrap in extern "C" (MONO_BEGIN_DECLS, MONO_END_DECLS). +#define MONO_API_DATA MONO_API_NO_EXTERN_C extern + +typedef int32_t mono_bool; +typedef uint8_t mono_byte; +typedef mono_byte MonoBoolean; +#ifdef _WIN32 +MONO_END_DECLS +#include +typedef wchar_t mono_unichar2; +MONO_BEGIN_DECLS +#else +typedef uint16_t mono_unichar2; +#endif +typedef uint32_t mono_unichar4; + +typedef void (*MonoFunc) (void* data, void* user_data); +typedef void (*MonoHFunc) (void* key, void* value, void* user_data); + +#define MONO_ALLOCATOR_VTABLE_VERSION 1 + +typedef struct { + int version; + void *(*malloc) (size_t size); + void *(*realloc) (void *mem, size_t count); + void (*free) (void *mem); + void *(*calloc) (size_t count, size_t size); +} MonoAllocatorVTable; + +#define MONO_CONST_RETURN const + +/* + * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any + * other Mono header file if you use a different compiler from the one used to + * build Mono. + */ +#ifndef MONO_ZERO_LEN_ARRAY +#ifdef __GNUC__ +#define MONO_ZERO_LEN_ARRAY 0 +#else +#define MONO_ZERO_LEN_ARRAY 1 +#endif +#endif + +#if defined (MONO_INSIDE_RUNTIME) + +#if defined (__CENTRINEL__) +/* Centrinel is an analyzer that warns about raw pointer to managed objects + * inside Mono. + */ +#define MONO_RT_MANAGED_ATTR __CENTRINEL_MANAGED_ATTR +#define MONO_RT_CENTRINEL_SUPPRESS __CENTRINEL_SUPPRESS_ATTR(1) +#else +#define MONO_RT_MANAGED_ATTR +#define MONO_RT_CENTRINEL_SUPPRESS +#endif + +#if defined (__clang__) || defined (__GNUC__) +// attribute(deprecated(message)) was introduced in gcc 4.5. +// attribute(deprecated)) was introduced in gcc 4.0. +// Compare: https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Function-Attributes.html +// https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Function-Attributes.html +// https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html +#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define MONO_RT_EXTERNAL_ONLY \ + __attribute__ ((__deprecated__ ("The mono runtime must not call this function."))) \ + MONO_RT_CENTRINEL_SUPPRESS +#elif __GNUC__ >= 4 +#define MONO_RT_EXTERNAL_ONLY __attribute__ ((__deprecated__)) MONO_RT_CENTRINEL_SUPPRESS +#else +#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS +#endif + +#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) +// Pragmas for controlling diagnostics appear to be from gcc 4.2. +// This is used in place of configure gcc -Werror=deprecated-declarations: +// 1. To be portable across build systems. +// 2. configure is very sensitive to compiler flags; they break autoconf's probes. +// Though #2 can be mitigated by being late in configure. +#pragma GCC diagnostic error "-Wdeprecated-declarations" +#endif + +#else +#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS +#endif // clang or gcc + +#else +#define MONO_RT_EXTERNAL_ONLY +#define MONO_RT_MANAGED_ATTR +#endif /* MONO_INSIDE_RUNTIME */ + +#if defined (__clang__) || defined (__GNUC__) +#define _MONO_DEPRECATED __attribute__ ((__deprecated__)) +#elif defined (_MSC_VER) +#define _MONO_DEPRECATED __declspec (deprecated) +#else +#define _MONO_DEPRECATED +#endif + +#define MONO_DEPRECATED MONO_API MONO_RT_EXTERNAL_ONLY _MONO_DEPRECATED + +MONO_END_DECLS + +#endif /* _MONO_PUBLIB_TYPES_H */ diff --git a/Prism/vendor/mono/include/mono/utils/mono-counters.h b/Prism/vendor/mono/include/mono/utils/mono-counters.h new file mode 100644 index 0000000..6cf8c64 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-counters.h @@ -0,0 +1,22 @@ +/** + * \file + * + * WARNING: The functions in this header are no-ops and provided for source compatibility with older versions of mono only. + * + */ + +#ifndef __MONO_COUNTERS_H__ +#define __MONO_COUNTERS_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_COUNTERS_H__ */ + diff --git a/Prism/vendor/mono/include/mono/utils/mono-dl-fallback.h b/Prism/vendor/mono/include/mono/utils/mono-dl-fallback.h new file mode 100644 index 0000000..53d4dc3 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-dl-fallback.h @@ -0,0 +1,19 @@ +/** + * \file + */ + +#ifndef __MONO_UTILS_DL_FALLBACK_H__ +#define __MONO_UTILS_DL_FALLBACK_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_UTILS_DL_FALLBACK_H__ */ + diff --git a/Prism/vendor/mono/include/mono/utils/mono-error.h b/Prism/vendor/mono/include/mono/utils/mono-error.h new file mode 100644 index 0000000..c30c62f --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-error.h @@ -0,0 +1,18 @@ +/** + * \file + */ + +#ifndef __MONO_ERROR_H__ +#define __MONO_ERROR_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif diff --git a/Prism/vendor/mono/include/mono/utils/mono-forward.h b/Prism/vendor/mono/include/mono/utils/mono-forward.h new file mode 100644 index 0000000..784f6e0 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-forward.h @@ -0,0 +1,15 @@ +/** + * \file + * + * (C) 2018 Microsoft, Inc. + * + */ +#ifndef _MONO_UTILS_FORWARD_ +#define _MONO_UTILS_FORWARD_ + +typedef struct _MonoDomain MonoDomain; +typedef struct _MonoJitInfo MonoJitInfo; + +typedef void * MonoGCHandle; + +#endif diff --git a/Prism/vendor/mono/include/mono/utils/mono-jemalloc.h b/Prism/vendor/mono/include/mono/utils/mono-jemalloc.h new file mode 100644 index 0000000..73d869b --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-jemalloc.h @@ -0,0 +1,36 @@ +/** + * \file + * + * Header for jemalloc registration code + */ + +#ifndef __MONO_JEMALLOC_H__ +#define __MONO_JEMALLOC_H__ + +#if defined(MONO_JEMALLOC_ENABLED) + +#include + +/* Jemalloc can be configured in three ways. + * 1. You can use it with library loading hacks at run-time + * 2. You can use it as a global malloc replacement + * 3. You can use it with a prefix. If you use it with a prefix, you have to explicitly name the malloc function. + * + * In order to make this feature able to be toggled at run-time, I chose to use a prefix of mono_je. + * This mapping is captured below in the header, in the spirit of "no magic constants". + * + * The place that configures jemalloc and sets this prefix is in the Makefile in + * mono/jemalloc/Makefile.am + * + */ +#define MONO_JEMALLOC_MALLOC mono_jemalloc +#define MONO_JEMALLOC_REALLOC mono_jerealloc +#define MONO_JEMALLOC_FREE mono_jefree +#define MONO_JEMALLOC_CALLOC mono_jecalloc + +void mono_init_jemalloc (void); + +#endif + +#endif + diff --git a/Prism/vendor/mono/include/mono/utils/mono-logger.h b/Prism/vendor/mono/include/mono/utils/mono-logger.h new file mode 100644 index 0000000..477e362 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-logger.h @@ -0,0 +1,19 @@ +/** + * \file + */ + +#ifndef __MONO_LOGGER_H__ +#define __MONO_LOGGER_H__ + +#include +MONO_BEGIN_DECLS + +#include + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_LOGGER_H__ */ diff --git a/Prism/vendor/mono/include/mono/utils/mono-private-unstable.h b/Prism/vendor/mono/include/mono/utils/mono-private-unstable.h new file mode 100644 index 0000000..489c345 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-private-unstable.h @@ -0,0 +1,19 @@ +/** + * \file + * + * Private unstable APIs. + * + * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at + * any time. + * + */ + + +#ifndef __MONO_UTILS_MONO_PRIVATE_UNSTABLE_H__ +#define __MONO_UTILS_MONO_PRIVATE_UNSTABLE_H__ + +#include + + + +#endif /*__MONO_UTILS_MONO_PRIVATE_UNSTABLE_H__*/ diff --git a/Prism/vendor/mono/include/mono/utils/mono-publib.h b/Prism/vendor/mono/include/mono/utils/mono-publib.h new file mode 100644 index 0000000..72f91a2 --- /dev/null +++ b/Prism/vendor/mono/include/mono/utils/mono-publib.h @@ -0,0 +1,18 @@ +/** + * \file + */ + +#ifndef __MONO_PUBLIB_H__ +#define __MONO_PUBLIB_H__ + +#include + +MONO_BEGIN_DECLS + +#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args; +#include +#undef MONO_API_FUNCTION + +MONO_END_DECLS + +#endif /* __MONO_PUBLIB_H__ */ diff --git a/Prism/vendor/mono/lib/coreclr.import.lib b/Prism/vendor/mono/lib/coreclr.import.lib new file mode 100644 index 0000000..c8b9d62 Binary files /dev/null and b/Prism/vendor/mono/lib/coreclr.import.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-debugger-static.lib b/Prism/vendor/mono/lib/mono-component-debugger-static.lib new file mode 100644 index 0000000..da302aa Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-debugger-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-debugger-stub-static.lib b/Prism/vendor/mono/lib/mono-component-debugger-stub-static.lib new file mode 100644 index 0000000..762752d Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-debugger-stub-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-diagnostics_tracing-static.lib b/Prism/vendor/mono/lib/mono-component-diagnostics_tracing-static.lib new file mode 100644 index 0000000..793939a Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-diagnostics_tracing-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-diagnostics_tracing-stub-static.lib b/Prism/vendor/mono/lib/mono-component-diagnostics_tracing-stub-static.lib new file mode 100644 index 0000000..bb9d1cc Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-diagnostics_tracing-stub-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-hot_reload-static.lib b/Prism/vendor/mono/lib/mono-component-hot_reload-static.lib new file mode 100644 index 0000000..b598529 Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-hot_reload-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-hot_reload-stub-static.lib b/Prism/vendor/mono/lib/mono-component-hot_reload-stub-static.lib new file mode 100644 index 0000000..d6f15a4 Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-hot_reload-stub-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-marshal-ilgen-static.lib b/Prism/vendor/mono/lib/mono-component-marshal-ilgen-static.lib new file mode 100644 index 0000000..3f58c65 Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-marshal-ilgen-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-component-marshal-ilgen-stub-static.lib b/Prism/vendor/mono/lib/mono-component-marshal-ilgen-stub-static.lib new file mode 100644 index 0000000..92f9325 Binary files /dev/null and b/Prism/vendor/mono/lib/mono-component-marshal-ilgen-stub-static.lib differ diff --git a/Prism/vendor/mono/lib/mono-profiler-aot.lib b/Prism/vendor/mono/lib/mono-profiler-aot.lib new file mode 100644 index 0000000..ad48ab1 Binary files /dev/null and b/Prism/vendor/mono/lib/mono-profiler-aot.lib differ diff --git a/Prism/vendor/mono/lib/monosgen-2.0.lib b/Prism/vendor/mono/lib/monosgen-2.0.lib new file mode 100644 index 0000000..a6ac41e Binary files /dev/null and b/Prism/vendor/mono/lib/monosgen-2.0.lib differ