fixes & dumb shit

This commit is contained in:
Yoshman29
2023-03-28 23:23:18 +02:00
parent c4c3e44e71
commit ef7a3c1602
7 changed files with 20 additions and 27 deletions
+4 -20
View File
@@ -10,26 +10,10 @@ import haxe.macro.Expr;
*/
class ScriptsMacro {
public static function addAdditionalClasses() {
Compiler.include("flixel");
Compiler.include("away3d");
Compiler.include("flx3d");
#if (sys && !web)
Compiler.include("sys");
#end
Compiler.include("DateTools");
Compiler.include("EReg");
Compiler.include("Lambda");
Compiler.include("StringBuf");
Compiler.include("haxe.crypto");
Compiler.include("haxe.display");
Compiler.include("haxe.exceptions");
#if !web
Compiler.include("haxe.extern");
#end
Compiler.include("scripting");
for(inc in ["flixel", "away3d", "flx3d", "sys", "DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting"]) {
Compiler.include(inc);
}
// FOR ABSTRACTS
Compiler.addGlobalMetadata('haxe.xml', '@:build(hscript.UsingHandler.build())');
}
-1
View File
@@ -52,7 +52,6 @@ class ModsFolderLibrary extends AssetLibrary implements ModsAssetLibrary {
var path = getAssetPath();
editedTimes[id] = FileSystem.stat(path).mtime.getTime();
var e = Bytes.fromFile(path);
cachedBytes.set(id, e);
return e;
}
+3 -3
View File
@@ -199,10 +199,10 @@ class Conductor
var oldStep = curStep;
var oldBeat = curBeat;
var oldMeasure = curMeasure;
if (curStep != (curStep = Std.int(curStepFloat))) {
if (curStep != (curStep = CoolUtil.floorInt(curStepFloat))) {
// updates step
__updateBeat = curBeat != (curBeat = Std.int(curBeatFloat));
__updateMeasure = __updateBeat && (curMeasure != (curMeasure = Std.int(curMeasureFloat)));
__updateBeat = curBeat != (curBeat = CoolUtil.floorInt(curBeatFloat));
__updateMeasure = __updateBeat && (curMeasure != (curMeasure = CoolUtil.floorInt(curMeasureFloat)));
if (curStep > oldStep) {
for(i in oldStep...curStep) {
+1 -2
View File
@@ -17,7 +17,7 @@ class GraphicCacheSprite extends FlxSprite {
public override function new() {
super();
alpha = 0.001;
alpha = 0.00001;
}
/**
@@ -44,7 +44,6 @@ class GraphicCacheSprite extends FlxSprite {
public override function draw() {
while (nonRenderedCachedGraphics.length > 0) {
trace("DRAWING GRAPHIC - ", nonRenderedCachedGraphics[0].key);
loadGraphic(nonRenderedCachedGraphics.shift());
drawComplex(FlxG.camera);
}
+2 -1
View File
@@ -1,5 +1,6 @@
package funkin.system;
import flixel.addons.transition.FlxTransitionableState;
import funkin.system.framerate.Framerate;
import funkin.scripting.DummyScript;
import flixel.FlxState;
@@ -11,7 +12,7 @@ import funkin.system.Conductor;
import flixel.addons.ui.FlxUIState;
import funkin.options.PlayerSettings;
class MusicBeatState extends FlxUIState implements IBeatReceiver
class MusicBeatState extends FlxTransitionableState implements IBeatReceiver
{
private var lastBeat:Float = 0;
private var lastStep:Float = 0;
@@ -7,6 +7,8 @@ class FlixelInfo extends FramerateCategory {
public override function __enterFrame(t:Int) {
if (alpha <= 0.05) return;
@:privateAccess {
var c:Int = 0;
for(_ in FlxG.bitmap._cache.keys())
@@ -18,6 +20,7 @@ class FlixelInfo extends FramerateCategory {
_text += '\nBitmaps Count: ${c}';
_text += '\nSounds Count: ${FlxG.sound.list.length}';
_text += '\nFlxG.game Childs Count: ${FlxG.game.numChildren}';
// _text += '\nCached objects count: ${cachedObjects}';
}
this.text.text = _text;
+7
View File
@@ -419,6 +419,13 @@ class CoolUtil
public static inline function maxInt(p1:Int, p2:Int)
return p1 < p2 ? p2 : p1;
public static inline function floorInt(e:Float) {
var r = Std.int(e);
if (e < 0 && r != e)
r--;
return r;
}
}
enum abstract CoolSfx(Int) from Int {