summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-03-20 15:31:34 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-03-21 11:06:05 -0400
commit9f036b05d36203465ca481f39d2cd51233e82b9e (patch)
tree0b44323ed2e401cf5e6dd2840e2fd45a1d9597bc /src/game.cpp
parente6e7f56c9bba3b2191583c4c1d0599370d1f00c7 (diff)
pke: rename Parse to Deserialize
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 6283d5c..690292c 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -163,7 +163,7 @@ bool FindFirstInstanceHandle(void *handle, void *mapping) {
InstMapping *inst_mapping = reinterpret_cast<InstMapping *>(mapping);
return inst_mapping->origHandle == *reinterpret_cast<InstanceHandle *>(handle);
}
-void ParseCamera(PkeLevel *level, std::ifstream &stream) {
+void DeserializeCamera(PkeLevel *level, std::ifstream &stream) {
PkeCamera cam{};
InstanceHandle instanceHandle = InstanceHandle_MAX;
InstanceHandle targetInstanceHandle = InstanceHandle_MAX;
@@ -183,7 +183,7 @@ void ParseCamera(PkeLevel *level, std::ifstream &stream) {
instPos.mass = 1.f;
instPos.posRot.setIdentity();
instPos.scale = btVector3(1.f, 1.f, 1.f);
- fprintf(stdout, "[ParseCamera] Failed to find instance mapping. Is this an outdated parse?\n");
+ fprintf(stdout, "[DeserializeCamera] Failed to find instance mapping. Is this an outdated parse?\n");
} else {
instPos = loadFileInstanceMappings[instanceIndex].newInstance;
}
@@ -248,7 +248,7 @@ void ParseCamera(PkeLevel *level, std::ifstream &stream) {
}
}
-void ParseInstance(Entity_Base *parentEntity, std::ifstream &stream) {
+void DeserializeInstance(Entity_Base *parentEntity, std::ifstream &stream) {
CompInstance comp{};
InstMapping mapping {
.origHandle = InstanceHandle_MAX,
@@ -271,7 +271,7 @@ void ParseInstance(Entity_Base *parentEntity, std::ifstream &stream) {
if (strlen(entTypeCode) > 1) {
etPtr = EntityType_FindByTypeCode(entTypeCode);
if (etPtr == nullptr) {
- fprintf(stdout, "[Game::ParseInstance] Unknown EntityTypeCode: \"%s\"\n", entTypeCode);
+ fprintf(stdout, "[Game::DeserializeInstance] Unknown EntityTypeCode: \"%s\"\n", entTypeCode);
break;
}
} else if (strlen(entTypeCode) == 1) {
@@ -280,7 +280,7 @@ void ParseInstance(Entity_Base *parentEntity, std::ifstream &stream) {
skipEntCreate = true;
}
} else {
- fprintf(stdout, "[Game::ParseInstance] Failed to create instance from save file. No EntTypeCode present.\n");
+ fprintf(stdout, "[Game::DeserializeInstance] Failed to create instance from save file. No EntTypeCode present.\n");
break;
}
@@ -290,7 +290,7 @@ void ParseInstance(Entity_Base *parentEntity, std::ifstream &stream) {
entity = reinterpret_cast<CreateInst*>(etPtr->createInstanceCallback.func)();
} else {
entity = EntityType_CreateGenericInstance(etPtr, parentEntity, &comp, &mapping.newInstance);
- fprintf(stdout ,"[Game::ParseInstance] Debug: entTypeCode '%s' does not have a registered callback func to handle instance creation.\n", entTypeCode);
+ fprintf(stdout ,"[Game::DeserializeInstance] Debug: entTypeCode '%s' does not have a registered callback func to handle instance creation.\n", entTypeCode);
}
mapping.newEntHandle = entity->handle;
}
@@ -487,11 +487,11 @@ void Game_LoadSceneFile(PkeLevel *level, const char *sceneFilePath) {
while (f.getline(readLine, readLineLength)) {
if (strcmp(PKE_FILE_OBJ_INSTANCE, readLine) == 0) {
- ParseInstance(level, f);
+ DeserializeInstance(level, f);
continue;
}
if (strcmp(PKE_FILE_OBJ_CAMERA, readLine) == 0) {
- ParseCamera(level, f);
+ DeserializeCamera(level, f);
continue;
}
}