Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let cleanblack surface x y =
- let (w,h) = get_dims surface in
- Sdlvideo.put_pixel_color surface x y (255,255,255);
- let x = ref 0 and y = ref 0 in
- while ((y < (h-1)) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
- while ((x< (w-1)) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
- Sdlvideo.put_pixel_color surface x y (255,255,255);
- x := (!x + 1)
- done;
- x := 0;
- y := (!y +1);
- done;
- x := (w-1);
- y:= 0;
- while ((y < (h-1)) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
- while ((x > 0) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
- Sdlvideo.put_pixel_color surface x y (255,255,255);
- x := (!x - 1)
- done;
- x := (w -1);
- y := (!y -1);
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement