removed debugging leftovers, fixed one more sprite clipping issue.

svn-id: r8423
This commit is contained in:
Robert Göffringmann 2003-06-09 23:02:56 +00:00
parent d95e9d09dd
commit 797eaee433
2 changed files with 9 additions and 4 deletions

View File

@ -1877,7 +1877,7 @@ bool SkyLogic::fnResetId(uint32 id, uint32 resetBlock, uint32 c) {
Compact *cpt = SkyState::fetchCompact(id);
uint16 *rst = (uint16 *)SkyState::fetchCompact(resetBlock);
SkyCompact::jobsworth;
if (!cpt) {
warning("fnResetId(): Compact %d (id) == NULL\n",id);
return true;

View File

@ -601,11 +601,12 @@ void SkyScreen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) {
} else {
int32 botClip = GAME_SCREEN_HEIGHT - FROM_LE_16(sprDataFile->s_height) - spriteY;
if (botClip < 0) {
if (botClip + _sprHeight <= 0) {
botClip = -botClip;
if (_sprHeight <= botClip) {
_sprWidth = 0;
return ;
}
_sprHeight += botClip;
_sprHeight -= botClip;
}
}
_sprY = (uint32)spriteY;
@ -633,13 +634,17 @@ void SkyScreen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) {
}
_sprX = (uint32)spriteX;
uint8 *screenPtr = _backScreen + _sprY * GAME_SCREEN_WIDTH + _sprX;
if ((_sprHeight > 192) || (_sprY > 192)) {
_sprWidth = 0;
return;
}
if ((_sprX + _sprWidth > 320) || (_sprY + _sprHeight > 192)) {
warning("SkyScreen::drawSprite fatal error: got x = %d, y = %d, w = %d, h = %d\n",_sprX, _sprY, _sprWidth, _sprHeight);
_sprWidth = 0;
return ;
}
for (uint8 cnty = 0; cnty < _sprHeight; cnty++) {
for (uint16 cnty = 0; cnty < _sprHeight; cnty++) {
for (uint16 cntx = 0; cntx < _sprWidth; cntx++)
if (spriteData[cntx + _maskX1]) screenPtr[cntx] = spriteData[cntx + _maskX1];
spriteData += _sprWidth + _maskX2 + _maskX1;