Hopefully fixed gpu images crash

This commit is contained in:
NeeEoo
2023-12-29 15:06:59 +01:00
parent e0e9a1b7ab
commit a4771d9340
4 changed files with 16 additions and 13 deletions
@@ -29,16 +29,18 @@ class OptimizedBitmapData extends BitmapData {
__isValid = true;
readable = true;
lock();
getTexture(FlxG.stage.context3D);
getSurface();
if(FlxG.stage.context3D != null) {
lock();
getTexture(FlxG.stage.context3D);
getSurface();
readable = true;
this.image = null;
readable = true;
this.image = null;
// @:privateAccess
// if (FlxG.bitmap.__doNotDelete)
// MemoryUtil.clearMinor();
// @:privateAccess
// if (FlxG.bitmap.__doNotDelete)
// MemoryUtil.clearMinor();
}
}
#end
}
+1 -1
View File
@@ -681,7 +681,7 @@ class PlayState extends MusicBeatState
MusicBeatState.skipTransIn = true;
camFollow.setPosition(smoothTransitionData.camFollowX, smoothTransitionData.camFollowY);
} else {
FlxG.camera.focusOn(camFollow.getPosition());
FlxG.camera.focusOn(camFollow.getPosition(FlxPoint.weak()));
}
smoothTransitionData = null;
+4 -3
View File
@@ -20,6 +20,8 @@ class Stage extends FlxBasic implements IBeatReceiver {
public var state:FlxState;
public var characterPoses:Map<String, StageCharPos> = [];
private var spritesParentFolder = "";
public function getSprite(name:String) {
return stageSprites[name];
}
@@ -45,7 +47,6 @@ class Stage extends FlxBasic implements IBeatReceiver {
}
if (stageXML != null) {
var spritesParentFolder = "";
if (PlayState.instance != null) {
if (stageXML.has.zoom) {
var parsed:Null<Float> = Std.parseFloat(stageXML.att.zoom);
@@ -55,7 +56,7 @@ class Stage extends FlxBasic implements IBeatReceiver {
}
if (stageXML.has.folder) {
spritesParentFolder = stageXML.att.folder;
if (spritesParentFolder.charAt(spritesParentFolder.length-1) != "/") spritesParentFolder = spritesParentFolder + "/";
if (!spritesParentFolder.endsWith("/")) spritesParentFolder += "/";
}
var elems = [];
@@ -246,7 +247,7 @@ class Stage extends FlxBasic implements IBeatReceiver {
var file:String = Path.withoutDirectory(Path.withoutExtension(path));
if (!list.contains(file)) list.push(file);
}
return list;
}
}
+1 -1
View File
@@ -160,6 +160,6 @@ class Strum extends FlxSprite {
centerOrigin();
}
public function getAnim() {
return animation.curAnim == null ? null : animation.curAnim.name;
return animation.name;
}
}