mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
add Resolution setting
This commit is contained in:
parent
c9d5e1015c
commit
19ed60642f
@ -116,6 +116,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"兼容性设置";
|
CompatibilityBtn->Caption = L"兼容性设置";
|
||||||
RestoreDefaultsBtn->Caption = L"恢复默认设置";
|
RestoreDefaultsBtn->Caption = L"恢复默认设置";
|
||||||
PresentationLbl->Caption = L"显示方式";
|
PresentationLbl->Caption = L"显示方式";
|
||||||
|
ResolutionLbl->Caption = L"解决";
|
||||||
MaintasLbl->Caption = L"保持纵横比";
|
MaintasLbl->Caption = L"保持纵横比";
|
||||||
VsyncLbl->Caption = L"打开垂直同步";
|
VsyncLbl->Caption = L"打开垂直同步";
|
||||||
AdjmouseLbl->Caption = L"调整鼠标灵敏度";
|
AdjmouseLbl->Caption = L"调整鼠标灵敏度";
|
||||||
@ -175,6 +176,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"Ajustes de compatibilidad";
|
CompatibilityBtn->Caption = L"Ajustes de compatibilidad";
|
||||||
RestoreDefaultsBtn->Caption = L"Restaurar la configuración predeterminada";
|
RestoreDefaultsBtn->Caption = L"Restaurar la configuración predeterminada";
|
||||||
PresentationLbl->Caption = L"Presentación";
|
PresentationLbl->Caption = L"Presentación";
|
||||||
|
ResolutionLbl->Caption = L"Resolución";
|
||||||
MaintasLbl->Caption = L"Mantener la relación de aspecto";
|
MaintasLbl->Caption = L"Mantener la relación de aspecto";
|
||||||
VsyncLbl->Caption = L"Activar VSync";
|
VsyncLbl->Caption = L"Activar VSync";
|
||||||
AdjmouseLbl->Caption = L"Ajustar sensibilidad de ratón";
|
AdjmouseLbl->Caption = L"Ajustar sensibilidad de ratón";
|
||||||
@ -234,6 +236,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"Kompatibilitätseinstellungen";
|
CompatibilityBtn->Caption = L"Kompatibilitätseinstellungen";
|
||||||
RestoreDefaultsBtn->Caption = L"Standardeinstellungen wiederherstellen";
|
RestoreDefaultsBtn->Caption = L"Standardeinstellungen wiederherstellen";
|
||||||
PresentationLbl->Caption = L"Darstellung";
|
PresentationLbl->Caption = L"Darstellung";
|
||||||
|
ResolutionLbl->Caption = L"Auflösung";
|
||||||
MaintasLbl->Caption = L"Seitenverhältnis beibehalten";
|
MaintasLbl->Caption = L"Seitenverhältnis beibehalten";
|
||||||
VsyncLbl->Caption = L"VSync aktiveren";
|
VsyncLbl->Caption = L"VSync aktiveren";
|
||||||
AdjmouseLbl->Caption = L"Mausempfindlichkeit anpassen";
|
AdjmouseLbl->Caption = L"Mausempfindlichkeit anpassen";
|
||||||
@ -294,6 +297,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"Настройки совместимости";
|
CompatibilityBtn->Caption = L"Настройки совместимости";
|
||||||
RestoreDefaultsBtn->Caption = L"Восстановить настройки по умолчанию";
|
RestoreDefaultsBtn->Caption = L"Восстановить настройки по умолчанию";
|
||||||
PresentationLbl->Caption = L"Отображение";
|
PresentationLbl->Caption = L"Отображение";
|
||||||
|
ResolutionLbl->Caption = L"Разрешение";
|
||||||
MaintasLbl->Caption = L"Сохранять соотношение сторон";
|
MaintasLbl->Caption = L"Сохранять соотношение сторон";
|
||||||
VsyncLbl->Caption = L"Включить VSync";
|
VsyncLbl->Caption = L"Включить VSync";
|
||||||
AdjmouseLbl->Caption = L"Регулировка чувствительности мыши";
|
AdjmouseLbl->Caption = L"Регулировка чувствительности мыши";
|
||||||
@ -353,6 +357,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"Kompatibilitás Beállítások";
|
CompatibilityBtn->Caption = L"Kompatibilitás Beállítások";
|
||||||
RestoreDefaultsBtn->Caption = L"Visszaállítja az alapértelmezett beállításokat";
|
RestoreDefaultsBtn->Caption = L"Visszaállítja az alapértelmezett beállításokat";
|
||||||
PresentationLbl->Caption = L"Bemutató";
|
PresentationLbl->Caption = L"Bemutató";
|
||||||
|
ResolutionLbl->Caption = L"Felbontás";
|
||||||
MaintasLbl->Caption = L"Képarány megtartása";
|
MaintasLbl->Caption = L"Képarány megtartása";
|
||||||
VsyncLbl->Caption = L"VSync bekapcsolása";
|
VsyncLbl->Caption = L"VSync bekapcsolása";
|
||||||
AdjmouseLbl->Caption = L"Egérérzékenység beállítás";
|
AdjmouseLbl->Caption = L"Egérérzékenység beállítás";
|
||||||
@ -412,6 +417,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"Paramètres de Compatibilité";
|
CompatibilityBtn->Caption = L"Paramètres de Compatibilité";
|
||||||
RestoreDefaultsBtn->Caption = L"Restaurer les paramètres par défaut";
|
RestoreDefaultsBtn->Caption = L"Restaurer les paramètres par défaut";
|
||||||
PresentationLbl->Caption = L"Présentation";
|
PresentationLbl->Caption = L"Présentation";
|
||||||
|
ResolutionLbl->Caption = L"Résolution";
|
||||||
MaintasLbl->Caption = L"Conserver les proportions de l'image";
|
MaintasLbl->Caption = L"Conserver les proportions de l'image";
|
||||||
VsyncLbl->Caption = L"Activer la synchro verticale (VSync)";
|
VsyncLbl->Caption = L"Activer la synchro verticale (VSync)";
|
||||||
AdjmouseLbl->Caption = L"Ajuster la sensibilité souris";
|
AdjmouseLbl->Caption = L"Ajuster la sensibilité souris";
|
||||||
@ -471,6 +477,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"Impostazioni di compatibilità";
|
CompatibilityBtn->Caption = L"Impostazioni di compatibilità";
|
||||||
RestoreDefaultsBtn->Caption = L"Ripristina le impostazioni predefinite";
|
RestoreDefaultsBtn->Caption = L"Ripristina le impostazioni predefinite";
|
||||||
PresentationLbl->Caption = L"Presentazione";
|
PresentationLbl->Caption = L"Presentazione";
|
||||||
|
ResolutionLbl->Caption = L"Risoluzione";
|
||||||
MaintasLbl->Caption = L"Mantieni il rapporto d'aspetto";
|
MaintasLbl->Caption = L"Mantieni il rapporto d'aspetto";
|
||||||
VsyncLbl->Caption = L"Abilita la sincronizzazione verticale (VSync)";
|
VsyncLbl->Caption = L"Abilita la sincronizzazione verticale (VSync)";
|
||||||
AdjmouseLbl->Caption = L"Regola la sensibilità del mouse";
|
AdjmouseLbl->Caption = L"Regola la sensibilità del mouse";
|
||||||
@ -575,6 +582,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
CompatibilityBtn->Caption = L"Compatibility Settings";
|
CompatibilityBtn->Caption = L"Compatibility Settings";
|
||||||
RestoreDefaultsBtn->Caption = L"Restore default settings";
|
RestoreDefaultsBtn->Caption = L"Restore default settings";
|
||||||
PresentationLbl->Caption = L"Presentation";
|
PresentationLbl->Caption = L"Presentation";
|
||||||
|
ResolutionLbl->Caption = L"Resolution";
|
||||||
MaintasLbl->Caption = L"Maintain aspect ratio";
|
MaintasLbl->Caption = L"Maintain aspect ratio";
|
||||||
VsyncLbl->Caption = L"Enable VSync";
|
VsyncLbl->Caption = L"Enable VSync";
|
||||||
AdjmouseLbl->Caption = L"Adjust mouse sensitivity";
|
AdjmouseLbl->Caption = L"Adjust mouse sensitivity";
|
||||||
@ -694,6 +702,7 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto *ini = new TIniFile(".\\dd-hd.ini");
|
auto *ini = new TIniFile(".\\dd-hd.ini");
|
||||||
|
auto *hd_ini = new TIniFile(".\\Warcraft_II_HD.ini");
|
||||||
|
|
||||||
if (ini->ReadString("ddraw", "configtheme", "Windows10") == "Cobalt XEMedia") {
|
if (ini->ReadString("ddraw", "configtheme", "Windows10") == "Cobalt XEMedia") {
|
||||||
|
|
||||||
@ -727,6 +736,18 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
|||||||
PresentationCbx->ItemIndex = 0;
|
PresentationCbx->ItemIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cwidth = hd_ini->ReadInteger("Warcraft_II_HD", "Width", 0);
|
||||||
|
int cheight = hd_ini->ReadInteger("Warcraft_II_HD", "Height", 0);
|
||||||
|
int reso = hd_ini->ReadInteger("Warcraft_II_HD", "Resolution", 3);
|
||||||
|
|
||||||
|
if (!cwidth || !cheight) {
|
||||||
|
ResolutionCbx->ItemIndex = reso <= 5 ? reso : 3;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ResolutionCbx->AddItem(IntToStr(cwidth) + "x" + IntToStr(cheight), NULL);
|
||||||
|
ResolutionCbx->ItemIndex = ResolutionCbx->Items->Count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
MaintasChk->State = GetBool(ini, "maintas", false) ? tssOn : tssOff;
|
MaintasChk->State = GetBool(ini, "maintas", false) ? tssOn : tssOff;
|
||||||
VsyncChk->State = GetBool(ini, "vsync", false) ? tssOn : tssOff;
|
VsyncChk->State = GetBool(ini, "vsync", false) ? tssOn : tssOff;
|
||||||
AdjmouseChk->State = GetBool(ini, "adjmouse", true) ? tssOn : tssOff;
|
AdjmouseChk->State = GetBool(ini, "adjmouse", true) ? tssOn : tssOff;
|
||||||
@ -889,6 +910,7 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
|||||||
GetBool(ini, "allow_reset", true);
|
GetBool(ini, "allow_reset", true);
|
||||||
|
|
||||||
delete ini;
|
delete ini;
|
||||||
|
delete hd_ini;
|
||||||
|
|
||||||
Initialized = true;
|
Initialized = true;
|
||||||
}
|
}
|
||||||
@ -899,6 +921,7 @@ void TConfigForm::SaveSettings()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
auto *ini = new TIniFile(".\\dd-hd.ini");
|
auto *ini = new TIniFile(".\\dd-hd.ini");
|
||||||
|
auto *hd_ini = new TIniFile(".\\Warcraft_II_HD.ini");
|
||||||
|
|
||||||
/* Display Settings */
|
/* Display Settings */
|
||||||
|
|
||||||
@ -925,6 +948,18 @@ void TConfigForm::SaveSettings()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ResolutionCbx->ItemIndex <= 5) {
|
||||||
|
hd_ini->WriteInteger(
|
||||||
|
"Warcraft_II_HD", "Resolution", ResolutionCbx->ItemIndex);
|
||||||
|
|
||||||
|
hd_ini->WriteInteger("Warcraft_II_HD", "Width", 0);
|
||||||
|
hd_ini->WriteInteger("Warcraft_II_HD", "Height", 0);
|
||||||
|
|
||||||
|
if (ResolutionCbx->Items->Count == 7) {
|
||||||
|
ResolutionCbx->Items->Delete(6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ini->WriteString(
|
ini->WriteString(
|
||||||
"ddraw",
|
"ddraw",
|
||||||
"maintas",
|
"maintas",
|
||||||
@ -1112,6 +1147,7 @@ void TConfigForm::SaveSettings()
|
|||||||
NonexclusiveChk->State == tssOn ? "true" : "false");
|
NonexclusiveChk->State == tssOn ? "true" : "false");
|
||||||
|
|
||||||
delete ini;
|
delete ini;
|
||||||
|
delete hd_ini;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __fastcall TConfigForm::FormActivate(TObject *Sender)
|
void __fastcall TConfigForm::FormActivate(TObject *Sender)
|
||||||
@ -1340,3 +1376,4 @@ void __fastcall TConfigForm::PboxPaint(TObject *Sender)
|
|||||||
//pbox->Canvas->Rectangle(pbox->ClientRect);
|
//pbox->Canvas->Rectangle(pbox->ClientRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2696,8 +2696,6 @@ object ConfigForm: TConfigForm
|
|||||||
ShowCaption = False
|
ShowCaption = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
StyleElements = [seFont, seBorder]
|
StyleElements = [seFont, seBorder]
|
||||||
ExplicitWidth = 495
|
|
||||||
ExplicitHeight = 464
|
|
||||||
DesignSize = (
|
DesignSize = (
|
||||||
499
|
499
|
||||||
465)
|
465)
|
||||||
@ -2716,7 +2714,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object MaintasLbl: TLabel
|
object MaintasLbl: TLabel
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 105
|
Top = 182
|
||||||
Width = 145
|
Width = 145
|
||||||
Height = 21
|
Height = 21
|
||||||
Margins.Top = 18
|
Margins.Top = 18
|
||||||
@ -2730,7 +2728,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object VsyncLbl: TLabel
|
object VsyncLbl: TLabel
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 173
|
Top = 250
|
||||||
Width = 93
|
Width = 93
|
||||||
Height = 21
|
Height = 21
|
||||||
Margins.Top = 18
|
Margins.Top = 18
|
||||||
@ -2744,7 +2742,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object AdjmouseLbl: TLabel
|
object AdjmouseLbl: TLabel
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 241
|
Top = 318
|
||||||
Width = 168
|
Width = 168
|
||||||
Height = 21
|
Height = 21
|
||||||
Margins.Top = 18
|
Margins.Top = 18
|
||||||
@ -2758,7 +2756,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object DevmodeLbl: TLabel
|
object DevmodeLbl: TLabel
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 309
|
Top = 386
|
||||||
Width = 216
|
Width = 216
|
||||||
Height = 21
|
Height = 21
|
||||||
Margins.Top = 18
|
Margins.Top = 18
|
||||||
@ -2806,6 +2804,26 @@ object ConfigForm: TConfigForm
|
|||||||
Visible = False
|
Visible = False
|
||||||
OnClick = LanguageImgClick
|
OnClick = LanguageImgClick
|
||||||
end
|
end
|
||||||
|
object ResolutionLbl: TLabel
|
||||||
|
Left = 40
|
||||||
|
Top = 105
|
||||||
|
Width = 74
|
||||||
|
Height = 21
|
||||||
|
Caption = 'Resolution'
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -16
|
||||||
|
Font.Name = 'Segoe UI'
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object ResolutionPbox: TPaintBox
|
||||||
|
Left = 40
|
||||||
|
Top = 131
|
||||||
|
Width = 282
|
||||||
|
Height = 31
|
||||||
|
OnPaint = PboxPaint
|
||||||
|
end
|
||||||
object PresentationCbx: TComboBox
|
object PresentationCbx: TComboBox
|
||||||
Left = 41
|
Left = 41
|
||||||
Top = 55
|
Top = 55
|
||||||
@ -2831,7 +2849,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object MaintasChk: TToggleSwitch
|
object MaintasChk: TToggleSwitch
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 132
|
Top = 209
|
||||||
Width = 50
|
Width = 50
|
||||||
Height = 20
|
Height = 20
|
||||||
ShowStateCaption = False
|
ShowStateCaption = False
|
||||||
@ -2840,7 +2858,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object VsyncChk: TToggleSwitch
|
object VsyncChk: TToggleSwitch
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 200
|
Top = 277
|
||||||
Width = 50
|
Width = 50
|
||||||
Height = 20
|
Height = 20
|
||||||
ShowStateCaption = False
|
ShowStateCaption = False
|
||||||
@ -2849,7 +2867,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object AdjmouseChk: TToggleSwitch
|
object AdjmouseChk: TToggleSwitch
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 268
|
Top = 345
|
||||||
Width = 50
|
Width = 50
|
||||||
Height = 20
|
Height = 20
|
||||||
ShowStateCaption = False
|
ShowStateCaption = False
|
||||||
@ -2858,7 +2876,7 @@ object ConfigForm: TConfigForm
|
|||||||
end
|
end
|
||||||
object DevmodeChk: TToggleSwitch
|
object DevmodeChk: TToggleSwitch
|
||||||
Left = 40
|
Left = 40
|
||||||
Top = 336
|
Top = 413
|
||||||
Width = 50
|
Width = 50
|
||||||
Height = 20
|
Height = 20
|
||||||
ShowStateCaption = False
|
ShowStateCaption = False
|
||||||
@ -2879,6 +2897,31 @@ object ConfigForm: TConfigForm
|
|||||||
OnClick = ThemePnlClick
|
OnClick = ThemePnlClick
|
||||||
ExplicitLeft = 471
|
ExplicitLeft = 471
|
||||||
end
|
end
|
||||||
|
object ResolutionCbx: TComboBox
|
||||||
|
Left = 41
|
||||||
|
Top = 132
|
||||||
|
Width = 280
|
||||||
|
Height = 29
|
||||||
|
BevelEdges = []
|
||||||
|
BevelInner = bvNone
|
||||||
|
BevelOuter = bvSpace
|
||||||
|
Style = csDropDownList
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -16
|
||||||
|
Font.Name = 'Segoe UI'
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 6
|
||||||
|
OnChange = PresentationCbxChange
|
||||||
|
Items.Strings = (
|
||||||
|
'640x480 (4:3)'
|
||||||
|
'800x608 (4:3)'
|
||||||
|
'832x480 (16:9)'
|
||||||
|
'960x544 (16:9)'
|
||||||
|
'1280x704 (16:9)'
|
||||||
|
'1280x544 (21:9)')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object CompatibilityPnl: TPanel
|
object CompatibilityPnl: TPanel
|
||||||
Left = 233
|
Left = 233
|
||||||
|
@ -81,6 +81,9 @@ __published: // Von der IDE verwaltete Komponenten
|
|||||||
TComboBox *ShaderD3DCbx;
|
TComboBox *ShaderD3DCbx;
|
||||||
TSpeedButton *RestoreDefaultsBtn;
|
TSpeedButton *RestoreDefaultsBtn;
|
||||||
TPanel *ThemePnl;
|
TPanel *ThemePnl;
|
||||||
|
TComboBox *ResolutionCbx;
|
||||||
|
TLabel *ResolutionLbl;
|
||||||
|
TPaintBox *ResolutionPbox;
|
||||||
void __fastcall DisplayBtnClick(TObject *Sender);
|
void __fastcall DisplayBtnClick(TObject *Sender);
|
||||||
void __fastcall AdvancedBtnClick(TObject *Sender);
|
void __fastcall AdvancedBtnClick(TObject *Sender);
|
||||||
void __fastcall CompatibilityBtnClick(TObject *Sender);
|
void __fastcall CompatibilityBtnClick(TObject *Sender);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user