Fix wrong offsets in SDL code

This is fallout from 16 to 32 bit change.
This commit is contained in:
Ilari Liusvaara 2011-10-19 18:24:35 +03:00
parent 5abde22e85
commit 869cee64bc

View file

@ -1288,14 +1288,14 @@ namespace
uint32_t ch = current_screen ? current_screen->height : 0; uint32_t ch = current_screen ? current_screen->height : 0;
//Blank parts not drawn. //Blank parts not drawn.
for(uint32_t i = 6; i < ch + 6; i++) for(uint32_t i = 6; i < ch + 6; i++)
memset(reinterpret_cast<uint8_t*>(swsurf->pixels) + i * swsurf->pitch + 12 + 4 * cw, 0, memset(reinterpret_cast<uint8_t*>(swsurf->pixels) + i * swsurf->pitch + 24 + 4 * cw, 0,
4 * (screensize.first - cw)); 4 * (screensize.first - cw));
for(uint32_t i = ch + 6; i < screensize.second + 6; i++) for(uint32_t i = ch + 6; i < screensize.second + 6; i++)
memset(reinterpret_cast<uint8_t*>(swsurf->pixels) + i * swsurf->pitch + 12, 0, memset(reinterpret_cast<uint8_t*>(swsurf->pixels) + i * swsurf->pitch + 24, 0,
4 * screensize.first); 4 * screensize.first);
if(current_screen) { if(current_screen) {
for(uint32_t i = 0; i < ch; i++) for(uint32_t i = 0; i < ch; i++)
memcpy(reinterpret_cast<uint8_t*>(swsurf->pixels) + (i + 6) * swsurf->pitch + 12, memcpy(reinterpret_cast<uint8_t*>(swsurf->pixels) + (i + 6) * swsurf->pitch + 24,
reinterpret_cast<uint8_t*>(current_screen->memory) + current_screen->pitch * i, reinterpret_cast<uint8_t*>(current_screen->memory) + current_screen->pitch * i,
4 * cw); 4 * cw);
} }