diff options
author | Filippos Karapetis | 2016-03-11 14:26:05 +0200 |
---|---|---|
committer | Filippos Karapetis | 2016-03-11 14:26:05 +0200 |
commit | dd220e7c82b62eb0a79791905700745ddf057760 (patch) | |
tree | 0ffd889ed83a262e7de3caf0f69768d4bf169853 | |
parent | 7cf8ce33cb6336f867df9498cc25bf40b3cd18a3 (diff) | |
download | scummvm-rg350-dd220e7c82b62eb0a79791905700745ddf057760.tar.gz scummvm-rg350-dd220e7c82b62eb0a79791905700745ddf057760.tar.bz2 scummvm-rg350-dd220e7c82b62eb0a79791905700745ddf057760.zip |
SCI32: Use Common::fill() instead of memset(), where possible
Thanks wjp, LordHoto, waltervn
-rw-r--r-- | engines/sci/graphics/remap.cpp | 12 | ||||
-rw-r--r-- | engines/sci/graphics/remap.h | 4 |
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); } }; |