4 * Copyright 1993 Bob Amstadt
11 /**********************************************************************
14 void WINAPI
LineDDA16( INT16 nXStart
, INT16 nYStart
, INT16 nXEnd
, INT16 nYEnd
,
15 LINEDDAPROC16 callback
, LPARAM lParam
)
17 LineDDA32( nXStart
, nYStart
, nXEnd
, nYEnd
,
18 (LINEDDAPROC32
)callback
, lParam
);
22 /**********************************************************************
23 * LineDDA32 (GDI32.248)
25 BOOL32 WINAPI
LineDDA32(INT32 nXStart
, INT32 nYStart
, INT32 nXEnd
, INT32 nYEnd
,
26 LINEDDAPROC32 callback
, LPARAM lParam
)
28 INT32 xadd
= 1, yadd
= 1;
31 INT32 dx
= nXEnd
- nXStart
;
32 INT32 dy
= nYEnd
- nYStart
;
40 if (dx
> dy
) { /* line is "more horizontal" */
41 err
= 2*dy
- dx
; erradd
= 2*dy
- 2*dx
;
42 for(cnt
= 0;cnt
<= dx
; cnt
++) {
43 callback(nXStart
,nYStart
,lParam
);
52 } else { /* line is "more vertical" */
53 err
= 2*dx
- dy
; erradd
= 2*dx
- 2*dy
;
54 for(cnt
= 0;cnt
<= dy
; cnt
++) {
55 callback(nXStart
,nYStart
,lParam
);