Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions editor/ScreenLayers/ProjectMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,16 @@ private string buildWarningMessage()
warnings += $"⚠ {totalGpuMemory:0.0}MB Texture Mem. (Total)\n";

if (project.FrameStats.OverlappedCommands)
warnings += $"⚠ Overlapped Commands\n";
{
var scriptList = string.Join(", ", project.FrameStats.OverlappedScriptNames);
warnings += $"⚠ Overlapped Commands in: {scriptList}\n";
}

if (project.FrameStats.IncompatibleCommands)
warnings += $"⚠ Incompatible Commands\n";
{
var scriptList = string.Join(", ", project.FrameStats.IncompatibleScriptNames);
warnings += $"⚠ Incompatible Commands in: {scriptList}\n";
}

return warnings.TrimEnd('\n');
}
Expand Down
1 change: 1 addition & 0 deletions editor/Storyboarding/EditorOsbAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace StorybrewEditor.Storyboarding
{
public class EditorOsbAnimation : OsbAnimation, DisplayableObject, HasPostProcess
{
public string ScriptName { get; set; }
public void Draw(DrawContext drawContext, Camera camera, Box2 bounds, float opacity, StoryboardTransform transform, Project project, FrameStats frameStats)
=> EditorOsbSprite.Draw(drawContext, camera, bounds, opacity, transform, project, frameStats, this);

Expand Down
19 changes: 17 additions & 2 deletions editor/Storyboarding/EditorOsbSprite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class EditorOsbSprite : OsbSprite, DisplayableObject, HasPostProcess
{
public readonly static RenderStates AlphaBlendStates = new RenderStates();
public readonly static RenderStates AdditiveStates = new RenderStates() { BlendingFactor = new BlendingFactorState(BlendingMode.Additive), };
public string ScriptName { get; set; }

public void Draw(DrawContext drawContext, Camera camera, Box2 bounds, float opacity, StoryboardTransform transform, Project project, FrameStats frameStats)
=> Draw(drawContext, camera, bounds, opacity, transform, project, frameStats, this);
Expand All @@ -39,8 +40,22 @@ public static void Draw(DrawContext drawContext, Camera camera, Box2 bounds, flo
if (!sprite.InDisplayInterval(time))
frameStats.ProlongedCommands += sprite.CommandCost;
frameStats.CommandCount += sprite.CommandCost;
frameStats.IncompatibleCommands |= sprite.HasIncompatibleCommands;
frameStats.OverlappedCommands |= sprite.HasOverlappedCommands;

if (sprite.HasOverlappedCommands)
{
frameStats.OverlappedCommands = true;
var editorSprite = sprite as EditorOsbSprite;
if (editorSprite != null && !string.IsNullOrEmpty(editorSprite.ScriptName))
frameStats.OverlappedScriptNames.Add(editorSprite.ScriptName);
}

if (sprite.HasIncompatibleCommands)
{
frameStats.IncompatibleCommands = true;
var editorSprite = sprite as EditorOsbSprite;
if (editorSprite != null && !string.IsNullOrEmpty(editorSprite.ScriptName))
frameStats.IncompatibleScriptNames.Add(editorSprite.ScriptName);
}
}

var forceVisible = !sprite.InDisplayInterval(time) && Keyboard.GetState().IsKeyDown(Key.AltLeft);
Expand Down
2 changes: 2 additions & 0 deletions editor/Storyboarding/EditorStoryboardSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public override OsbSprite CreateSprite(string path, OsbOrigin origin, Vector2 in
TexturePath = path,
Origin = origin,
InitialPosition = initialPosition,
ScriptName = Effect.BaseName
};
storyboardObjects.Add(storyboardObject);
displayableObjects.Add(storyboardObject);
Expand All @@ -78,6 +79,7 @@ public override OsbAnimation CreateAnimation(string path, int frameCount, double
FrameDelay = frameDelay,
LoopType = loopType,
InitialPosition = initialPosition,
ScriptName = Effect.BaseName
};
storyboardObjects.Add(storyboardObject);
displayableObjects.Add(storyboardObject);
Expand Down
2 changes: 2 additions & 0 deletions editor/Storyboarding/FrameStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class FrameStats
public int ProlongedCommands;
public bool IncompatibleCommands;
public bool OverlappedCommands;
public HashSet<string> OverlappedScriptNames = new HashSet<string>();
public HashSet<string> IncompatibleScriptNames = new HashSet<string>();

public float ScreenFill;
public ulong GpuPixelsFrame;
Expand Down