isolate dependencies to SDL

Do not access directly the SDL_Surface Screen_pixels
use new functions Get_Screen_pixel_ptr() Set_Screen_pixel(),
Get_Screen_pixel()
And SetPalette()

Signed-off-by: Thomas Bernard <miniupnp@free.fr>
This commit is contained in:
Thomas Bernard
2018-05-26 23:49:19 +02:00
parent c6975afe94
commit 72fea0290f
21 changed files with 1006 additions and 440 deletions

View File

@@ -3169,7 +3169,8 @@ void Horizontal_grid_line(word x_pos,word y_pos,word width)
int x;
for (x=!(x_pos&1);x<width;x+=2)
Pixel(x_pos+x, y_pos, xor_lut[*((y_pos-1)*Pixel_height*VIDEO_LINE_WIDTH+x_pos*Pixel_width+Screen_pixels+x*Pixel_width)]);
Pixel(x_pos+x, y_pos, xor_lut[Get_Screen_pixel((x_pos+x)*Pixel_width, (y_pos-1)*Pixel_height)]);
//Pixel(x_pos+x, y_pos, xor_lut[*((y_pos-1)*Pixel_height*VIDEO_LINE_WIDTH+x_pos*Pixel_width+Screen_pixels+x*Pixel_width)]);
}
void Vertical_grid_line(word x_pos,word y_pos,word height)
@@ -3177,7 +3178,8 @@ void Vertical_grid_line(word x_pos,word y_pos,word height)
int y;
for (y=!(y_pos&1);y<height;y+=2)
Pixel(x_pos, y_pos+y, xor_lut[*(Screen_pixels+(x_pos*Pixel_width-1)+(y_pos*Pixel_height+y*Pixel_height)*VIDEO_LINE_WIDTH)]);
Pixel(x_pos, y_pos+y, xor_lut[Get_Screen_pixel(x_pos*Pixel_width-1, (y_pos+y)*Pixel_height)]);
//Pixel(x_pos, y_pos+y, xor_lut[*(Screen_pixels+(x_pos*Pixel_width-1)+(y_pos*Pixel_height+y*Pixel_height)*VIDEO_LINE_WIDTH)]);
}
// Tile Grid