diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-20 15:56:35 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-21 11:06:05 -0400 |
| commit | cae76dd98e301a4560bb46ecb59b5952dff04149 (patch) | |
| tree | 8e85d17234c6838fd24925889cd784296df56956 /src/game.cpp | |
| parent | 9f036b05d36203465ca481f39d2cd51233e82b9e (diff) | |
pke: cleanup std stream usage
Diffstat (limited to 'src/game.cpp')
| -rw-r--r-- | src/game.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp index 690292c..3c39018 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -29,7 +29,6 @@ #include <iomanip> #include <ostream> #include <fstream> -#include <sstream> #include <thread> const long readLineLength = 128; @@ -73,7 +72,7 @@ const char *PKE_FILE_CAMERA_INSTANCE_HANDLE = "Cam::InstanceHandle: "; const char *PKE_FILE_CAMERA_TARGET_INSTANCE_HANDLE = "Cam::TargetInstanceHandle: "; const char *PKE_FILE_CAMERA_IS_PRIMARY = "Cam::IsPrimary: "; -void SerializeCamera(std::ostringstream &stream, const PkeCamera &cam) { +void SerializeCamera(std::ostream &stream, const PkeCamera &cam) { NULL_CHAR_ARR(handleStr, 23); PkeCamera c{}; if (cam.type != c.type) { @@ -95,7 +94,7 @@ void SerializeCamera(std::ostringstream &stream, const PkeCamera &cam) { } } -void SerializeInstance(std::ostringstream &stream, const CompInstance &comp) { +void SerializeInstance(std::ostream &stream, const CompInstance &comp) { NULL_CHAR_ARR(handleStr, 23); EntityType *et = nullptr; if (comp.grBindsHandle != GrBindsHandle_MAX) { @@ -163,7 +162,7 @@ bool FindFirstInstanceHandle(void *handle, void *mapping) { InstMapping *inst_mapping = reinterpret_cast<InstMapping *>(mapping); return inst_mapping->origHandle == *reinterpret_cast<InstanceHandle *>(handle); } -void DeserializeCamera(PkeLevel *level, std::ifstream &stream) { +void DeserializeCamera(PkeLevel *level, std::istream &stream) { PkeCamera cam{}; InstanceHandle instanceHandle = InstanceHandle_MAX; InstanceHandle targetInstanceHandle = InstanceHandle_MAX; @@ -248,7 +247,7 @@ void DeserializeCamera(PkeLevel *level, std::ifstream &stream) { } } -void DeserializeInstance(Entity_Base *parentEntity, std::ifstream &stream) { +void DeserializeInstance(Entity_Base *parentEntity, std::istream &stream) { CompInstance comp{}; InstMapping mapping { .origHandle = InstanceHandle_MAX, |
