rem: SetDrMd( amiga_window->RPort, JAM1 );  if( mixmode != MIX_TRANSPARENT ) { SetAPen( amiga_window->RPort, bgpen ); RectFill( amiga_window->RPort, x, y, x + cx - 1, y + cy - 1 ); }    SetAPen( amiga_window->RPort, fgpen ); SetAfPt( amiga_window->RPort, &amiga_solid_pattern, 0 ); BltPattern( amiga_window->RPort, g->Data, x, y, x + cx - 1 , y + cy - 1, g->BytesPerRow );
add: SetABPenDrMd( amiga_window->RPort, fgpen, bgpen, mixmode == MIX_TRANSPARENT ? JAM1 : JAM2 ); BltTemplate( g->Data + g->BytesPerRow * srcy, srcx, g->BytesPerRow, amiga_window->RPort, x, y, cx, cy );
context: ui_draw_glyph(int mixmode,	      /* dest */ int x, int y, int cx, int cy,	      /* src */ HGLYPH glyph, int srcx, int srcy, int bgcolour,	      int fgcolour){  struct Glyph* g = (struct Glyph*) glyph;  LONG bgpen = amiga_obtain_pen( bgcolour );  LONG fgpen = amiga_obtain_pen( fgcolour );  SetDrMd( amiga_window->RPort, JAM1 );  if( mixmode != MIX_TRANSPARENT )  {    SetAPen( amiga_window->RPort, bgpen );    RectFill( amiga_window->RPort, x, y, x + cx - 1, y + cy - 1 );  }  // TODO: Use srcx, srcy  SetAPen( amiga_window->RPort, fgpen );  SetAfPt( amiga_window->RPort, &amiga_solid_pattern, 0 );  BltPattern( amiga_window->RPort, g->Data,               x, y, x + cx - 1 , y + cy - 1,               g->BytesPerRow );  amiga_release_pen( bgpen );  amiga_release_pen( fgpen );}