Replace dawnlibs with dawn.hpp
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
/**
|
||||
* Asserts that a given statement must evaluate to true or the assertion fails
|
||||
|
@ -97,16 +97,16 @@ bool_t AssetDataLoader::isOpen() {
|
||||
}
|
||||
|
||||
void AssetDataLoader::open() {
|
||||
assertNull(this->assetArchiveFile, "AssetDataLoader::open: File is already open");
|
||||
assertNull(this->assetArchive, "AssetDataLoader::open: Archive is already open");
|
||||
assertNull(this->assetArchiveEntry, "AssetDataLoader::open: Entry is already open");
|
||||
assertNull(this->assetArchiveFile, "File is already open");
|
||||
assertNull(this->assetArchive, "Archive is already open");
|
||||
assertNull(this->assetArchiveEntry, "Entry is already open");
|
||||
|
||||
this->assetArchiveFile = this->openAssetArchiveFile();
|
||||
assertNotNull(this->assetArchiveFile, "AssetDataLoader::open: Failed to open archive file!");
|
||||
assertNotNull(this->assetArchiveFile, "Failed to open archive file!");
|
||||
|
||||
// Open archive reader
|
||||
assetArchive = archive_read_new();
|
||||
assertNotNull(assetArchive, "AssetDataLoader::open: Failed to create archive reader");
|
||||
assertNotNull(assetArchive, "Failed to create archive reader");
|
||||
|
||||
// Set up the reader
|
||||
archive_read_support_format_tar(assetArchive);
|
||||
@ -119,7 +119,7 @@ void AssetDataLoader::open() {
|
||||
archive_read_set_callback_data(assetArchive, this);
|
||||
|
||||
int32_t ret = archive_read_open1(assetArchive);
|
||||
assertTrue(ret == ARCHIVE_OK, "AssetDataLoader::open: Failed to open archive!");
|
||||
assertTrue(ret == ARCHIVE_OK, "Failed to open archive!");
|
||||
position = 0;
|
||||
|
||||
// Iterate over each file to find the one for this asset loader.
|
||||
@ -127,20 +127,20 @@ void AssetDataLoader::open() {
|
||||
const char_t *headerFile = (char_t*)archive_entry_pathname(assetArchiveEntry);
|
||||
if(std::string(headerFile) == this->fileName) return;
|
||||
int32_t ret = archive_read_data_skip(assetArchive);
|
||||
assertTrue(ret == ARCHIVE_OK, "AssetDataLoader::open: Failed to skip data!");
|
||||
assertTrue(ret == ARCHIVE_OK, "Failed to skip data!");
|
||||
}
|
||||
|
||||
assertUnreachable("AssetDataLoader::open: Failed to find file!");
|
||||
assertUnreachable("Failed to find file!");
|
||||
}
|
||||
|
||||
int32_t AssetDataLoader::close() {
|
||||
assertNotNull(this->assetArchiveFile, "AssetDataLoader::close: File is NULL");
|
||||
assertNotNull(this->assetArchive, "AssetDataLoader::close: Archive is NULL!");
|
||||
assertNotNull(this->assetArchiveEntry, "AssetDataLoader::close: Entry is NULL!");
|
||||
assertNotNull(this->assetArchiveFile, "File is NULL");
|
||||
assertNotNull(this->assetArchive, "Archive is NULL!");
|
||||
assertNotNull(this->assetArchiveEntry, "Entry is NULL!");
|
||||
|
||||
// Close the archive
|
||||
int32_t ret = archive_read_free(this->assetArchive);
|
||||
assertTrue(ret == ARCHIVE_OK, "AssetDataLoader::close: Failed to close archive!");
|
||||
assertTrue(ret == ARCHIVE_OK, "Failed to close archive!");
|
||||
|
||||
this->assetArchive = nullptr;
|
||||
this->assetArchiveEntry = nullptr;
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <archive.h>
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class AssetLoader {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
#include "asset/AssetLoader.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class IAudioManager {
|
||||
|
12
src/dawn/component/Registry.cpp
Normal file
12
src/dawn/component/Registry.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright (c) 2024 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "Registry.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
void Dawn::someFunction(const char_t *someParam) {
|
||||
printf("Hello, %s!\n", someParam);
|
||||
}
|
11
src/dawn/component/Registry.hpp
Normal file
11
src/dawn/component/Registry.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2024 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
static void someFunction(const char_t *someParam);
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
struct ColorU8 {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
#include "display/RenderTarget.hpp"
|
||||
#include "display/RenderPipeline.hpp"
|
||||
#include "display/shader/ShaderManager.hpp"
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Game;
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
struct TrueTypeCharacter {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
enum MeshDrawMode {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
enum class ShaderParameterType {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
enum class ShaderStageType {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Environment {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
enum class CustomEventResult {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
template<typename ...A>
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
#include "display/RenderHost.hpp"
|
||||
#include "input/InputManager.hpp"
|
||||
#include "time/TimeManager.hpp"
|
||||
|
@ -25,6 +25,10 @@ std::string LocaleManager::getString(
|
||||
const std::unordered_map<std::string, std::string> replacements
|
||||
) {
|
||||
assertNotNull(languageAsset, "Language asset cannot be null.");
|
||||
assertTrue(
|
||||
languageAsset->loaded,
|
||||
"Language asset must be loaded before attempting to get a string."
|
||||
);
|
||||
|
||||
// Key comes in like "main_menu.new_game", which would be;
|
||||
// data["main_menu"]["new_game"], so we need to split by dot and iterate.
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class SaveManager;
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
#define SCENE_COMPONENT_STATE_INIT 0x01
|
||||
#define SCENE_COMPONENT_STATE_DISPOSED 0x02
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class SceneItem;
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class ITimeManager {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Flag final {
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
#define MATH_PI 3.1415926535897f
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class String {
|
||||
|
Reference in New Issue
Block a user