public void BlitSurface(SurfaceInstance surf, int x, int y) { fixed (byte* buf = _pixels) { DrawImage(buf, x, y, surf.GetBytes(), (int)surf._width, (int)surf._height); } _changed = true; }
public void BlitMaskSurface(SurfaceInstance surf, int ox, int oy, ColorInstance mask) { Color mask_c = mask.GetColor(), final = new Color(); fixed (byte* buf = _pixels) { for (int y = 0; y < surf._height; ++y) { for (int x = 0; x < surf._width; ++x) { Color dest = surf.GetColorAt(x, y); ColorBlend(ref dest, ref mask_c, ref final); // todo SetPixel(buf, ox + x, oy + y, ref final); } } } _changed = true; }