mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-13 10:11:02 +00:00
Change by-ref passed float or bool parameters to callbacks in public API
* Mostly used for passing a progress float back during a long blocking call like opening a capture or doing a copy. * This is much more feasible for python to bind to. * In several cases we just use a tiny lambda that updates a float anyway since we can't push the progress directly into a progress dialog, but need to let it query from a temporary in-between float.
This commit is contained in:
@@ -408,7 +408,8 @@ void Serialiser<SerialiserMode::Writing>::EndChunk()
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser<SerialiserMode::Writing>::WriteStructuredFile(const SDFile &file, float *progress)
|
||||
void Serialiser<SerialiserMode::Writing>::WriteStructuredFile(const SDFile &file,
|
||||
RENDERDOC_ProgressCallback progress)
|
||||
{
|
||||
Serialiser<SerialiserMode::Writing> scratchWriter(
|
||||
new StreamWriter(StreamWriter::DefaultScratchSize), Ownership::Stream);
|
||||
@@ -475,9 +476,12 @@ void Serialiser<SerialiserMode::Writing>::WriteStructuredFile(const SDFile &file
|
||||
}
|
||||
|
||||
if(progress)
|
||||
*progress = float(i) / float(file.chunks.size());
|
||||
progress(float(i) / float(file.chunks.size()));
|
||||
}
|
||||
|
||||
if(progress)
|
||||
progress(1.0f);
|
||||
|
||||
m_StructuredFile = &m_StructData;
|
||||
scratchWriter.m_StructuredFile = &scratchWriter.m_StructData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user