This commit is contained in:
2023-10-18 23:32:04 -05:00
parent a372fe4374
commit a511c5c908
15 changed files with 575 additions and 103 deletions

View File

@ -10,4 +10,5 @@ tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologue3.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologue4.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologue5.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologueSportsField.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologueToilets.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologueToilets.xml)
tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/ScenePrologue7.xml)

View File

@ -0,0 +1,204 @@
<vnscene name="ScenePrologue7" extend="scenes/SceneMonologue">
<events>
<set-font font="font_main" size="32" />
<text>
<string lang="en">The bell rings. School begins for the very last time in Angelwood High.</string>
</text>
<!-- Biology -->
<text>
<string lang="en">I can't concentrate.</string>
</text>
<text>
<string lang="en"><font style="italics">“Homosapiens. Our origins were not so far away-”</font></string>
</text>
<text>
<string lang="en">My teacher prattles on. Im thinking too much again.</string>
</text>
<text>
<string lang="en">(Like usual.)</string>
</text>
<text>
<string lang="en"><font style="italics">“— and well be discussing the way the world began.”</font></string>
</text>
<text>
<string lang="en">I remember this class. I remember the words that will leave Mr. Holdens lips.</string>
</text>
<text>
<string lang="en"><font style="italics">“We were born like this.”</font></string>
</text>
<text>
<string lang="en"><font style="italics">“A female of the species is born with XX chromosomes—”</font></string>
</text>
<text>
<string lang="en"><font style="italics">“XY chromosomes denote a male of the species—”</font></string>
</text>
<text>
<string lang="en">Why am I doing this again?</string>
</text>
<text>
<string lang="en">I died last night.</string>
</text>
<text>
<string lang="en">I <font style="italics">died.</font></string>
</text>
<text>
<string lang="en">I'm only shocked that I dont feel the wound pounded in my brain. Wheres the pain that murdered me? Why is it that when I raise my fingers to my head I feel nothing?</string>
</text>
<text>
<string lang="en">(But a phantom of pain whispers by my head. Stays; hisses; peels; <font style="italics">breaks me</font>, further and further down. Until my head is good as caved open.)</string>
</text>
<text>
<string lang="en">(Pain isnt here; and pain wants me to drown.)</string>
</text>
<text>
<string lang="en">I wasnt dreaming. I died. Thats the only explanation for how I know exactly how today will unfold.</string>
</text>
<text>
<string lang="en"><font style="italics">“Such markers are indicators of gender—”</font></string>
</text>
<text>
<string lang="en">No. <font style="italics">Not</font> unfold. I dont want to die again.</string>
</text>
<text>
<string lang="en">(I wont die again.)</string>
</text>
<text>
<string lang="en"><font style="italics">“— categories which all humans fall into.”</fon></string>
</text>
<text>
<string lang="en">Why am I back?</string>
</text>
<text>
<string lang="en">To win again? I wont complain. Ill win Prom Queen a thousand times if I had to, and Id do it gladly.</string>
</text>
<text>
<string lang="en">To try again?</string>
</text>
<text>
<string lang="en">I dont want to die again.</string>
</text>
<text>
<string lang="en">“Ethereality? Are you with us?”</string>
</text>
<text>
<string lang="en">I snap to attention. Mr. Holden looks at me expectantly, though not with malice. He knows I'm an Estridge and I'm the kindest girl on earth— supposedly. I wouldnt ignore his class.</string>
</text>
<text>
<string lang="en">“Yes,” I say. “Im here.”</string>
</text>
<text>
<string lang="en">“Will you answer my question?” He asks. “What makes a female of the species?”</string>
</text>
<text>
<string lang="en">Mr. Holden smiles, encouraging, as he awaits my answer.</string>
</text>
<text>
<string lang="en">I think about this. Ive done this before. Dont I remember my answer?</string>
</text>
<choices key="female-species">
<title>
<string lang="en">"A female species is the..."</string>
</title>
<choice value="nuturing">
<string lang="en">Nuturing.</string>
</choice>
<choice value="emotional">
<string lang="en">Emotional.</string>
</choice>
<choice value="sweet">
<string lang="en">Sweet.</string>
</choice>
<choice value="empathetic">
<string lang="en">Empathetic.</string>
</choice>
<choice value="beautiful">
<string lang="en">Beautiful.</string>
</choice>
</choices>
<text>
<string lang="en">Mr. Holden nods. His smile widens. “Etherealitys right,” he says, and turns to the class again.</string>
</text>
<if key="female-species" value="nuturing">
<text>
<string lang="en">“The ability to nuture is crucial to femininity…”</string>
</text>
</if>
<if key="female-species" value="emotional">
<text>
<string lang="en">“The ability to be emotional is crucial to femininity…”</string>
</text>
</if>
<if key="female-species" value="sweet">
<text>
<string lang="en">“The ability to be sweet is crucial to femininity…”</string>
</text>
</if>
<if key="female-species" value="empathetic">
<text>
<string lang="en">“The ability to be empathetic is crucial to femininity…”</string>
</text>
</if>
<if key="female-species" value="beautiful">
<text>
<string lang="en">“The ability to be beautiful is crucial to femininity…”</string>
</text>
</if>
<choices key="elegy">
<title>
<string lang="en">Even if I dont remember, this has been drilled into me since the beginning of time. Its easy. Angelwood maintains its same elegy for women.</string>
</title>
<choice value="elegy">
<string lang="en">(And the elegy is you.)</string>
</choice>
</choices>
<text>
<string lang="en">The bell rings. Everyone leaves Biology. In the corridors, they tell me how well Ive done in class (as if); ask me about tonight, because Prom is all thats on everyones minds and I am the star <font style="TRUE_TYPE_DECORATION_STRIKETHROUGH">(blood-streaked.)</font></string>
</text>
<text>
<string lang="en">I manage to return their <font style="italics">hellos</font> and smiles without feeling— too — faint.</string>
</text>
<text>
<string lang="en">Finally the questioning abates and their bodies rush off to their next class. I need to go, too. I cant miss English, theyll wonder where I am. But my heart rams in my throat; my chest is sick with heave. I feel like hurling.</string>
</text>
<text>
<string lang="en">(My death keeps coming back. My grace keeps cracking. My body keeps falling. Is it because my descent was always the prettiest of them all?)</string>
</text>
<text>
<string lang="en">I breathe in the corridors.</string>
</text>
<text>
<string lang="en"><font style="italics">Who</font> murdered me?</string>
</text>
<text>
<string lang="en">All of Angelwood High adores me. Ive made sure of the fact. Its been true since the beginning of time.</string>
</text>
<text>
<string lang="en">Or as close to the beginning of time as it could be. When I turned into a teen and shot up the ranks, with my saunter and my beauty and my smile.</string>
</text>
<text>
<string lang="en">(When I stopped hanging with the wrong people. When I began to be beautiful and lived up to the best ideals.)</string>
</text>
<text>
<string lang="en">...</string>
</text>
<text>
<string lang="en">(When I started to become perfect.)</string>
</text>
<text>
<string lang="en">There are only a few possibilities. There are only a few that hate me. </string>
</text>
<scene-change scene="vnscenes/ScenePrologue8" />
</events>
</vnscene>

View File

@ -1,9 +1,107 @@
<vnscene name="ScenePrologueSportsField" extend="scenes/SceneMonologue">
<vnscene name="ScenePrologueSportsField" extend="scenes/SceneStandard">
<events>
<set-font font="font_main" style="italics" size="32" />
<set-font font="font_main" size="32" />
<text>
<string lang="en"><font style="italics">SF.</font></string>
<string lang="en">Craig is my boyfriend. He's throwing down for his football tournament happening in June. He loves me like a King loves his Queen- with worship, reverence, and the stars. He's beyond the golden boy: he glistens.</string>
</text>
<text>
<string lang="en">"Ethy!"</string>
</text>
<text>
<string lang="en">Craig calls. He waves me down as I enter the field.</string>
</text>
<text>
<string lang="en">The whistle screeches; Craig whips his head back to the field. He dashes to the football and scores. His teammates' cheers ring in my ears.</string>
</text>
<text>
<string lang="en">Craig winks as he jogs back. "That was for you."</string>
</text>
<text>
<string lang="en"><font style="italics">Despite myself, I chuckle.</font></string>
</text>
<choices key="look-beautiful">
<title>
<string lang="en">"So," he says, "you look beautiful."</string>
</title>
<choice value="thanks">
<string lang="en">Thanks.</string>
</choice>
<choice value="so-do-you">
<string lang="en">So do you.</string>
</choice>
<choice value="duh">
<string lang="en">Duh.</string>
</choice>
</choices>
<if key="look-beautiful" value="thanks">
<text>
<string lang="en">As if I don't know that.</string>
</text>
</if>
<if key="look-beautiful" value="so-do-you">
<text>
<string lang="en">No harm in a little lie. Especially when it brightens him up like sun-dusk.</string>
</text>
</if>
<if key="look-beautiful" value="duh">
<text>
<string lang="en">He says what all of Angelwood says. Per usual.</string>
</text>
</if>
<text>
<string lang="en">Craig smiles wide. He holds me close to him and laughs.</string>
</text>
<text>
<string lang="en">"My tournament's soon. You'll be there, yeah?"</string>
</text>
<text>
<string lang="en">He's been talking about his tournament since the school year started. He thinks it's his one ticket out of Angelwood.</string>
</text>
<text>
<string lang="en">As if I won't, Craig.</string>
</text>
<text>
<string lang="en">
He throws an arm around my shoulders. He kisses my cheek. He holds me
tight, squeezes me into his sweat-stained, disgusting body. Laughs, nods
to his teammates towering high and hulking, their shoulder pads like
soldiers in another life.
</string>
</text>
<text>
<string lang="en">They throw the football at Craig's head. He catches it. I nearly flinch.</string>
</text>
<text>
<string lang="en"><font style="italics">It's fine. Fine. You're okay.</font></string>
</text>
<text>
<string lang="en">He doesn't notice.</string>
</text>
<text>
<string lang="en">"See you tonight, Ethy," he says. "I can't wait to see your dress."</string>
</text>
<text>
<string lang="en">Craig kisses me in full view of his teammates. They roar, clap Craig on the shoulder and drag him back.</string>
</text>
<text>
<string lang="en">He wipes his mouth clean and grins. Then he throws the football, and all the boys begin to sprint.</string>
</text>
<if key="go-to" value="sports-field">
<scene-change scene="vnscenes/ScenePrologueToilets" />
</if>
<scene-change scene="vnscenes/ScenePrologue7" />
</events>
</vnscene>

