void VWB_Plot (id0_int_t x, id0_int_t y, id0_int_t color) { x+=pansx; y+=pansy; if (VW_MarkUpdateBlock (x,y,x,y)) VW_Plot(x,y,color); }
void VWB_DrawTile16 (id0_int_t x, id0_int_t y, id0_int_t tile) { x+=pansx; y+=pansy; if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+15,y+15)) VW_DrawTile16 (x/SCREENXDIV,y,tile); }
void VWB_Bar (id0_int_t x, id0_int_t y, id0_int_t width, id0_int_t height, id0_int_t color) { x+=pansx; y+=pansy; if (VW_MarkUpdateBlock (x,y,x+width,y+height-1) ) VW_Bar (x,y,width,height,color); }
void VWL_EraseCursor (void) { VW_MemToScreen(cursorsave,cursorspot,cursorwidth,cursorheight); VW_MarkUpdateBlock ((cursorx+pansx)&SCREENXMASK,cursory+pansy, ( (cursorx+pansx)&SCREENXMASK)+cursorwidth*SCREENXDIV-1, cursory+pansy+cursorheight-1); }
void VWB_DrawSprite(id0_int_t x, id0_int_t y, id0_int_t chunknum) { spritetabletype id0_far *spr; void/*spritetype*/ id0_seg *block; id0_unsigned_t dest,shift,width,height; x+=pansx; y+=pansy; spr = &spritetable[chunknum-STARTSPRITES]; block = /*(spritetype id0_seg *)*/grsegs[chunknum]; y+=spr->orgy>>G_P_SHIFT; x+=spr->orgx>>G_P_SHIFT; if (GRMODE == EGAGR) shift = (x&7)/2; else if (GRMODE == CGAGR) shift = 0; dest = bufferofs + ylookup[y]; if (x>=0) dest += x/SCREENXDIV; else dest += (x+1)/SCREENXDIV; width = VW_GetSpriteShiftWidth(block,shift)/*block->width[shift]*/; height = spr->height; if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+width*SCREENXDIV-1 ,y+height-1)) VW_MaskBlock (block,VW_GetSpriteShiftSourceOffset(block,shift)/*block->sourceoffset[shift]*/,dest, width,height,VW_GetSpriteShiftPlaneSize(block,shift)/*block->planesize[shift]*/); }
void VWB_Vlin (id0_int_t y1, id0_int_t y2, id0_int_t x, id0_int_t color) { x+=pansx; y1+=pansy; y2+=pansy; if (VW_MarkUpdateBlock (x,y1,x,y2)) VW_Vlin(y1,y2,x,color); }
void VWB_Hlin (id0_int_t x1, id0_int_t x2, id0_int_t y, id0_int_t color) { x1+=pansx; x2+=pansx; y+=pansy; if (VW_MarkUpdateBlock (x1,y,x2,y)) VW_Hlin(x1,x2,y,color); }
void VWB_DrawMPropString (const id0_char_t id0_far *string, const id0_char_t id0_far *optsend) { id0_int_t x,y; x = px+pansx; y = py+pansy; VW_DrawMPropString (string,optsend); VW_MarkUpdateBlock(x,y,x+bufferwidth*8-1,y+bufferheight-1); }
void VWB_DrawTile16M (id0_int_t x, id0_int_t y, id0_int_t tile) { id0_int_t xb; x+=pansx; y+=pansy; xb = x/SCREENXDIV; // use intermediate because VW_DT16M is macro if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+15,y+15)) VW_DrawTile16M (xb,y,tile); }
void VWB_DrawTile8M (id0_int_t x, id0_int_t y, id0_int_t tile) { id0_int_t xb; x+=pansx; y+=pansy; xb = x/SCREENXDIV; // use intermediate because VW_DT8M is macro #ifdef REFKEEN_VER_CATADVENTURES // if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+7,y+7)) // MDM (GAMER EDGE) VW_DrawTile8M(xb,y,tile); // statement prevents drawing chars past 42 #else if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+7,y+7)) VW_DrawTile8M(xb,y,tile); #endif }
void VWB_DrawMPic(id0_int_t x, id0_int_t y, id0_int_t chunknum) { // mostly copied from drawmpic id0_int_t picnum = chunknum - STARTPICM; memptr source; id0_unsigned_t dest,width,height; x+=pansx; y+=pansy; x/=SCREENXDIV; source = grsegs[chunknum]; dest = ylookup[y]+x+bufferofs; width = picmtable[picnum].width; height = picmtable[picnum].height; if (VW_MarkUpdateBlock (x*SCREENXDIV,y,(x+width)*SCREENXDIV-1,y+height-1)) VW_MaskBlock(source,0,dest,width,height,width*height); }
void VWB_DrawSprite(id0_int_t x, id0_int_t y, id0_int_t chunknum) { spritetabletype id0_far *spr; spritetype id0_seg *block; id0_unsigned_t dest,shift,width,height; x+=pansx; y+=pansy; spr = &spritetable[chunknum-STARTSPRITES]; block = (spritetype id0_seg *)grsegs[chunknum]; y+=spr->orgy>>G_P_SHIFT; x+=spr->orgx>>G_P_SHIFT; #if GRMODE == EGAGR shift = (x&7)/2; #endif #if GRMODE == CGAGR shift = 0; #endif dest = bufferofs + ylookup[y]; if (x>=0) dest += x/SCREENXDIV; else dest += (x+1)/SCREENXDIV; width = block->width[shift]; height = spr->height; if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+width*SCREENXDIV-1 ,y+height-1)) VW_MaskBlock (block,block->sourceoffset[shift],dest, width,height,block->planesize[shift]); }