diff --git a/assets/games/liminal/prefabs/EthPrefab.xml b/assets/games/liminal/prefabs/EthPrefab.xml index 71945d40..25dee4f5 100644 --- a/assets/games/liminal/prefabs/EthPrefab.xml +++ b/assets/games/liminal/prefabs/EthPrefab.xml @@ -10,4 +10,4 @@ - \ No newline at end of file + diff --git a/assets/games/liminal/prefabs/RoninPrefab.xml b/assets/games/liminal/prefabs/RoninPrefab.xml index b8753b57..772b35ab 100644 --- a/assets/games/liminal/prefabs/RoninPrefab.xml +++ b/assets/games/liminal/prefabs/RoninPrefab.xml @@ -1,19 +1,19 @@ - + - + - + - + \ No newline at end of file diff --git a/assets/games/liminal/prefabs/VNTextbox.xml b/assets/games/liminal/prefabs/VNTextbox.xml index 7adbc1e7..325dac8f 100644 --- a/assets/games/liminal/prefabs/VNTextbox.xml +++ b/assets/games/liminal/prefabs/VNTextbox.xml @@ -4,7 +4,7 @@ - - - whoa - - - - - \ No newline at end of file diff --git a/assets/games/liminal/scenes/SceneMonologue.xml b/assets/games/liminal/scenes/SceneMonologue.xml index fae22258..22fb2144 100644 --- a/assets/games/liminal/scenes/SceneMonologue.xml +++ b/assets/games/liminal/scenes/SceneMonologue.xml @@ -1,19 +1,26 @@ + - + - + + + + + + + diff --git a/assets/games/liminal/scenes/SceneStandard.xml b/assets/games/liminal/scenes/SceneStandard.xml index 22726d93..e4a6ca4e 100644 --- a/assets/games/liminal/scenes/SceneStandard.xml +++ b/assets/games/liminal/scenes/SceneStandard.xml @@ -1,28 +1,34 @@ + - - + - + - + + + + + + + + + useEvent([&]{ assertNotNull(camTexture); diff --git a/assets/games/liminal/scenes/SceneTest.xml b/assets/games/liminal/scenes/SceneTest.xml deleted file mode 100644 index 41d98a04..00000000 --- a/assets/games/liminal/scenes/SceneTest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - whoa - - - \ No newline at end of file diff --git a/assets/games/liminal/scenes/prologue/CMakeLists.txt b/assets/games/liminal/scenes/prologue/CMakeLists.txt new file mode 100644 index 00000000..5210be07 --- /dev/null +++ b/assets/games/liminal/scenes/prologue/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2023 Dominic Masters +# +# This software is released under the MIT License. +# https://opensource.org/licenses/MIT + +tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologue0.xml) +tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologue1.xml) +tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologue2.xml) \ No newline at end of file diff --git a/assets/games/liminal/scenes/Scene1Prologue0.xml b/assets/games/liminal/scenes/prologue/ScenePrologue0.xml similarity index 92% rename from assets/games/liminal/scenes/Scene1Prologue0.xml rename to assets/games/liminal/scenes/prologue/ScenePrologue0.xml index f0cd3c06..e88de19a 100644 --- a/assets/games/liminal/scenes/Scene1Prologue0.xml +++ b/assets/games/liminal/scenes/prologue/ScenePrologue0.xml @@ -1,4 +1,4 @@ - + There is a bucket. @@ -32,6 +32,6 @@ Is their eyes. - + \ No newline at end of file diff --git a/assets/games/liminal/scenes/prologue/ScenePrologue1.xml b/assets/games/liminal/scenes/prologue/ScenePrologue1.xml new file mode 100644 index 00000000..1d563e8e --- /dev/null +++ b/assets/games/liminal/scenes/prologue/ScenePrologue1.xml @@ -0,0 +1,91 @@ + + + + + + I wake. + + + + I gasp. I close my eyes — I'm fine, I'm fine. I'm still here. Breathing. + + + + That bucket was a dream. My death was a dream. I'm not dead. + + + + (Am I?) + + + + (...) + + + + (Aren't I?) + + + + Of course I'm not. + + + + I exhale. My feet fall to the edges of my bed. Slowly, I raise myself to stand. + + + + My fingers tremble by the edges of my leg: I curl my hand in. My nails catch on my skin. They're sharp, pastel pink. Done for Prom Day today. + + + + The dream didn't happen. How could it have? Prom Day hasn't happened yet. + + + + I'm fine. + + + + (Didn't it happen?) + + + + (It felt so...) + + + + (Real.) + + + + I tidy the bedsheets. Pull the corners over the bed's edges, fluff up the pillows, pat away the sweat and the residue of a scream: my parents want it pretty. + + + + It wasn't real. I only had a visceral dream, sunken into my brain as an anchor to a sea, as a stone angel's crumbling visage, as a bird's descent off Devil Cradle's cliffs. That wasn't real. + + + + No, of course not. + + + + My calendar says May 29th. I've got to prepare for Prom. + + + + After all, if there is anything I will be, it is Prom Queen. + + + + I've been chasing this moment since the beginning of time. Today is the finale. + + + + And I am nothing if not ready. + + + + + \ No newline at end of file diff --git a/assets/games/liminal/scenes/prologue/ScenePrologue2.xml b/assets/games/liminal/scenes/prologue/ScenePrologue2.xml new file mode 100644 index 00000000..b53a186a --- /dev/null +++ b/assets/games/liminal/scenes/prologue/ScenePrologue2.xml @@ -0,0 +1,11 @@ + + + + + + I wake. + + + + + \ No newline at end of file diff --git a/assets/games/liminal/textures/ronin/faces/CMakeLists.txt b/assets/games/liminal/textures/ronin/faces/CMakeLists.txt index 023c3023..ee0ddd3a 100644 --- a/assets/games/liminal/textures/ronin/faces/CMakeLists.txt +++ b/assets/games/liminal/textures/ronin/faces/CMakeLists.txt @@ -7,7 +7,6 @@ set(RONIN_FACE_TEXTURE_OPTIONS SCALE=${LIMINIAL_CHARACTER_SCALE} FILTER_MIN=nearest FILTER_MAG=nearest - CROP_END_Y=2833 ) include(${CMAKE_CURRENT_LIST_DIR}/day/CMakeLists.txt) diff --git a/src/dawn/asset/AssetLoader.cpp b/src/dawn/asset/AssetLoader.cpp index c22ad2f1..42cfb5d8 100644 --- a/src/dawn/asset/AssetLoader.cpp +++ b/src/dawn/asset/AssetLoader.cpp @@ -78,7 +78,7 @@ size_t AssetLoader::loadRaw(uint8_t **buffer) { this->rewind(); // Read the string then close the file handle. - *buffer = static_cast(malloc(sizeof(uint8_t) * length)); + *buffer = static_cast(memoryAllocate(sizeof(uint8_t) * length)); read = this->read(*buffer, length); this->close(); diff --git a/src/dawn/asset/assets/TextureAsset.cpp b/src/dawn/asset/assets/TextureAsset.cpp index 900a2bbe..64cf8a4f 100644 --- a/src/dawn/asset/assets/TextureAsset.cpp +++ b/src/dawn/asset/assets/TextureAsset.cpp @@ -127,5 +127,6 @@ void TextureAsset::updateAsync() { TextureAsset::~TextureAsset() { if(this->buffer != nullptr) { memoryFree(this->buffer); + this->buffer = nullptr; } } \ No newline at end of file diff --git a/src/dawnliminal/game/LiminalGame.cpp b/src/dawnliminal/game/LiminalGame.cpp index 00fcf087..128d914c 100644 --- a/src/dawnliminal/game/LiminalGame.cpp +++ b/src/dawnliminal/game/LiminalGame.cpp @@ -4,12 +4,10 @@ // https://opensource.org/licenses/MIT #include "game/DawnGame.hpp" -#include "vnscenes/SceneTest.hpp" -#include "scenes/HelloWorldScene.hpp" +#include "vnscenes/ScenePrologue0.hpp" using namespace Dawn; Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) { - // return new HelloWorldScene(game); - return new SceneTest(game); + return new ScenePrologue0(game); } \ No newline at end of file diff --git a/src/dawnlinux64/host/DawnHostTux32.cpp b/src/dawnlinux64/host/DawnHostTux32.cpp index 4cd3927f..21bf915e 100644 --- a/src/dawnlinux64/host/DawnHostTux32.cpp +++ b/src/dawnlinux64/host/DawnHostTux32.cpp @@ -5,11 +5,19 @@ #include "DawnHostTux32.hpp" +#if DAWN_DEBUG_BUILD + uint64_t dawnAllocatedItemCount; +#endif + using namespace Dawn; int32_t main(int32_t argc, char **args) { int32_t result; + #if DAWN_DEBUG_BUILD + dawnAllocatedItemCount = 0; + #endif + // Create the host auto host = new DawnHost(); auto game = new DawnGame(host); @@ -40,6 +48,10 @@ int32_t main(int32_t argc, char **args) { delete game; delete host; + #if DAWN_DEBUG_BUILD + assertTrue(dawnAllocatedItemCount == 0); + #endif + // Success return 0; } \ No newline at end of file diff --git a/src/dawnshared/util/memory.hpp b/src/dawnshared/util/memory.hpp index 5f80af07..041ccd12 100644 --- a/src/dawnshared/util/memory.hpp +++ b/src/dawnshared/util/memory.hpp @@ -8,6 +8,10 @@ #pragma once #include "assert/assert.hpp" +#if DAWN_DEBUG_BUILD + extern uint64_t dawnAllocatedItemCount; +#endif + /** * Allocate some space in memory to use for your needs. Memory allocation may * change how it functions later on to keep things nice and efficient. For now @@ -18,6 +22,9 @@ */ static inline void * memoryAllocate(const size_t size) { assertTrue(size > 0); + #if DAWN_DEBUG_BUILD + dawnAllocatedItemCount++; + #endif auto x = (void *)malloc(size); assertNotNull(x); return x; @@ -31,6 +38,9 @@ static inline void * memoryAllocate(const size_t size) { */ static inline void * memoryFillWithZero(const size_t size) { assertTrue(size > 0); + #if DAWN_DEBUG_BUILD + dawnAllocatedItemCount++; + #endif auto x =(void *)calloc(1, size); assertNotNull(x); return x; @@ -43,6 +53,9 @@ static inline void * memoryFillWithZero(const size_t size) { */ static inline void memoryFree(void *pointer) { assertNotNull(pointer); + #if DAWN_DEBUG_BUILD + dawnAllocatedItemCount--; + #endif free(pointer); }