1
0
mirror of synced 2024-11-28 09:20:53 +01:00

Merge branch 'main' of github.com:0auBSQ/TJAPlayer3-Develop-BSQ into main

This commit is contained in:
0aubsq 2022-06-25 12:28:28 +02:00
commit 7ff3b79ba2
4 changed files with 61 additions and 12 deletions

View File

@ -293,8 +293,20 @@ namespace SampleFramework
#region #23510 2010.11.14 yyagi add: from http://www.vcskicks.com/maintain-aspect-ratio.php
//double so division keeps decimal points
const double widthRatio = SampleFramework.GameWindowSize.Width;
const double heightRatio = SampleFramework.GameWindowSize.Height;
double widthRatio
{
get
{
return SampleFramework.GameWindowSize.Width;
}
}
double heightRatio
{
get
{
return SampleFramework.GameWindowSize.Height;
}
}
const int WM_SIZING = 0x214;
const int WMSZ_LEFT = 1;
const int WMSZ_RIGHT = 2;

View File

@ -4,7 +4,7 @@ namespace SampleFramework
{
public static class GameWindowSize
{
public const int Width = 1280;
public const int Height = 720;
public static int Width = 1280;
public static int Height = 720;
}
}

View File

@ -1087,6 +1087,14 @@ namespace TJAPlayer3
{
this.Skin_Creator = strParam;
}
/*else if (strCommand == "Resolution")
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 2; i++)
{
Resolution[i] = int.Parse(strSplit[i]);
}
}*/
#endregion
#region [Background Scroll]
@ -2653,6 +2661,7 @@ namespace TJAPlayer3
public string Skin_Name = "Unknown";
public string Skin_Version = "Unknown";
public string Skin_Creator = "Unknown";
public int[] Resolution = new int[] { 1280, 720 };
#endregion
#region Config

View File

@ -1042,6 +1042,7 @@ namespace TJAPlayer3
//-----------------------------
#endregion
}
return;
}
//-----------------------------
#endregion
@ -2283,6 +2284,9 @@ for (int i = 0; i < 3; i++) {
{
Skin = new CSkin( TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false);
TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ); // 旧指定のSkinフォルダが消滅していた場合に備える
ChangeResolution(TJAPlayer3.Skin.Resolution[0], TJAPlayer3.Skin.Resolution[1]);
Trace.TraceInformation( "スキンの初期化を完了しました。" );
}
catch (Exception e)
@ -3071,6 +3075,28 @@ for (int i = 0; i < 3; i++) {
Trace.TraceInformation( this.listプラグイン.Count + " 個のプラグインを読み込みました。" );
}
private void ChangeResolution(int nWidth, int nHeight)
{
if (base.GraphicsDeviceManager.CurrentSettings.BackBufferWidth == nWidth ||
base.GraphicsDeviceManager.CurrentSettings.BackBufferHeight == nHeight)
return;
currentClientSize = this.Window.ClientSize;
var state = base.Window.WindowState;
SampleFramework.GameWindowSize.Width = nWidth;
SampleFramework.GameWindowSize.Height = nHeight;
base.GraphicsDeviceManager.CurrentSettings.BackBufferWidth = nWidth;
base.GraphicsDeviceManager.CurrentSettings.BackBufferHeight = nHeight;
base.GraphicsDeviceManager.ChangeDevice(base.GraphicsDeviceManager.CurrentSettings);
base.Window.ClientSize = new Size(currentClientSize.Width, currentClientSize.Height);
base.Window.WindowState = state;
}
public void RefleshSkin()
{
Trace.TraceInformation("スキン変更:" + TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false));
@ -3081,8 +3107,10 @@ for (int i = 0; i < 3; i++) {
TJAPlayer3.Skin = null;
TJAPlayer3.Skin = new CSkin(TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false);
TJAPlayer3.Tx.DisposeTexture();
ChangeResolution(TJAPlayer3.Skin.Resolution[0], TJAPlayer3.Skin.Resolution[1]);
TJAPlayer3.Tx.LoadTexture();
TJAPlayer3.act文字コンソール.On活性化();