View File

@ -1,9 +1,140 @@
<vnscene name="ScenePrologueToilets" extend="scenes/SceneMonologue">
<vnscene name="ScenePrologueToilets" extend="scenes/SceneStandard">
<events>
<set-font font="font_main" style="italics" size="32" />
<set-font font="font_main" size="32" />
<if key="go-to" value="sports-field">
<text>
<string lang="en">On my return, I pass him by the lockers.</string>
</text>
</if>
<if key="go-to" value="toilets">
<text>
<string lang="en">He's by the lockers.</string>
</text>
</if>
<text>
<string lang="en"><font style="italics">TEST</font></string>
<string lang="en">Ronin Beaufort. That's his name. I haven't seen him much around Angelwood: he was homeschooled throughout middle school. Came back again for his final years in Angelwood High.</string>
</text>
<text>
<string lang="en">Boys pass by Ronin, entering the toilets and out again. Ronin looks at me and only me.</string>
</text>
<text>
<string lang="en">...</string>
</text>
<text>
<string lang="en">He doesn't need to watch me.</string>
</text>
<text>
<string lang="en"><font style="italics">I</font> don't need to look at <font style="italics">him.</font></string>
</text>
<text>
<string lang="en">But he calls.</string>
</text>
<text>
<string lang="en">"Stranger."</string>
</text>
<text>
<string lang="en">And I stop.</string>
</text>
<text>
<string lang="en">"And you are?"</string>
</text>
<text>
<string lang="en"><font style="italics">He smiles thinly.</font></string>
</text>
<text>
<string lang="en">"Ronin. Beaufort. But you knew that, Ther."</string>
</text>
<text>
<string lang="en">Jesus.</string>
</text>
<text>
<string lang="en"><font style="italics">I roll my eyes.</font></string>
</text>
<text>
<string lang="en">I stroll towards Ronin. Head high, back straight. I'm goddess of this school and he's- an a-hole of nothing.</string>
</text>
<text>
<string lang="en">"I don't know who you are."</string>
</text>
<text>
<string lang="en">It's a lie. Of course I know who he is.</string>
</text>
<text>
<string lang="en">Ave Beaufort's brother, in all of his edgy glory.</string>
</text>
<text>
<string lang="en">Of course I know.</string>
</text>
<text>
<string lang="en">The boys go in and out of the toilets, like a cycle of flies. Going in, buzzing out. Hovering: mildly intrigued by whatever <font style="italics">this</font> confrontation is. They tend to want to know what Ethereality Estridge is doing.</string>
</text>
<text>
<string lang="en">"Sure you don't," Ronin says. "I don't know who you are, either."</string>
</text>
<text>
<string lang="en">Ugh.</string>
</text>
<text>
<string lang="en">"Somethin' wrong, Ther?"</string>
</text>
<text>
<string lang="en">Somethin' wrong, Ther?"</string>
</text>
<choices key="asshole">
<title>
<string lang="en"><font style="italics">Asshole.</font></string>
</title>
<choice value="you">
<string lang="en">You.</string>
</choice>
<choice value="nothing">
<string lang="en">Nothing.</string>
</choice>
</choices>
<if key="asshole" value="you">
<!-- He Laughs.-->
<text>
<string lang="en">"Direct," Ronin says. "I like it."</string>
</text>
</if>
<if key="asshole" value="nothing">
<text>
<string lang="en">"Nothing, nothing," Ronin says. "That goes knockin'." He raps his fist against his skull and grins. </string>
</text>
</if>
<text>
<string lang="en">Get out of my sight.</string>
</text>
<text>
<string lang="en">Ronin gets out of my sight. He strolls into the boys' toilets. His boots clack with him, echoing through the floorboards. Each crack is as sharp as a bullet.</string>
</text>
<text>
<string lang="en">I exhale.</string>
</text>
<text>
<string lang="en">Thank Christ. I wouldn't know how to deal with him, otherwise.</string>
</text>
<if key="go-to" value="toilets">
<text>
<string lang="en">I need to get out of here. I need to find Craig.</string>
</text>
<scene-change scene="vnscenes/ScenePrologueSportsField" />
</if>
<scene-change scene="vnscenes/ScenePrologue7" />
</events>
</vnscene>

