From 61795739f8f45c5de4cfd0fe57af459146c5173c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 16 Nov 2011 18:06:30 +0100 Subject: COMMON: Rename Common::set_to to Common::fill. This makes the name match with the name of the STL function with the same behavior. --- engines/cge/events.cpp | 2 +- engines/cine/cine.cpp | 4 ++-- engines/cine/main_loop.cpp | 2 +- engines/cruise/gfxModule.cpp | 2 +- engines/kyra/kyra_hof.cpp | 4 ++-- engines/kyra/lol.cpp | 2 +- engines/kyra/scene_mr.cpp | 4 ++-- engines/kyra/script_mr.cpp | 2 +- engines/lure/res.cpp | 2 +- engines/lure/room.cpp | 2 +- engines/lure/sound.cpp | 10 +++++----- engines/m4/assets.cpp | 2 +- engines/m4/dialogs.cpp | 2 +- engines/m4/graphics.cpp | 16 ++++++++-------- engines/m4/mads_anim.cpp | 4 ++-- engines/m4/mads_logic.cpp | 4 ++-- engines/m4/mads_scene.cpp | 2 +- engines/sword25/gfx/image/renderedimage.cpp | 4 ++-- engines/tinsel/graphics.cpp | 6 +++--- engines/tsage/converse.cpp | 6 +++--- engines/tsage/globals.cpp | 4 ++-- engines/tsage/graphics.cpp | 10 +++++----- engines/tsage/graphics.h | 2 +- engines/tsage/resources.cpp | 4 ++-- engines/tsage/scenes.cpp | 4 ++-- engines/tsage/sound.cpp | 8 ++++---- 26 files changed, 57 insertions(+), 57 deletions(-) (limited to 'engines') diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp index e277d79ee1..73bef63129 100644 --- a/engines/cge/events.cpp +++ b/engines/cge/events.cpp @@ -86,7 +86,7 @@ const uint16 Keyboard::_scummVmCodes[0x60] = { }; Keyboard::Keyboard(CGEEngine *vm) : _client(NULL), _vm(vm) { - Common::set_to(&_key[0], &_key[0x60], false); + Common::fill(&_key[0], &_key[0x60], false); _current = 0; } diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 6f34b0f860..6b94c33c31 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -141,11 +141,11 @@ void CineEngine::initialize() { // Resize zone data table to its correct size and reset all its elements g_cine->_zoneData.resize(NUM_MAX_ZONE); - Common::set_to(g_cine->_zoneData.begin(), g_cine->_zoneData.end(), 0); + Common::fill(g_cine->_zoneData.begin(), g_cine->_zoneData.end(), 0); // Resize zone query table to its correct size and reset all its elements g_cine->_zoneQuery.resize(NUM_MAX_ZONE); - Common::set_to(g_cine->_zoneQuery.begin(), g_cine->_zoneQuery.end(), 0); + Common::fill(g_cine->_zoneQuery.begin(), g_cine->_zoneQuery.end(), 0); _timerDelayMultiplier = 12; // Set default speed setupOpcodes(); diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index bb0545db72..971830ce8f 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -345,7 +345,7 @@ void CineEngine::mainLoop(int bootScriptIdx) { // Clear the zoneQuery table (Operation Stealth specific) if (g_cine->getGameType() == Cine::GType_OS) { - Common::set_to(g_cine->_zoneQuery.begin(), g_cine->_zoneQuery.end(), 0); + Common::fill(g_cine->_zoneQuery.begin(), g_cine->_zoneQuery.end(), 0); } if (g_cine->getGameType() == Cine::GType_OS) { diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 7bbcae2259..aa2dbc5370 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -326,7 +326,7 @@ void flip() { void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color) { for (int y = y1; y < y2; ++y) { byte *p = &gfxModuleData.pPage00[y * 320 + x1]; - Common::set_to(p, p + (x2 - x1), color); + Common::fill(p, p + (x2 - x1), color); } } diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 8a3229ea1f..e91f3ba6fc 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -1083,7 +1083,7 @@ void KyraEngine_HoF::loadNPCScript() { #pragma mark - void KyraEngine_HoF::resetScaleTable() { - Common::set_to(_scaleTable, ARRAYEND(_scaleTable), 0x100); + Common::fill(_scaleTable, ARRAYEND(_scaleTable), 0x100); } void KyraEngine_HoF::setScaleTableItem(int item, int data) { @@ -1673,7 +1673,7 @@ void KyraEngine_HoF::setCauldronState(uint8 state, bool paletteFade) { } void KyraEngine_HoF::clearCauldronTable() { - Common::set_to(_cauldronTable, ARRAYEND(_cauldronTable), -1); + Common::fill(_cauldronTable, ARRAYEND(_cauldronTable), -1); } void KyraEngine_HoF::addFrontCauldronTable(int item) { diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 182b734e11..43859ddfbb 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -896,7 +896,7 @@ void LoLEngine::startupNew() { _availableSpells[0] = 0; setupScreenDims(); - Common::set_to(_globalScriptVars2, ARRAYEND(_globalScriptVars2), 0x100); + Common::fill(_globalScriptVars2, ARRAYEND(_globalScriptVars2), 0x100); static const int selectIds[] = { -9, -1, -8, -5 }; assert(_charSelection >= 0); diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index 74d2e89e6e..d6df523f82 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -83,7 +83,7 @@ void KyraEngine_MR::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2 } _specialExitCount = 0; - Common::set_to(_specialExitTable, ARRAYEND(_specialExitTable), 0xFFFF); + Common::fill(_specialExitTable, ARRAYEND(_specialExitTable), 0xFFFF); _mainCharacter.sceneId = sceneId; _sceneList[sceneId].flags &= ~1; @@ -388,7 +388,7 @@ void KyraEngine_MR::initSceneScript(int unk1) { strcat(filename, ".CPS"); _screen->loadBitmap(filename, 3, 3, 0); - Common::set_to(_specialSceneScriptState, ARRAYEND(_specialSceneScriptState), false); + Common::fill(_specialSceneScriptState, ARRAYEND(_specialSceneScriptState), false); _sceneEnterX1 = 160; _sceneEnterY1 = 0; _sceneEnterX2 = 296; diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index 8ab094ac0c..afe11aba02 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -405,7 +405,7 @@ int KyraEngine_MR::o3_updateConversations(EMCState *script) { } int convs[4]; - Common::set_to(convs, convs+4, -1); + Common::fill(convs, convs+4, -1); if (_currentChapter == 1) { switch (_mainCharacter.dlgIndex) { diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index fbf9f33b87..6328301233 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -408,7 +408,7 @@ byte *Resources::getCursor(uint8 cursorNum) { if (!LureEngine::getReference().isEGA()) return _cursors->data() + (cursorNum * CURSOR_SIZE); - Common::set_to(&_cursor[0], &_cursor[0] + CURSOR_SIZE, 0); + Common::fill(&_cursor[0], &_cursor[0] + CURSOR_SIZE, 0); byte *pSrc = _cursors->data() + (cursorNum * 64); byte *pDest = &_cursor[0]; diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 2cb871d73f..219ed0263d 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -43,7 +43,7 @@ RoomLayer::RoomLayer(uint16 screenId, bool backgroundLayer): int cellIndex = 0; // Reset all the cells to unused - Common::set_to((uint8 *) _cells, (uint8 *) _cells + GRID_SIZE, 0xff); + Common::fill((uint8 *) _cells, (uint8 *) _cells + GRID_SIZE, 0xff); // Load up the screen data MemoryBlock *rawData = disk.getEntry(screenId); diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index 85b86a8400..0aecae22ec 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -53,7 +53,7 @@ SoundManager::SoundManager() { _isRoland = MidiDriver::getMusicType(dev) != MT_ADLIB; _nativeMT32 = ((MidiDriver::getMusicType(dev) == MT_MT32) || ConfMan.getBool("native_mt32")); - Common::set_to(_channelsInUse, _channelsInUse + NUM_CHANNELS, false); + Common::fill(_channelsInUse, _channelsInUse + NUM_CHANNELS, false); _driver = MidiDriver::createMidi(dev); int statusCode = _driver->open(); @@ -182,7 +182,7 @@ void SoundManager::killSounds() { // Clear the active sounds _activeSounds.clear(); - Common::set_to(_channelsInUse, _channelsInUse + NUM_CHANNELS, false); + Common::fill(_channelsInUse, _channelsInUse + NUM_CHANNELS, false); } void SoundManager::addSound(uint8 soundIndex, bool tidyFlag) { @@ -221,7 +221,7 @@ void SoundManager::addSound(uint8 soundIndex, bool tidyFlag) { } // Mark the found channels as in use - Common::set_to(_channelsInUse+channelCtr, _channelsInUse+channelCtr + numChannels, true); + Common::fill(_channelsInUse+channelCtr, _channelsInUse+channelCtr + numChannels, true); SoundDescResource *newEntry = new SoundDescResource(); newEntry->soundNumber = rec.soundNumber; @@ -342,7 +342,7 @@ void SoundManager::tidySounds() { ++i; else { // Mark the channels that it used as now being free - Common::set_to(_channelsInUse+rec->channel, _channelsInUse+rec->channel+rec->numChannels, false); + Common::fill(_channelsInUse+rec->channel, _channelsInUse+rec->channel+rec->numChannels, false); i = _activeSounds.erase(i); } @@ -373,7 +373,7 @@ void SoundManager::restoreSounds() { SoundDescResource *rec = (*i).get(); if ((rec->numChannels != 0) && ((rec->flags & SF_RESTORE) != 0)) { - Common::set_to(_channelsInUse+rec->channel, _channelsInUse+rec->channel+rec->numChannels, true); + Common::fill(_channelsInUse+rec->channel, _channelsInUse+rec->channel+rec->numChannels, true); musicInterface_Play(rec->soundNumber, rec->channel, rec->numChannels); musicInterface_SetVolume(rec->channel, rec->volume); diff --git a/engines/m4/assets.cpp b/engines/m4/assets.cpp index f70a35d5ad..e871218ec1 100644 --- a/engines/m4/assets.cpp +++ b/engines/m4/assets.cpp @@ -233,7 +233,7 @@ void SpriteAsset::loadMadsSpriteAsset(MadsM4Engine *vm, Common::SeekableReadStre RGB8 *palData = Palette::decodeMadsPalette(spriteStream, &numColors); Common::copy(palData, &palData[numColors], &_palette[0]); if (numColors < 256) - Common::set_to((byte *)&_palette[numColors], (byte *)&_palette[256], 0); + Common::fill((byte *)&_palette[numColors], (byte *)&_palette[256], 0); _colorCount = numColors; delete[] palData; delete spriteStream; diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index e9c7414845..2a36fa037c 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -80,7 +80,7 @@ void Dialog::writeChars(const char *srcLine) { while (*srcP) { bool wordEndedP = false, newlineP = false; char *destP = &wordStr[0]; - Common::set_to(&wordStr[0], &wordStr[80], 0); + Common::fill(&wordStr[0], &wordStr[80], 0); // Try and get the next word for (;;) { diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index 4c272de32c..99130aee08 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -48,7 +48,7 @@ RGBList::RGBList(int numEntries, RGB8 *srcData, bool freeData) { } _palIndexes = new byte[numEntries]; - Common::set_to(&_palIndexes[0], &_palIndexes[numEntries], 0); + Common::fill(&_palIndexes[0], &_palIndexes[numEntries], 0); } RGBList::~RGBList() { @@ -337,7 +337,7 @@ void M4Surface::freeData() { } void M4Surface::clear() { - Common::set_to((byte *)pixels, (byte *)pixels + w * h, _vm->_palette->BLACK); + Common::fill((byte *)pixels, (byte *)pixels + w * h, _vm->_palette->BLACK); } void M4Surface::reset() { @@ -1029,7 +1029,7 @@ static void fadeRange(MadsM4Engine *vm, RGB8 *srcPal, RGB8 *destPal, int startI Palette::Palette(MadsM4Engine *vm) : _vm(vm) { reset(); _fading_in_progress = false; - Common::set_to(&_usageCount[0], &_usageCount[256], 0); + Common::fill(&_usageCount[0], &_usageCount[256], 0); } void Palette::setPalette(const byte *colors, uint start, uint num) { @@ -1166,7 +1166,7 @@ void Palette::fadeFromGreen(int numSteps, uint delayAmount, bool fadeToBlack) { RGB8 *destPalette = (RGB8 *) &_originalPalette[0]; if (fadeToBlack) { - Common::set_to((byte *)&blackPalette[0], (byte *)&blackPalette[256], 0); + Common::fill((byte *)&blackPalette[0], (byte *)&blackPalette[256], 0); destPalette = &blackPalette[0]; } @@ -1193,7 +1193,7 @@ void Palette::fadeIn(int numSteps, uint delayAmount, RGB8 *destPalette, int numC _fading_in_progress = true; RGB8 blackPalette[256]; - Common::set_to((byte *)&blackPalette[0], (byte *)&blackPalette[256], 0); + Common::fill((byte *)&blackPalette[0], (byte *)&blackPalette[256], 0); // Initially set the black palette _vm->_palette->setPalette(blackPalette, 0, numColors); @@ -1209,7 +1209,7 @@ RGB8 *Palette::decodeMadsPalette(Common::SeekableReadStream *palStream, int *num assert(*numColors <= 252); RGB8 *palData = new RGB8[*numColors]; - Common::set_to((byte *)&palData[0], (byte *)&palData[*numColors], 0); + Common::fill((byte *)&palData[0], (byte *)&palData[*numColors], 0); for (int i = 0; i < *numColors; ++i) { byte r = palStream->readByte(); @@ -1249,12 +1249,12 @@ void Palette::setMadsSystemPalette() { } void Palette::resetColorCounts() { - Common::set_to(&_usageCount[0], &_usageCount[256], 0); + Common::fill(&_usageCount[0], &_usageCount[256], 0); } void Palette::blockRange(int startIndex, int size) { // Use a reference count of -1 to signal a palette index shouldn't be used - Common::set_to(&_usageCount[startIndex], &_usageCount[startIndex + size], -1); + Common::fill(&_usageCount[startIndex], &_usageCount[startIndex + size], -1); } void Palette::addRange(RGBList *list) { diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp index 2ea576dfa4..aac21ae65d 100644 --- a/engines/m4/mads_anim.cpp +++ b/engines/m4/mads_anim.cpp @@ -87,7 +87,7 @@ void TextviewView::reset() { _panY = 0; _panSpeed = 0; _soundDriverLoaded = false; - Common::set_to(&_spareScreens[0], &_spareScreens[10], 0); + Common::fill(&_spareScreens[0], &_spareScreens[10], 0); _scrollCount = 0; _lineY = -1; _scrollTimeout = 0; @@ -211,7 +211,7 @@ void TextviewView::updateState() { byte *pixelsP = _textSurface.getBasePtr(0, 0); Common::copy(pixelsP + width(), pixelsP + _textSurface.width() * _textSurface.height(), pixelsP); pixelsP = _textSurface.getBasePtr(0, _textSurface.height() - 1); - Common::set_to(pixelsP, pixelsP + _textSurface.width(), _vm->_palette->BLACK); + Common::fill(pixelsP, pixelsP + _textSurface.width(), _vm->_palette->BLACK); if (_scrollCount > 0) { // Handling final scrolling of text off of screen diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index cafddb2d53..a7838d0e26 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -33,7 +33,7 @@ namespace M4 { void MadsGameLogic::initializeGlobals() { // Clear the entire globals list - Common::set_to(&_madsVm->globals()->_globals[0], &_madsVm->globals()->_globals[TOTAL_NUM_VARIABLES], 0); + Common::fill(&_madsVm->globals()->_globals[0], &_madsVm->globals()->_globals[TOTAL_NUM_VARIABLES], 0); SET_GLOBAL(4, 8); SET_GLOBAL(33, 1); @@ -479,7 +479,7 @@ void MadsSceneLogic::selectScene(int sceneNum) { assert(sceneNum == 101); _sceneNumber = sceneNum; - Common::set_to(&_spriteIndexes[0], &_spriteIndexes[50], 0); + Common::fill(&_spriteIndexes[0], &_spriteIndexes[50], 0); // If debugging is turned on, show a debug warning if any of the scene methods aren't present if (gDebugLevel > 0) { diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index 73d9f57124..e2d034f6d1 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -729,7 +729,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su } } else { // 8-bit depth pixels - Common::set_to(destP, destP + runLength, *srcP++); + Common::fill(destP, destP + runLength, *srcP++); destP += runLength; } } diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index 3b29b0333f..b0d4853e5e 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -152,7 +152,7 @@ RenderedImage::RenderedImage(uint width, uint height, bool &result) : _height(height) { _data = new byte[width * height * 4]; - Common::set_to(_data, &_data[width * height * 4], 0); + Common::fill(_data, &_data[width * height * 4], 0); _backSurface = Kernel::getInstance()->getGfx()->getSurface(); @@ -507,7 +507,7 @@ int *RenderedImage::scaleLine(int size, int srcSize) { int scale = 100 * size / srcSize; assert(scale > 0); int *v = new int[size]; - Common::set_to(v, &v[size], 0); + Common::fill(v, &v[size], 0); int distCtr = 0; int *destP = v; diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 6a5d626de8..545310185c 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -478,9 +478,9 @@ static void t2WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply // Non-transparent run length color += pObj->constant; if (horizFlipped) - Common::set_to(tempP - runLength + 1, tempP + 1, color); + Common::fill(tempP - runLength + 1, tempP + 1, color); else - Common::set_to(tempP, tempP + runLength, color); + Common::fill(tempP, tempP + runLength, color); } } @@ -533,7 +533,7 @@ static void WrtConst(DRAWOBJECT *pObj, uint8 *destP, bool applyClipping) { // Loop through any remaining lines while (pObj->height > 0) { - Common::set_to(destP, destP + pObj->width, pObj->constant); + Common::fill(destP, destP + pObj->width, pObj->constant); --pObj->height; destP += SCREEN_WIDTH; diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index d86548bd4b..31a689b80c 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -32,7 +32,7 @@ namespace TsAGE { SequenceManager::SequenceManager() : Action() { - Common::set_to(&_objectList[0], &_objectList[6], (SceneObject *)NULL); + Common::fill(&_objectList[0], &_objectList[6], (SceneObject *)NULL); _sequenceData.clear(); _fontNum = 0; _sequenceOffset = 0; @@ -81,7 +81,7 @@ void SequenceManager::remove() { if (g_globals->_sceneObjects->contains(&_sceneText)) _sceneText.remove(); - Common::set_to(&_objectList[0], &_objectList[6], (SceneObject *)NULL); + Common::fill(&_objectList[0], &_objectList[6], (SceneObject *)NULL); Action::remove(); } @@ -342,7 +342,7 @@ void SequenceManager::attached(EventHandler *newOwner, EventHandler *endHandler, DEALLOCATE(seqData); - Common::set_to(&_objectList[0], &_objectList[6], (SceneObject *)NULL); + Common::fill(&_objectList[0], &_objectList[6], (SceneObject *)NULL); for (int idx = 0; idx < 6; ++idx) { _objectList[idx] = va_arg(va, SceneObject *); if (!_objectList[idx]) diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index d21321a201..540c3b6225 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -155,7 +155,7 @@ Globals::~Globals() { } void Globals::reset() { - Common::set_to(&_flags[0], &_flags[MAX_FLAGS], false); + Common::fill(&_flags[0], &_flags[MAX_FLAGS], false); g_saver->addFactory(classFactoryProc); } @@ -379,7 +379,7 @@ void Ringworld2Globals::reset() { _v565F5 = 0; _v57C2C = 0; _v58CE2 = 0; - Common::set_to(&_v565F1[0], &_v565F1[MAX_CHARACTERS], 0); + Common::fill(&_v565F1[0], &_v565F1[MAX_CHARACTERS], 0); _insetUp = 0; // Reset fields stored in the player class diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 40654a345e..f0a5973e6b 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -81,7 +81,7 @@ GfxSurface surfaceFromRes(const byte *imgData) { if (!rleEncoded) { Common::copy(srcP, srcP + (r.width() * r.height()), destP); } else { - Common::set_to(destP, destP + (r.width() * r.height()), s._transColor); + Common::fill(destP, destP + (r.width() * r.height()), s._transColor); for (int yp = 0; yp < r.height(); ++yp) { int width = r.width(); @@ -105,7 +105,7 @@ GfxSurface surfaceFromRes(const byte *imgData) { controlVal &= 0x3f; int pixel = *srcP++; - Common::set_to(destP, destP + controlVal, pixel); + Common::fill(destP, destP + controlVal, pixel); destP += controlVal; width -= controlVal; } @@ -261,7 +261,7 @@ void GfxSurface::create(int width, int height) { } _customSurface = new Graphics::Surface(); _customSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); - Common::set_to((byte *)_customSurface->pixels, (byte *)_customSurface->pixels + (width * height), 0); + Common::fill((byte *)_customSurface->pixels, (byte *)_customSurface->pixels + (width * height), 0); _bounds = Rect(0, 0, width, height); } @@ -455,7 +455,7 @@ static int *scaleLine(int size, int srcSize) { int scale = PRECISION_FACTOR * size / srcSize; assert(scale >= 0); int *v = new int[size]; - Common::set_to(v, &v[size], -1); + Common::fill(v, &v[size], -1); int distCtr = PRECISION_FACTOR / 2; int *destP = v; @@ -493,7 +493,7 @@ static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize, int trans byte *destP = (byte *)destImage.getBasePtr(0, yp); if (vertUsage[yp] == -1) { - Common::set_to(destP, destP + xSize, transIndex); + Common::fill(destP, destP + xSize, transIndex); } else { const byte *srcP = (const byte *)srcImage.getBasePtr(0, vertUsage[yp]); diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index 06b482d7b5..dba3401700 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -292,7 +292,7 @@ public: Common::copy(src, src + size, dest); } virtual void set(byte *dest, int size, byte val) { - Common::set_to(dest, dest + size, val); + Common::fill(dest, dest + size, val); } void copyFrom(GfxSurface &src, Rect destBounds, Region *priorityRegion = NULL) { _surface.setBounds(_bounds); diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index b8c8fcdeea..824f20e9b2 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -33,7 +33,7 @@ namespace TsAGE { MemoryManager::MemoryManager() { _memoryPool = new MemoryHeader*[MEMORY_POOL_SIZE]; - Common::set_to(&_memoryPool[0], &_memoryPool[MEMORY_POOL_SIZE], (MemoryHeader *)NULL); + Common::fill(&_memoryPool[0], &_memoryPool[MEMORY_POOL_SIZE], (MemoryHeader *)NULL); } MemoryManager::~MemoryManager() { @@ -67,7 +67,7 @@ uint16 MemoryManager::allocate(uint32 size) { byte *MemoryManager::allocate2(uint32 size) { uint32 idx = allocate(size); byte *result = lock(idx); - Common::set_to(result, result + size, 0); + Common::fill(result, result + size, 0); return result; } diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 5ed7c06800..6362c63bc3 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -259,7 +259,7 @@ Scene::Scene() : _sceneBounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), _sceneMode = 0; _activeScreenNumber = 0; _oldSceneBounds = Rect(4000, 4000, 4100, 4100); - Common::set_to(&_zoomPercents[0], &_zoomPercents[256], 0); + Common::fill(&_zoomPercents[0], &_zoomPercents[256], 0); } Scene::~Scene() { @@ -363,7 +363,7 @@ void Scene::loadSceneData(int sceneNum) { _priorities.load(sceneNum); // Initialize the section enabled list - Common::set_to(&_enabledSections[0], &_enabledSections[16 * 16], 0xffff); + Common::fill(&_enabledSections[0], &_enabledSections[16 * 16], 0xffff); g_globals->_sceneOffset.x = (_sceneBounds.left / 160) * 160; g_globals->_sceneOffset.y = (_sceneBounds.top / 100) * 100; diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index fb88a5ff5e..9df5a6666b 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -798,7 +798,7 @@ void SoundManager::_sfRethinkVoiceTypes() { continue; _sfUpdateVoiceStructs(); - Common::set_to(sound->_chWork, sound->_chWork + SOUND_ARR_SIZE, false); + Common::fill(sound->_chWork, sound->_chWork + SOUND_ARR_SIZE, false); for (;;) { // Scan for sub priority @@ -1485,7 +1485,7 @@ Sound::Sound() { memset(_chNumVoices, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_chSubPriority, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_chFlags, 0, SOUND_ARR_SIZE * sizeof(int)); - Common::set_to(_chWork, _chWork + SOUND_ARR_SIZE, false); + Common::fill(_chWork, _chWork + SOUND_ARR_SIZE, false); memset(_channelData, 0, SOUND_ARR_SIZE * sizeof(byte *)); memset(_trkChannel, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_trkState, 0, SOUND_ARR_SIZE * sizeof(int)); @@ -2557,7 +2557,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); - Common::set_to(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false); + Common::fill(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false); memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); memset(_v4405E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); memset(_v44067, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); @@ -2565,7 +2565,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { memset(_v44079, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); memset(_v44082, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); _v44082[ADLIB_CHANNEL_COUNT] = 0x90; - Common::set_to(_pitchBlend, _pitchBlend + ADLIB_CHANNEL_COUNT, 0x2000); + Common::fill(_pitchBlend, _pitchBlend + ADLIB_CHANNEL_COUNT, 0x2000); memset(_v4409E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); _patchData = NULL; } -- cgit v1.2.3