public static CMVFrame CloneFrame(CMVFrame sourceFrame) { CMVFrame frame; frame = new CMVFrame(sourceFrame.frame, sourceFrame.cols, sourceFrame.rows); return frame; }
public CMV(uint cols, uint rows) { init(); CMVFrame firstFrame = new CMVFrame(cols, rows); frames.Add(firstFrame); version = 10005; }
private void action_PaintStart(object sender, EventArgs e) { if (cmvPlayer.PaintedCell.X == -1) return; clonedFrame = CMVFrame.CloneFrame(cmvframes[cmvPlayer.Frame]); cmvframes = cmvframes.Replace(cmvPlayer.Frame, clonedFrame); if (cmvPlayer.PaintedCell.X < clonedFrame.Columns && cmvPlayer.PaintedCell.Y < clonedFrame.Rows) { clonedFrame.SetCell((uint)cmvPlayer.PaintedCell.X, (uint)cmvPlayer.PaintedCell.Y, (byte)tileSelector.SelectedTile, CMVColours.GenerateColorCode(tileSelector.BackgroundColor, tileSelector.ForegroundColor)); } cmvPlayer.Pause(); UpdateCMV(); RefreshControls(); }
private void action_Paste(object sender, EventArgs e) { if (copybuffer.Count == 0) return; CMVEditorComponents.TimelineControl control = timelineControl; if (control.SelectionStart == control.SelectionEnd) { // Insert just before selection CMVFrame[] range = new CMVFrame[copybuffer.Count]; copybuffer.CopyTo(range); cmvframes = cmvframes.InsertRange(control.SelectionStart, range); control.SelectionEnd = control.SelectionStart + copybuffer.Count - 1; } else { // Replace selection CMVFrame[] range = new CMVFrame[copybuffer.Count]; copybuffer.CopyTo(range); cmvframes = cmvframes.ReplaceRange(control.SelectionStart, control.SelectionEnd, range); control.SelectionEnd = control.SelectionStart + copybuffer.Count - 1; } cmvPlayer.Pause(); UpdateCMV(); RefreshControls(); }
private void action_DuplicateFrame(object sender, EventArgs e) { var frameIndex = cmvPlayer.Frame; if (cmvframes.Count > 0) { clonedFrame = CMVFrame.CloneFrame(cmvframes[frameIndex]); cmvframes = cmvframes.Insert(frameIndex, clonedFrame); } else { MessageBox.Show(this, "No frame available to duplicate, they've all been deleted.", "Duplicate Frame Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } cmvPlayer.Pause(); cmvPlayer.Frame = frameIndex + 1; UpdateCMV(); RefreshControls(); }