internal static void Execute(Player p, DrawOp op, Brush brush, Vec3S32[] marks) { UndoDrawOpEntry entry = new UndoDrawOpEntry(); entry.Init(op.Name, op.Level.name); if (brush != null) { brush.Configure(op, p); } Level lvl = op.Level; DrawOpOutputter outputter = new DrawOpOutputter(op); if (op.AffectedByTransform) { p.Transform.Perform(marks, p, lvl, op, brush, outputter.Output); } else { op.Perform(marks, brush, outputter.Output); } bool needsReload = op.TotalModified >= outputter.reloadThreshold; if (op.Undoable) { entry.Finish(p); } if (needsReload) { DoReload(p, op.Level); } op.TotalModified = 0; // reset total modified (as drawop instances are reused in static mode) }
static bool DoDrawOp(PendingDrawOp item, Player p) { Level lvl = item.Op.Level; DrawOpOutputter outputter = new DrawOpOutputter(item.Op); if (item.Op.AffectedByTransform) { p.Transform.Perform(item.Marks, p, lvl, item.Op, item.Brush, outputter.Output); } else { item.Op.Perform(item.Marks, item.Brush, outputter.Output); } return(item.Op.TotalModified >= outputter.reloadThreshold); }