mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 09:49:11 +00:00
Fixes for the backupBackground method when X < 0
svn-id: r40590
This commit is contained in:
parent
bb45be960d
commit
b7af9831da
@ -52,7 +52,11 @@ void backupBackground(backgroundIncrustStruct *pIncrust, int X, int Y, int width
|
||||
pIncrust->ptr = (uint8*)malloc(width * height);
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
pIncrust->ptr[i * width + j] = pBackground[(i+Y) * 320 + j + X];
|
||||
int xp = j + X;
|
||||
int yp = i + Y;
|
||||
|
||||
pIncrust->ptr[i * width + j] = ((xp < 0) || (yp < 0) || (xp >= 320) || (yp >= 200)) ?
|
||||
0 : pBackground[yp * 320 + xp];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ struct backgroundIncrustStruct {
|
||||
uint16 objectIdx;
|
||||
int16 type;
|
||||
uint16 overlayIdx;
|
||||
uint16 X;
|
||||
uint16 Y;
|
||||
int16 X;
|
||||
int16 Y;
|
||||
uint16 field_E;
|
||||
uint16 scale;
|
||||
uint16 backgroundIdx;
|
||||
|
Loading…
Reference in New Issue
Block a user