moved nativeapi

This commit is contained in:
Yoshman29
2023-03-31 15:23:15 +02:00
parent cb94dd7208
commit 5eb5ca4d17
22 changed files with 29 additions and 29 deletions

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 355 KiB

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

+1 -1
View File
@@ -24,7 +24,7 @@ import away3d.loaders.misc.AssetLoaderContext;
import openfl.Assets;
import away3d.entities.Mesh;
import away3d.loaders.Loader3D;
import funkin.windows.WindowsAPI.ConsoleColor;
import funkin.native.NativeAPI.ConsoleColor;
import flixel.FlxCamera;
import away3d.containers.View3D;
+1 -1
View File
@@ -24,7 +24,7 @@ import away3d.loaders.misc.AssetLoaderContext;
import openfl.Assets;
import away3d.entities.Mesh;
import away3d.loaders.Loader3D;
import funkin.windows.WindowsAPI.ConsoleColor;
import funkin.native.NativeAPI.ConsoleColor;
// FlxView3D with helpers for easier updating
+3 -3
View File
@@ -3,7 +3,7 @@ package funkin.editors;
import funkin.options.type.*;
import funkin.options.OptionsScreen;
import funkin.options.TreeMenu;
import funkin.windows.WindowsAPI;
import funkin.utils.NativeAPI;
class DebugOptions extends TreeMenu {
public override function create() {
@@ -33,8 +33,9 @@ class DebugOptionsScreen extends OptionsScreen {
"Show Console",
"Select this to show the debug console, which contains log information about the game.",
function() {
WindowsAPI.allocConsole();
NativeAPI.allocConsole();
}));
#end
add(new Checkbox(
"Enable Editor SFXs",
"If checked, will play sound effects when working on editors (ex: will play sfxs when checking checkboxes...)",
@@ -43,6 +44,5 @@ class DebugOptionsScreen extends OptionsScreen {
"Resizable Editors",
"If checked, editors will be resizable and extensible like other programs instead of zooming in upon maximization.",
"resizableEditors"));
#end
}
}
+4 -4
View File
@@ -3,8 +3,8 @@ package funkin.system;
import flixel.system.debug.log.LogStyle;
import flixel.system.frontEnds.LogFrontEnd;
import haxe.Log;
import funkin.windows.WindowsAPI;
import funkin.windows.WindowsAPI.ConsoleColor;
import funkin.utils.NativeAPI;
import funkin.utils.NativeAPI.ConsoleColor;
class Logs {
private static var __showing:Bool = false;
@@ -83,10 +83,10 @@ class Logs {
}
__showing = true;
for(t in text) {
WindowsAPI.setConsoleColors(t.color);
NativeAPI.setConsoleColors(t.color);
Sys.print(t.text);
}
WindowsAPI.setConsoleColors();
NativeAPI.setConsoleColors();
Sys.print("\r\n");
__showing = false;
#else
+2 -2
View File
@@ -5,7 +5,7 @@ import openfl.utils.AssetLibrary;
import openfl.utils.AssetCache;
import openfl.text.TextFormat;
import flixel.system.ui.FlxSoundTray;
import funkin.windows.WindowsAPI;
import funkin.utils.NativeAPI;
import funkin.menus.BetaWarningState;
import funkin.menus.TitleState;
import funkin.game.Highscore;
@@ -59,7 +59,7 @@ class Main extends Sprite
public static function main():Void
{
#if windows WindowsAPI.setDarkMode(true); #end
#if windows NativeAPI.setDarkMode(true); #end
Lib.current.addChild(instance = new Main());
}
+1 -1
View File
@@ -1,6 +1,6 @@
package funkin.system.framerate;
import funkin.native.HiddenProcess;
import funkin.utils.native.HiddenProcess;
import funkin.utils.MemoryUtil;
using StringTools;
@@ -3,7 +3,7 @@ package funkin.system.modules;
import lime.media.AudioManager;
import flixel.system.FlxSound;
import flixel.FlxState;
import funkin.windows.WindowsAPI;
import funkin.utils.NativeAPI;
/**
* if youre stealing this keep this comment at least please lol
@@ -56,7 +56,7 @@ class AudioSwitchFix {
public static function init() {
#if windows
WindowsAPI.registerAudio();
NativeAPI.registerAudio();
FlxG.signals.preStateCreate.add(onStateSwitch);
#end
}
+2 -2
View File
@@ -1,7 +1,7 @@
package funkin.system.modules;
import lime.system.System;
import funkin.windows.WindowsAPI;
import funkin.utils.NativeAPI;
import openfl.Lib;
import openfl.events.UncaughtErrorEvent;
import openfl.events.ErrorEvent;
@@ -48,7 +48,7 @@ class CrashHandler {
e.stopPropagation();
e.stopImmediatePropagation();
WindowsAPI.showMessageBox("Codename Engine Crash Handler", 'Uncaught Error:$m\n\n$stackLabel', MSG_ERROR);
NativeAPI.showMessageBox("Codename Engine Crash Handler", 'Uncaught Error:$m\n\n$stackLabel', MSG_ERROR);
#if sys
Sys.exit(1);
#end
+4 -4
View File
@@ -1,6 +1,6 @@
package funkin.utils;
import funkin.native.HiddenProcess;
import funkin.utils.native.HiddenProcess;
#if cpp
import cpp.vm.Gc;
#elseif hl
@@ -66,11 +66,11 @@ class MemoryUtil {
public static function getTotalMem():Float
{
#if windows
return funkin.native.Windows.getTotalRam();
return funkin.utils.native.Windows.getTotalRam();
#elseif mac
return funkin.native.Mac.getTotalRam();
return funkin.utils.native.Mac.getTotalRam();
#elseif linux
return funkin.native.Linux.getTotalRam();
return funkin.utils.native.Linux.getTotalRam();
#else
return 0;
#end
@@ -1,14 +1,14 @@
package funkin.windows;
package funkin.utils;
import funkin.native.*;
import funkin.utils.native.*;
/**
* Class for Windows-only functions, such as transparent windows, message boxes, and more.
* Does not have any effect on other platforms.
*/
class WindowsAPI {
class NativeAPI {
@:dox(hide) public static function registerAudio() {
#if windows
Windows.registerAudio();
@@ -1,4 +1,4 @@
package funkin.native;
package funkin.utils.native;
#if cpp
/*
@@ -1,4 +1,4 @@
package funkin.native;
package funkin.utils.native;
#if linux
@:cppFileCode("#include <stdio.h>")
@@ -1,4 +1,4 @@
package funkin.native;
package funkin.utils.native;
#if mac
@:cppFileCode("#include <sys/sysctl.h>")
@@ -1,6 +1,6 @@
package funkin.native;
package funkin.utils.native;
import funkin.windows.WindowsAPI.MessageBoxIcon;
import funkin.utils.NativeAPI.MessageBoxIcon;
#if windows
@:buildXml('
<target id="haxe">
+1 -1
View File
@@ -529,7 +529,7 @@ class System
// executes first!!
#if sys
funkin.windows.WindowsAPI.registerAsDPICompatible();
funkin.native.NativeAPI.registerAsDPICompatible();
funkin.system.CommandLineHandler.parseCommandLine(Sys.args());
#end