COMMON: Rename Common::set_to to Common::fill.
This makes the name match with the name of the STL function with the same behavior.
This commit is contained in:
parent
6e90f9e693
commit
61795739f8
30 changed files with 69 additions and 69 deletions
|
@ -287,7 +287,7 @@ void GLESTexture::fillBuffer(uint32 color) {
|
|||
((color & 0xff) == ((color >> 8) & 0xff)))
|
||||
memset(_pixels, color & 0xff, _surface.pitch * _surface.h);
|
||||
else
|
||||
Common::set_to(_pixels, _pixels + _surface.pitch * _surface.h,
|
||||
Common::fill(_pixels, _pixels + _surface.pitch * _surface.h,
|
||||
(uint16)color);
|
||||
|
||||
setDirty();
|
||||
|
|
|
@ -73,25 +73,25 @@ Out copy_if(In first, In last, Out dst, Op op) {
|
|||
return dst;
|
||||
}
|
||||
|
||||
// Our 'specialized' 'set_to' template for char, signed char and unsigned char arrays.
|
||||
// Our 'specialized' 'fill' template for char, signed char and unsigned char arrays.
|
||||
// Since C++ doesn't support partial specialized template functions (currently) we
|
||||
// are going this way...
|
||||
// With this we assure the usage of memset for those, which should be
|
||||
// faster than a simple loop like for the generic 'set_to'.
|
||||
// faster than a simple loop like for the generic 'fill'.
|
||||
template<class Value>
|
||||
signed char *set_to(signed char *first, signed char *last, Value val) {
|
||||
signed char *fill(signed char *first, signed char *last, Value val) {
|
||||
memset(first, (val & 0xFF), last - first);
|
||||
return last;
|
||||
}
|
||||
|
||||
template<class Value>
|
||||
unsigned char *set_to(unsigned char *first, unsigned char *last, Value val) {
|
||||
unsigned char *fill(unsigned char *first, unsigned char *last, Value val) {
|
||||
memset(first, (val & 0xFF), last - first);
|
||||
return last;
|
||||
}
|
||||
|
||||
template<class Value>
|
||||
char *set_to(char *first, char *last, Value val) {
|
||||
char *fill(char *first, char *last, Value val) {
|
||||
memset(first, (val & 0xFF), last - first);
|
||||
return last;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ char *set_to(char *first, char *last, Value val) {
|
|||
* Sets all elements in the range [first, last) to val.
|
||||
*/
|
||||
template<class In, class Value>
|
||||
In set_to(In first, In last, Value val) {
|
||||
In fill(In first, In last, Value val) {
|
||||
while (first != last)
|
||||
*first++ = val;
|
||||
return first;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 (;;) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ namespace Graphics {
|
|||
/**
|
||||
* Fills several pixels in a row with a given color.
|
||||
*
|
||||
* This is a replacement function for Common::set_to, using an unrolled
|
||||
* This is a replacement function for Common::fill, using an unrolled
|
||||
* loop to maximize performance on most architectures.
|
||||
* This function may (and should) be overloaded in any child renderers
|
||||
* for portable platforms with platform-specific assembly code.
|
||||
|
|
|
@ -95,10 +95,10 @@ void Surface::hLine(int x, int y, int x2, uint32 color) {
|
|||
memset(ptr, (byte)color, x2 - x + 1);
|
||||
} else if (format.bytesPerPixel == 2) {
|
||||
uint16 *ptr = (uint16 *)getBasePtr(x, y);
|
||||
Common::set_to(ptr, ptr + (x2 - x + 1), (uint16)color);
|
||||
Common::fill(ptr, ptr + (x2 - x + 1), (uint16)color);
|
||||
} else if (format.bytesPerPixel == 4) {
|
||||
uint32 *ptr = (uint32 *)getBasePtr(x, y);
|
||||
Common::set_to(ptr, ptr + (x2 - x + 1), color);
|
||||
Common::fill(ptr, ptr + (x2 - x + 1), color);
|
||||
} else {
|
||||
error("Surface::hLine: bytesPerPixel must be 1, 2, or 4");
|
||||
}
|
||||
|
@ -172,13 +172,13 @@ void Surface::fillRect(Common::Rect r, uint32 color) {
|
|||
if (format.bytesPerPixel == 2) {
|
||||
uint16 *ptr = (uint16 *)getBasePtr(r.left, r.top);
|
||||
while (height--) {
|
||||
Common::set_to(ptr, ptr + width, (uint16)color);
|
||||
Common::fill(ptr, ptr + width, (uint16)color);
|
||||
ptr += pitch / 2;
|
||||
}
|
||||
} else {
|
||||
uint32 *ptr = (uint32 *)getBasePtr(r.left, r.top);
|
||||
while (height--) {
|
||||
Common::set_to(ptr, ptr + width, color);
|
||||
Common::fill(ptr, ptr + width, color);
|
||||
ptr += pitch / 4;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue