Moving some scene files around

This commit is contained in:
2023-07-03 23:05:59 -07:00
parent ff360b9983
commit 98d284f201
18 changed files with 171 additions and 50 deletions

View File

@ -10,4 +10,4 @@
<QuadMeshHost xy0="-0.39118198874, 1" xy1="0.39118198874, .66439962476547842402" />
<SimpleTexturedMaterial ref="faceMaterial" opaque="false" />
</item>
</prefab>
</prefab>

View File

@ -1,19 +1,19 @@
<prefab name="RoninPrefab" type="">
<prefab name="RoninPrefab" type="" scale="2, 2, 2">
<item>
<MeshRenderer />
<QuadMeshHost xy0="-0.5, 1" xy1="0.5, 0" />
<QuadMeshHost xy0="-0.37383385162150155487, 1" xy1="0.37383385162150155487, 0" />
<SimpleTexturedMaterial ref="bodyMaterial" opaque="false" />
</item>
<item>
<MeshRenderer />
<QuadMeshHost xy0="-0.5, 1" xy1="0.5, 0" />
<QuadMeshHost xy0="-0.37383385162150155487, 1" xy1="0.37383385162150155487, 0" />
<SimpleTexturedMaterial ref="faceMaterial" opaque="false" />
</item>
<item>
<MeshRenderer />
<QuadMeshHost xy0="-0.5, 1" xy1="0.5, 0" />
<QuadMeshHost xy0="-0.37383385162150155487, 1" xy1="0.37383385162150155487, 0" />
<SimpleTexturedMaterial ref="poseMaterial" opaque="false" />
</item>
</prefab>

View File

@ -4,7 +4,7 @@
<UIBorder
borderSize="16, 16"
alignment="50, 0, 0, 0"
alignment="40, 0, 0, 0"
alignUnitLeft="UI_COMPONENT_ALIGN_UNIT_PERCENT"
ref="border"
alignX="UI_COMPONENT_ALIGN_END"

View File

@ -5,6 +5,5 @@
tool_scene(${CMAKE_CURRENT_LIST_DIR}/SceneStandard.xml)
tool_scene(${CMAKE_CURRENT_LIST_DIR}/SceneMonologue.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/Scene1Prologue0.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/Scene1Prologue1.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/SceneTest.xml)
include("${CMAKE_CURRENT_LIST_DIR}/prologue/CMakeLists.txt")

View File

@ -1,9 +0,0 @@
<vnscene name="Scene1Prologue1" extend="scenes/SceneStandard">
<events>
<text>
<string lang="en"><font style="italics">whoa</font></string>
</text>
<scene-change scene="vnscenes/Scene1Prologue1" />
</events>
</vnscene>

View File

@ -1,19 +1,26 @@
<scene name="SceneMonologue">
<!-- Background -->
<item position="0, 0, -10">
<MeshRenderer />
<QuadMeshHost xy0="-500000, -500000" xy1="500000, 500000" />
<SimpleTexturedMaterial color="COLOR_BLACK" />
<SimpleTexturedMaterial ref="backgroundMaterial" color="COLOR_BLACK" />
</item>
<!-- VN Scene Camera -->
<item lookAt="0, 0.65, 1.8, 0, .65, 0">
<Camera ref="camera" fov="0.610865" />
</item>
<!-- UI -->
<item>
<!-- Canvas -->
<UICanvas ref="canvas" camera="camera" />
<!-- Textbox -->
<item ref="textbox" prefab="prefabs/VNTextboxMonologue" />
</item>
<!-- VN Manager -->
<item ref="vnItem">
<VNManager ref="vnManager" />
</item>

View File

