4 * Copyright 1993 Bob Amstadt
10 #include "wine/wingdi16.h"
12 /* ### start build ### */
13 extern WORD CALLBACK
DDA_CallTo16_word_wwl(LINEDDAPROC16
,WORD
,WORD
,LONG
);
14 /* ### stop build ### */
23 static void CALLBACK
DDA_callback( INT x
, INT y
, LPARAM param
)
25 const struct linedda16_info
*info
= (struct linedda16_info
*)param
;
26 DDA_CallTo16_word_wwl( info
->proc
, x
, y
, info
->param
);
29 /**********************************************************************
32 BOOL WINAPI
LineDDA(INT nXStart
, INT nYStart
, INT nXEnd
, INT nYEnd
,
33 LINEDDAPROC callback
, LPARAM lParam
)
35 INT xadd
= 1, yadd
= 1;
38 INT dx
= nXEnd
- nXStart
;
39 INT dy
= nYEnd
- nYStart
;
47 if (dx
> dy
) { /* line is "more horizontal" */
48 err
= 2*dy
- dx
; erradd
= 2*dy
- 2*dx
;
49 for(cnt
= 0;cnt
<= dx
; cnt
++) {
50 callback(nXStart
,nYStart
,lParam
);
59 } else { /* line is "more vertical" */
60 err
= 2*dx
- dy
; erradd
= 2*dx
- 2*dy
;
61 for(cnt
= 0;cnt
<= dy
; cnt
++) {
62 callback(nXStart
,nYStart
,lParam
);
76 /**********************************************************************
79 void WINAPI
LineDDA16( INT16 nXStart
, INT16 nYStart
, INT16 nXEnd
,
80 INT16 nYEnd
, LINEDDAPROC16 proc
, LPARAM lParam
)
82 struct linedda16_info info
;
85 LineDDA( nXStart
, nYStart
, nXEnd
, nYEnd
, DDA_callback
, (LPARAM
)&info
);