1
0
mirror of synced 2024-11-24 07:30:21 +01:00

タワーの終了演出とノーツの描画を修正 (#573)

This commit is contained in:
Takkkom 2024-02-14 20:06:37 +09:00 committed by GitHub
parent ce59131d69
commit 0daa0a5da1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 48 additions and 139 deletions

View File

@ -59,6 +59,11 @@ namespace FDK
/// </summary>
private static int ColorID;
/// <summary>
/// 拡大率のハンドル
/// </summary>
private static int ScaleID;
/// <summary>
/// テクスチャの切り抜きのハンドル
/// </summary>
@ -66,6 +71,8 @@ namespace FDK
private static int CameraID;
private static int NoteModeID;
/// <summary>
/// 描画に使用する共通のバッファを作成
/// </summary>
@ -100,12 +107,23 @@ namespace FDK
uniform vec4 color;
uniform sampler2D texture1;
uniform vec4 textureRect;
uniform vec2 scale;
uniform bool noteMode;
varying vec2 texcoord;
void main()
{
vec2 rect = vec2(textureRect.xy + (texcoord * textureRect.zw));
vec2 rect;
if (noteMode)
{
rect = textureRect.xy + (texcoord * textureRect.zw * scale);
rect = rect - (floor((rect - textureRect.xy) / textureRect.zw) * textureRect.zw);
}
else
{
rect = vec2(textureRect.xy + (texcoord * textureRect.zw));
}
gl_FragColor = texture2D(texture1, rect) * color;
}"
);
@ -114,8 +132,10 @@ namespace FDK
//シェーダーに値を送るためのハンドルを取得------
MVPID = Game.Gl.GetUniformLocation(ShaderProgram, "mvp"); //拡大縮小、移動、回転のMatrix
ColorID = Game.Gl.GetUniformLocation(ShaderProgram, "color"); //色合い
ScaleID = Game.Gl.GetUniformLocation(ShaderProgram, "scale"); //スケール
TextureRectID = Game.Gl.GetUniformLocation(ShaderProgram, "textureRect"); //テクスチャの切り抜きの座標と大きさ
CameraID = Game.Gl.GetUniformLocation(ShaderProgram, "camera"); //テクスチャの切り抜きの座標と大きさ
NoteModeID = Game.Gl.GetUniformLocation(ShaderProgram, "noteMode"); //テクスチャの切り抜きの座標と大きさ
//------
@ -580,9 +600,13 @@ namespace FDK
{
this.t2D描画(x - (rc画像内の描画領域.Width / 2), y - (rc画像内の描画領域.Height), rc画像内の描画領域);
//this.t2D描画(devicek x, y, rc画像内の描画領域;
}
public void t2D_DisplayImage_RollNote(int x, int y, RectangleF rc)
{
this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc, true);
}
public void t2D拡大率考慮中央基準描画(int x, int y)
{
this.t2D描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像);
@ -699,7 +723,7 @@ namespace FDK
{
this.t2D描画((int)x, (int)y, 1f, rc画像内の描画領域);
}
public void t2D描画(float x, float y, float depth, RectangleF rc画像内の描画領域, bool flipX = false, bool flipY = false)
public void t2D描画(float x, float y, float depth, RectangleF rc画像内の描画領域, bool flipX = false, bool flipY = false, bool rollMode = false)
{
this.color4.Alpha = this._opacity / 255f;
@ -729,7 +753,6 @@ namespace FDK
Game.Gl.UseProgram(ShaderProgram);//Uniform4よりこれが先
//Game.Gl.Uniform1(Texture1ID, Texture_);
Game.Gl.BindTexture(TextureTarget.Texture2D, Texture_); //テクスチャをバインド
//MVPを設定----
@ -766,12 +789,14 @@ namespace FDK
//------
Game.Gl.Uniform4(ColorID, new System.Numerics.Vector4(color4.Red, color4.Green, color4.Blue, color4.Alpha)); //変色用のカラーを設定
//テクスチャの切り抜きの座標と大きさを設定
Game.Gl.Uniform2(ScaleID, new System.Numerics.Vector2(vcScaleRatio.X, vcScaleRatio.Y)); //変色用のカラーを設定
//テクスチャの切り抜きの座標と大きさを設定
Game.Gl.Uniform4(TextureRectID, new System.Numerics.Vector4(
rc画像内の描画領域.X / rc全画像.Width, rc画像内の描画領域.Y / rc全画像.Height, //始まり
rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない
rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない
Game.Gl.Uniform1(NoteModeID, rollMode ? 1 : 0);
//描画-----
Game.Gl.BindVertexArray(VAO);
@ -921,14 +946,16 @@ namespace FDK
Game.Gl.UniformMatrix4(CameraID, 1, false, (float*)&camera);
}
//------
Game.Gl.Uniform4(ColorID, new System.Numerics.Vector4(color4.Red, color4.Green, color4.Blue, color4.Alpha)); //変色用のカラーを設定
//テクスチャの切り抜きの座標と大きさを設定
Game.Gl.Uniform4(ColorID, new System.Numerics.Vector4(color4.Red, color4.Green, color4.Blue, color4.Alpha)); //変色用のカラーを設定
Game.Gl.Uniform2(ScaleID, new System.Numerics.Vector2(vcScaleRatio.X, vcScaleRatio.Y)); //変色用のカラーを設定
//テクスチャの切り抜きの座標と大きさを設定
Game.Gl.Uniform4(TextureRectID, new System.Numerics.Vector4(
rc画像内の描画領域.X / rc全画像.Width, rc画像内の描画領域.Y / rc全画像.Height, //始まり
rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない
rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない
Game.Gl.Uniform1(NoteModeID, 0);
//描画-----
Game.Gl.BindVertexArray(VAO);

View File

@ -761,63 +761,6 @@ namespace TJAPlayer3
#endregion
#region
End_Clear_Chara = TxC(GAME + END + @$"Clear_Chara.png");
End_Star = TxC(GAME + END + @$"Star.png");
End_Clear_Text = new CTexture[2];
End_Clear_Text[0] = TxC(GAME + END + @$"Clear_Text.png");
End_Clear_Text[1] = TxC(GAME + END + @$"Clear_Text_End.png");
End_Clear_L = new CTexture[5];
End_Clear_R = new CTexture[5];
for (int i = 0; i < 5; i++)
{
End_Clear_L[i] = TxC(GAME + END + @$"Clear{Path.DirectorySeparatorChar}" + @$"Clear_L_" + i.ToString() + ".png");
End_Clear_R[i] = TxC(GAME + END + @$"Clear{Path.DirectorySeparatorChar}" + @$"Clear_R_" + i.ToString() + ".png");
}
End_Clear_Text_ = TxC(GAME + END + @$"Clear{Path.DirectorySeparatorChar}" + @$"Clear_Text.png");
End_Clear_Text_Effect = TxC(GAME + END + @$"Clear{Path.DirectorySeparatorChar}" + @$"Clear_Text_Effect.png");
if (End_Clear_Text_Effect != null) End_Clear_Text_Effect.b加算合成 = true;
ClearFailed = TxC(GAME + END + @$"ClearFailed{Path.DirectorySeparatorChar}" + "Clear_Failed.png");
ClearFailed1 = TxC(GAME + END + @$"ClearFailed{Path.DirectorySeparatorChar}" + "Clear_Failed1.png");
ClearFailed2 = TxC(GAME + END + @$"ClearFailed{Path.DirectorySeparatorChar}" + "Clear_Failed2.png");
End_ClearFailed = new CTexture[26];
for (int i = 0; i < 26; i++)
End_ClearFailed[i] = TxC(GAME + END + @$"ClearFailed{Path.DirectorySeparatorChar}" + i.ToString() + ".png");
End_FullCombo = new CTexture[67];
for (int i = 0; i < 67; i++)
End_FullCombo[i] = TxC(GAME + END + @$"FullCombo{Path.DirectorySeparatorChar}" + i.ToString() + ".png");
End_FullComboLoop = new CTexture[3];
for (int i = 0; i < 3; i++)
End_FullComboLoop[i] = TxC(GAME + END + @$"FullCombo{Path.DirectorySeparatorChar}" + "loop_" + i.ToString() + ".png");
End_DondaFullComboBg = TxC(GAME + END + @$"DondaFullCombo{Path.DirectorySeparatorChar}" + "bg.png");
End_DondaFullCombo = new CTexture[62];
for (int i = 0; i < 62; i++)
End_DondaFullCombo[i] = TxC(GAME + END + @$"DondaFullCombo{Path.DirectorySeparatorChar}" + i.ToString() + ".png");
End_DondaFullComboLoop = new CTexture[3];
for (int i = 0; i < 3; i++)
End_DondaFullComboLoop[i] = TxC(GAME + END + @$"DondaFullCombo{Path.DirectorySeparatorChar}" + "loop_" + i.ToString() + ".png");
End_Goukaku = new CTexture[3];
for (int i = 0; i < End_Goukaku.Length; i++)
{
End_Goukaku[i] = TxC(GAME + END + @$"Dan" + i.ToString() + ".png");
}
#endregion
#region GameMode
GameMode_Timer_Tick = TxC(GAME + GAMEMODE + @$"Timer_Tick.png");
@ -2877,27 +2820,6 @@ namespace TJAPlayer3
Lane_Background_Sub,
Lane_Background_GoGo;
#endregion
#region
public CTexture End_Clear_Chara;
public CTexture[] End_Clear_Text;
public CTexture End_Star;
public CTexture[] End_Clear_L,
End_Clear_R,
End_ClearFailed,
End_FullCombo,
End_FullComboLoop,
End_DondaFullCombo,
End_DondaFullComboLoop,
End_Goukaku;
public CTexture End_Clear_Text_,
End_Clear_Text_Effect,
ClearFailed,
ClearFailed1,
ClearFailed2,
End_DondaFullComboBg;
#endregion
#region
public CTexture GameMode_Timer_Frame,
GameMode_Timer_Tick;

View File

@ -71,7 +71,6 @@ namespace TJAPlayer3
{
this.dbFailedTime = TJAPlayer3.Timer.NowTime;
this.ct進行 = new CCounter( 0, 300, 22, TJAPlayer3.Timer );
this.ctEnd_ClearFailed = new CCounter(0, 69, 30, TJAPlayer3.Timer);
if ( TJAPlayer3.ConfigIni.eGameMode != EGame.OFF )
{
this.ct進行 = new CCounter( 0, 4000, 2, TJAPlayer3.Timer );
@ -125,23 +124,6 @@ namespace TJAPlayer3
{
int[] y = new int[] { 0, 176 };
this.ctEnd_ClearFailed.Tick();
if (this.ctEnd_ClearFailed.CurrentValue <= 20 || TJAPlayer3.Tx.ClearFailed == null)
{
TJAPlayer3.Tx.End_ClearFailed[Math.Min(this.ctEnd_ClearFailed.CurrentValue, TJAPlayer3.Tx.End_ClearFailed.Length - 1)]?.t2D描画(505, y[i] + 145);
}
else if(this.ctEnd_ClearFailed.CurrentValue >= 20 && this.ctEnd_ClearFailed.CurrentValue <= 67)
{
TJAPlayer3.Tx.ClearFailed?.t2D描画(502, y[i] + 192);
}
else if (this.ctEnd_ClearFailed.CurrentValue == 68)
{
TJAPlayer3.Tx.ClearFailed1?.t2D描画(502, y[i] + 192);
}
else if (this.ctEnd_ClearFailed.CurrentValue >= 69)
{
TJAPlayer3.Tx.ClearFailed2?.t2D描画(502, y[i] + 192);
}
}
#endregion
@ -251,7 +233,6 @@ namespace TJAPlayer3
private bool failedSongPlayed;
private CSound soundFailed;
private CCounter ctEnd_ClearFailed;
//private CTexture txStageFailed;
// private CTexture txGameFailed;
// private CTexture txBlack;

View File

@ -593,7 +593,7 @@ namespace TJAPlayer3
{
base.IsFirstDraw = false;
}
if (this.ct進行メイン != null && (TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut))
if (this.ct進行メイン != null && (TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_FAILED || TJAPlayer3.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut))
{
this.ct進行メイン.Tick();
@ -898,29 +898,6 @@ namespace TJAPlayer3
Dan_Gold_Perfect
}
void StarDraw(int x, int y, int count, int starttime = 0, int Endtime = 20)
{
if (count >= 0 && count <= Endtime)
{
count += starttime;
if (count <= 11)
{
TJAPlayer3.Tx.End_Star.vcScaleRatio.X = count * 0.09f;
TJAPlayer3.Tx.End_Star.vcScaleRatio.Y = count * 0.09f;
TJAPlayer3.Tx.End_Star.Opacity = 255;
TJAPlayer3.Tx.End_Star.t2D拡大率考慮中央基準描画(x, y);
}
else if (count <= 20)
{
TJAPlayer3.Tx.End_Star.vcScaleRatio.X = 1.0f;
TJAPlayer3.Tx.End_Star.vcScaleRatio.Y = 1.0f;
TJAPlayer3.Tx.End_Star.Opacity = (int)(255 - (255.0f / 9.0f) * (count - 11));
TJAPlayer3.Tx.End_Star.t2D拡大率考慮中央基準描画(x, y);
}
}
}
//-----------------
#endregion
}

View File

@ -448,8 +448,9 @@ namespace TJAPlayer3
|| (TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower && CFloorManagement.CurrentNumberOfLives <= 0))
&& ( base.ePhaseID == CStage.EPhase.Common_NORMAL ))
{
this.actStageFailed.Start();
TJAPlayer3.DTX.t全チップの再生停止();
this.actStageFailed.Start();
this.actEnd.Start();
TJAPlayer3.DTX.t全チップの再生停止();
base.ePhaseID = CStage.EPhase.Game_STAGE_FAILED;
}
@ -600,7 +601,6 @@ namespace TJAPlayer3
this.t全体制御メソッド();
this.actPauseMenu.t進行描画();
//this.actEnd.On進行描画();
this.t進行描画_STAGEFAILED();
@ -619,7 +619,9 @@ namespace TJAPlayer3
for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++)
{
if (!ifp[i]) bIsFinishedPlaying = false;
}
}
this.actPauseMenu.t進行描画();
//演奏終了→演出表示→フェードアウト
if ( bIsFinishedPlaying && base.ePhaseID == CStage.EPhase.Common_NORMAL )

View File

@ -451,7 +451,7 @@ namespace TJAPlayer3
var _center_x = (x + x末端 + image_size) / 2;
var _center_y = _adjust + (y + y末端) / 2;
//TJAPlayer3.Tx.Notes[(int)_gt].t2D描画(_x0, _y0, new Rectangle(rollOrigin + TJAPlayer3.Skin.Game_Notes_Size[0] + _offset, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1]));
_texarr.t2D拡大率考慮中央基準描画((int)_center_x, (int)_center_y, new Rectangle(rollOrigin + TJAPlayer3.Skin.Game_Notes_Size[0] + _offset, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1]));
_texarr.t2D_DisplayImage_RollNote((int)_center_x, (int)_center_y, new Rectangle(rollOrigin + TJAPlayer3.Skin.Game_Notes_Size[0] + _offset, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1]));
//t2D拡大率考慮中央基準描画 t2D中心基準描画
// Tail