Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. let cleanblack surface x y =
  2. let (w,h) = get_dims surface in
  3. Sdlvideo.put_pixel_color surface x y (255,255,255);
  4. let x = ref 0 and y = ref 0 in
  5. while ((y < (h-1)) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
  6. while ((x< (w-1)) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
  7. Sdlvideo.put_pixel_color surface x y (255,255,255);
  8. x := (!x + 1)
  9. done;
  10. x := 0;
  11. y := (!y +1);
  12. done;
  13.  
  14. x := (w-1);
  15. y:= 0;
  16. while ((y < (h-1)) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
  17. while ((x > 0) && (Sdlvideo.get_pixel_color surface x y = (0,0,0)) do
  18. Sdlvideo.put_pixel_color surface x y (255,255,255);
  19. x := (!x - 1)
  20. done;
  21. x := (w -1);
  22. y := (!y -1);
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement