source: golgotha/src/i4/image/context.hh

Last change on this file was 80, checked in by Sam Hocevar, 15 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.4 KB
Line 
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
9#ifndef CONTEXT_HH
10#define CONTEXT_HH
11
12#include "area/rectlist.hh"
13
14class i4_draw_context_class
15{
16  public :
17  i4_rect_list_class clip;
18  i4_rect_list_class *single_dirty; // all areas that only need updating for the next frame
19  i4_rect_list_class *both_dirty;   // all areas that need updating on all future frames
20  sw16 xoff,yoff;
21
22  i4_draw_context_class(sw16 x1, sw16 y1, sw16 x2, sw16 y2)
23  {
24    clip.add_area(x1,y1,x2,y2);
25    single_dirty=0;
26    both_dirty=0;
27    xoff=0;
28    yoff=0;
29  }
30  ~i4_draw_context_class()
31  {
32    if (single_dirty)
33      delete single_dirty;
34    if (both_dirty)
35      delete both_dirty;
36  }
37
38  void add_single_dirty(sw16 x1, sw16 y1, sw16 x2, sw16 y2)
39  {
40    if (single_dirty)
41      single_dirty->add_area(x1,y1,x2,y2);
42  }
43
44  void add_both_dirty(sw16 x1, sw16 y1, sw16 x2, sw16 y2)
45  {
46    if (both_dirty)
47      both_dirty->add_area(x1,y1,x2,y2);
48  }
49
50} ;
51
52
53#endif
Note: See TracBrowser for help on using the repository browser.