aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/graphics/remap.cpp12
-rw-r--r--engines/sci/graphics/remap.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/sci/graphics/remap.cpp b/engines/sci/graphics/remap.cpp
index 833cf2b77f..999cfc7753 100644
--- a/engines/sci/graphics/remap.cpp
+++ b/engines/sci/graphics/remap.cpp
@@ -192,7 +192,7 @@ bool GfxRemap32::updateRemap(byte index, bool palChanged) {
if (!_update && !palChanged)
return false;
- memset(_targetChanged, false, NON_REMAPPED_COLOR_COUNT);
+ Common::fill(_targetChanged, _targetChanged + NON_REMAPPED_COLOR_COUNT, false);
switch (curRemap->type) {
case kRemappingNone:
@@ -237,7 +237,7 @@ bool GfxRemap32::updateRemap(byte index, bool palChanged) {
}
changed = applyRemap(index);
- memset(curRemap->colorChanged, false, NON_REMAPPED_COLOR_COUNT);
+ Common::fill(curRemap->colorChanged, curRemap->colorChanged + NON_REMAPPED_COLOR_COUNT, false);
curRemap->oldPercent = curRemap->percent;
return changed;
case kRemappingToGray:
@@ -265,7 +265,7 @@ bool GfxRemap32::updateRemap(byte index, bool palChanged) {
}
changed = applyRemap(index);
- memset(curRemap->colorChanged, false, NON_REMAPPED_COLOR_COUNT);
+ Common::fill(curRemap->colorChanged, curRemap->colorChanged + NON_REMAPPED_COLOR_COUNT, false);
curRemap->oldGray = curRemap->gray;
return changed;
case kRemappingToPercentGray:
@@ -294,7 +294,7 @@ bool GfxRemap32::updateRemap(byte index, bool palChanged) {
}
changed = applyRemap(index);
- memset(curRemap->colorChanged, false, NON_REMAPPED_COLOR_COUNT);
+ Common::fill(curRemap->colorChanged, curRemap->colorChanged + NON_REMAPPED_COLOR_COUNT, false);
curRemap->oldPercent = curRemap->percent;
curRemap->oldGray = curRemap->gray;
return changed;
@@ -317,9 +317,9 @@ bool GfxRemap32::applyRemap(byte index) {
Color newColors[NON_REMAPPED_COLOR_COUNT];
bool changed = false;
- memset(unmappedColors, NON_REMAPPED_COLOR_COUNT, false);
+ Common::fill(unmappedColors, unmappedColors + NON_REMAPPED_COLOR_COUNT, false);
if (_noMapCount)
- memset(unmappedColors + _noMapStart, true, _noMapCount);
+ Common::fill(unmappedColors + _noMapStart, unmappedColors + _noMapStart + _noMapCount, true);
for (int i = 0; i < NON_REMAPPED_COLOR_COUNT; i++) {
if (cycleMap[i])
diff --git a/engines/sci/graphics/remap.h b/engines/sci/graphics/remap.h
index 1c2a01c59d..cce48ec533 100644
--- a/engines/sci/graphics/remap.h
+++ b/engines/sci/graphics/remap.h
@@ -96,7 +96,7 @@ struct RemapParams {
memset(distance, 0, 256);
for (int i = 0; i < NON_REMAPPED_COLOR_COUNT; i++)
remap[i] = i;
- memset(colorChanged, true, 256);
+ Common::fill(colorChanged, colorChanged + ARRAYSIZE(colorChanged), true);
}
RemapParams(byte from_, byte to_, byte base_, byte gray_, byte percent_, ColorRemappingType type_) {
@@ -113,7 +113,7 @@ struct RemapParams {
memset(distance, 0, 256);
for (int i = 0; i < NON_REMAPPED_COLOR_COUNT; i++)
remap[i] = i;
- memset(colorChanged, true, 256);
+ Common::fill(colorChanged, colorChanged + ARRAYSIZE(colorChanged), true);
}
};