dae models support

This commit is contained in:
Yoshman29
2022-12-19 17:06:44 +01:00
parent cd0edc8378
commit ea24d91efa
4 changed files with 28 additions and 7 deletions
+3 -1
View File
@@ -155,12 +155,14 @@ class FreeplayState extends MusicBeatState
// putting it before so that its actually smooth
updateOptionsAlpha();
var dontPlaySongThisFrame = false;
#if PRELOAD_ALL
autoplayElapsed += elapsed;
if (!songInstPlaying && (autoplayElapsed > timeUntilAutoplay || FlxG.keys.justPressed.SPACE)) {
if (curPlayingInst != (curPlayingInst = Paths.inst(songs[curSelected].songName, songs[curSelected].difficulties[curDifficulty])))
FlxG.sound.playMusic(curPlayingInst, 0);
songInstPlaying = true;
dontPlaySongThisFrame = true;
}
#end
@@ -171,7 +173,7 @@ class FreeplayState extends MusicBeatState
FlxG.switchState(new MainMenuState());
}
if (controls.ACCEPT)
if (controls.ACCEPT && !dontPlaySongThisFrame)
{
CoolUtil.loadSong(songs[curSelected].songName, songs[curSelected].difficulties[curDifficulty]);
FlxG.switchState(new PlayState());
+1 -4
View File
@@ -159,10 +159,7 @@ class CoolUtil
"BPM" => null
]);
var parsedBPM:Null<Float> = Std.parseFloat(musicInfo["BPM"]);
if (parsedBPM == null)
Conductor.changeBPM(DefaultBPM);
else
Conductor.changeBPM(parsedBPM);
Conductor.changeBPM(parsedBPM == null ? DefaultBPM : parsedBPM);
} else
Conductor.changeBPM(DefaultBPM);
}
+16
View File
@@ -176,6 +176,22 @@ class Paths
return getPath('models/$key.obj', BINARY, null);
}
inline static public function dae(key:String) {
return getPath('models/$key.dae', BINARY, null);
}
inline static public function md2(key:String) {
return getPath('models/$key.md2', BINARY, null);
}
inline static public function md5(key:String) {
return getPath('models/$key.md5', BINARY, null);
}
inline static public function awd(key:String) {
return getPath('models/$key.awd', BINARY, null);
}
inline static public function getSparrowAtlas(key:String, ?library:String)
{
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));