View File

@ -41,5 +41,12 @@ namespace Dawn {
}
}, getScene()->eventSceneUpdate);
}
public:
std::string getChoiceKey() {
auto it = choices.begin();
std::advance(it, choice);
return it->first;
}
};
}

View File

@ -0,0 +1,82 @@
#pragma once
#include "scenes/SceneMonologue.hpp"
#include "games/vn/events/VNDummyEvent.hpp"
#include "games/vn/events/VNSetDefaultFontEvent.hpp"
#include "games/vn/events/VNTextEvent.hpp"
#include "games/vn/events/VNChoiceEvent.hpp"
#include "games/vn/events/VNIfEvent.hpp"
#include "games/vn/events/VNSceneChangeEvent.hpp"
#include "games/vn/events/VNChoiceSetEvent.hpp"
#include "vnscenes/ScenePrologue9.hpp"
namespace Dawn {
class ScenePrologue8CustomEventForChoiceSet : public VNChoiceEvent {
protected:
void onStart() override {
auto scene = dynamic_cast<ScenePrologue8*>this->manager->getScene();
assertNotNull(scene, "ScenePrologue8CustomEventForChoiceSet - Scene is null?");
this->choices = scene->remainingChoices;
this->key = "killer";
this->text = "It is...";
VNChoiceSetEvent::onStart();
}
};
class ScenePrologue8CustomEventForAfterChoice : public VNEvent {
protected:
void onStart() override {
auto prev = dynamic_cast<ScenePrologue8CustomEventForChoiceSet*>(this->previous);
assertNotNull(prev, "ScenePrologue8CustomEventForAfterChoice - Previous is null?");
auto scene = dynamic_cast<ScenePrologue8*>this->manager->getScene();
assertNotNull(scene, "ScenePrologue8CustomEventForAfterChoice - Scene is null?");
auto key = prev->getChoiceKey();
scene->remainingChoices.erase(key);
this->next();
}
};
class ScenePrologue8 : public SceneMonologue {
public:
std::map<std::string, std::string> remainingChoices;
ScenePrologue8(DawnGame *game) : SceneMonologue(game) {
}
std::vector<Asset*> getRequiredAssets() override {
auto man = &this->game->assetManager;
std::vector<Asset*> assets = SceneMonologue::getRequiredAssets();
return assets;
}
void stage() override {
SceneMonologue::stage();
remainingChoices["ave"] = "Ave?";
remainingChoices["ronin"] = "Ronin?";
remainingChoices["craig"] = "Craig?";
auto man = &this->game->assetManager;
assertNotNull(vnManager, "VNSceneGenInit - VN Manager is null?");
VNEvent *previous = vnManager->createEvent<VNDummyEvent>();
auto eventStart = previous;
auto event0 = vnManager->createEvent<VNSetDefaultFontEvent>();
event0->font = "<font font=\"font_main\" size=\"32.0f\">{{ text }}</font>";
auto event1 = vnManager->createEvent<ScenePrologue8CustomEventForChoiceSet>();
auto event2 = vnManager->createEvent<ScenePrologue8CustomEventForAfterChoice>();
auto sceneChange = vnManager->createEvent<VNSceneChangeEvent<ScenePrologue9>>();
eventStart->then(event0);
event0->then(event1);
event1->then(event2);
event2->then(sceneChange);
vnManager->setEvent(eventStart);
}
};
}

