void setVideoMode ( int mode )
{
asm {
mov axs mode int 10h
}
}
void drawVertLine ( int col, int top, int bottom, int color )

13. Элементы виртуальной реальност

char far * vptr = (char far *)MK_FP ( OxAOOO, col + 320 * top );
while (top <= bottom ) {
* vptr = color; top++; vptr += 320;
}
}
void dumpLevel ()
{
FILE * fp = fopen ("level", "w");
fprintf (fp, "\n\t %d Vertices\n", numVertices ); for (int i = 0; i < numVertices; i++ )
fprintf (fp," %3d (%5d, %5d)\n", i, vertices [i].x, vertices [i].y );
fprintf (fp, "\n\t %d LineDefs\n", numLines ); for (i = 0; i < numLines; i++ )
fprintf (fp, "%3d From %3d to %3d Right SideDef %3d Left SideDef %3d\n' i, lines [i].fromVertex, lines [i].toVertex, lines [i].sideDefs [0], lines [iJ.sideDefs [1]);
fprintf (fp, "\n\t %d SideDefs\n", numSides ); for (i = 0; i < numSides; i++ )
fprintf (fp, "%3d Upper %8s Lower %8s Main %8s Sector %d\n",
i, sides [i].upper__tx, sides [i].lower_tx,
sides [i].main_tx, sides [i].sector);
fprintf (fp, "\n\t %d Segs\n", numSegs ); for (i = 0; i < numSegs; i++ )
fprintf (fp, "%3d From %3d to %3d Side %d\nM, i, segs [i].from, segs [i].to, segs [i].lineSide );
fprintf (fp, "\n\t %d SSectors\n", numSubSectors ); for (i = 0; i < numSubSectors; i++ )
fprintf (fp, "%3d numSegs %4d FirstSeg %4d\n", i, subSectors [i].numSegs, subSectors [i].firstSeg );
fprintf (fp, "\n\t %d Nodes\n", numNodes ); for (i = 0; i < numNodes; i++ )
fprintf (fp, "%3d x %4d y %4d dx %4d dy %4d Right %4d(%4d) Left %4d(%4d)\n",
i, nodes [i].x, nodes [i].y, nodes [i].dx, nodes [i].dy, nodes [i].rightNode, nodes [i].rightNode & 0x7FFF, nodes [ij.leftNode, nodes [i].JeftNode & 0x7FFF );
fclose (fp );
}
main () {
int done = 0;
initFixMath (); wad.loadLevel (1,1 );

Компьютерная графика. Полигональные модели

// set viewer to start of level for (int i = 0; i < numThings; i++ ) if (things [i].type == 1 )

⇐ Предыдущая| |Следующая ⇒