SCI: View::getCelCount now validates input

svn-id: r47267
This commit is contained in:
Martin Kiewitz 2010-01-12 18:24:37 +00:00
parent e4aed638b0
commit 52eb58a3e5
2 changed files with 7 additions and 1 deletions

View File

@ -507,6 +507,12 @@ void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectT
}
}
uint16 View::getCelCount(int16 loopNo) {
if ((loopNo < 0) || (loopNo >= _loopCount))
return 0;
return _loop[loopNo].celCount;
}
Palette *View::getPalette() {
return _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
}

View File

@ -62,7 +62,7 @@ public:
byte *getBitmap(int16 loopNo, int16 celNo);
void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires, uint16 scaleX = 128, uint16 scaleY = 128);
uint16 getLoopCount() const { return _loopCount; }
uint16 getCelCount(int16 loopNo) { return _loop[loopNo].celCount; }
uint16 getCelCount(int16 loopNo);
Palette *getPalette();
private: