danoniplus 41.4.10 → 41.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/js/danoni_main.js +22 -7
  2. package/package.json +1 -1
package/js/danoni_main.js CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2025/09/21
7
+ * Revised : 2025/12/30
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 41.4.10`;
12
- const g_revisedDate = `2025/09/21`;
11
+ const g_version = `Ver 41.4.12`;
12
+ const g_revisedDate = `2025/12/30`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -115,6 +115,9 @@ const waitUntilLoaded = () => {
115
115
  // fps(デフォルトは60)
116
116
  let g_fps = 60;
117
117
 
118
+ // プレイ画面再生時の内部スケジューリング用のマージン時間(100ms)
119
+ let g_scheduleLead = 0.1;
120
+
118
121
  // 譜面データの&区切りを有効にするか
119
122
  let g_enableAmpersandSplit = true;
120
123
 
@@ -2317,13 +2320,25 @@ class AudioPlayer {
2317
2320
  this._eventListeners[`canplaythrough`]?.forEach(_listener => _listener());
2318
2321
  }
2319
2322
 
2323
+ /**
2324
+ * 再生処理
2325
+ * @param {number} _adjustmentTime
2326
+ * - 実際の再生開始時間は、g_scheduleLead + _adjustmentTime から開始される
2327
+ * - ただしゲーム内での経過時間計算は _adjustmentTime を基準に行う
2328
+ * - g_scheduleLead は安定した再生タイミングを確保するための内部マージン
2329
+ */
2320
2330
  play(_adjustmentTime = 0) {
2321
2331
  this._source = this._context.createBufferSource();
2322
2332
  this._source.buffer = this._buffer;
2323
2333
  this._source.playbackRate.value = this.playbackRate;
2324
2334
  this._source.connect(this._gain);
2325
- this._startTime = this._context.currentTime;
2326
- this._source.start(this._context.currentTime + _adjustmentTime, this._fadeinPosition);
2335
+
2336
+ // 実際の予約時刻(内部スケジューリング用のマージンを含む)
2337
+ const startAt = this._context.currentTime + g_scheduleLead + _adjustmentTime;
2338
+ this._source.start(startAt, this._fadeinPosition);
2339
+
2340
+ // ゲーム側の論理的開始時刻(g_scheduleLead を含めない)
2341
+ this._startTime = this._context.currentTime + _adjustmentTime;
2327
2342
  }
2328
2343
 
2329
2344
  pause() {
@@ -11502,7 +11517,7 @@ const mainInit = () => {
11502
11517
  mainSpriteJ.appendChild(createColorObject2(`filterBar${j % 2 == 0 ? j + 1 : j - 1}_HS`, g_lblPosObj.filterBar, filterCss));
11503
11518
  }
11504
11519
  addTransform(`mainSprite${j}`, `mainSprite${j}`,
11505
- _keyObj[`layerTrans${keyCtrlPtn}`]?.[0]?.[Math.floor(j / 2) * 2 + (j + Number(g_stateObj.reverse === C_FLG_ON)) % 2]);
11520
+ g_keyObj[`layerTrans${keyCtrlPtn}`]?.[0]?.[Math.floor(j / 2) * 2 + (j + Number(g_stateObj.reverse === C_FLG_ON)) % 2]);
11506
11521
 
11507
11522
  stepSprite.push(createEmptySprite(mainSpriteJ, `stepSprite${j}`, mainCommonPos));
11508
11523
  arrowSprite.push(createEmptySprite(mainSpriteJ, `arrowSprite${j}`, Object.assign({ y: g_workObj.hitPosition * (j % 2 === 0 ? 1 : -1) }, mainCommonPos)));
@@ -12765,7 +12780,7 @@ const mainInit = () => {
12765
12780
  // WebAudioAPIが使用できる場合は小数フレーム分だけ音源位置を調整
12766
12781
  if (g_audio instanceof AudioPlayer) {
12767
12782
  const musicStartAdjustment = (g_headerObj.blankFrame - g_stateObj.decimalAdjustment + 1) / g_fps;
12768
- musicStartTime = performance.now() + musicStartAdjustment * 1000;
12783
+ musicStartTime = performance.now() + (musicStartAdjustment + g_scheduleLead) * 1000;
12769
12784
  g_audio.play(musicStartAdjustment);
12770
12785
  }
12771
12786
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "41.4.10",
3
+ "version": "41.4.12",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {