Skip to content

Commit

Permalink
Add experimental storyboard support
Browse files Browse the repository at this point in the history
Most of the work comes from fluddokt, see itdelatrisu/opsu#480
  • Loading branch information
CloneWith committed Aug 3, 2024
1 parent 6e08654 commit b31ce25
Show file tree
Hide file tree
Showing 18 changed files with 4,413 additions and 14 deletions.
34 changes: 34 additions & 0 deletions src/clonewith/opsu/storyboard/SBComEventRunner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package clonewith.opsu.storyboard;

import java.util.List;
import java.util.Set;

/**
* Storyboard Command Event Runner
*
* @author fluddokt
*
*/
class SBComEventRunner extends SBEventRunner{
public int start = Integer.MAX_VALUE, end = Integer.MIN_VALUE;

public void addCommands(List<SBCommand> commands, Set<SBCommand> activeCommands) {
for(SBCommand c : commands) {
start = Math.min(start, c.startTime);
end = Math.max(end, c.endTime);
if(c.startTime == c.endTime || c.isSameInitalEndValue) {
if(c.isVarying) //commands that vary just go to end value
events.add(new EndCommandSBEvent(c.startTime, c));
else //commands that don't vary (flip/ blend) just sets it
events.add(new StartCommandSBEvent(c.startTime, c));

} else if(c.isVarying){
events.add(new AttachCommandSBEvent(c.startTime, activeCommands, c));
events.add(new RemoveCommandSBEvent(c.endTime, activeCommands, c));
} else {
events.add(new StartCommandSBEvent(c.startTime, c));
events.add(new EndCommandSBEvent(c.endTime, c));
}
}
}
}
Loading

0 comments on commit b31ce25

Please sign in to comment.