Merge branch 'main' into new-editors

This commit is contained in:
⍚~Nex
2024-09-20 14:40:25 +02:00
23 changed files with 201 additions and 78 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class FlxAnimate extends flxanimate.FlxAnimate {
for (camera in cameras)
{
rMatrix.identity();
rMatrix.translate(-limb.offset.x, -limb.offset.y);
limb.prepareMatrix(rMatrix, FlxFrameAngle.ANGLE_0, _checkFlipX() != camera.flipX, _checkFlipY() != camera.flipY);
rMatrix.concat(_rMatrix);
if (!camera.visible || !camera.exists || !limbOnScreen(limb, _rMatrix, camera))
return;
+1 -1
View File
@@ -64,7 +64,7 @@ class HScript extends Script {
}
private function importFailedCallback(cl:Array<String>):Bool {
if(_importFailedCallback(cl, "") || _importFailedCallback(cl, "source/")) {
if(_importFailedCallback(cl, "source/") || _importFailedCallback(cl, "")) {
return true;
}
return false;
+1 -1
View File
@@ -283,7 +283,7 @@ class Script extends FlxBasic implements IFlxDestroyable {
public function get(variable:String):Dynamic {return null;}
/**
* Gets the variable `variable` from the script's variables.
* Sets the variable `variable` from the script's variables.
* @param variable Name of the variable.
* @return Variable (or null if it doesn't exists)
*/
@@ -0,0 +1,23 @@
package funkin.backend.scripting.events;
import funkin.game.SplashGroup;
import funkin.game.Strum;
final class SplashShowEvent extends CancellableEvent {
/**
Splash name/type
**/
public var splashName:String;
/**
Splash that is shown
**/
public var splash:FunkinSprite;
/**
Strum that the splash is shown on
**/
public var strum:Strum;
/**
Splash group that the splash is from
**/
public var group:SplashGroup;
}
+11 -12
View File
@@ -438,34 +438,33 @@ uniform sampler2D bitmap;
uniform bool hasTransform;
uniform bool hasColorTransform;
vec4 flixel_texture2D(sampler2D bitmap, vec2 coord)
{
vec4 color = texture2D(bitmap, coord);
if (!hasTransform)
{
vec4 applyFlixelEffects(vec4 color) {
if (!hasTransform) {
return color;
}
if (color.a == 0.0)
{
if (color.a == 0.0) {
return vec4(0.0, 0.0, 0.0, 0.0);
}
if (!hasColorTransform)
{
if (!hasColorTransform) {
return color * openfl_Alphav;
}
color = vec4(color.rgb / color.a, color.a);
color.rgb = color.rgb / color.a;
color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0);
if (color.a > 0.0)
{
if (color.a > 0.0) {
return vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);
}
return vec4(0.0, 0.0, 0.0, 0.0);
}
vec4 flixel_texture2D(sampler2D bitmap, vec2 coord) {
vec4 color = texture2D(bitmap, coord);
return applyFlixelEffects(color);
}
uniform vec4 _camSize;
float map(float value, float min1, float max1, float min2, float max2) {
@@ -75,34 +75,13 @@ class EventMacro {
// add a "set this" expr for each variable
for(v in values) {
var name = v.name;
exprs.push({
pos: Context.currentPos(),
expr: EBinop(OpAssign, {
pos: Context.currentPos(),
expr: EField({
pos: Context.currentPos(),
expr: EConst(CIdent("this"))
}, name)
}, {
pos: Context.currentPos(),
expr: EConst(CIdent(name))
})
});
exprs.push(macro this.$name = $i{name});
}
// add a "set this" expr to reset each private/hidden variables
for(v in hiddenValues) {
var name = v.name;
exprs.push({
pos: Context.currentPos(),
expr: EBinop(OpAssign, {
pos: Context.currentPos(),
expr: EField({
pos: Context.currentPos(),
expr: EConst(CIdent("this"))
}, name)
}, v.expr)
});
exprs.push(macro this.$name = ${v.expr});
}
exprs.push(macro return this);
+11 -1
View File
@@ -117,7 +117,17 @@ final class MemoryUtil {
22 => "DDR2 FB-DIMM",
24 => "DDR3",
25 => "FBD2",
26 => "DDR4"
26 => "DDR4",
27 => "LPDDR",
28 => "LPDDR2",
29 => "LPDDR3",
30 => "LPDDR4",
31 => "Logical Non-volatile device",
32 => "HBM",
33 => "HBM2",
34 => "DDR5",
35 => "LPDDR5",
36 => "HBM3",
];
var memoryOutput:Int = -1;