-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP working on AssetManager / asset loading/creation
- Loading branch information
Showing
36 changed files
with
870 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "dnpch.h" | ||
|
||
#include "AnimatedSprite2D.h" | ||
|
||
namespace Duin | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include "Duin/Core/Core.h" | ||
#include "Duin/Core/Scene/Object.h" | ||
|
||
namespace Duin | ||
{ | ||
class DUIN_API AnimatedSprite2D : public Object | ||
{ | ||
public: | ||
|
||
private: | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "dnpch.h" | ||
|
||
#include "Asset.h" | ||
#include "Duin/Assets/AssetManager.h" | ||
|
||
namespace Duin | ||
{ | ||
Asset::Asset() | ||
{ | ||
} | ||
|
||
Asset::Asset(AssetManager* assetManager) | ||
: assetManager(assetManager) | ||
{ | ||
} | ||
|
||
Asset::~Asset() | ||
{ | ||
} | ||
|
||
void Asset::SetAssetManager(AssetManager* assetManager) | ||
{ | ||
this->assetManager = assetManager; | ||
} | ||
|
||
AssetManager* Asset::GetAssetManager() | ||
{ | ||
return assetManager; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "Duin/Core/Core.h" | ||
#include "Duin/Core/UUID.h" | ||
|
||
namespace Duin | ||
{ | ||
class AssetManager; | ||
|
||
/* | ||
* A wrapper for the _Asset class. | ||
* The client will interact with this class, and children. | ||
*/ | ||
class DUIN_API Asset | ||
{ | ||
public: | ||
Asset(); | ||
Asset(AssetManager* assetManager); | ||
~Asset(); | ||
|
||
void SetAssetManager(AssetManager* assetManager); | ||
AssetManager* GetAssetManager(); | ||
|
||
private: | ||
UUID uuid; | ||
AssetManager* assetManager = nullptr; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "dnpch.h" | ||
|
||
#include "AssetStructs.h" | ||
#include "AssetManager.h" | ||
|
||
namespace Duin | ||
{ | ||
std::shared_ptr<_Asset> _TextureAssetFactory::CreateAsset(AssetManager* assetManager, const char* path) | ||
{ | ||
// TODO | ||
::Texture rlTexture = ::LoadTexture(path); | ||
std::shared_ptr<_TextureAsset> textureAsset = std::make_shared<_TextureAsset>(rlTexture); | ||
|
||
return textureAsset; | ||
} | ||
|
||
std::shared_ptr<_Asset> _ImageAssetFactory::CreateAsset(AssetManager* assetManager, const char* path) | ||
{ | ||
// TODO | ||
::Image rlImage = ::LoadImage(path); | ||
std::shared_ptr<_ImageAsset> imageAsset = std::make_shared<_ImageAsset>(rlImage); | ||
|
||
return imageAsset; | ||
} | ||
} |
Oops, something went wrong.