1
0
mirror of synced 2024-12-01 02:27:21 +01:00

Scale scroll speed to skin resolution to avoid widescreening, fix a crash while changing skins with different bar count in game

This commit is contained in:
0auBSQ 2022-12-24 10:23:53 +09:00
parent 1aff11fa65
commit 65922a29ab
3 changed files with 28 additions and 4 deletions

View File

@ -2545,6 +2545,8 @@ namespace TJAPlayer3
private void tバーの初期化() private void tバーの初期化()
{ {
stバー情報 = new STバー情報[TJAPlayer3.Skin.SongSelect_Bar_Count];
int barCenterNum = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2; int barCenterNum = (TJAPlayer3.Skin.SongSelect_Bar_Count - 1) / 2;
for ( int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++ ) for ( int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Count; i++ )
{ {

View File

@ -1773,7 +1773,7 @@ namespace TJAPlayer3
long time = pChip.n発声時刻ms - __dbt; long time = pChip.n発声時刻ms - __dbt;
float play_bpm_time = this.GetNowPBMTime(dTX, 0); float play_bpm_time = this.GetNowPBMTime(dTX, 0);
y += NotesManager.GetNoteX(pChip, time * pChip.dbBPM, _scrollSpeed, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, configIni.eScrollMode, false); y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, TJAPlayer3.Skin.Game_Notes_Interval, play_bpm_time, configIni.eScrollMode, false);
/* /*
if (TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.Normal) if (TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.Normal)

View File

@ -63,17 +63,39 @@ namespace TJAPlayer3
public static int GetNoteX(CDTX.CChip pChip, double timems, double scroll, int interval, float play_bpm_time, EScrollMode eScrollMode, bool roll) public static int GetNoteX(CDTX.CChip pChip, double timems, double scroll, int interval, float play_bpm_time, EScrollMode eScrollMode, bool roll)
{ {
double hbtime = ((roll ? pChip.fBMSCROLLTime_end : pChip.fBMSCROLLTime) - (play_bpm_time)); double hbtime = ((roll ? pChip.fBMSCROLLTime_end : pChip.fBMSCROLLTime) - (play_bpm_time));
double screen_ratio = TJAPlayer3.Skin.Resolution[0] / 1280.0;
switch (eScrollMode) switch (eScrollMode)
{ {
case EScrollMode.Normal: case EScrollMode.Normal:
return (int)((timems / 240000.0) * interval * scroll); return (int)((timems / 240000.0) * interval * scroll * screen_ratio);
case EScrollMode.BMSCROLL: case EScrollMode.BMSCROLL:
{ {
return (int)((hbtime / 16.0) * interval); return (int)((hbtime / 16.0) * interval * screen_ratio);
} }
case EScrollMode.HBSCROLL: case EScrollMode.HBSCROLL:
{ {
return (int)((hbtime / 16.0) * interval * scroll); return (int)((hbtime / 16.0) * interval * scroll * screen_ratio);
}
default:
return 0;
}
}
public static int GetNoteY(CDTX.CChip pChip, double timems, double scroll, int interval, float play_bpm_time, EScrollMode eScrollMode, bool roll)
{
double hbtime = ((roll ? pChip.fBMSCROLLTime_end : pChip.fBMSCROLLTime) - (play_bpm_time));
double screen_ratio = TJAPlayer3.Skin.Resolution[1] / 720.0;
switch (eScrollMode)
{
case EScrollMode.Normal:
return (int)((timems / 240000.0) * interval * scroll * screen_ratio);
case EScrollMode.BMSCROLL:
{
return (int)((hbtime / 16.0) * interval * screen_ratio);
}
case EScrollMode.HBSCROLL:
{
return (int)((hbtime / 16.0) * interval * scroll * screen_ratio);
} }
default: default:
return 0; return 0;