Optimizations

This commit is contained in:
Ne_Eo
2024-08-02 23:42:42 +02:00
parent d0bf0aa323
commit ffcc9e7476
31 changed files with 47 additions and 29 deletions
+1
View File
@@ -23,6 +23,7 @@ class Setup {
var CHECK_VSTUDIO = !args.existsOption("no-vscheck");
var REINSTALL_ALL = args.existsOption("reinstall");
var SILENT = args.existsOption("silent-progress");
// TODO: add only install missing libs
// to prevent messing with currently installed libs
if (!FileSystem.exists('.haxelib'))
+15
View File
@@ -94,5 +94,20 @@
</cmd>
</if>
<if cond="ne_eo">
<!-- Ignore this its only for Ne_Eo -->
<cmd>
<line>haxelib dev lime ../../lime</line>
<line>haxelib dev openfl ../../openfl</line>
<line>haxelib dev flixel ../../flixel</line>
<line>haxelib dev flixel-addons ../../flixel-addons</line>
<line>haxelib dev hscript-improved ../../hscript-improved</line>
<line>haxelib dev flxanimate ../../flxanimate</line>
<!-- <line>haxelib dev hxdiscord_rpc ../../hxdiscord_rpc</line> -->
<line>haxelib dev away3d ../../away3d</line>
<line>haxelib dev hxcpp ../../../hxcpp</line>
</cmd>
</if>
<print pretty="true">Setup for dev libs complete!</print>
</libraries>
+1 -1
View File
@@ -14,7 +14,7 @@ import flixel.FlxG;
* @see https://twitter.com/Ne_Eo_Twitch
*/
@:access(away3d.core.managers.Stage3DManager)
class Flx3DUtil
final class Flx3DUtil
{
#if THREE_D_SUPPORT
/**
+1 -1
View File
@@ -11,7 +11,7 @@ import sys.FileSystem;
using StringTools;
class Chart {
final class Chart {
/**
* Default background colors for songs without bg color
*/
+1 -1
View File
@@ -9,7 +9,7 @@ import openfl.Assets;
using StringTools;
class EventsData {
final class EventsData {
public static var defaultEventsList:Array<String> = ["HScript Call", "Camera Movement", "Add Camera Zoom", "Camera Modulo Change", "Camera Flash", "BPM Change", "Scroll Speed Change", "Alt Animation Toggle", "Play Animation"];
public static var defaultEventsParams:Map<String, Array<EventParamInfo>> = [
"HScript Call" => [
@@ -3,7 +3,7 @@ package funkin.backend.scripting;
import flixel.FlxState;
import funkin.backend.scripting.events.*;
class EventManager {
final class EventManager {
// map doesnt work for that
public static var eventValues:Array<CancellableEvent> = [];
public static var eventKeys:Array<Class<CancellableEvent>> = [];
@@ -2,7 +2,7 @@ package funkin.backend.system;
#if sys
import sys.FileSystem;
class CommandLineHandler {
final class CommandLineHandler {
public static function parseCommandLine(cmd:Array<String>) {
var i:Int = 0;
while(i < cmd.length) {
+1 -1
View File
@@ -6,7 +6,7 @@ import funkin.backend.utils.NativeAPI.ConsoleColor;
import funkin.backend.utils.NativeAPI;
import haxe.Log;
class Logs {
final class Logs {
private static var __showing:Bool = false;
public static var nativeTrace = Log.trace;
@@ -11,7 +11,7 @@ import lime.media.AudioManager;
* hi gray itsa me yoshicrafter29 i fixed it hehe
*/
@:dox(hide)
class AudioSwitchFix {
final class AudioSwitchFix {
@:noCompletion
private static function onStateSwitch(state:FlxState):Void {
#if windows
@@ -7,7 +7,7 @@ import openfl.errors.Error;
import openfl.events.ErrorEvent;
import openfl.events.UncaughtErrorEvent;
class CrashHandler {
final class CrashHandler {
public static function init() {
Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);
#if cpp
+1 -1
View File
@@ -5,7 +5,7 @@ import openfl.display.BitmapData;
import openfl.geom.Point;
import openfl.geom.Rectangle;
class BitmapUtil {
final class BitmapUtil {
/**
* Returns the most present color in a Bitmap.
* @param bmap Bitmap
+1 -1
View File
@@ -41,7 +41,7 @@ import openfl.geom.ColorTransform;
using StringTools;
@:allow(funkin.game.PlayState)
class CoolUtil
final class CoolUtil
{
public static function getLastExceptionStack():String {
return CallStack.toString(CallStack.exceptionStack());
+1 -1
View File
@@ -16,7 +16,7 @@ import lime.app.Application;
import sys.thread.Thread;
#end
class DiscordUtil
final class DiscordUtil
{
public static var currentID(default, set):String = null;
public static var discordThread:#if DISCORD_RPC Thread #else Dynamic #end = null;
+1 -1
View File
@@ -4,7 +4,7 @@ import flixel.util.FlxColor;
import flixel.math.FlxAngle;
import flixel.math.FlxPoint;
class DrawUtil {
final class DrawUtil {
public static var line:FlxSprite = null;
public static var dot:FlxSprite = null;
+1 -1
View File
@@ -3,7 +3,7 @@ package funkin.backend.utils;
import funkin.backend.scripting.MultiThreadedScript;
import funkin.backend.scripting.Script;
class EngineUtil {
final class EngineUtil {
/**
* Starts a new multithreaded script.
* This script will share all the variables with the current one, which means already existing callbacks will be replaced by new ones on conflict.
+1 -1
View File
@@ -2,7 +2,7 @@ package funkin.backend.utils;
import haxe.Http;
class HttpUtil
final class HttpUtil
{
public static var userAgent:String = "request";
public static function requestText(url:String)
+1 -1
View File
@@ -3,7 +3,7 @@ package funkin.backend.utils;
/**
* DOESNT SUPPORT CATEGORIES YET!!
*/
class IniUtil {
final class IniUtil {
public static inline function parseAsset(assetPath:String, ?defaultVariables:Map<String, String>)
return parseString(Assets.getText(assetPath), defaultVariables);
+1 -1
View File
@@ -3,7 +3,7 @@ package funkin.backend.utils;
import flixel.text.FlxText;
import flixel.util.FlxColor;
class MarkdownUtil {
final class MarkdownUtil {
public static function applyMarkdownText(text:FlxText, str:String) {
text.textField.htmlText = Markdown.markdownToHtml(prepareMarkdown(str));
var changes:Array<FlxTextFormatMarkerPair> = [
+1 -1
View File
@@ -2,7 +2,7 @@ package funkin.backend.utils;
import haxe.macro.Expr;
class MathUtil {
final class MathUtil {
/**
* Returns the maximum value in the arguments.
* @param args Array of values
+1 -1
View File
@@ -9,7 +9,7 @@ interface IPrePostDraw {
public function postDraw():Void;
}
class MatrixUtil {
final class MatrixUtil {
public static function getMatrixPosition(sprite:FlxSprite, points:OneOfTwo<FlxPoint, Array<FlxPoint>>, ?camera:FlxCamera, _width:Float = 1, _height:Float = 1):Array<FlxPoint>
{
//if(_width == -1) _width = sprite.width;
+1 -1
View File
@@ -14,7 +14,7 @@ import openfl.system.System;
using StringTools;
class MemoryUtil {
final class MemoryUtil {
public static var disableCount:Int = 0;
public static function askDisable() {
+1 -1
View File
@@ -14,7 +14,7 @@ package funkin.backend.utils;
* - The Function cannot be found in the NDLL
* then an empty function will be returned instead, and a message will be shown in logs.
*/
class NdllUtil {
final class NdllUtil {
#if NDLLS_SUPPORTED
#if windows public static final os:String = "windows"; #end
#if linux public static final os:String = "linux"; #end
@@ -2,7 +2,7 @@ package funkin.backend.utils;
import openfl.display.Sprite;
class ShaderResizeFix {
final class ShaderResizeFix {
public static var doResizeFix:Bool = true;
public static function init() {
@@ -3,7 +3,7 @@ package funkin.backend.utils;
/**
* All types of utils only usable in a sorted array.
*/
class SortedArrayUtil {
final class SortedArrayUtil {
/**
* Gets the index of a possible new element of an Array of T using an efficient algorithm.
* @param array Array of T to check in
+1 -1
View File
@@ -1,7 +1,7 @@
package funkin.backend.utils;
#if ALLOW_MULTITHREADING
class ThreadUtil {
final class ThreadUtil {
/**
* Creates a new Thread with an error handler.
* @param func Function to execute
+1 -1
View File
@@ -2,7 +2,7 @@ package funkin.backend.utils;
import openfl.Lib;
class WindowUtils {
final class WindowUtils {
public static var winTitle(default, set):String;
private static function set_winTitle(value:String):String {
winTitle = value;
+1 -1
View File
@@ -15,7 +15,7 @@ typedef TextFormat = { text:String, format:Dynamic }
/**
* Class made to make XML parsing easier.
*/
class XMLUtil {
final class XMLUtil {
/**
* Applies a property XML node to an object.
+1 -1
View File
@@ -23,7 +23,7 @@ using StringTools;
// import ZipUtils; ZipUtils.uncompressZip(ZipUtils.openZip("E:\\Desktop\\test\\termination lua.ycemod"), "E:\\Desktop\\test\\uncompressed\\");
// import ZipUtils; var e = ZipUtils.createZipFile("gjnsdghs.ycemod"); ZipUtils.writeFolderToZip(e, "./mods/Friday Night Funkin'/", "Friday Night Funkin'/"); e.flush(); e.close();
class ZipUtil {
final class ZipUtil {
public static var bannedNames:Array<String> = [".git", ".gitignore", ".github", ".vscode", ".gitattributes", "readme.txt"];
/**
+2 -1
View File
@@ -2,7 +2,8 @@ package funkin.backend.utils.native;
#if linux
@:cppFileCode("#include <stdio.h>")
class Linux {
@:dox(hide)
final class Linux {
@:functionCode('
FILE *meminfo = fopen("/proc/meminfo", "r");
+2 -1
View File
@@ -5,7 +5,8 @@ import funkin.backend.utils.NativeAPI.CodeCursor;
import openfl.ui.Mouse;
@:headerInclude('sys/sysctl.h')
class Mac
@:dox(hide)
final class Mac
{
@:functionCode('
int mib [] = { CTL_HW, HW_MEMSIZE };
@@ -114,7 +114,7 @@ class AudioFixClient : public IMMNotificationClient {
AudioFixClient *curAudioFix;
')
@:dox(hide)
class Windows {
final class Windows {
public static var __audioChangeCallback:Void->Void = function() {
trace("test");