1
0
mirror of synced 2024-11-12 01:50:47 +01:00

マイナーフィックス (#518)

* スクリーンショットの透明度の問題を修正

* メモリリークの修正
This commit is contained in:
Takkkom 2023-11-03 18:01:54 +09:00 committed by GitHub
parent 241af47ec9
commit f299b433ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View File

@ -149,15 +149,15 @@ namespace SampleFramework
public unsafe void GetScreenPixelsASync(Action<SKBitmap> action)
{
uint[] pixels = new uint[(uint)ViewportWidth * (uint)ViewportHeight];
byte[] pixels = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4];
Gl.ReadBuffer(GLEnum.Front);
fixed(uint* pix = pixels)
fixed(byte* pix = pixels)
{
Gl.ReadPixels(0, 0, (uint)ViewportWidth, (uint)ViewportHeight, GLEnum.Bgra, GLEnum.UnsignedByte, pix);
}
Task.Run(() =>{
fixed(uint* pixels2 = new uint[(uint)ViewportWidth * (uint)ViewportHeight])
fixed(byte* pixels2 = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4])
{
for(int x = 0; x < ViewportWidth; x++)
{
@ -165,8 +165,10 @@ namespace SampleFramework
{
int pos = x + ((y - 1) * ViewportWidth);
int pos2 = x + ((ViewportHeight - y) * ViewportWidth);
var p = pixels[pos2];
pixels2[pos] = p;
pixels2[(pos * 4) + 0] = pixels[(pos2 * 4) + 0];
pixels2[(pos * 4) + 1] = pixels[(pos2 * 4) + 1];
pixels2[(pos * 4) + 2] = pixels[(pos2 * 4) + 2];
pixels2[(pos * 4) + 3] = 255;
}
}

View File

@ -138,7 +138,14 @@ namespace TJAPlayer3
Task.Run(() =>
{
this.list進行文字列.Add("LOADING TEXTURES...");
TJAPlayer3.Tx.LoadTexture();
try
{
TJAPlayer3.Tx.LoadTexture();
}
catch(Exception exception)
{
Trace.TraceError( exception.ToString() );
}
this.list進行文字列.Add("LOADING TEXTURES...OK");
this.str現在進行中 = "Setup done.";
this.eフェーズID = Eフェーズ.7_;

View File

@ -45,6 +45,8 @@ namespace TJAPlayer3
public override void DeActivate()
{
TJAPlayer3.tテクスチャの解放(ref Mob);
base.DeActivate();
}