Ниже приведена простейшая программа, реализующая просмотр заданного уровня без использования текстур.
(21 // File dooml.cpp
#include <alloc.h>
#include <bios.h>
#include <dos.h>
#include <math.h>
#include <stdio.h>
#include <time.h>
#include "Wad.h"
#define SCREEN_WIDTH 320
#define SCREENJHEIGHT 200
#define V_MIN 20
#define HSCALE 1601
Компьютерная графика. Полигональные модели
#define VSCALE 1601
#define FLOOR_COLOR 8
#define CEILING__COLOR 7
#define WALL_COLOR 1
#define LOWER_WALL_COLOR 2
#define UPPER_WALL_COLOR 3
#define ESC 0x011b
#define UP 0x4800
#define DOWN 0x5000
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define CtriLeft 0x7300
#define CtrlRight 0x7400
HIM Ml HUM HUM Static Data IIIIIIHHIHIIIIIIHIIIIIIII
int locX; // viewer's location
int locY;
int locZ; // viewer height
Angle angle; // viewing direction
SSector * curSector; // ssector, viewer located in
long totalFrames = 0;
int topLine [SCREEN WIDTH]; //top horizon line
int bottomLine [SCRËEN_WIDTH]; // bottom horizon line
WadFile wad ( "E:\\GAMES\\DOOM.ULT\\DOOM.WAD" );
llllllllllllllllllllllllllllJIIHIIIHIIHninillllllllllllllllll
void drawView ();
int viewerOnRight ( int node );
int frontFacing ( int from, int to );
void drawNode ( unsigned node );
void drawSubSector ( int s );
void drawSeg. ( Segment * seg );
void drawSimpleWall ( int coll, int col2, int bottomHeight, int topHeight,
int v1, int v2 );
void drawLowerWall ( int coll, int col2, int bottomHeight, int topHeight,
int v1, int v2 );
void drawUpperWall ( int co!1, int col2, int bottomHeight, int topHeight,
int v1, int v2 ); void setVideoMode ( int mode );
void drawVertLine ( int col, int top, int bottom, int color );
HIHillHIHHHHlllHIHIIHHHHHIIHHHIHHHHIMMIM