Change bold code snippets to inline code blocks
This commit is contained in:
parent
f658bfbb40
commit
3c76d884ef
185 changed files with 1772 additions and 1772 deletions
22
35-04.md
22
35-04.md
|
|
@ -100,20 +100,20 @@ void main()
|
|||
|
||||
#### Looking at EVGALine {#Heading7}
|
||||
|
||||
The **EVGALine** function itself performs four operations. **EVGALine**
|
||||
The `EVGALine` function itself performs four operations. `EVGALine`
|
||||
first sets up the VGA's hardware so that all pixels drawn will be in the
|
||||
desired color. This is accomplished by setting two of the VGA's
|
||||
registers, the Enable Set/Reset register and the Set/Reset register.
|
||||
Setting the Enable Set/Reset to the value 0FH, as is done in
|
||||
**EVGALine**, causes all drawing to produce pixels in the color
|
||||
`EVGALine`, causes all drawing to produce pixels in the color
|
||||
contained in the Set/Reset register. Setting the Set/Reset register to
|
||||
the passed color, in conjunction with the Enable Set/Reset setting of
|
||||
0FH, causes all drawing done by **EVGALine** and the functions it calls
|
||||
0FH, causes all drawing done by `EVGALine` and the functions it calls
|
||||
to generate the passed color. In summary, setting up the Enable
|
||||
Set/Reset and Set/Reset registers in this way causes the remainder of
|
||||
**EVGALine** to draw a line in the specified color.
|
||||
`EVGALine` to draw a line in the specified color.
|
||||
|
||||
**EVGALine** next performs a simple check to cut in half the number of
|
||||
`EVGALine` next performs a simple check to cut in half the number of
|
||||
line orientations that must be handled separately. Figure 35.4 shows the
|
||||
eight possible line orientations among which a Bresenham's algorithm
|
||||
implementation must distinguish. (In interpreting Figure 35.4, assume
|
||||
|
|
@ -128,16 +128,16 @@ start to the line end.
|
|||
> 
|
||||
> A moment of thought will show, however, that four of the line
|
||||
> orientations are redundant. Each of the four orientations for which
|
||||
> **DeltaY**, the Y component of the line, is less than 0 (that is, for
|
||||
> `DeltaY`, the Y component of the line, is less than 0 (that is, for
|
||||
> which the line start Y coordinate is greater than the line end Y
|
||||
> coordinate) can be transformed into one of the four orientations for
|
||||
> which the line start Y coordinate is less than the line end Y coordinate
|
||||
> simply by reversing the line start and end coordinates, so that the line
|
||||
> is drawn in the other direction. **EVGALine** does this by swapping
|
||||
> is drawn in the other direction. `EVGALine` does this by swapping
|
||||
> (X0,Y0) (the line start coordinates) with (X1,Y1) (the line end
|
||||
> coordinates) whenever Y0 is greater than Y1.
|
||||
|
||||
This accomplished, **EVGALine** must still distinguish among the four
|
||||
This accomplished, `EVGALine` must still distinguish among the four
|
||||
remaining line orientations. Those four orientations form two major
|
||||
categories, orientations for which the X dimension is the major axis of
|
||||
the line and orientations for which the Y dimension is the major axis.
|
||||
|
|
@ -146,10 +146,10 @@ finish) and 2 (where X decreases from start to finish) fall into the
|
|||
latter category, and differ in only one respect, the direction in which
|
||||
the X coordinate moves when it changes. Handling of the running error of
|
||||
the line is exactly the same for both cases, as one would expect given
|
||||
the symmetry of lines differing only in the sign of **DeltaX**, the X
|
||||
coordinate of the line. Consequently, for those cases where **DeltaX**
|
||||
the symmetry of lines differing only in the sign of `DeltaX`, the X
|
||||
coordinate of the line. Consequently, for those cases where `DeltaX`
|
||||
is less than zero, the direction of X movement is made negative, and the
|
||||
absolute value of **DeltaX** is used for error term calculations.
|
||||
absolute value of `DeltaX` is used for error term calculations.
|
||||
|
||||
Similarly, octants 0 (where X increases from start to finish) and 3
|
||||
(where X decreases from start to finish) differ only in the direction in
|
||||
|
|
|
|||
Loading…
Reference in a new issue