source: golgotha/src/i4/window/colorwin.cc @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 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.5 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#include "window/colorwin.hh"
10#include "image/image.hh"
11#include "window/style.hh"
12
13void i4_color_window_class::parent_draw(i4_draw_context_class &context)
14{     
15  i4_rect_list_class child_clip(&context.clip,0,0);
16  child_clip.intersect_list(&undrawn_area);
17
18  child_clip.swap(&context.clip);
19
20 
21  if (color==style->color_hint->neutral())
22  {
23    for (i4_rect_list_class::area_iter c=context.clip.list.begin();c!=context.clip.list.end();++c)
24      style->deco_neutral_fill(local_image, c->x1, c->y1, c->x2, c->y2, context);
25  }
26  else local_image->clear(color,context);
27
28  child_clip.swap(&context.clip);
29  i4_parent_window_class::parent_draw(context);
30}
31
32i4_parent_window_class *i4_add_color_window(i4_parent_window_class *parent, i4_color color,
33                                            i4_graphical_style_class *style,
34                                            i4_coord x, i4_coord y, w16 w, w16 h)
35{
36  i4_color_window_class *cw=new i4_color_window_class(w,h,color, style);
37  if (parent)
38    parent->add_child(x,y,cw);
39  return cw;
40}
41
Note: See TracBrowser for help on using the repository browser.