From 719d29dec3f97ddfa86a399e9ddb9e4276b7a4d1 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Tue, 22 Nov 2022 16:51:07 +0800 Subject: [PATCH] Renamed Mesh and Font structs in Managed to MeshAsset and FontAsset and reworked them to be a abstraction for asset IDs --- .../Resource/SHResourceManagerInterface.cpp | 59 ++++++++++ .../src/Resource/SHResourceManagerInterface.h | 111 ++++++++++++++++++ .../src/Resource/SHResourceManagerWrapper.cpp | 34 ------ .../src/Resource/SHResourceManagerWrapper.h | 57 --------- .../src/Assets/{Font.cxx => FontAsset.cxx} | 26 ++-- .../src/Assets/{Font.hxx => FontAsset.hxx} | 21 ++-- .../src/Assets/{Mesh.cxx => MeshAsset.cxx} | 26 ++-- .../src/Assets/{Mesh.hxx => MeshAsset.hxx} | 21 ++-- SHADE_Managed/src/Assets/NativeAsset.cxx | 13 +- SHADE_Managed/src/Assets/NativeAsset.hxx | 13 +- SHADE_Managed/src/Components/Renderable.cxx | 6 +- SHADE_Managed/src/Components/Renderable.hxx | 8 +- .../src/Components/TextRenderable.cxx | 6 +- .../src/Components/TextRenderable.hxx | 8 +- 14 files changed, 229 insertions(+), 180 deletions(-) create mode 100644 SHADE_Engine/src/Resource/SHResourceManagerInterface.cpp create mode 100644 SHADE_Engine/src/Resource/SHResourceManagerInterface.h delete mode 100644 SHADE_Engine/src/Resource/SHResourceManagerWrapper.cpp delete mode 100644 SHADE_Engine/src/Resource/SHResourceManagerWrapper.h rename SHADE_Managed/src/Assets/{Font.cxx => FontAsset.cxx} (79%) rename SHADE_Managed/src/Assets/{Font.hxx => FontAsset.hxx} (86%) rename SHADE_Managed/src/Assets/{Mesh.cxx => MeshAsset.cxx} (79%) rename SHADE_Managed/src/Assets/{Mesh.hxx => MeshAsset.hxx} (86%) diff --git a/SHADE_Engine/src/Resource/SHResourceManagerInterface.cpp b/SHADE_Engine/src/Resource/SHResourceManagerInterface.cpp new file mode 100644 index 00000000..d89a7b16 --- /dev/null +++ b/SHADE_Engine/src/Resource/SHResourceManagerInterface.cpp @@ -0,0 +1,59 @@ +/************************************************************************************//*! +\file SHResourceManagerInterface.cpp +\author Tng Kah Wei, kahwei.tng, 390009620 +\par email: kahwei.tng\@digipen.edu +\date Nov 22, 2022 +\brief Contains the definition of the functions of the + SHResourceManagerInterface static class. + +Copyright (C) 2022 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ +// Precompiled Header +#include "SHpch.h" +// Primary Include +#include "SHResourceManagerInterface.h" +// Project Includes +#include "SHResourceManager.h" + +namespace SHADE +{ + Handle SHResourceManagerInterface::LoadOrGetMesh(AssetID assetId) + { + return SHResourceManager::LoadOrGet(assetId); + } + Handle SHResourceManagerInterface::LoadOrGetTexture(AssetID assetId) + { + return SHResourceManager::LoadOrGet(assetId); + } + Handle SHResourceManagerInterface::LoadOrGetShaderModule(AssetID assetId) + { + return SHResourceManager::LoadOrGet(assetId); + } + Handle SHResourceManagerInterface::LoadOrGetMaterialSpec(AssetID assetId) + { + return SHResourceManager::LoadOrGet(assetId); + } + Handle SHResourceManagerInterface::LoadOrGetMaterial(AssetID assetId) + { + return SHResourceManager::LoadOrGet(assetId); + } + Handle SHResourceManagerInterface::LoadOrGetFont(AssetID assetId) + { + return SHResourceManager::LoadOrGet(assetId); + } + + /*-----------------------------------------------------------------------------------*/ + /* Query Functions */ + /*-----------------------------------------------------------------------------------*/ + std::optional SHResourceManagerInterface::GetAssetID(Handle handle) + { + return SHResourceManager::GetAssetID(handle); + } + + std::optional SHResourceManagerInterface::GetAssetName(Handle handle) + { + return SHResourceManager::GetAssetName(handle); + } +} diff --git a/SHADE_Engine/src/Resource/SHResourceManagerInterface.h b/SHADE_Engine/src/Resource/SHResourceManagerInterface.h new file mode 100644 index 00000000..359bd7c8 --- /dev/null +++ b/SHADE_Engine/src/Resource/SHResourceManagerInterface.h @@ -0,0 +1,111 @@ +/************************************************************************************//*! +\file SHResourceManagerInterface.h +\author Tng Kah Wei, kahwei.tng, 390009620 +\par email: kahwei.tng\@digipen.edu +\date Nov 22, 2022 +\brief Contains the definition of the SHResourceManagerInterface static class. + +Copyright (C) 2022 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ +#pragma once + +// STL Includes +#include +// Project Includes +#include "SH_API.h" +#include "Resource/SHHandle.h" +#include "Assets/SHAssetMacros.h" + +namespace SHADE +{ + /*-----------------------------------------------------------------------------------*/ + /* Forward Declarations */ + /*-----------------------------------------------------------------------------------*/ + class SHMesh; + class SHTexture; + class SHVkShaderModule; + struct SHMaterialSpec; + class SHMaterial; + class SHFont; + + /*-----------------------------------------------------------------------------------*/ + /* Type Definitions */ + /*-----------------------------------------------------------------------------------*/ + /// + /// Static class providing access to non-templated functions of SHResourceManager for + /// SHADE_Managed. + /// + class SH_API SHResourceManagerInterface + { + public: + /*---------------------------------------------------------------------------------*/ + /* Loading Functions */ + /*---------------------------------------------------------------------------------*/ + + /// + /// Wrapper for SHResourceManager::LoadOrGet(). + /// + /// Asset ID of the resource to load. + /// Handle to the resource to retrieve. + static Handle LoadOrGetMesh(AssetID assetId); + /// + /// Wrapper for SHResourceManager::LoadOrGet(). + /// + /// + /// Handle to the resource to retrieve. + static Handle LoadOrGetTexture(AssetID assetId); + /// + /// Wrapper for SHResourceManager::LoadOrGet(). + /// + /// Asset ID of the resource to load. + /// Handle to the resource to retrieve. + static Handle LoadOrGetShaderModule(AssetID assetId); + /// + /// Wrapper for SHResourceManager::LoadOrGet(). + /// + /// Asset ID of the resource to load. + /// Handle to the resource to retrieve. + static Handle LoadOrGetMaterialSpec (AssetID assetId); + /// + /// Wrapper for SHResourceManager::LoadOrGet(). + /// + /// Asset ID of the resource to load. + /// Handle to the resource to retrieve. + static Handle LoadOrGetMaterial(AssetID assetId); + /// + /// Wrapper for SHResourceManager::LoadOrGet(). + /// + /// Asset ID of the resource to load. + /// Handle to the resource to retrieve. + static Handle LoadOrGetFont(AssetID assetId); + + /*---------------------------------------------------------------------------------*/ + /* Query Functions */ + /*---------------------------------------------------------------------------------*/ + /// + /// Retrieves the AssetID associated with a specified Handle. + /// Compared to the templated version, this function is slower as it requires + /// searching through the storage of all resource types. + /// + /// Handle to get the AssetID of. + /// + /// AssetID for the specified Handle. If the Handle is invalid, there will be no + /// value. + /// + static std::optional GetAssetID(Handle handle); + /// + /// Retrieves the name associated with the AssetID that is associated with the + /// specified Handle. + /// Compared to the templated version, this function is slower as it requires + /// searching through the storage of all resource types. + /// + /// Handle to get the name of. + /// + /// Name for the specified Handle. If the Handle is invalid, there will be no + /// value. + /// + static std::optional GetAssetName(Handle handle); + }; +} \ No newline at end of file diff --git a/SHADE_Engine/src/Resource/SHResourceManagerWrapper.cpp b/SHADE_Engine/src/Resource/SHResourceManagerWrapper.cpp deleted file mode 100644 index f99e2dc6..00000000 --- a/SHADE_Engine/src/Resource/SHResourceManagerWrapper.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************************//*! -\file SHResourceManagerWrapper.cpp -\author Tng Kah Wei, kahwei.tng, 390009620 -\par email: kahwei.tng\@digipen.edu -\date Nov 22, 2022 -\brief Contains the definition of the functions of the SHResourceManagerWraper - static class. - -Copyright (C) 2022 DigiPen Institute of Technology. -Reproduction or disclosure of this file or its contents without the prior written consent -of DigiPen Institute of Technology is prohibited. -*//*************************************************************************************/ -// Precompiled Header -#include "SHpch.h" -// Primary Include -#include "SHResourceManagerWrapper.h" -// Project Includes -#include "SHResourceManager.h" - -namespace SHADE -{ - /*-----------------------------------------------------------------------------------*/ - /* Query Functions */ - /*-----------------------------------------------------------------------------------*/ - std::optional SHResourceManagerWrapper::GetAssetID(Handle handle) - { - return SHResourceManager::GetAssetID(handle); - } - - std::optional SHResourceManagerWrapper::GetAssetName(Handle handle) - { - return SHResourceManager::GetAssetName(handle); - } -} diff --git a/SHADE_Engine/src/Resource/SHResourceManagerWrapper.h b/SHADE_Engine/src/Resource/SHResourceManagerWrapper.h deleted file mode 100644 index 9f34f74e..00000000 --- a/SHADE_Engine/src/Resource/SHResourceManagerWrapper.h +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************************//*! -\file SHResourceManagerWrapper.h -\author Tng Kah Wei, kahwei.tng, 390009620 -\par email: kahwei.tng\@digipen.edu -\date Nov 22, 2022 -\brief Contains the definition of the SHResourceManagerWrapper static class. - -Copyright (C) 2022 DigiPen Institute of Technology. -Reproduction or disclosure of this file or its contents without the prior written consent -of DigiPen Institute of Technology is prohibited. -*//*************************************************************************************/ -#pragma once - -// STL Includes -#include -// Project Includes -#include "SH_API.h" -#include "Resource/SHHandle.h" -#include "Assets/SHAssetMacros.h" - -namespace SHADE -{ - /// - /// Static class providing access to non-templated functions of SHResourceManager for - /// SHADE_Managed. - /// - class SH_API SHResourceManagerWrapper - { - public: - /*---------------------------------------------------------------------------------*/ - /* Query Functions */ - /*---------------------------------------------------------------------------------*/ - /// - /// Retrieves the AssetID associated with a specified Handle. - /// Compared to the templated version, this function is slower as it requires - /// searching through the storage of all resource types. - /// - /// Handle to get the AssetID of. - /// - /// AssetID for the specified Handle. If the Handle is invalid, there will be no - /// value. - /// - static std::optional GetAssetID(Handle handle); - /// - /// Retrieves the name associated with the AssetID that is associated with the - /// specified Handle. - /// Compared to the templated version, this function is slower as it requires - /// searching through the storage of all resource types. - /// - /// Handle to get the name of. - /// - /// Name for the specified Handle. If the Handle is invalid, there will be no - /// value. - /// - static std::optional GetAssetName(Handle handle); - }; -} \ No newline at end of file diff --git a/SHADE_Managed/src/Assets/Font.cxx b/SHADE_Managed/src/Assets/FontAsset.cxx similarity index 79% rename from SHADE_Managed/src/Assets/Font.cxx rename to SHADE_Managed/src/Assets/FontAsset.cxx index b21c7a02..e49568fc 100644 --- a/SHADE_Managed/src/Assets/Font.cxx +++ b/SHADE_Managed/src/Assets/FontAsset.cxx @@ -14,7 +14,9 @@ of DigiPen Institute of Technology is prohibited. // Precompiled Headers #include "SHpch.h" // Primary Header -#include "Font.hxx" +#include "FontAsset.hxx" +// External Dependencies +#include "Resource/SHResourceManagerInterface.h" // Project Headers #include "Utility/Convert.hxx" @@ -23,20 +25,16 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ /* Properties */ /*---------------------------------------------------------------------------------*/ - Handle Font::NativeObject::get() + Handle FontAsset::NativeObject::get() try { - return Handle(Convert::ToNative(asset.NativeObjectHandle)); + return SHResourceManagerInterface::LoadOrGetFont(asset.NativeAssetID); } catch (const BadHandleCastException&) { return Handle(); } - GenericHandle Font::NativeObjectHandle::get() - { - return asset.NativeObjectHandle; - } - AssetID Font::NativeAssetID::get() + AssetID FontAsset::NativeAssetID::get() { return asset.NativeAssetID; } @@ -44,14 +42,14 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ /* Constructors/Destructor */ /*---------------------------------------------------------------------------------*/ - Font::Font(Handle font) - : asset { Handle(font) } + FontAsset::FontAsset(AssetID fontId) + : asset { fontId } {} /*---------------------------------------------------------------------------------*/ /* Operator Overloads */ /*---------------------------------------------------------------------------------*/ - Font::operator bool(Font asset) + FontAsset::operator bool(FontAsset asset) { return asset; } @@ -59,13 +57,13 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ /* Conversion Operators */ /*---------------------------------------------------------------------------------*/ - Font::operator Asset(Font nativeAsset) + FontAsset::operator Asset(FontAsset nativeAsset) { return nativeAsset.asset; } - Font::operator Font(Asset asset) + FontAsset::operator FontAsset(Asset asset) { - return Font(Handle(Convert::ToNative(asset.NativeObjectHandle))); + return FontAsset(asset.NativeAssetID); } } diff --git a/SHADE_Managed/src/Assets/Font.hxx b/SHADE_Managed/src/Assets/FontAsset.hxx similarity index 86% rename from SHADE_Managed/src/Assets/Font.hxx rename to SHADE_Managed/src/Assets/FontAsset.hxx index 4acc49e6..89239224 100644 --- a/SHADE_Managed/src/Assets/Font.hxx +++ b/SHADE_Managed/src/Assets/FontAsset.hxx @@ -26,7 +26,7 @@ namespace SHADE /// Managed counterpart of the native Font object that can be fed to TextRenderables /// for rendering. /// - public value struct Font + public value struct FontAsset { internal: /*-----------------------------------------------------------------------------*/ @@ -40,13 +40,6 @@ namespace SHADE Handle get(); } /// - /// Generic handle for the native object - /// - property GenericHandle NativeObjectHandle - { - GenericHandle get(); - } - /// /// The raw asset ID of the asset. /// property AssetID NativeAssetID @@ -60,8 +53,8 @@ namespace SHADE /// /// Constructor for the Font. /// - /// Handle to the font object. - Font(Handle font); + /// AssetID to the font asset. + FontAsset(AssetID fontId); /*-----------------------------------------------------------------------------*/ /* Operator Overloads */ @@ -71,7 +64,7 @@ namespace SHADE /// /// Asset to check. /// True if the Asset is valid. - static operator bool(Font asset); + static operator bool(FontAsset asset); /*-----------------------------------------------------------------------------*/ /* Conversion Operators */ @@ -80,12 +73,12 @@ namespace SHADE /// Conversion operator to enable casting from a Font to an Asset. /// /// Vector3 to convert from. - static explicit operator Asset(Font nativeAsset); + static explicit operator Asset(FontAsset nativeAsset); /// /// Conversion operator to enable casting from a Asset to a Font. /// - /// Vector2 to convert from. - static explicit operator Font(Asset vec); + /// + static explicit operator FontAsset(Asset asset); protected: /*-----------------------------------------------------------------------------*/ diff --git a/SHADE_Managed/src/Assets/Mesh.cxx b/SHADE_Managed/src/Assets/MeshAsset.cxx similarity index 79% rename from SHADE_Managed/src/Assets/Mesh.cxx rename to SHADE_Managed/src/Assets/MeshAsset.cxx index bcfeac36..d24ad20d 100644 --- a/SHADE_Managed/src/Assets/Mesh.cxx +++ b/SHADE_Managed/src/Assets/MeshAsset.cxx @@ -14,7 +14,9 @@ of DigiPen Institute of Technology is prohibited. // Precompiled Headers #include "SHpch.h" // Primary Header -#include "Mesh.hxx" +#include "MeshAsset.hxx" +// External Dependencies +#include "Resource/SHResourceManagerInterface.h" // Project Headers #include "Utility/Convert.hxx" @@ -23,20 +25,16 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ /* Properties */ /*---------------------------------------------------------------------------------*/ - Handle Mesh::NativeObject::get() + Handle MeshAsset::NativeObject::get() try { - return Handle(Convert::ToNative(asset.NativeObjectHandle)); + return SHResourceManagerInterface::LoadOrGetMesh(asset.NativeAssetID); } catch (const BadHandleCastException&) { return Handle(); } - GenericHandle Mesh::NativeObjectHandle::get() - { - return asset.NativeObjectHandle; - } - AssetID Mesh::NativeAssetID::get() + AssetID MeshAsset::NativeAssetID::get() { return asset.NativeAssetID; } @@ -44,14 +42,14 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ /* Constructors/Destructor */ /*---------------------------------------------------------------------------------*/ - Mesh::Mesh(Handle Mesh) - : asset{ Handle(Mesh) } + MeshAsset::MeshAsset(AssetID meshId) + : asset{ meshId } {} /*---------------------------------------------------------------------------------*/ /* Operator Overloads */ /*---------------------------------------------------------------------------------*/ - Mesh::operator bool(Mesh asset) + MeshAsset::operator bool(MeshAsset asset) { return asset; } @@ -59,13 +57,13 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ /* Conversion Operators */ /*---------------------------------------------------------------------------------*/ - Mesh::operator Asset(Mesh nativeAsset) + MeshAsset::operator Asset(MeshAsset nativeAsset) { return nativeAsset.asset; } - Mesh::operator Mesh(Asset asset) + MeshAsset::operator MeshAsset(Asset asset) { - return Mesh(Handle(Convert::ToNative(asset.NativeObjectHandle))); + return MeshAsset(asset.NativeAssetID); } } diff --git a/SHADE_Managed/src/Assets/Mesh.hxx b/SHADE_Managed/src/Assets/MeshAsset.hxx similarity index 86% rename from SHADE_Managed/src/Assets/Mesh.hxx rename to SHADE_Managed/src/Assets/MeshAsset.hxx index 7403ae83..26625c1a 100644 --- a/SHADE_Managed/src/Assets/Mesh.hxx +++ b/SHADE_Managed/src/Assets/MeshAsset.hxx @@ -26,7 +26,7 @@ namespace SHADE /// Managed counterpart of the native Mesh object containing vertex data that can /// be fed to Renderables for rendering. /// - public value struct Mesh + public value struct MeshAsset { internal: /*-----------------------------------------------------------------------------*/ @@ -40,13 +40,6 @@ namespace SHADE Handle get(); } /// - /// Generic handle for the native object - /// - property GenericHandle NativeObjectHandle - { - GenericHandle get(); - } - /// /// The raw asset ID of the asset. /// property AssetID NativeAssetID @@ -60,8 +53,8 @@ namespace SHADE /// /// Constructor for the Mesh. /// - /// Handle to the Mesh object. - Mesh(Handle Mesh); + /// AssetID to the Mesh asset. + MeshAsset(AssetID meshId); /*-----------------------------------------------------------------------------*/ /* Operator Overloads */ @@ -71,7 +64,7 @@ namespace SHADE /// /// Asset to check. /// True if the Asset is valid. - static operator bool(Mesh asset); + static operator bool(MeshAsset asset); /*-----------------------------------------------------------------------------*/ /* Conversion Operators */ @@ -80,12 +73,12 @@ namespace SHADE /// Conversion operator to enable casting from a Mesh to an Asset. /// /// Vector3 to convert from. - static explicit operator Asset(Mesh nativeAsset); + static explicit operator Asset(MeshAsset nativeAsset); /// /// Conversion operator to enable casting from a Asset to a Mesh. /// - /// Vector2 to convert from. - static explicit operator Mesh(Asset vec); + /// + static explicit operator MeshAsset(Asset asset); protected: /*-----------------------------------------------------------------------------*/ diff --git a/SHADE_Managed/src/Assets/NativeAsset.cxx b/SHADE_Managed/src/Assets/NativeAsset.cxx index 3f827fea..9480b02a 100644 --- a/SHADE_Managed/src/Assets/NativeAsset.cxx +++ b/SHADE_Managed/src/Assets/NativeAsset.cxx @@ -18,27 +18,22 @@ of DigiPen Institute of Technology is prohibited. // Project Includes #include "Engine/GenericHandle.hxx" #include "Utility/Convert.hxx" -#include "Resource/SHResourceManagerWrapper.h" namespace SHADE { /*---------------------------------------------------------------------------------*/ /* Properties */ /*---------------------------------------------------------------------------------*/ - GenericHandle Asset::NativeObjectHandle::get() - { - return nativeObjHandle; - } AssetID Asset::NativeAssetID::get() { - return SHResourceManagerWrapper::GetAssetID(Convert::ToNative(nativeObjHandle)).value_or(INVALID_ASSET_ID); + return assetId; } /*---------------------------------------------------------------------------------*/ /* Constructors */ /*---------------------------------------------------------------------------------*/ - Asset::Asset(Handle nativeHandle) - : nativeObjHandle { Convert::ToCLI(Handle(nativeHandle)) } + Asset::Asset(AssetID id) + : assetId { id } {} /*---------------------------------------------------------------------------------*/ @@ -46,6 +41,6 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ Asset::operator bool(Asset asset) { - return asset.nativeObjHandle && asset.NativeAssetID != INVALID_ASSET_ID; + return asset.NativeAssetID != INVALID_ASSET_ID; } } \ No newline at end of file diff --git a/SHADE_Managed/src/Assets/NativeAsset.hxx b/SHADE_Managed/src/Assets/NativeAsset.hxx index 7ce9c6ed..40f7e628 100644 --- a/SHADE_Managed/src/Assets/NativeAsset.hxx +++ b/SHADE_Managed/src/Assets/NativeAsset.hxx @@ -31,13 +31,6 @@ namespace SHADE /* Properties */ /*-----------------------------------------------------------------------------*/ /// - /// Generic handle for the native object - /// - property GenericHandle NativeObjectHandle - { - GenericHandle get(); - } - /// /// The raw asset ID of the asset. /// property AssetID NativeAssetID @@ -51,8 +44,8 @@ namespace SHADE /// /// Constructor for the asset. /// - /// Native asset object handle. - Asset(Handle nativeHandle); + /// Native asset ID to construct this asset from. + explicit Asset(AssetID id); /*-----------------------------------------------------------------------------*/ /* Operator Overloads */ @@ -68,6 +61,6 @@ namespace SHADE /*-----------------------------------------------------------------------------*/ /* Data Members */ /*-----------------------------------------------------------------------------*/ - GenericHandle nativeObjHandle; + AssetID assetId; }; } diff --git a/SHADE_Managed/src/Components/Renderable.cxx b/SHADE_Managed/src/Components/Renderable.cxx index bc01bc03..b4efe26e 100644 --- a/SHADE_Managed/src/Components/Renderable.cxx +++ b/SHADE_Managed/src/Components/Renderable.cxx @@ -30,11 +30,11 @@ namespace SHADE /*---------------------------------------------------------------------------------*/ /* Properties */ /*---------------------------------------------------------------------------------*/ - SHADE::Mesh^ Renderable::Mesh::get() + SHADE::MeshAsset^ Renderable::Mesh::get() { - return gcnew SHADE::Mesh(GetNativeComponent()->GetMesh()); + return gcnew SHADE::MeshAsset(GetNativeComponent()->GetMesh()); } - void Renderable::Mesh::set(SHADE::Mesh^ value) + void Renderable::Mesh::set(SHADE::MeshAsset^ value) { if (value == nullptr) { diff --git a/SHADE_Managed/src/Components/Renderable.hxx b/SHADE_Managed/src/Components/Renderable.hxx index e8f11ef6..be7d107f 100644 --- a/SHADE_Managed/src/Components/Renderable.hxx +++ b/SHADE_Managed/src/Components/Renderable.hxx @@ -20,7 +20,7 @@ of DigiPen Institute of Technology is prohibited. #include "Math/Quaternion.hxx" // External Dependencies #include "Graphics/MiddleEnd/Interface/SHRenderable.h" -#include "Assets/Mesh.hxx" +#include "Assets/MeshAsset.hxx" #include "Assets/Material.hxx" namespace SHADE @@ -48,10 +48,10 @@ namespace SHADE /// /// Mesh used to render this Renderable. /// - property SHADE::Mesh^ Mesh + property SHADE::MeshAsset^ Mesh { - SHADE::Mesh^ get(); - void set(SHADE::Mesh^ value); + SHADE::MeshAsset^ get(); + void set(SHADE::MeshAsset^ value); } /// /// Material used to render this Renderable. diff --git a/SHADE_Managed/src/Components/TextRenderable.cxx b/SHADE_Managed/src/Components/TextRenderable.cxx index c5859854..e34592ae 100644 --- a/SHADE_Managed/src/Components/TextRenderable.cxx +++ b/SHADE_Managed/src/Components/TextRenderable.cxx @@ -39,11 +39,11 @@ namespace SHADE { GetNativeComponent()->SetText(Convert::ToNative(value)); } - SHADE::Font^ TextRenderable::Font::get() + SHADE::FontAsset^ TextRenderable::Font::get() { - return gcnew SHADE::Font(GetNativeComponent()->GetFont()); + return gcnew SHADE::FontAsset(GetNativeComponent()->GetFont()); } - void TextRenderable::Font::set(SHADE::Font^ value) + void TextRenderable::Font::set(SHADE::FontAsset^ value) { if (value == nullptr) { diff --git a/SHADE_Managed/src/Components/TextRenderable.hxx b/SHADE_Managed/src/Components/TextRenderable.hxx index 5418b6e5..bcd99bcf 100644 --- a/SHADE_Managed/src/Components/TextRenderable.hxx +++ b/SHADE_Managed/src/Components/TextRenderable.hxx @@ -20,7 +20,7 @@ of DigiPen Institute of Technology is prohibited. #include "Components/Component.hxx" #include "Math/Vector3.hxx" #include "Math/Quaternion.hxx" -#include "Assets/Font.hxx" +#include "Assets/FontAsset.hxx" namespace SHADE { @@ -55,10 +55,10 @@ namespace SHADE /// /// Font to use to render using this TextRenderable. /// - property SHADE::Font^ Font + property SHADE::FontAsset^ Font { - SHADE::Font^ get(); - void set(SHADE::Font^ value); + SHADE::FontAsset^ get(); + void set(SHADE::FontAsset^ value); } }; }