LOL: fixed bug #3099321

(Crash in Yvel tavern basement)

svn-id: r53973
This commit is contained in:
Florian Kagerer 2010-10-31 00:20:30 +00:00
parent 917c4b00cb
commit ec680ef8aa
2 changed files with 9 additions and 0 deletions

View File

@ -187,16 +187,22 @@ uint8 *Screen_v2::getPtrToShape(uint8 *shpFile, int shape) {
}
int Screen_v2::getShapeScaledWidth(const uint8 *shpFile, int scale) {
if (!shpFile)
return 0;
int width = READ_LE_UINT16(shpFile+3);
return (width * scale) >> 8;
}
int Screen_v2::getShapeScaledHeight(const uint8 *shpFile, int scale) {
if (!shpFile)
return 0;
int height = shpFile[2];
return (height * scale) >> 8;
}
uint16 Screen_v2::getShapeSize(const uint8 *shp) {
if (!shp)
return 0;
return READ_LE_UINT16(shp+6);
}

View File

@ -901,6 +901,9 @@ void LoLEngine::calcSpriteRelPosition(uint16 x1, uint16 y1, int &x2, int &y2, ui
}
void LoLEngine::drawDoor(uint8 *shape, uint8 *doorPalette, int index, int unk2, int w, int h, int flags) {
if (!shape)
return;
uint8 c = _dscDoor1[(_currentDirection << 5) + unk2];
int r = (c / 5) + 5 * _dscDimMap[index];
uint16 d = _dscShapeOvlIndex[r];