Change HTML4 entities to HTML5

&lt to <
&gt to >
&amp to &
This commit is contained in:
James Gregory 2013-12-30 14:33:39 +11:00
commit b8e7ce7165
105 changed files with 1117 additions and 1117 deletions

View file

@ -42,8 +42,8 @@
/* 3-D animation program to rotate 12 cubes. Uses fixed point. All C code
tested with Borland C++ in C compilation mode and the small model. */
#include &ltconio.h&gt
#include &ltdos.h&gt
#include <conio.h>
#include <dos.h>
#include “polygon.h”
/* base offset of page to which to draw */
@ -73,11 +73,11 @@ void main() {
and flipping the page to show it */
do {
/* For each object, regenerate viewing info, if necessary */
for (i=0; i&ltNumObjects; i++) {
if ((ObjectPtr = ObjectList[i])-&gtRecalcXform ||
for (i=0; i<NumObjects; i++) {
if ((ObjectPtr = ObjectList[i])->RecalcXform ||
RecalcAllXforms) {
ObjectPtr-&gtRecalcFunc(ObjectPtr);
ObjectPtr-&gtRecalcXform = 0;
ObjectPtr->RecalcFunc(ObjectPtr);
ObjectPtr->RecalcXform = 0;
}
}
RecalcAllXforms = 0;
@ -85,32 +85,32 @@ void main() {
PageStartOffsets[NonDisplayedPage = DisplayedPage ^ 1];
/* For each object, clear the portion of the non-displayed page
that was drawn to last time, then reset the erase extent */
for (i=0; i&ltNumObjects; i++) {
for (i=0; i<NumObjects; i++) {
ObjectPtr = ObjectList[i];
FillRectangleX(ObjectPtr-&gtEraseRect[NonDisplayedPage].Left,
ObjectPtr-&gtEraseRect[NonDisplayedPage].Top,
ObjectPtr-&gtEraseRect[NonDisplayedPage].Right,
ObjectPtr-&gtEraseRect[NonDisplayedPage].Bottom,
FillRectangleX(ObjectPtr->EraseRect[NonDisplayedPage].Left,
ObjectPtr->EraseRect[NonDisplayedPage].Top,
ObjectPtr->EraseRect[NonDisplayedPage].Right,
ObjectPtr->EraseRect[NonDisplayedPage].Bottom,
CurrentPageBase, 0);
ObjectPtr-&gtEraseRect[NonDisplayedPage].Left =
ObjectPtr-&gtEraseRect[NonDisplayedPage].Top = 0x7FFF;
ObjectPtr-&gtEraseRect[NonDisplayedPage].Right =
ObjectPtr-&gtEraseRect[NonDisplayedPage].Bottom = 0;
ObjectPtr->EraseRect[NonDisplayedPage].Left =
ObjectPtr->EraseRect[NonDisplayedPage].Top = 0x7FFF;
ObjectPtr->EraseRect[NonDisplayedPage].Right =
ObjectPtr->EraseRect[NonDisplayedPage].Bottom = 0;
}
/* Draw all objects */
for (i=0; i&ltNumObjects; i++)
ObjectList[i]-&gtDrawFunc(ObjectList[i]);
for (i=0; i<NumObjects; i++)
ObjectList[i]->DrawFunc(ObjectList[i]);
/* Flip to display the page into which we just drew */
ShowPage(PageStartOffsets[DisplayedPage = NonDisplayedPage]);
/* Move and reorient each object */
for (i=0; i&ltNumObjects; i++)
ObjectList[i]-&gtMoveFunc(ObjectList[i]);
for (i=0; i<NumObjects; i++)
ObjectList[i]->MoveFunc(ObjectList[i]);
if (kbhit())
if (getch() == 0x1B) Done = 1; /* Esc to exit */
} while (!Done);
/* Return to text mode and exit */
regset.x.ax = 0x0003; /* AL = 3 selects 80x25 text mode */
int86(0x10, &ampregset, &ampregset);
int86(0x10, &regset, &regset);
exit(1);
}
</PRE>
@ -120,45 +120,45 @@ void main() {
<PRE>
/* Transforms all vertices in the specified polygon-based object into view
space, then perspective projects them to screen space and maps them to screen
coordinates, storing results in the object. Recalculates object-&gtview
coordinates, storing results in the object. Recalculates object-&gt;view
transformation because only if transform changes would we bother
to retransform the vertices. */
#include &ltmath.h&gt
#include &lt;math.h&gt;
#include &ldquo;polygon.h&rdquo;
void XformAndProjectPObject(PObject * ObjectToXform)
{
int i, NumPoints = ObjectToXform-&gtNumVerts;
Point3 * Points = ObjectToXform-&gtVertexList;
Point3 * XformedPoints = ObjectToXform-&gtXformedVertexList;
Point3 * ProjectedPoints = ObjectToXform-&gtProjectedVertexList;
Point * ScreenPoints = ObjectToXform-&gtScreenVertexList;
int i, NumPoints = ObjectToXform-&gt;NumVerts;
Point3 * Points = ObjectToXform-&gt;VertexList;
Point3 * XformedPoints = ObjectToXform-&gt;XformedVertexList;
Point3 * ProjectedPoints = ObjectToXform-&gt;ProjectedVertexList;
Point * ScreenPoints = ObjectToXform-&gt;ScreenVertexList;
/* Recalculate the object-&gtview transform */
ConcatXforms(WorldViewXform, ObjectToXform-&gtXformToWorld,
ObjectToXform-&gtXformToView);
/* Recalculate the object-&gt;view transform */
ConcatXforms(WorldViewXform, ObjectToXform-&gt;XformToWorld,
ObjectToXform-&gt;XformToView);
/* Apply that new transformation and project the points */
for (i=0; i&ltNumPoints; i++, Points++, XformedPoints++,
for (i=0; i&lt;NumPoints; i++, Points++, XformedPoints++,
ProjectedPoints++, ScreenPoints++) {
/* Transform to view space */
XformVec(ObjectToXform-&gtXformToView, (Fixedpoint *) Points,
XformVec(ObjectToXform-&gt;XformToView, (Fixedpoint *) Points,
(Fixedpoint *) XformedPoints);
/* Perspective-project to screen space */
ProjectedPoints-&gtX =
FixedMul(FixedDiv(XformedPoints-&gtX, XformedPoints-&gtZ),
ProjectedPoints-&gt;X =
FixedMul(FixedDiv(XformedPoints-&gt;X, XformedPoints-&gt;Z),
DOUBLE_TO_FIXED(PROJECTION_RATIO * (SCREEN_WIDTH/2)));
ProjectedPoints-&gtY =
FixedMul(FixedDiv(XformedPoints-&gtY, XformedPoints-&gtZ),
ProjectedPoints-&gt;Y =
FixedMul(FixedDiv(XformedPoints-&gt;Y, XformedPoints-&gt;Z),
DOUBLE_TO_FIXED(PROJECTION_RATIO * (SCREEN_WIDTH/2)));
ProjectedPoints-&gtZ = XformedPoints-&gtZ;
ProjectedPoints-&gt;Z = XformedPoints-&gt;Z;
/* Convert to screen coordinates. The Y coord is negated to flip from
increasing Y being up to increasing Y being down, as expected by polygon
filler. Add in half the screen width and height to center on screen. */
ScreenPoints-&gtX = ((int) ((ProjectedPoints-&gtX +
DOUBLE_TO_FIXED(0.5)) &gt&gt 16)) + SCREEN_WIDTH/2;
ScreenPoints-&gtY = (-((int) ((ProjectedPoints-&gtY +
DOUBLE_TO_FIXED(0.5)) &gt&gt 16))) + SCREEN_HEIGHT/2;
ScreenPoints-&gt;X = ((int) ((ProjectedPoints-&gt;X +
DOUBLE_TO_FIXED(0.5)) &gt;&gt; 16)) + SCREEN_WIDTH/2;
ScreenPoints-&gt;Y = (-((int) ((ProjectedPoints-&gt;Y +
DOUBLE_TO_FIXED(0.5)) &gt;&gt; 16))) + SCREEN_HEIGHT/2;
}
}<B></B>
</PRE>