View File

@ -10,6 +10,8 @@ using namespace Dawn;
int32_t main(int32_t argc, char **args) {
int32_t result;
memoryInit();
// Create the host
auto host = new DawnHost();
auto game = new DawnGame(host);
@ -40,9 +42,7 @@ int32_t main(int32_t argc, char **args) {
delete game;
delete host;
#if DAWN_DEBUG_BUILD
assertTrue(dawnAllocatedItemCount == 0, "DawnHostOSX: Failed to free all allocated items.");
#endif
memoryDispose();
// Success
return 0;

View File

@ -281,7 +281,8 @@ Xml * Xml::getFirstChildOfType(std::string type) {
Xml::~Xml() {
auto it = this->children.begin();
while(it != this->children.end()) {
delete *it;
Xml *child = *it;
delete child;
++it;
}
}

View File

@ -5,6 +5,7 @@
#pragma once
#include "dawnsharedlibs.hpp"
#include "util/memory.hpp"
#include "assert/assert.hpp"
#include "util/array.hpp"

View File

@ -6,60 +6,40 @@
#include "memory.hpp"
#include "assert/assert.hpp"
uint64_t dawnAllocatedItemCount = -1;
void memoryInit() {
dawnAllocatedItemCount = 0;
void * operator new(size_t size) noexcept {
return memoryAllocate(size);
}
void memoryDispose() {
assertTrue(dawnAllocatedItemCount <= 0, "memoryDispose: !!!Leaked memory detected (not enough free)!!!");
assertTrue(dawnAllocatedItemCount >= 0, "memoryDispose: !!!Leaked memory detected (too much free)!!!");
dawnAllocatedItemCount = -1;
void operator delete (void *p) noexcept {
return memoryFree(p);
}
void * memoryAllocate(const size_t size) {
assertTrue(dawnAllocatedItemCount >= 0, "memoryAllocate: Either a memory leak or memoryInit was not called.");
assertTrue(size >= 0, "memoryAllocate: size must be greater than 0 or equal to.");
if(size == 0) {
// Technically this is an implementation specific case, I think it should
// basically be undefined behaviour tbh.
return memoryCallMalloc(size);
}
dawnAllocatedItemCount++;
auto x = (void *)memoryCallMalloc(size);
void *x = (void *)memoryCallMalloc(size);
assertNotNull(x, "memoryAllocate: Failed to allocate memory");
return x;
}
void * memoryAllocateEmpty(const size_t count, const size_t size) {
assertTrue(dawnAllocatedItemCount >= 0, "memoryAllocateEmpty: Either a memory leak or memoryInit was not called.");
assertTrue(count >= 0, "memoryAllocateEmpty: count must be greater than or equal to 0");
assertTrue(size >= 0, "memoryAllocateEmpty: size must be greater than or equal to 0");
if(count == 0 || size == 0) {
// Technically this is an implementation specific case, I think it should
// basically be undefined behaviour tbh.
return memoryCallCalloc(count, size);
}
dawnAllocatedItemCount++;
auto x = (void*)memoryCallCalloc(count, size);
void *x = (void *)memoryCallCalloc(count, size);
assertNotNull(x, "memoryAllocateEmpty: Failed to allocate memory");
return x;
}
void memoryFree(void *pointer) {
assertTrue(dawnAllocatedItemCount > 0, "memoryFree: Either a memory leak or memoryInit was not called.");
if(pointer == nullptr || pointer == NULL) {
// Technically this is an implementation specific case, I think it should
// basically be undefined behaviour tbh.
return memoryCallFree(pointer);
}
dawnAllocatedItemCount--;
memoryCallFree(pointer);
}
void * memoryReallocate(void *ptr, size_t newSize) {
assertTrue(newSize >= 0, "memoryReallocate: newSize must be greater than or equal to 0");
return memoryCallRealloc(ptr, newSize);
}
void memoryCopy(void *source, void *destination, size_t size) {
assertTrue(dawnAllocatedItemCount >= 0, "memoryAllocate: Either a memory leak or memoryInit was not called.");
assertNotNull(source, "memoryCopy: source must not be null");
assertNotNull(destination, "memoryCopy: destination must not be null");
assertTrue(destination != source, "memoryCopy: destination must not be source");
@ -68,32 +48,21 @@ void memoryCopy(void *source, void *destination, size_t size) {
}
int32_t memoryCompare(const void *left, const void *right, const size_t size) {
assertTrue(dawnAllocatedItemCount >= 0, "memoryAllocate: Either a memory leak or memoryInit was not called.");
assertTrue(left != right, "memoryCompare: left must not be right");
assertTrue(size > 0, "memoryCompare: size must be greater than 0");
return memcmp(left, right, size);
}
void memorySet(void *dest, uint8_t data, size_t length) {
assertTrue(dawnAllocatedItemCount >= 0, "memoryAllocate: Either a memory leak or memoryInit was not called.");
assertNotNull(dest, "memorySet: dest must not be null");
assertTrue(length > 0, "memorySet: length must be greater than 0");
memset(dest, data, length);
}
size_t memoryReallocate(void **pointer, size_t currentSize, size_t newSize) {
// Create the new buffer
void *newBuffer = memoryAllocate(newSize);
memoryCopy(*pointer, newBuffer, currentSize);
memoryFree(*pointer);
*pointer = newBuffer;
return newSize;
void memoryInit() {
}
void * operator new(size_t size) {
return memoryAllocate(size);
}
void operator delete(void *pointer) {
memoryFree(pointer);
void memoryDispose() {
}

View File

@ -8,7 +8,7 @@
#pragma once
#include "dawnsharedlibs.hpp"
extern uint64_t dawnAllocatedItemCount;
#define DAWN_MEMORY_TRACKING 1
static void * memoryCallMalloc(const size_t size) {
return malloc(size);
@ -22,15 +22,9 @@ static void memoryCallFree(void *p) {
free(p);
}
/**
* Initializes the memory management system.
*/
void memoryInit();
/**
* Disposes of the memory management system.
*/
void memoryDispose();
static void * memoryCallRealloc(void *p, size_t newSize) {
return realloc(p, newSize);
}
/**
* Allocate some space in memory to use for your needs. Memory allocation may
@ -57,6 +51,16 @@ void * memoryAllocateEmpty(const size_t count, const size_t size);
*/
void memoryFree(void *pointer);
/**
* Reallocate a part of memory. Reallocation simply creates a new buffer that
* will take all of the existing contents and then free's the original buffer.
*
* @param pointer Pointer to pointer in memory that you wish to re-allocate.
* @param newSize The new size of the buffer.
* @return Pointer to the new buffer.
*/
void * memoryReallocate(void *pointer, size_t newSize);
/**
* Copies data from one buffer to another. Typically used for array operations.
*
@ -86,32 +90,11 @@ int32_t memoryCompare(const void *left, const void *right, const size_t size);
void memorySet(void *dest, uint8_t data, size_t length);
/**
* Reallocate a part of memory. Reallocation simply creates a new buffer that
* will take all of the existing contents and then free's the original buffer.
*
* @param pointer Pointer to pointer in memory that you wish to re-allocate.
* @param currentSize Current size of the buffer that the pointer points to.
* @param newSize The new size of the buffer.
* @return The new size param you provided.
* Initializes the memory management system.
*/
size_t memoryReallocate(void **pointer, size_t currentSize, size_t newSize);
void memoryInit();
/**
* Overloads the new operator to use our memory allocation.
*
* @param size Size of the memory to allocate.
* @return Pointer to the memory.
* Disposes of the memory management system.
*/
void * operator new(size_t size);
/**
* Overloads the delete operator to use our memory allocation.
*
* @param p Pointer to the memory to free.
*/
void operator delete(void * p);
// Override default memory functions
#define malloc(n) memoryAllocate(n)
#define free(n) memoryFree(n)
#define calloc(n, s) memoryAllocateEmpty(n, s)
void memoryDispose();

View File

@ -151,12 +151,7 @@ int32_t TrueTypeTool::start() {
}
// Cleanup
itFile = files.begin();
while(itFile != files.end()) {
auto file = *itFile;
delete file;
++itFile;
}
cleanupFiles();
// Done
fileOut.close();

View File

@ -38,7 +38,7 @@ int32_t VNChoiceParser::onParse(
if(ret != 0) return ret;
out->texts.push_back(text);
} else {
*error = "Unknown child node '" + child->node + "'";
*error = "Unknown child node for choice event '" + child->node + "'";
return -1;
}
@ -98,7 +98,7 @@ int32_t VNChoicesEventParser::onParse(
out->choices.push_back(choice);
} else {
*error = "Unknown child node '" + child->node + "'";
*error = "Unknown child node for choices event '" + child->node + "'";
return -1;
}

View File

@ -71,7 +71,7 @@ int32_t VNTextEventParser::onParse(
if(ret != 0) return ret;
out->texts.push_back(text);
} else {
*error = "Unknown child node '" + child->node + "'";
*error = "Unknown child node for text event '" + child->node + "'";
return -1;
}