DIRECTOR: fix FPE in initTransParams

This commit is contained in:
ysj1173886760 2021-08-09 19:35:10 +08:00
parent 677cec6aea
commit be5134d7ca

View File

@ -1064,19 +1064,19 @@ void Window::initTransParams(TransParams &t, Common::Rect &clipRect) {
switch (transProps[t.type].dir) {
case kTransDirHorizontal:
t.steps = w / t.chunkSize;
t.steps = MAX(w / t.chunkSize, (uint)1);
t.xStepSize = w / t.steps;
t.xpos = w % t.steps;
break;
case kTransDirVertical:
t.steps = h / t.chunkSize;
t.steps = MAX(h / t.chunkSize, (uint)1);
t.yStepSize = h / t.steps;
t.ypos = h % t.steps;
break;
case kTransDirBoth:
t.steps = m / t.chunkSize;
t.steps = MAX(m / t.chunkSize, (uint)1);
t.xStepSize = w / t.steps;
t.xpos = w % t.steps;