diff options
author | Joseph-Eugene Winzer | 2017-06-23 19:53:05 +0200 |
---|---|---|
committer | Thierry Crozat | 2018-01-22 23:42:07 +0000 |
commit | 6c4768a051b64f14af47c343f589b3bee34aba0a (patch) | |
tree | 199bc173a71dd80e1b795626a92bbd067ed79725 /engines | |
parent | 018cff8c4252aa41989974ef639af955dee516c2 (diff) | |
download | scummvm-rg350-6c4768a051b64f14af47c343f589b3bee34aba0a.tar.gz scummvm-rg350-6c4768a051b64f14af47c343f589b3bee34aba0a.tar.bz2 scummvm-rg350-6c4768a051b64f14af47c343f589b3bee34aba0a.zip |
SUPERNOVA: Reformatting
Substitute size_t with ScummVM defined uint type
Diffstat (limited to 'engines')
-rw-r--r-- | engines/supernova/graphics.cpp | 8 | ||||
-rw-r--r-- | engines/supernova/rooms.cpp | 2 | ||||
-rw-r--r-- | engines/supernova/rooms.h | 6 | ||||
-rw-r--r-- | engines/supernova/supernova.cpp | 30 | ||||
-rw-r--r-- | engines/supernova/supernova.h | 4 |
5 files changed, 25 insertions, 25 deletions
diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp index d59438983d..90d149bbeb 100644 --- a/engines/supernova/graphics.cpp +++ b/engines/supernova/graphics.cpp @@ -56,7 +56,7 @@ bool MSNImageDecoder::init(int filenumber) { bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) { destroy(); - size_t size = 0; + uint size = 0; size = (stream.readUint16LE() + 0xF) >> 4; size |= (stream.readUint16LE() & 0xF) << 12; size += 0x70; // zus_paragraph @@ -81,7 +81,7 @@ bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) { } _numSections = stream.readByte(); - for (size_t i = 0; i < kMaxSections; ++i) { + for (uint i = 0; i < kMaxSections; ++i) { _section[i].addressHigh = 0xff; _section[i].addressLow = 0xffff; _section[i].x2 = 0; @@ -112,7 +112,7 @@ bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) { numZw += numRepeat; byte input = 0; - size_t i = 0; + uint i = 0; while (stream.read(&input, 1)) { if (input < numRepeat) { @@ -168,7 +168,7 @@ bool MSNImageDecoder::loadSection(int section) { const uint32 kInvalidAddress = 0x00FFFFFF; - size_t image = section; + uint image = section; if (image < 128) { do { uint32 offset = (_section[image].addressHigh << 16) + _section[image].addressLow; diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp index ce43e961a0..66013a1db4 100644 --- a/engines/supernova/rooms.cpp +++ b/engines/supernova/rooms.cpp @@ -146,7 +146,7 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) { goto escape; } l = atol(input); - for (size_t i = 0; i < strlen(input); i++) { + for (uint i = 0; i < strlen(input); i++) { if ((input[i] < '0') || (input[i] > '9')) { l = 0; } diff --git a/engines/supernova/rooms.h b/engines/supernova/rooms.h index 611f4c23b3..e78f446987 100644 --- a/engines/supernova/rooms.h +++ b/engines/supernova/rooms.h @@ -49,13 +49,13 @@ public: return _fileNumber; } - void setSectionVisible(size_t section, bool visible) { + void setSectionVisible(uint section, bool visible) { _shown[section] = visible; } - bool isSectionVisible(size_t index) const { + bool isSectionVisible(uint index) const { return _shown[index]; } - Object *getObject(size_t index) { + Object *getObject(uint index) { return &_objectState[index]; } diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index ede216d735..f8fce4cb69 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -216,7 +216,7 @@ void SupernovaEngine::renderImage(MSNImageDecoder &image, int section, bool full _system->copyRectToScreen(image.getSurface()->getPixels(), image._pitch, 0, 0, kScreenWidth, kScreenHeight); } else { - size_t offset = image._section[section].y1 * 320 + image._section[section].x1; + uint offset = image._section[section].y1 * 320 + image._section[section].x1; _system->copyRectToScreen(static_cast<const byte *>(image.getSurface()->getPixels()) + offset, 320, image._section[section].x1, @@ -255,7 +255,7 @@ static int characterWidth(const char *text) { c = 35; } - for (size_t i = 0; i < 5; ++i) { + for (uint i = 0; i < 5; ++i) { ++charWidth; if (font[c - 32][i] == 0xff) { break; @@ -270,7 +270,7 @@ void SupernovaEngine::renderMessage(const char *text, MessagePosition position) Common::String t(text); char *row[20]; Common::String::iterator p = t.begin(); - size_t numRows = 0; + uint numRows = 0; int rowWidthMax = 0; int x = 0; int y = 0; @@ -287,7 +287,7 @@ void SupernovaEngine::renderMessage(const char *text, MessagePosition position) ++p; } } - for (size_t i = 0; i < numRows; ++i) { + for (uint i = 0; i < numRows; ++i) { int rowWidth = characterWidth(row[i]); if (rowWidth > rowWidthMax) rowWidthMax = rowWidth; @@ -329,7 +329,7 @@ void SupernovaEngine::renderMessage(const char *text, MessagePosition position) int message_width = rowWidthMax + 6; int message_height = numRows * 9 + 5; renderBox(message_columns, message_rows, message_width, message_height, HGR_MELD); - for (size_t i = 0; i < numRows; ++i) { + for (uint i = 0; i < numRows; ++i) { renderText(row[i], x, y, textColor); y += 9; } @@ -356,7 +356,7 @@ void SupernovaEngine::renderText(const char *text, int x, int y, byte color) { c = 128; } - for (size_t i = 0; i < 5; ++i) { + for (uint i = 0; i < 5; ++i) { if (font[c - 32][i] == 0xff) { ++cursor; break; @@ -374,8 +374,8 @@ void SupernovaEngine::renderText(const char *text, int x, int y, byte color) { } _system->unlockScreen(); - size_t numChars = cursor - basePtr; - size_t absPosition = y * kScreenWidth + x + numChars; + uint numChars = cursor - basePtr; + uint absPosition = y * kScreenWidth + x + numChars; _textCursorX = absPosition % kScreenWidth; _textCursorY = absPosition / kScreenWidth; _textColor = color; @@ -395,10 +395,10 @@ void SupernovaEngine::paletteBrightness() { byte palette[768]; _system->getPaletteManager()->grabPalette(palette, 0, 255); - for (size_t i = 0; i < 48; ++i) { + for (uint i = 0; i < 48; ++i) { palette[i] = (initVGAPalette[i] * _menuBrightness) >> 8; } - for (size_t i = 0; i < 717; ++i) { + for (uint i = 0; i < 717; ++i) { const byte *imagePalette; if (_currentImage->getPalette()) { imagePalette = _currentImage->getPalette(); @@ -465,7 +465,7 @@ void Inventory::add(Object &obj) { // TODO: Update Inventory surface for scrolling void Inventory::remove(Object &obj) { - for (size_t i = 0; i < _numObjects; ++i) { + for (uint i = 0; i < _numObjects; ++i) { if (_inventory[i] == &obj) { --_numObjects; while (i < _numObjects) { @@ -477,7 +477,7 @@ void Inventory::remove(Object &obj) { } } -Object *Inventory::get(size_t index) const { +Object *Inventory::get(uint index) const { if (index < _numObjects) return _inventory[index]; @@ -485,7 +485,7 @@ Object *Inventory::get(size_t index) const { } Object *Inventory::get(ObjectID id) const { - for (size_t i = 0; i < _numObjects; ++i) { + for (uint i = 0; i < _numObjects; ++i) { if (_inventory[i]->_id == id) return _inventory[i]; } @@ -870,9 +870,9 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) { f = true; } - for (size_t i = 0; i < strlen(t); i++) + for (uint i = 0; i < strlen(t); i++) if ((t[i] < '0') || (t[i] > '9')) f = true; - for (size_t i = 0; i < strlen(min); i++) + for (uint i = 0; i < strlen(min); i++) if ((min[i] < '0') || (min[i] > '9')) f = true; hours = atoi(t); minutes = atoi(min); diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h index 01049a2539..7f181b5be5 100644 --- a/engines/supernova/supernova.h +++ b/engines/supernova/supernova.h @@ -125,12 +125,12 @@ public: void add(Object &obj); void remove(Object &obj); - Object *get(size_t index) const; + Object *get(uint index) const; Object *get(ObjectID id) const; private: Object *_inventory[kMaxCarry]; - size_t _numObjects; + uint _numObjects; }; class GameManager { |