From bd81da1a6a7604805c927073f086767c5baf2bac Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Tue, 15 Mar 2016 14:29:35 -0500 Subject: SCI32: Initialise all scaler tables Initialising only the first table means that if the first ratios aren't 1:1 but the *second* ratios are 1:1, the second ratios will read from an uninitialised table. --- engines/sci/graphics/celobj32.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/sci') diff --git a/engines/sci/graphics/celobj32.h b/engines/sci/graphics/celobj32.h index 8d030cfd4a..14d9fa3d87 100644 --- a/engines/sci/graphics/celobj32.h +++ b/engines/sci/graphics/celobj32.h @@ -180,13 +180,16 @@ public: CelScaler() : _scaleTables(), _activeIndex(0) { - CelScalerTable &table = _scaleTables[_activeIndex]; + CelScalerTable &table = _scaleTables[0]; table.scaleX = Ratio(); table.scaleY = Ratio(); for (int i = 0; i < ARRAYSIZE(table.valuesX); ++i) { table.valuesX[i] = i; table.valuesY[i] = i; } + for (int i = 1; i < ARRAYSIZE(_scaleTables); ++i) { + _scaleTables[i] = _scaleTables[0]; + } } /** -- cgit v1.2.3