X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=DTXMania%2F%E3%82%B3%E3%83%BC%E3%83%89%2F%E3%82%B9%E3%83%86%E3%83%BC%E3%82%B8%2F07.%E6%BC%94%E5%A5%8F%2F%E3%83%89%E3%83%A9%E3%83%A0%E7%94%BB%E9%9D%A2%2FCAct%E6%BC%94%E5%A5%8FDrums%E3%82%B0%E3%83%A9%E3%83%95.cs;fp=DTXMania%2F%E3%82%B3%E3%83%BC%E3%83%89%2F%E3%82%B9%E3%83%86%E3%83%BC%E3%82%B8%2F07.%E6%BC%94%E5%A5%8F%2F%E3%83%89%E3%83%A9%E3%83%A0%E7%94%BB%E9%9D%A2%2FCAct%E6%BC%94%E5%A5%8FDrums%E3%82%B0%E3%83%A9%E3%83%95.cs;h=9f87d7ee3533f991cddad8a1ee30a7b6b318634e;hb=7bf3e650c7c6f5afac463ea6e288fcd3fad4387b;hp=0000000000000000000000000000000000000000;hpb=296446998eeba408353da55a275458b590e4ebf5;p=dtxmania%2Fdtxmania.git diff --git a/DTXMania/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsグラフ.cs b/DTXMania/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsグラフ.cs new file mode 100644 index 00000000..9f87d7ee --- /dev/null +++ b/DTXMania/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsグラフ.cs @@ -0,0 +1,203 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.IO; +using SharpDX; +using FDK; + +using Rectangle = System.Drawing.Rectangle; + +namespace DTXMania +{ + internal class CAct演奏グラフ : CActivity + { + // #24074 2011.01.23 ikanick グラフの描画 + // 実装内容 + // ・左を現在、右を目標 + // ・基準線(60,70,80,90,100%)を超えると線が黄色くなる(元は白) + // ・目標を超えると現在が光る + // ・オート時には描画しない + // 要望・実装予定 + // ・グラフを波打たせるなどの視覚の向上→実装済 + // 修正等 + // ・画像がないと落ちる→修正済 + + public STDGBSValue dbTarget; + private STDGBSValue dbTargetDisp; + public STDGBSValue dbCurrent; + private STDGBSValue dbCurrentDisp; + + private CTexture txグラフ; + + private STDGBSValue counterYposInImg; + private readonly int slices = 10; + + public CAct演奏グラフ() + { + base.b活性化してない = true; + } + + public override void On活性化() + { + if (base.b活性化してない) + { + this.dbTarget = new STDGBSValue(); + dbTarget.Drums = dbTarget.Guitar = dbTarget.Bass = 80.0; + this.dbCurrent = new STDGBSValue(); + dbCurrent.Drums = dbCurrent.Guitar = dbCurrent.Bass = 0.0; + counterYposInImg = new STDGBSValue(); + base.On活性化(); + } + } + + public override void OnManagedリソースの作成() + { + if (base.b活性化してる) + { + string pathグラフ = CSkin.Path(@"Graphics\ScreenPlay graph.png"); + if (File.Exists(pathグラフ)) + { + this.txグラフ = TextureFactory.tテクスチャの生成(pathグラフ); + } + base.OnManagedリソースの作成(); + } + } + + public override void OnManagedリソースの解放() + { + if (base.b活性化してる) + { + TextureFactory.tテクスチャの解放(ref this.txグラフ); + base.OnManagedリソースの解放(); + } + } + + public override int On進行描画() + { + if (b活性化してる && !CDTXMania.Instance.ConfigIni.bStoicMode) + { + + for (EPart inst = EPart.Drums; inst <= EPart.Bass; ++inst) + { + if (CDTXMania.Instance.ConfigIni.b楽器有効(inst) && + CDTXMania.Instance.ConfigIni.bGraph[inst] && + CDTXMania.Instance.DTX.bチップがある[inst]) + { + + if (base.b初めての進行描画) + { + base.b初めての進行描画 = false; + counterYposInImg.Drums = new CCounter(0, 35, 16, CDTXMania.Instance.Timer); + counterYposInImg.Guitar = new CCounter(0, 35, 16, CDTXMania.Instance.Timer); + counterYposInImg.Bass = new CCounter(0, 35, 16, CDTXMania.Instance.Timer); + } + + counterYposInImg[inst].t進行Loop(); + int stYposInImg = counterYposInImg[inst].n現在の値; + + int gx = CDTXMania.Instance.ConfigIni.cdInstX[inst][CDTXMania.Instance.ConfigIni.eActiveInst].Value + + CDTXMania.Instance.Coordinates.Instrument[inst].W; + int gy = 0; + + if (this.txグラフ != null) + { + // 背景暗幕 + this.txグラフ.n透明度 = 128; + this.txグラフ.vc拡大縮小倍率.X = CDTXMania.Instance.Coordinates.Graph[inst].W; + this.txグラフ.vc拡大縮小倍率.Y = CDTXMania.Instance.Coordinates.Graph[inst].H; + this.txグラフ.t2D描画(CDTXMania.Instance.Device, gx, gy, new Rectangle(62, 0, 1, 1)); + + // 基準線 + this.txグラフ.vc拡大縮小倍率.X = CDTXMania.Instance.Coordinates.Graph[inst].W; + this.txグラフ.vc拡大縮小倍率.Y = 1f; + + for (int i = 0; i < slices; i++) + { + if (this.dbCurrent[inst] < (100 - i * slices)) + { + // 通常の基準線(白) + this.txグラフ.n透明度 = 128; + this.txグラフ.t2D描画(CDTXMania.Instance.Device, + gx, gy + CDTXMania.Instance.Coordinates.Graph[inst].H * i / slices, new Rectangle(60, 0, 1, 1)); + } + else + { + // 基準線を越えたら線が黄色くなる + this.txグラフ.n透明度 = 224; + this.txグラフ.t2D描画(CDTXMania.Instance.Device, + gx, gy + CDTXMania.Instance.Coordinates.Graph[inst].H * i / slices, new Rectangle(61, 0, 1, 1)); + } + } + + // グラフのゲージ部分 + + // --現在値 + this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, 1f, 1f); + + if (this.dbCurrentDisp[inst] < this.dbCurrent[inst]) + { + this.dbCurrentDisp[inst] += (this.dbCurrent[inst] - this.dbCurrentDisp[inst]) / 5 + 0.01; + } + else + { + this.dbCurrentDisp[inst] = this.dbCurrent[inst]; + } + int ar = (int)(CDTXMania.Instance.Coordinates.Graph[inst].H * this.dbCurrentDisp[inst] / 100.0); + + this.txグラフ.n透明度 = 224; + this.txグラフ.t2D描画( + CDTXMania.Instance.Device, + gx, gy + CDTXMania.Instance.Coordinates.Graph[inst].H - ar, + new Rectangle(0, 5 + stYposInImg, 30, ar) + ); + this.txグラフ.t2D描画( // 上部白いバー + CDTXMania.Instance.Device, + gx, gy + CDTXMania.Instance.Coordinates.Graph[inst].H - ar, + new Rectangle(63 + 0, 0, 30, 5) + ); + + // 目標を超えた時に発光?させる + if ((dbCurrent[inst] >= dbTarget[inst])) + { + this.txグラフ.n透明度 = 128; + this.txグラフ.b加算合成 = true; + this.txグラフ.t2D描画( + CDTXMania.Instance.Device, + gx, gy + CDTXMania.Instance.Coordinates.Graph[inst].H - ar, + new Rectangle(0, 5 + stYposInImg, 30, ar) + ); + this.txグラフ.b加算合成 = false; + } + + // --目標値 + if (this.dbTargetDisp[inst] < this.dbTarget[inst]) + { + this.dbTargetDisp[inst] += (this.dbTarget[inst] - this.dbTargetDisp[inst]) / 5 + 0.01; + } + else + { + this.dbTargetDisp[inst] = this.dbTarget[inst]; + } + ar = (int)(CDTXMania.Instance.Coordinates.Graph[inst].H * this.dbTargetDisp[inst] / 100.0); + + this.txグラフ.n透明度 = 224; + this.txグラフ.t2D描画( + CDTXMania.Instance.Device, + gx + 30, + gy + CDTXMania.Instance.Coordinates.Graph[inst].H - ar, + new Rectangle(30, 5 + stYposInImg, 30, ar) + ); + this.txグラフ.t2D描画( // 上部白いバー + CDTXMania.Instance.Device, gx + 30, gy + CDTXMania.Instance.Coordinates.Graph[inst].H - ar, + new Rectangle(63 + 30, 0, 30, 5) + ); + } + } + } + } + return 0; + } + } +}