diff options
author | Martin Kiewitz | 2010-05-13 15:39:20 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-05-13 15:39:20 +0000 |
commit | 86cd5b71fc667cf7b85094500e1c6a8134d787d3 (patch) | |
tree | 2a83ddbc46566453a62a31015397740f33aecd29 /engines/sci/graphics | |
parent | 983c41bea236f4d22277895ce29fb753407698a0 (diff) | |
download | scummvm-rg350-86cd5b71fc667cf7b85094500e1c6a8134d787d3.tar.gz scummvm-rg350-86cd5b71fc667cf7b85094500e1c6a8134d787d3.tar.bz2 scummvm-rg350-86cd5b71fc667cf7b85094500e1c6a8134d787d3.zip |
SCI: adding some more assert()s in view data loading for clone :D
svn-id: r49023
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/view.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 990c6e298d..5142454483 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -171,6 +171,7 @@ void GfxView::initData(GuiResourceId resourceId) { headerSize = READ_LE_UINT16(_resourceData + 0) + 2; // headerSize is not part of the header, so its added assert(headerSize >= 16); _loopCount = _resourceData[2]; + assert(_loopCount); palOffset = READ_LE_UINT32(_resourceData + 8); // FIXME: After LoopCount there is another byte and its set for view 50 within Laura Bow 2 CD, check what it means @@ -178,6 +179,7 @@ void GfxView::initData(GuiResourceId resourceId) { loopSize = _resourceData[12]; assert(loopSize >= 16); celSize = _resourceData[13]; + assert(celSize >= 32); if (palOffset) { _palette->createFromData(&_resourceData[palOffset], &_viewPalette); @@ -199,6 +201,7 @@ void GfxView::initData(GuiResourceId resourceId) { } celCount = loopData[2]; + assert(celCount); _loop[loopNo].celCount = celCount; celData = _resourceData + READ_LE_UINT32(loopData + 12); @@ -208,7 +211,9 @@ void GfxView::initData(GuiResourceId resourceId) { for (celNo = 0; celNo < celCount; celNo++) { cel = &_loop[loopNo].cel[celNo]; cel->width = READ_LE_UINT16(celData); + assert(cel->width); cel->height = READ_LE_UINT16(celData + 2); + assert(cel->height); cel->displaceX = READ_LE_UINT16(celData + 4); cel->displaceY = READ_LE_UINT16(celData + 6); cel->clearKey = celData[8]; |