[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Adonthell-commits] CVS: adonthell/src surface.h,1.7.2.2,1.7.2.3 surface
From: |
Alexandre Courbot <address@hidden> |
Subject: |
[Adonthell-commits] CVS: adonthell/src surface.h,1.7.2.2,1.7.2.3 surface.cc,1.9.2.1,1.9.2.2 |
Date: |
Fri, 05 Apr 2002 13:21:50 -0500 |
Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv25531/src
Modified Files:
Tag: Branch_road_to_0-4
surface.h surface.cc
Log Message:
Added config.h.in to .cvsignore
Modified surface::draw_line so it can take an optionnal drawing area.
Index: surface.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/surface.h,v
retrieving revision 1.7.2.2
retrieving revision 1.7.2.3
diff -C2 -r1.7.2.2 -r1.7.2.3
*** surface.h 23 Feb 2002 13:22:57 -0000 1.7.2.2
--- surface.h 5 Apr 2002 18:21:45 -0000 1.7.2.3
***************
*** 229,234 ****
*
*/
! void draw_line (s_int16 sx, s_int16 sy, s_int16 ex, s_int16 ey, u_int32
col);
!
//@}
--- 229,234 ----
*
*/
! void draw_line (s_int16 sx, s_int16 sy, s_int16 ex, s_int16 ey, u_int32
col,
! drawing_area * da_opt = NULL);
//@}
Index: surface.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/surface.cc,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -C2 -r1.9.2.1 -r1.9.2.2
*** surface.cc 20 Feb 2002 12:57:46 -0000 1.9.2.1
--- surface.cc 5 Apr 2002 18:21:45 -0000 1.9.2.2
***************
*** 107,111 ****
}
! void surface::draw_line (s_int16 x1, s_int16 y1, s_int16 x2, s_int16 y2,
u_int32 color)
{
int i;
--- 107,111 ----
}
! void surface::draw_line(s_int16 x1, s_int16 y1, s_int16 x2, s_int16 y2,
u_int32 color, drawing_area * da_opt = NULL)
{
int i;
***************
*** 116,119 ****
--- 116,137 ----
int inc1,inc2;
int offset;
+
+ if (da_opt)
+ {
+ u_int16 mx = da_opt->x() + da_opt->length();
+ u_int16 my = da_opt->y() + da_opt->height();
+
+ if (x1 < da_opt->x()) x1 = da_opt->x();
+ if (x2 < da_opt->x()) x2 = da_opt->x();
+
+ if (x1 >= mx) x1 = mx - 1;
+ if (x2 >= mx) x2 = mx - 1;
+
+ if (y1 < da_opt->y()) y1 = da_opt->y();
+ if (y2 < da_opt->y()) y2 = da_opt->y();
+
+ if (y1 >= my) y1 = my - 1;
+ if (y2 >= my) y2 = my - 1;
+ }
x=x1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Adonthell-commits] CVS: adonthell/src surface.h,1.7.2.2,1.7.2.3 surface.cc,1.9.2.1,1.9.2.2,
Alexandre Courbot <address@hidden> <=