Replace invalid characters with HTML entities
— with — ’ with ’ + with + × with x ç with ç “ with “ ” with ” ‘ with ‘ • with • – with - µ with µ † with † Fix C++ θ with θ Yen symbol instead of times Fix broken apos Bullet again E-circumflex
This commit is contained in:
parent
9e52de9586
commit
500e7f5654
353 changed files with 5091 additions and 5091 deletions
16
36-04.html
16
36-04.html
|
|
@ -36,13 +36,13 @@
|
|||
</TABLE>
|
||||
</CENTER>
|
||||
<P><BR></P>
|
||||
<P>Notwithstanding that it’s not optimized, Listing 36.1 is reasonably fast. If you run Listing 36.2 (a sample line-drawing program that you can use to test-drive Listing 36.1), you may be as surprised as I was at how quickly the screen fills with vectors, considering that Listing 36.1 is entirely in C and has some redundant divides. Or perhaps you won’t be surprised—in which case I suggest you <I>not</I> miss the next chapter.</P>
|
||||
<P>Notwithstanding that it’s not optimized, Listing 36.1 is reasonably fast. If you run Listing 36.2 (a sample line-drawing program that you can use to test-drive Listing 36.1), you may be as surprised as I was at how quickly the screen fills with vectors, considering that Listing 36.1 is entirely in C and has some redundant divides. Or perhaps you won’t be surprised—in which case I suggest you <I>not</I> miss the next chapter.</P>
|
||||
<P><B>LISTING 36.2 L36-2.C</B></P>
|
||||
<!-- CODE //-->
|
||||
<PRE>
|
||||
/* Sample line-drawing program. Uses the optimized
|
||||
line-drawing functions coded in LListing L36.1.C.
|
||||
Tested with Borland C++ in the small model. */
|
||||
Tested with Borland C++ in the small model. */
|
||||
|
||||
#include <dos.h>
|
||||
|
||||
|
|
@ -66,27 +66,27 @@ int Color; /* color to draw lines in */
|
|||
/* lines from center to top of rectangle */
|
||||
WorkingX = XCenter - XLength;
|
||||
WorkingY = YCenter - YLength;
|
||||
for ( ; WorkingX < ( XCenter + XLength ); WorkingX++ )
|
||||
for ( ; WorkingX < ( XCenter + XLength ); WorkingX++ )
|
||||
{
|
||||
LineDraw(XCenter, YCenter, WorkingX, WorkingY, Color);
|
||||
}
|
||||
/* lines from center to right of rectangle */
|
||||
WorkingX = XCenter + XLength - 1;
|
||||
WorkingX = XCenter + XLength - 1;
|
||||
WorkingY = YCenter - YLength;
|
||||
for ( ; WorkingY < ( YCenter + YLength ); WorkingY++ )
|
||||
for ( ; WorkingY < ( YCenter + YLength ); WorkingY++ )
|
||||
{
|
||||
LineDraw(XCenter, YCenter, WorkingX, WorkingY, Color);
|
||||
}
|
||||
/* lines from center to bottom of rectangle */
|
||||
WorkingX = XCenter + XLength - 1;
|
||||
WorkingY = YCenter + YLength - 1;
|
||||
WorkingX = XCenter + XLength - 1;
|
||||
WorkingY = YCenter + YLength - 1;
|
||||
for ( ; WorkingX >= ( XCenter - XLength ); WorkingX-- )
|
||||
{
|
||||
LineDraw(XCenter, YCenter, WorkingX, WorkingY, Color);
|
||||
}
|
||||
/* lines from center to left of rectangle */
|
||||
WorkingX = XCenter - XLength;
|
||||
WorkingY = YCenter + YLength - 1;
|
||||
WorkingY = YCenter + YLength - 1;
|
||||
for ( ; WorkingY >= ( YCenter - YLength ); WorkingY-- )
|
||||
{
|
||||
LineDraw(XCenter, YCenter, WorkingX, WorkingY, Color);
|
||||
|
|
|
|||
Loading…
Reference in a new issue