| 54 | } |
| 55 | |
| 56 | void RenderState::SaveSerialized(const std::string &fileName) { |
| 57 | SLG_LOG("Saving render state: " << fileName); |
| 58 | |
| 59 | SerializationOutputFile sof(fileName); |
| 60 | |
| 61 | // The following line is a workaround to a clang bug |
| 62 | RenderState *state = this; |
| 63 | sof.GetArchive() << state; |
| 64 | |
| 65 | if (!sof.IsGood()) |
| 66 | throw runtime_error("Error while saving serialized render state: " + fileName); |
| 67 | |
| 68 | sof.Flush(); |
| 69 | |
| 70 | const streamoff size = sof.GetPosition(); |
| 71 | if (size < 1024) { |
| 72 | SLG_LOG("Render state saved: " << size << " bytes"); |
| 73 | } else { |
| 74 | SLG_LOG("Render state saved: " << (size / 1024) << " Kbytes"); |
| 75 | } |
| 76 | } |
nothing calls this directly
no test coverage detected