Buffer_To_Page now writes to the correct area.

This commit is contained in:
Justin Marshall
2020-06-16 16:29:29 -07:00
parent 9183814eb8
commit 032b6e112f
+2 -2
View File
@@ -3434,8 +3434,8 @@ extern "C" long __cdecl Buffer_To_Page(int x, int y, int w, int h, void *buffer,
yend = min(yend, vp.Get_Height() - 1);
int pitch = vp.Get_Pitch() + vp.Get_Width() + vp.Get_XAdd();
uint8_t* dst = y * pitch + x + (uint8_t*)(vp.Get_Offset());
uint8_t* src = (xoffset * 4) + w * (yoffset * 4) + static_cast<uint8_t*>(buffer);
uint8_t* dst = (y * 4) * pitch + (x * 4) + (uint8_t*)(vp.Get_Offset());
uint8_t* src = xoffset + w * yoffset + static_cast<uint8_t*>(buffer);
// int dst_pitch = x_pos + pitch - xend;
// int src_pitch = x_pos + width - xend;
int lines = yend - ystart + 1;