Bugfix to prevent off-screen areas from being restored by restoreBackground

svn-id: r40593
This commit is contained in:
Paul Gilbert 2009-05-15 06:36:44 +00:00
parent bee8be58e3
commit 5e5098bb96

View File

@ -78,7 +78,11 @@ void restoreBackground(backgroundIncrustStruct *pIncrust) {
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
pBackground[(i+Y)* 320 + j + X] = pIncrust->ptr[i * width + j];
int xp = j + X;
int yp = i + Y;
if ((xp >= 0) && (yp >= 0) && (xp < 320) && (yp < 200))
pBackground[yp * 320 + xp] = pIncrust->ptr[i * width + j];
}
}
}