-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling in AssetLoader
- Loading branch information
Showing
18 changed files
with
717 additions
and
875 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
File renamed without changes.
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,21 @@ | ||
// Copyright (c) 2013-2019 mogemimi. Distributed under the MIT license. | ||
|
||
#pragma once | ||
|
||
#include "Pomdog/Audio/detail/ForwardDeclarations.hpp" | ||
#include "Pomdog/Basic/Export.hpp" | ||
#include "Pomdog/Utility/Errors.hpp" | ||
#include <cstddef> | ||
#include <fstream> | ||
#include <memory> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
namespace Pomdog::WAV { | ||
|
||
/// Reads an audio data from Waveform Audio File (.wav) format data. | ||
[[nodiscard]] POMDOG_EXPORT | ||
std::tuple<std::shared_ptr<AudioClip>, std::shared_ptr<Error>> | ||
Load(std::ifstream&& stream, std::size_t byteLength); | ||
|
||
} // namespace Pomdog::WAV |
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,20 @@ | ||
// Copyright (c) 2013-2019 mogemimi. Distributed under the MIT license. | ||
|
||
#pragma once | ||
|
||
#include "Pomdog/Basic/Export.hpp" | ||
#include "Pomdog/Content/Image/ImageBuffer.hpp" | ||
#include "Pomdog/Utility/Errors.hpp" | ||
#include <cstddef> | ||
#include <cstdint> | ||
#include <memory> | ||
#include <tuple> | ||
|
||
namespace Pomdog::DDS { | ||
|
||
/// Reads a DDS image from data (.dds). | ||
[[nodiscard]] POMDOG_EXPORT | ||
std::tuple<ImageBuffer, std::shared_ptr<Error>> | ||
Decode(const std::uint8_t* data, std::size_t size); | ||
|
||
} // namespace Pomdog::DDS |
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,36 @@ | ||
// Copyright (c) 2013-2019 mogemimi. Distributed under the MIT license. | ||
|
||
#pragma once | ||
|
||
#include "Pomdog/Basic/Export.hpp" | ||
#include "Pomdog/Graphics/SurfaceFormat.hpp" | ||
#include <cstdint> | ||
#include <memory> | ||
#include <vector> | ||
|
||
namespace Pomdog { | ||
|
||
struct POMDOG_EXPORT ImageBuffer final { | ||
/// Raw pixel data. | ||
std::vector<std::uint8_t> RawData; | ||
|
||
/// Pointer to pixel data array. | ||
const std::uint8_t* PixelData = nullptr; | ||
|
||
/// Size of byte array of pixel data. | ||
std::size_t ByteLength = 0; | ||
|
||
/// Width of the image in pixels. | ||
std::int32_t Width = 1; | ||
|
||
/// Height of the image in pixels. | ||
std::int32_t Height = 1; | ||
|
||
/// The number of mipmap levels in a multilevel texture. | ||
std::int32_t MipmapCount = 0; | ||
|
||
/// Surface format of the image. | ||
SurfaceFormat Format = SurfaceFormat::R8_UNorm; | ||
}; | ||
|
||
} // namespace Pomdog |
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,20 @@ | ||
// Copyright (c) 2013-2019 mogemimi. Distributed under the MIT license. | ||
|
||
#pragma once | ||
|
||
#include "Pomdog/Basic/Export.hpp" | ||
#include "Pomdog/Content/Image/ImageBuffer.hpp" | ||
#include "Pomdog/Utility/Errors.hpp" | ||
#include <cstddef> | ||
#include <cstdint> | ||
#include <memory> | ||
#include <tuple> | ||
|
||
namespace Pomdog::PNG { | ||
|
||
/// Reads a PNG image from data (.png). | ||
[[nodiscard]] POMDOG_EXPORT | ||
std::tuple<ImageBuffer, std::shared_ptr<Error>> | ||
Decode(const std::uint8_t* data, std::size_t size); | ||
|
||
} // namespace Pomdog::PNG |
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
Oops, something went wrong.