You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And there is code that converts textureSerial: number to texture: someReplayTexture
It made me wonder if there would be any benefit from trying to make that code just scan every trace object for xxxSerial and then do auto convert. Something like
function deserilize(traceObject, replay) {
const kSerial = 'Serial';
for (const [key, value] of Object.entries(traceObject)) {
if (Array.isArray(value)) {
for (const elem of value) {
if (typeof elem === 'object') {
deserialize(elem, replay);
}
}
} else if (typeof value === 'object') {
deserialize(value, replay)
} else if (key.endsWith(kSerial)) {
const type = key.substring(0, key.length - kSerial.length);
traceObject[type] = replay[`${type}s`][value];
delete traceObject[key]; // probably needs to be moved out of loop
}
}
}
I don't know if that would be generic enough or if there'd be so many exceptions it's not worth it.
The text was updated successfully, but these errors were encountered:
There's lots of trace data that's like
And there is code that converts
textureSerial: number
totexture: someReplayTexture
It made me wonder if there would be any benefit from trying to make that code just scan every trace object for
xxxSerial
and then do auto convert. Something likeI don't know if that would be generic enough or if there'd be so many exceptions it's not worth it.
The text was updated successfully, but these errors were encountered: