Skip to content

Commit

Permalink
Fixed a small bug where 2 PCM commands could be swapped (STOP and STA…
Browse files Browse the repository at this point in the history
…RT for instance)
  • Loading branch information
Stephane-D committed Jul 4, 2024
1 parent 9daa5f0 commit 50eaa95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Binary file modified bin/xgm2tool.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/xgm2tool/src/sgdk/xgm2tool/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class Launcher extends JFrame
{
final static String VERSION = "1.03";
final static String VERSION = "1.04";

final static int SYSTEM_AUTO = -1;
final static int SYSTEM_NTSC = 0;
Expand Down
10 changes: 7 additions & 3 deletions tools/xgm2tool/src/sgdk/xgm2tool/format/XGM.java
Original file line number Diff line number Diff line change
Expand Up @@ -1239,10 +1239,14 @@ else if (com.isWait(true))
// optimized command is not the last frame command ?
if ((indOpt != -1) && (indOpt != (frameCommands.size() - 2)))
{
// swap with last command
final int ind1 = FMcommands.indexOf(frameCommands.get(indOpt));
final XGMFMCommand comOpt = frameCommands.get(indOpt);
final int ind1 = FMcommands.indexOf(comOpt);
final int ind2 = FMcommands.indexOf(frameCommands.get(frameCommands.size() - 2));
Collections.swap(FMcommands, ind1, ind2);

// move to last command (don't swap)
FMcommands.add(ind2 + 1, comOpt);
FMcommands.remove(ind1);
// Collections.swap(FMcommands, ind1, ind2);
}
}

Expand Down

0 comments on commit 50eaa95

Please sign in to comment.