context.hh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /********************************************************************** <BR>
  2. This file is part of Crack dot Com's free source code release of
  3. Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
  4. information about compiling & licensing issues visit this URL</a>
  5. <PRE> If that doesn't help, contact Jonathan Clark at
  6. golgotha_source@usa.net (Subject should have "GOLG" in it)
  7. ***********************************************************************/
  8. #ifndef CONTEXT_HH
  9. #define CONTEXT_HH
  10. #include "area/rectlist.hh"
  11. class i4_draw_context_class
  12. {
  13. public :
  14. i4_rect_list_class clip;
  15. i4_rect_list_class *single_dirty; // all areas that only need updating for the next frame
  16. i4_rect_list_class *both_dirty; // all areas that need updating on all future frames
  17. sw16 xoff,yoff;
  18. i4_draw_context_class(sw16 x1, sw16 y1, sw16 x2, sw16 y2)
  19. {
  20. clip.add_area(x1,y1,x2,y2);
  21. single_dirty=0;
  22. both_dirty=0;
  23. xoff=0;
  24. yoff=0;
  25. }
  26. ~i4_draw_context_class()
  27. {
  28. if (single_dirty)
  29. delete single_dirty;
  30. if (both_dirty)
  31. delete both_dirty;
  32. }
  33. void add_single_dirty(sw16 x1, sw16 y1, sw16 x2, sw16 y2)
  34. {
  35. if (single_dirty)
  36. single_dirty->add_area(x1,y1,x2,y2);
  37. }
  38. void add_both_dirty(sw16 x1, sw16 y1, sw16 x2, sw16 y2)
  39. {
  40. if (both_dirty)
  41. both_dirty->add_area(x1,y1,x2,y2);
  42. }
  43. } ;
  44. #endif