HOPKINS: Fix Sprite_Vesa() height clipping

This fixes some Valgrind warnings on the city overhead map, and also
seem to get rid of the bird "droppings" previously left behind in the
area beneath the picture. There are things I don't understand about
this function, but I hope I didn't break anything.
This commit is contained in:
Torbjörn Andersson
2013-02-02 12:41:44 +01:00
parent 9772426c58
commit ea4639c65f
+2 -1
View File
@@ -952,6 +952,7 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp,
}
// Clip Y
clip_y1 = height;
if (yp <= 0)
return;
if (yp < _minY + 300) {
@@ -999,7 +1000,7 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp,
// Handling for clipped versus non-clipped
if (_clipFl) {
// Clipped version
for (int yc = 0; yc < height; ++yc, destP += _lineNbr2) {
for (int yc = 0; yc < clip_y1; ++yc, destP += _lineNbr2) {
byte *tempDestP = destP;
byte byteVal;
int xc = 0;