summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-03-31 12:02:44 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-03-31 12:02:44 -0400
commit89614d1dee1049a08e64aead95de6fb28fa7b150 (patch)
tree77e59a92c370154d7b7d859506e570a1fffd66c3 /src/game.cpp
parent119c83096a81c5aef45a0dbef029bd2e49d2e977 (diff)
pke: parse uuid from scene and project files
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 630495a..f471d02 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -195,7 +195,7 @@ void DeserializeCamera(pke_scene *scene, std::istream &stream) {
} else {
instPos = loadFileInstanceMappings[instanceIndex].newInstance;
}
- auto &rCam = PkeCamera_Register(instPos);
+ auto &rCam = PkeCamera_Register(cam.uuid, instPos);
rCam.type = cam.type;
rCam.view = cam.view;
rCam.isPrimary = cam.isPrimary;
@@ -209,6 +209,11 @@ void DeserializeCamera(pke_scene *scene, std::istream &stream) {
}
return;
}
+ if (strncmp(readLine, PKE_FILE_CAMERA_UUID, strlen(PKE_FILE_CAMERA_TYPE)) == 0) {
+ uint64_t prefixLen = strlen(PKE_FILE_CAMERA_UUID);
+ (readLine + prefixLen) >> cam.uuid;
+ continue;
+ }
if (strncmp(readLine, PKE_FILE_CAMERA_TYPE, strlen(PKE_FILE_CAMERA_TYPE)) == 0) {
uint64_t prefixLen = strlen(PKE_FILE_CAMERA_TYPE);
PkeCameraType_T handle_t;
@@ -339,6 +344,11 @@ void DeserializeInstance(Entity_Base *parentEntity, std::istream &stream) {
assert(result2 == STR2NUM_ERROR::SUCCESS);
continue;
}
+ if (strstr(readLine, PKE_FILE_INSTANCE_UUID)) {
+ uint64_t prefixLen = strlen(PKE_FILE_INSTANCE_UUID);
+ (readLine + prefixLen) >> comp.uuid ;
+ continue;
+ }
if (strstr(readLine, PKE_FILE_INSTANCE_ENTITY_TYPE_CODE)) {
uint64_t prefixLen = strlen(PKE_FILE_INSTANCE_ENTITY_TYPE_CODE);
strncpy(entTypeCode, readLine + prefixLen, 21);