var l,r,t,b;
l = floor((view_xview[0]+0.01)/256)
r = ceil((view_xview[0]-0.01)/256)
t = floor((view_yview[0]+0.01)/256)
b = ceil((view_yview[0]-0.01)/256)
if surface_exists(ds_grid_get(grid,l,t)) {
draw_surface(ds_grid_get(grid,l,t),l*256,t*256)
} else {
draw_sprite_ext(s_warningchunk,0,l*256,t*256,2,2,0,c_white,0.5)
}
if surface_exists(ds_grid_get(grid,r,t)) {
draw_surface(ds_grid_get(grid,r,t),r*256,t*256)
} else {
draw_sprite_ext(s_warningchunk,0,r*256,t*256,2,2,0,c_white,0.5)
}
if surface_exists(ds_grid_get(grid,l,b)) {
draw_surface(ds_grid_get(grid,l,b),l*256,b*256)
} else {
draw_sprite_ext(s_warningchunk,0,l*256,b*256,2,2,0,c_white,0.5)
}
if surface_exists(ds_grid_get(grid,r,b)) {
draw_surface(ds_grid_get(grid,r,b),r*256,b*256)
} else {
draw_sprite_ext(s_warningchunk,0,r*256,b*256,2,2,0,c_white,0.5)
}Okay, I have a grid built up of surfaces, which correlate together, making a map.
When you scroll around the map, I only want to draw the visible surfaces, instead of rendering the whole grid of surfaces.
My code causes the map to flicker when the scroller is looking directly at the boundary between surfaces.
Please, can anyone help fix this?
Thanks, Ruirize.
EDIT: The surface checking is there for older computers, where the surfaces aren't always created. I will fix this eventually, but tbh, I cba right now.
Edited by ApplePiePod, 14 August 2010 - 10:45 PM.











