void VL_ClearBuffer (unsigned buf, byte color) { VGAMAPMASK(15); memset((byte *)buf,color,screensize); }
void VL_ClearVideo (byte color) { VGAMAPMASK(15); memset((byte *)(0xa000<<4),color,0x10000); }
void DrawSky( void ) { byte * src; int dest; // int plane; int height; // int height2; int ang; int angle; int ofs; angle=viewangle; if ((fog==0) && (lightning==true)) shadingtable=colormap+((basemaxshade-6-lightninglevel)<<8); else shadingtable=colormap+(1<<12); ofs=(((maxheight)-(player->z))>>3)+(centery*200/iGLOBAL_SCREENHEIGHT-((viewheight*200/iGLOBAL_SCREENHEIGHT)>>1)); if (ofs>centerskypost) { ofs=centerskypost; } else if (((centerskypost-ofs)+viewheight*200/iGLOBAL_SCREENHEIGHT)>1799) { ofs=-(1799-(centerskypost+viewheight*200/iGLOBAL_SCREENHEIGHT)); } //ofs=centerskypost; #ifdef DOS if (doublestep>0) { #ifdef DOS for (plane=0;plane<4;plane+=2) #endif { #ifdef DOS VGAMAPMASK((1<<plane)+(1<<(plane+1))); for (dest=plane;dest<viewwidth;dest+=4) #else for (dest=0;dest<viewwidth;dest+=2) #endif { height=posts[dest].ceilingclip; height2=posts[dest+1].ceilingclip; if (height<height2) height=height2; if (height<=0) continue; ang=(angle+pixelangle[dest])&(FINEANGLES-1); src=skysegs[ang]-ofs; #ifdef DOS DrawSkyPost((byte *)bufferofs + (dest>>2),src,height); #else /* TODO: this isn't right since it's not really optimized */ DrawSkyPost((byte *)bufferofs + dest,src,height); DrawSkyPost((byte *)bufferofs + dest + 1,src,height); #endif } } } else #endif { #ifdef DOS for (plane=0;plane<4;plane++)