[Scummvm-cvs-logs] scummvm master -> dd220e7c82b62eb0a79791905700745ddf057760

bluegr bluegr at gmail.com
Fri Mar 11 13:26:38 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
dd220e7c82 SCI32: Use Common::fill() instead of memset(), where possible


Commit: dd220e7c82b62eb0a79791905700745ddf057760
    https://github.com/scummvm/scummvm/commit/dd220e7c82b62eb0a79791905700745ddf057760
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-03-11T14:26:05+02:00

Commit Message:
SCI32: Use Common::fill() instead of memset(), where possible

Thanks wjp, LordHoto, waltervn

Changed paths:
    engines/sci/graphics/remap.cpp
    engines/sci/graphics/remap.h



diff --git a/engines/sci/graphics/remap.cpp b/engines/sci/graphics/remap.cpp
index 833cf2b..999cfc7 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 1c2a01c..cce48ec 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);
 	}
 };
 






More information about the Scummvm-git-logs mailing list