@ -1,28 +1,34 @@
<scene name="SceneStandard">
<!-- Main Camera, this is put way past where the characters will be -->
<item lookAt="9999, 9999, 9999, 9999, 9999, 0">
<Camera ref="backCamera" />
</item>
<!-- <item ref="eth" prefab="prefabs/EthPrefab" /> -->
<!-- Background -->
<item position="0, 0, -10">
<MeshRenderer />
<QuadMeshHost xy0="-500000, -500000" xy1="500000, 500000" />
<SimpleTexturedMaterial color="COLOR_BLACK" />
<SimpleTexturedMaterial ref="backgroundMaterial" color="COLOR_BLACK" />
</item>
<!-- VN Scene Camera -->
<item lookAt="0, 0.65, 1.8, 0, .65, 0">
<Camera ref="camera" fov="0.610865" />
<CameraTexture ref="camTexture" camera="camera" />
</item>
<!-- UI -->
<item>
<!-- Canvas -->
<UICanvas ref="canvas" camera="backCamera" />
<!-- Textbox -->
<item ref="textbox" prefab="prefabs/VNTextbox" />
<!-- VN Scene Texture -->
<item position="100, 0, 0">
<UIImage
alignment="0, 0, 50, 0"
alignment="0, 0, 60, 0"
alignX="UI_COMPONENT_ALIGN_START"
alignUnitRight="UI_COMPONENT_ALIGN_UNIT_PERCENT"
alignY="UI_COMPONENT_ALIGN_STRETCH"
@ -32,10 +38,12 @@
</item>
</item>
<!-- VN Manager -->
<item ref="vnItem">
<VNManager ref="vnManager" />
</item>
<!-- Code to handle scene resizing and auto adjusting the scene camera -->
<code type="init">
useEvent([&amp;]{
assertNotNull(camTexture);

View File

@ -1,17 +0,0 @@
<vnscene name="SceneTest" extend="scenes/SceneStandard">
<item ref="ronin" prefab="prefabs/RoninPrefab" />
<asset ref="baseBodyTexture" type="texture" name="texture_ronin_pose_day_body" />
<asset ref="faceTest" type="texture" name="texture_ronin_face_day_neutral" />
<asset ref="poseTexture" type="texture" name="texture_ronin_pose_day_cross" />
<events>
<set property="ronin->bodyMaterial->texture" value="&baseBodyTexture->texture" type="Texture*" />
<set property="ronin->faceMaterial->texture" value="&faceTest->texture" type="Texture*" />
<set property="ronin->poseMaterial->texture" value="&poseTexture->texture" type="Texture*" />
<text>
<string lang="en"><font style="italics">whoa</font></string>
</text>
</events>
</vnscene>

View File

@ -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)

View File

@ -1,4 +1,4 @@
<vnscene name="Scene1Prologue0" extend="scenes/SceneMonologue">
<vnscene name="ScenePrologue0" extend="scenes/SceneMonologue">
<events>
<text>
<string lang="en"><font style="italics">There is a bucket.</font></string>
@ -32,6 +32,6 @@
<string lang="en"><font style="italics">Is their eyes.</font></string>
</text>
<scene-change scene="vnscenes/Scene1Prologue1" />
<scene-change scene="vnscenes/ScenePrologue1" />
</events>
</vnscene>

View File

@ -0,0 +1,91 @@
<vnscene name="ScenePrologue1" extend="scenes/SceneStandard">
<events>
<set property="backgroundMaterial->color" value="COLOR_BLUE" type="struct Color" />
<text>
<string lang="en"><font style="italics">I wake.</font></string>
</text>
<text>
<string lang="en"><font style="italics">I gasp. I close my eyes — I'm fine, I'm fine. I'm still here. Breathing.</font></string>
</text>
<text>
<string lang="en"><font style="italics">That bucket was a dream. My death was a dream. I'm not dead.</font></string>
</text>
<text>
<string lang="en"><font style="italics">(Am I?)</font></string>
</text>
<text>
<string lang="en"><font style="italics">(...)</font></string>
</text>
<text>
<string lang="en"><font style="italics">(Aren't I?)</font></string>
</text>
<text>
<string lang="en"><font style="italics">Of course I'm not.</font></string>
</text>
<text>
<string lang="en"><font style="italics">I exhale. My feet fall to the edges of my bed. Slowly, I raise myself to stand.</font></string>
</text>
<text>
<string lang="en"><font style="italics">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.</font></string>
</text>
<text>
<string lang="en"><font style="italics">The dream didn't happen. How could it have? Prom Day hasn't happened yet.</font></string>
</text>
<text>
<string lang="en"><font style="italics">I'm fine.</font></string>
</text>
<text>
<string lang="en"><font style="italics">(Didn't it happen?)</font></string>
</text>
<text>
<string lang="en"><font style="italics">(It felt so...)</font></string>
</text>
<text>
<string lang="en"><font style="italics">(Real.)</font></string>
</text>
<text>
<string lang="en"><font style="italics">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.</font></string>
</text>
<text>
<string lang="en"><font style="italics">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.</font></string>
</text>
<text>
<string lang="en"><font style="italics">No, of course not.</font></string>
</text>
<text>
<string lang="en"><font style="italics">My calendar says May 29th. I've got to prepare for Prom.</font></string>
</text>
<text>
<string lang="en"><font style="italics">After all, if there is anything I will be, it is Prom Queen.</font></string>
</text>
<text>
<string lang="en"><font style="italics">I've been chasing this moment since the beginning of time. Today is the finale.</font></string>
</text>
<text>
<string lang="en"><font style="italics">And I am nothing if not ready.</font></string>
</text>
<scene-change scene="vnscenes/ScenePrologue2" />
</events>
</vnscene>

View File

@ -0,0 +1,11 @@
<vnscene name="ScenePrologue2" extend="scenes/SceneStandard">
<events>
<set property="backgroundMaterial->color" value="COLOR_RED" type="struct Color" />
<text>
<string lang="en"><font style="italics">I wake.</font></string>
</text>
<scene-change scene="vnscenes/ScenePrologue2" />
</events>
</vnscene>

View File

@ -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)

View File

@ -78,7 +78,7 @@ size_t AssetLoader::loadRaw(uint8_t **buffer) {
this->rewind();
// Read the string then close the file handle.
*buffer = static_cast<uint8_t *>(malloc(sizeof(uint8_t) * length));
*buffer = static_cast<uint8_t *>(memoryAllocate(sizeof(uint8_t) * length));
read = this->read(*buffer, length);
this->close();

View File

@ -127,5 +127,6 @@ void TextureAsset::updateAsync() {
TextureAsset::~TextureAsset() {
if(this->buffer != nullptr) {
memoryFree(this->buffer);
this->buffer = nullptr;
}
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);
}