avoid division by zero
parent
6b8cbe5c83
commit
8f960f0ed2
|
@ -97,7 +97,7 @@ public:
|
||||||
* of the file parsing.
|
* of the file parsing.
|
||||||
* */
|
* */
|
||||||
virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
|
virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
|
||||||
float f = currentStep / (float)numberOfSteps;
|
float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
|
||||||
Update( f * 0.5f );
|
Update( f * 0.5f );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public:
|
||||||
* increasing, although not necessarily linearly.
|
* increasing, although not necessarily linearly.
|
||||||
* */
|
* */
|
||||||
virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
|
virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
|
||||||
float f = currentStep / (float)numberOfSteps;
|
float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
|
||||||
Update( f * 0.5f + 0.5f );
|
Update( f * 0.5f + 0.5f );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue