public override void OnManagedReleaseResources() { if (!base.bNotActivated) { if (this.ct登場用 != null) { this.ct登場用 = null; } // if (this.ctPlayNewRecord != null) { this.ctPlayNewRecord = null; } CDTXMania.t安全にDisposeする(ref this.ds背景動画); CDTXMania.tReleaseTexture(ref this.txBackground); CDTXMania.tReleaseTexture(ref this.txTopPanel); CDTXMania.tReleaseTexture(ref this.txBottomPanel); base.OnManagedReleaseResources(); } }
public override void OnManagedReleaseResources() { if (!base.bNotActivated) { CDTXMania.t安全にDisposeする(ref this.prv表示用フォント); CDTXMania.t安全にDisposeする(ref this.prv称号フォント); CDTXMania.t安全にDisposeする(ref this.txスキルパネル); CDTXMania.tReleaseTexture(ref this.txパネル文字[0]); CDTXMania.tReleaseTexture(ref this.txパネル文字[1]); CDTXMania.tReleaseTexture(ref this.tx難易度パネル); CDTXMania.tReleaseTexture(ref this.tx難易度用数字); //Free new texture CDTXMania.tReleaseTexture(ref this.txPercent); CDTXMania.tReleaseTexture(ref this.txSkillMax); CDTXMania.tReleaseTexture(ref this.txLagHitCount); CDTXMania.tReleaseTexture(ref this.txネームプレート用文字[0]); CDTXMania.tReleaseTexture(ref this.txネームプレート用文字[1]); base.OnManagedReleaseResources(); } }
public override void OnManagedReleaseResources() { if (!base.bNotActivated) { CDTXMania.tReleaseTexture(ref this.txパネル本体); CDTXMania.tReleaseTexture(ref this.txNewRecord); CDTXMania.tReleaseTexture(ref this.txSkillPanel); CDTXMania.tReleaseTexture(ref this.txScore); CDTXMania.tReleaseTexture(ref this.tx難易度パネル); CDTXMania.tReleaseTexture(ref this.tx難易度用数字); //Free new texture CDTXMania.tReleaseTexture(ref this.txPercent); CDTXMania.tReleaseTexture(ref this.txSkillMax); for (int i = 0; i < 3; i++) { CDTXMania.tReleaseTexture(ref this.txネームプレート用文字[i]); CDTXMania.tReleaseTexture(ref this.txExciteGauge[i]); CDTXMania.tReleaseTexture(ref this.txCharacter[i]); } base.OnManagedReleaseResources(); } }
public override void OnManagedReleaseResources() { if (!base.bNotActivated) { CDTXMania.t安全にDisposeする(ref this.ftSongDifficultyFont); CDTXMania.t安全にDisposeする(ref this.iDrumSpeed); CDTXMania.tReleaseTexture(ref this.txジャケットパネル); CDTXMania.tReleaseTexture(ref this.txリザルト画像); CDTXMania.tReleaseTexture(ref this.txリザルト画像がないときの画像); CDTXMania.tReleaseTexture(ref this.txSongName); CDTXMania.tReleaseTexture(ref this.txArtistName); CDTXMania.tReleaseTexture(ref this.txModifiedPlaySpeed); CDTXMania.tReleaseTexture(ref this.txTrainingMode); CDTXMania.tReleaseTexture(ref this.txResultsNotSaved); CDTXMania.tReleaseTexture(ref this.r表示するリザルト画像); CDTXMania.tReleaseTexture(ref this.txSongLevel); CDTXMania.tReleaseTexture(ref this.txSongDifficulty); CDTXMania.tReleaseTexture(ref this.txDrumSpeed); base.OnManagedReleaseResources(); } }
public override void OnManagedReleaseResources() // OPTIONと同じ(COnfig.iniの書き出しタイミングのみ異なるが、無視して良い) { if (!base.bNotActivated) { CDTXMania.tReleaseTexture(ref this.tx背景); CDTXMania.tReleaseTexture(ref this.tx上部パネル); CDTXMania.tReleaseTexture(ref this.tx下部パネル); CDTXMania.tReleaseTexture(ref this.txMenuCursor); CDTXMania.tReleaseTexture(ref this.txMenuパネル); CDTXMania.tReleaseTexture(ref this.txItemBar); CDTXMania.tReleaseTexture(ref this.txDescriptionPanel); prvFont.Dispose(); for (int i = 0; i < txMenuItemLeft.GetLength(0); i++) { txMenuItemLeft[i, 0].Dispose(); txMenuItemLeft[i, 0] = null; txMenuItemLeft[i, 1].Dispose(); txMenuItemLeft[i, 1] = null; } txMenuItemLeft = null; base.OnManagedReleaseResources(); } }
public override void OnManagedReleaseResources() { if (!base.bNotActivated) { //特殊テクスチャ 3枚 if (this.tx描画用 != null) { this.tx描画用.Dispose(); this.tx描画用 = null; } if (this.tx描画用2 != null) { this.tx描画用2.Dispose(); this.tx描画用2 = null; } if (this.txDShow汎用 != null) { this.txDShow汎用.Dispose(); this.txDShow汎用 = null; } if (this.txlanes != null) { this.txlanes.Dispose(); this.txlanes = null; } //CDTXMania.t安全にDisposeする(ref this.ds汎用); //テクスチャ 17枚 //CDTXMania.tReleaseTexture(ref this.txドラム); CDTXMania.tReleaseTexture(ref this.txクリップパネル); CDTXMania.tReleaseTexture(ref this.txフィルインエフェクト); //for( int ar = 0; ar < 31; ar++ ) //{ // CDTXMania.tReleaseTexture( ref this.txフィルインエフェクト[ ar ] ); //} base.OnManagedReleaseResources(); } }
public void t選択曲が変更された() { CScore cスコア = CDTXMania.stageSongSelection.rSelectedScore; if (cスコア != null) { Bitmap image = new Bitmap(1, 1); CDTXMania.tReleaseTexture(ref this.txArtist); this.strArtist = cスコア.SongInformation.ArtistName; if ((this.strArtist != null) && (this.strArtist.Length > 0)) { Graphics graphics = Graphics.FromImage(image); graphics.PageUnit = GraphicsUnit.Pixel; SizeF ef = graphics.MeasureString(this.strArtist, this.ft描画用フォント); graphics.Dispose(); //if (ef.Width > SampleFramework.GameWindowSize.Width) //{ // ef.Width = SampleFramework.GameWindowSize.Width; //} try { //Fix length issue of Artist using the same method used for Song Title int nLargestLengthPx = 510; //510px is the available space for artist in the bar int widthAfterScaling = (int)((ef.Width + 2) * 0.5f); //+2 buffer if (widthAfterScaling > (CDTXMania.app.Device.Capabilities.MaxTextureWidth / 2)) { widthAfterScaling = CDTXMania.app.Device.Capabilities.MaxTextureWidth / 2; // 右端断ち切れ仕方ないよね } //Compute horizontal scaling factor float f拡大率X = (widthAfterScaling <= nLargestLengthPx) ? 0.5f : (((float)nLargestLengthPx / (float)widthAfterScaling) * 0.5f); // 長い文字列は横方向に圧縮。 //ef.Width Bitmap bitmap2 = new Bitmap((int)Math.Ceiling((double)widthAfterScaling * 2), (int)Math.Ceiling((double)this.ft描画用フォント.Size)); graphics = Graphics.FromImage(bitmap2); graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; graphics.DrawString(this.strArtist, this.ft描画用フォント, Brushes.White, ( float )0f, ( float )0f); graphics.Dispose(); this.txArtist = new CTexture(CDTXMania.app.Device, bitmap2, CDTXMania.TextureFormat); this.txArtist.vcScaleRatio = new Vector3(f拡大率X, 0.5f, 1f); bitmap2.Dispose(); } catch (CTextureCreateFailedException) { Trace.TraceError("ARTISTテクスチャの生成に失敗しました。"); this.txArtist = null; } } CDTXMania.tReleaseTexture(ref this.txComment); this.strComment = cスコア.SongInformation.Comment; if ((this.strComment != null) && (this.strComment.Length > 0)) { Graphics graphics2 = Graphics.FromImage(image); graphics2.PageUnit = GraphicsUnit.Pixel; SizeF ef2 = graphics2.MeasureString(this.strComment, this.ft描画用フォント); Size size = new Size((int)Math.Ceiling((double)ef2.Width), (int)Math.Ceiling((double)ef2.Height)); graphics2.Dispose(); this.nテクスチャの最大幅 = CDTXMania.app.Device.Capabilities.MaxTextureWidth; int maxTextureHeight = CDTXMania.app.Device.Capabilities.MaxTextureHeight; Bitmap bitmap3 = new Bitmap(size.Width, (int)Math.Ceiling((double)this.ft描画用フォント.Size)); graphics2 = Graphics.FromImage(bitmap3); graphics2.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; graphics2.DrawString(this.strComment, this.ft描画用フォント, Brushes.White, ( float )0f, ( float )0f); graphics2.Dispose(); this.nComment行数 = 1; this.nComment最終行の幅 = size.Width; while (this.nComment最終行の幅 > this.nテクスチャの最大幅) { this.nComment行数++; this.nComment最終行の幅 -= this.nテクスチャの最大幅; } while ((this.nComment行数 * ((int)Math.Ceiling((double)this.ft描画用フォント.Size))) > maxTextureHeight) { this.nComment行数--; this.nComment最終行の幅 = this.nテクスチャの最大幅; } Bitmap bitmap4 = new Bitmap((this.nComment行数 > 1) ? this.nテクスチャの最大幅 : this.nComment最終行の幅, this.nComment行数 * ((int)Math.Ceiling((double)this.ft描画用フォント.Size))); graphics2 = Graphics.FromImage(bitmap4); Rectangle srcRect = new Rectangle(); Rectangle destRect = new Rectangle(); for (int i = 0; i < this.nComment行数; i++) { srcRect.X = i * this.nテクスチャの最大幅; srcRect.Y = 0; srcRect.Width = ((i + 1) == this.nComment行数) ? this.nComment最終行の幅 : this.nテクスチャの最大幅; srcRect.Height = bitmap3.Height; destRect.X = 0; destRect.Y = i * bitmap3.Height; destRect.Width = srcRect.Width; destRect.Height = srcRect.Height; graphics2.DrawImage(bitmap3, destRect, srcRect, GraphicsUnit.Pixel); } graphics2.Dispose(); try { this.txComment = new CTexture(CDTXMania.app.Device, bitmap4, CDTXMania.TextureFormat); this.txComment.vcScaleRatio = new Vector3(0.5f, 0.5f, 1f); } catch (CTextureCreateFailedException) { Trace.TraceError("COMMENTテクスチャの生成に失敗しました。"); this.txComment = null; } bitmap4.Dispose(); bitmap3.Dispose(); } image.Dispose(); if (this.txComment != null) { this.ctComment = new CCounter(-740, (int)((((this.nComment行数 - 1) * this.nテクスチャの最大幅) + this.nComment最終行の幅) * this.txComment.vcScaleRatio.X), 10, CDTXMania.Timer); } } }
private bool t背景画像があればその一部からプレビュー画像を構築する() { CScore cスコア = CDTXMania.stageSongSelection.rSelectedScore; if ((cスコア == null) || string.IsNullOrEmpty(cスコア.SongInformation.Backgound)) { return(false); } string path = cスコア.FileInformation.AbsoluteFolderPath + cスコア.SongInformation.Backgound; if (!path.Equals(this.str現在のファイル名)) { if (!File.Exists(path)) { Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { path }); return(false); } CDTXMania.tReleaseTexture(ref this.txプレビュー画像); this.str現在のファイル名 = path; Bitmap image = null; Bitmap bitmap2 = null; Bitmap bitmap3 = null; try { image = new Bitmap(this.str現在のファイル名); bitmap2 = new Bitmap(SampleFramework.GameWindowSize.Width, SampleFramework.GameWindowSize.Height); Graphics graphics = Graphics.FromImage(bitmap2); int x = 0; for (int i = 0; i < SampleFramework.GameWindowSize.Height; i += image.Height) { for (x = 0; x < SampleFramework.GameWindowSize.Width; x += image.Width) { graphics.DrawImage(image, x, i, image.Width, image.Height); } } graphics.Dispose(); bitmap3 = new Bitmap(0xcc, 0x10d); graphics = Graphics.FromImage(bitmap3); graphics.DrawImage(bitmap2, 5, 5, new Rectangle(0x157, 0x6d, 204, 269), GraphicsUnit.Pixel); graphics.Dispose(); this.txプレビュー画像 = new CTexture(CDTXMania.app.Device, bitmap3, CDTXMania.TextureFormat); this.r表示するプレビュー画像 = this.txプレビュー画像; } catch { Trace.TraceError("背景画像の読み込みに失敗しました。({0})", new object[] { this.str現在のファイル名 }); this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像; return(false); } finally { if (image != null) { image.Dispose(); } if (bitmap2 != null) { bitmap2.Dispose(); } if (bitmap3 != null) { bitmap3.Dispose(); } } } return(true); }