void drawView ();
void drawNode ( unsigned node );
void drawSubSector ( int s );
void drawSeg ( Segment * seg );
void drawSimpleWall ( Texture * tex, SideDef * side, int coll, int col2,
int bottomHeight, int topHeight, Fixed t1, Fixed t2, int v1, int v2 );
void drawLowerWall ( Texture * tex, SideDef * side, int coll, int col2,
int bottomHeight, int topHeight, Fixed t1, Fixed t2, int v1, int v2 );
void drawUpperWall ( Texture * tex, SideDef * side, int coM, int co!2,
int bottomHeight, int topHeight, Fixed t1, Fixed t2, int v1, int v2 );
void setVideoMode ( int mode );
void drawVertLine ( int col, int top, int bottom, int color ); ///////////////////////////////////////////////////////////////////
Fixed fixedDist ( int u1, int v1, int u2, int v2, Angle angle ) {
int du = u2-u1; int dv = v2-v1; Fixed dist;
if ( abs ( du ) > abs ( dv ) )
dist = du * invCosine ( angle );

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

else
dist = dv * invSine ( angle ); return dist;
}
inline int viewerOnRight (int node ) {
Node * n = &nodes [node];
return n->dy * (long)( locX - n->x ) >= n->dx * (long)( locY - n->y );
}
inline int frontFacing (int from, int to ) {
return (long)( vertices [fromj.x - vertices [toj.x ) * (long)( locY - vertices [to].y ) >= (long)( vertices [fromj.y - vertices [to].y ) * (long)( locX - vertices [to].x );
}
void RMVideoInt () // execute real-mode video interrupt
{
segread (&sregs );
regs.w.ax = 0x0300; regs.w.bx = 0x0010; regs.w.cx = 0;
regs.x.edi = FP_OFF ( ÄrmRegs ); sregs.es = FP_SEG ( ÄrmRegs );
int386x ( 0x31, ®s, ®s, &sregs );
}
void DPMIAIIocDosMem ( DPMIDosPtr& ptr, int paras ) {
regs.w.ax = 0x0100; // allocate DOS memory
regs.w.bx = paras; // # of memory in paragraphs
int386 ( 0x31, ®s, ®s );
ptr.segment = regs.w.ax; // real-mode segment of the block ptr.selector = regs.w.dx; // selector for the allocated block
}
void DPMIFreeDosMem ( DPMIDosPtr& ptr) {
regs.w.ax = 0x0101; // free DOS memory

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