mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
Merge 0cf1992b70
into d31ef12363
This commit is contained in:
commit
fc2b654b88
3 changed files with 55 additions and 0 deletions
14
alsoft.txt
Normal file
14
alsoft.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
[general]
|
||||
sample-type=float32
|
||||
stereo-mode=speakers
|
||||
stereo-encoding=panpot
|
||||
hrtf=false
|
||||
cf_level=0
|
||||
resampler=fast_bsinc24
|
||||
front-stablizer=false
|
||||
output-limiter=false
|
||||
volume-adjust=0
|
||||
[decoder]
|
||||
hq-mode=false
|
||||
distance-comp=false
|
||||
nfc=false
|
10
project.hxp
10
project.hxp
|
@ -299,6 +299,7 @@ class Project extends HXProject {
|
|||
configureHaxelibs();
|
||||
configureAssets();
|
||||
configureIcons();
|
||||
configureALSoft();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -792,6 +793,15 @@ class Project extends HXProject {
|
|||
addIcon("art/iconOG.png");
|
||||
}
|
||||
|
||||
/**
|
||||
* For desktop platforms, copy the OpenALSoft config file into the build to improve audio quality.
|
||||
*/
|
||||
function configureALSoft() {
|
||||
if (isDesktop()) {
|
||||
addAsset("alsoft.txt", 'plugins/alsoft.${isWindows() ? "ini" : "conf"}', "default", false);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// HELPER FUNCTIONS
|
||||
// Easy functions to make the code more readable.
|
||||
|
|
31
source/funkin/audio/ALSoftConfig.hx
Normal file
31
source/funkin/audio/ALSoftConfig.hx
Normal file
|
@ -0,0 +1,31 @@
|
|||
package funkin.audio;
|
||||
|
||||
import haxe.io.Path;
|
||||
|
||||
/*
|
||||
* A class that simply points OpenALSoft to a custom configuration file when
|
||||
* the game starts up.
|
||||
*
|
||||
* The config overrides a few global OpenALSoft settings with the aim of
|
||||
* improving audio quality on desktop targets.
|
||||
*/
|
||||
class ALSoftConfig
|
||||
{
|
||||
#if desktop
|
||||
static function __init__():Void
|
||||
{
|
||||
var origin:String = #if hl Sys.getCwd() #else Sys.programPath() #end;
|
||||
|
||||
var configPath:String = Path.directory(Path.withoutExtension(origin));
|
||||
#if windows
|
||||
configPath += "/plugins/alsoft.ini";
|
||||
#elseif mac
|
||||
configPath = Path.directory(configPath) + "/Resources/plugins/alsoft.conf";
|
||||
#else
|
||||
configPath += "/plugins/alsoft.conf";
|
||||
#end
|
||||
|
||||
Sys.putEnv("ALSOFT_CONF", configPath);
|
||||
}
|
||||
#end
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue