no message
This commit is contained in:
commit
a9d2e86402
7 changed files with 488 additions and 0 deletions
15
Tenebrae_launch.dpr
Normal file
15
Tenebrae_launch.dpr
Normal file
|
@ -0,0 +1,15 @@
|
|||
program Tenebrae_launch;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
mainu in 'mainu.pas' {Form1},
|
||||
cred in 'cred.pas' {Form2};
|
||||
|
||||
{$R *.RES}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.CreateForm(TForm2, Form2);
|
||||
Application.Run;
|
||||
end.
|
BIN
Tenebrae_launch.res
Normal file
BIN
Tenebrae_launch.res
Normal file
Binary file not shown.
BIN
cred.dfm
Normal file
BIN
cred.dfm
Normal file
Binary file not shown.
32
cred.pas
Normal file
32
cred.pas
Normal file
|
@ -0,0 +1,32 @@
|
|||
unit cred;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||
StdCtrls, Buttons, ComCtrls;
|
||||
|
||||
type
|
||||
TForm2 = class(TForm)
|
||||
RichEdit1: TRichEdit;
|
||||
BitBtn1: TBitBtn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form2: TForm2;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
procedure TForm2.FormCreate(Sender: TObject);
|
||||
begin
|
||||
RichEdit1.Lines.LoadFromFile(ExtractFileDir(ParamStr(0))+'\tenebrae\credits.rtf');
|
||||
end;
|
||||
|
||||
end.
|
48
credits.rtf
Normal file
48
credits.rtf
Normal file
|
@ -0,0 +1,48 @@
|
|||
{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1043\deflangfe1043{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f32\froman\fcharset238\fprq2 Times New Roman CE;}{\f33\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f35\froman\fcharset161\fprq2 Times New Roman Greek;}{\f36\froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\f37\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f38\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f39\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f40\fswiss\fcharset238\fprq2 Arial CE;}{\f41\fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f43\fswiss\fcharset161\fprq2 Arial Greek;}{\f44\fswiss\fcharset162\fprq2 Arial Tur;}{\f45\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f46\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f47\fswiss\fcharset186\fprq2 Arial Baltic;}}
|
||||
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
|
||||
\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue153;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs24\lang1043\langfe1043\cgrid\langnp1043\langfenp1043 \snext0 Normal;}{\s1\qc \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\rin0\lin0\itap0 \b\fs22\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 \sbasedon0 \snext0 heading 1;}{\*\cs10 \additive
|
||||
Default Paragraph Font;}{\*\cs15 \additive \ul\cf17 \sbasedon10 Hyperlink;}{\*\cs16 \additive \ul\cf12 \sbasedon10 FollowedHyperlink;}{\s17\qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \b\fs28\lang2057\langfe1043\cgrid\langnp2057\langfenp1043
|
||||
\sbasedon0 \snext17 Title;}{\s18\qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \b\f1\fs22\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 \sbasedon0 \snext18 Subtitle;}}{\info{\author Unknown User}{\operator Unknown User}
|
||||
{\creatim\yr2002\mo9\dy24\hr21\min17}{\revtim\yr2002\mo9\dy24\hr21\min46}{\version5}{\edmins12}{\nofpages1}{\nofwords72}{\nofchars414}{\*\company Unknown Organization}{\nofcharsws0}{\vern8249}}\margl1417\margr1417\margt1417\margb1417
|
||||
\widowctrl\ftnbj\aenddoc\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind4\viewscale90\nolnhtadjtbl \fet0\sectd
|
||||
\linex0\headery708\footery708\colsx708\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}
|
||||
{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s17\qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0
|
||||
\b\fs28\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 {\f1\fs20 Tenebrae Credits (Win32)
|
||||
\par }\pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1043\langfe1043\cgrid\langnp1043\langfenp1043 {\b\f1\fs20\lang2057\langfe1043\langnp2057
|
||||
\par }\pard\plain \s18\qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \b\f1\fs22\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 {\fs20 Website
|
||||
\par }\pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1043\langfe1043\cgrid\langnp1043\langfenp1043 {\field\flddirty{\*\fldinst {\f1\fs20\lang2057\langfe1043\langnp2057 HYPERLINK "http://tenebrae.sourceforge.net/" }{
|
||||
\f1\fs20\lang2057\langfe1043\langnp2057 {\*\datafield
|
||||
00d0c9ea79f9bace118c8200aa004ba90b02000000170000002100000068007400740070003a002f002f00740065006e00650062007200610065002e0073006f00750072006300650066006f007200670065002e006e00650074002f000000e0c9ea79f9bace118c8200aa004ba90b4200000068007400740070003a002f00
|
||||
2f00740065006e00650062007200610065002e0073006f00750072006300650066006f007200670065002e006e00650074002f00000000000000000000}}}{\fldrslt {\cs15\f1\fs20\ul\cf17\lang2057\langfe1043\langnp2057 http://tenebrae.sourceforge.net/}}}{
|
||||
\f1\fs20\lang2057\langfe1043\langnp2057
|
||||
\par
|
||||
\par }\pard\plain \s1\qc \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\rin0\lin0\itap0 \b\fs22\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 {\f1\fs20\lang1036\langfe1043\langnp1036 Main programmer
|
||||
\par }\pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1043\langfe1043\cgrid\langnp1043\langfenp1043 {\f1\fs20\lang1036\langfe1043\langnp1036 Charles Hollemeersch
|
||||
\par }{\field\flddirty{\*\fldinst {\f1\fs20\lang1036\langfe1043\langnp1036 HYPERLINK "http://users.pandora.be/hollemeersch/blackrose/" }{\f1\fs20\lang1036\langfe1043\langnp1036 {\*\datafield
|
||||
00d0c9ea79f9bace118c8200aa004ba90b02000000170000003000000068007400740070003a002f002f00750073006500720073002e00700061006e0064006f00720061002e00620065002f0068006f006c006c0065006d006500650072007300630068002f0062006c00610063006b0072006f00730065002f000000e0c9
|
||||
ea79f9bace118c8200aa004ba90b6000000068007400740070003a002f002f00750073006500720073002e00700061006e0064006f00720061002e00620065002f0068006f006c006c0065006d006500650072007300630068002f0062006c00610063006b0072006f00730065002f0000000000000000000000000000}}
|
||||
}{\fldrslt {\cs15\f1\fs20\ul\cf17\lang1036\langfe1043\langnp1036 http://users.pandora.be/hollemeersch/blackrose/}}}{\f1\fs20\lang1036\langfe1043\langnp1036
|
||||
\par
|
||||
\par }\pard\plain \s1\qc \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\rin0\lin0\itap0 \b\fs22\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 {\f1\fs20 Art
|
||||
\par }\pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1043\langfe1043\cgrid\langnp1043\langfenp1043 {\f1\fs20\lang2057\langfe1043\langnp2057 Willi Hammes
|
||||
\par }{\field\flddirty{\*\fldinst {\f1\fs20\lang2057\langfe1043\langnp2057 HYPERLINK "http://www.3dluvr.com/willi/" }{\f1\fs20 {\*\datafield
|
||||
00d0c9ea79f9bace118c8200aa004ba90b02000000170000001d00000068007400740070003a002f002f007700770077002e00330064006c007500760072002e0063006f006d002f00770069006c006c0069002f000000e0c9ea79f9bace118c8200aa004ba90b3a00000068007400740070003a002f002f00770077007700
|
||||
2e00330064006c007500760072002e0063006f006d002f00770069006c006c0069002f0000000000000000000000000000}}}{\fldrslt {\cs15\f1\fs20\ul\cf17\lang2057\langfe1043\langnp2057 http://www.3dluvr.com/willi/}}}{\f1\fs20\lang2057\langfe1043\langnp2057
|
||||
\par
|
||||
\par }\pard\plain \s1\qc \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\rin0\lin0\itap0 \b\fs22\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 {\f1\fs20 Radeon Support
|
||||
\par }\pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1043\langfe1043\cgrid\langnp1043\langfenp1043 {\f1\fs20\lang2057\langfe1043\langnp2057 Jaaco Panaan
|
||||
\par }{\field\flddirty{\*\fldinst {\f1\fs20\lang2057\langfe1043\langnp2057 HYPERLINK "http://www.s2.org/~jpaana/" }{\f1\fs20\lang2057\langfe1043\langnp2057 {\*\datafield
|
||||
00d0c9ea79f9bace118c8200aa004ba90b02000000170000001b00000068007400740070003a002f002f007700770077002e00730032002e006f00720067002f007e006a007000610061006e0061002f000000e0c9ea79f9bace118c8200aa004ba90b3600000068007400740070003a002f002f007700770077002e007300
|
||||
32002e006f00720067002f007e006a007000610061006e0061002f000000}}}{\fldrslt {\cs15\f1\fs20\ul\cf17\lang2057\langfe1043\langnp2057 http://www.s2.org/~jpaana/}}}{\f1\fs20\lang2057\langfe1043\langnp2057
|
||||
\par }{\b\f1\fs20\lang2057\langfe1043\langnp2057
|
||||
\par Quake-C flashlight
|
||||
\par }{\f1\fs20\lang2057\langfe1043\langnp2057 Matt McChesney}{\f1\fs22\lang2057\langfe1043\langnp2057
|
||||
\par
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\rin0\lin0\itap0 \b\fs22\lang2057\langfe1043\cgrid\langnp2057\langfenp1043 {\f1
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1043\langfe1043\cgrid\langnp1043\langfenp1043 {\fs20\lang2057\langfe1043\langnp2057
|
||||
\par }}
|
BIN
mainu.dfm
Normal file
BIN
mainu.dfm
Normal file
Binary file not shown.
393
mainu.pas
Normal file
393
mainu.pas
Normal file
|
@ -0,0 +1,393 @@
|
|||
unit mainu;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||
StdCtrls, Buttons, IniFiles;
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
BitBtn1: TBitBtn;
|
||||
BitBtn2: TBitBtn;
|
||||
GroupBox1: TGroupBox;
|
||||
GroupBox2: TGroupBox;
|
||||
RadioButton1: TRadioButton;
|
||||
RadioButton2: TRadioButton;
|
||||
RadioButton3: TRadioButton;
|
||||
CheckBox1: TCheckBox;
|
||||
RadioButton4: TRadioButton;
|
||||
RadioButton5: TRadioButton;
|
||||
RadioButton6: TRadioButton;
|
||||
GroupBox3: TGroupBox;
|
||||
Edit1: TEdit;
|
||||
Label1: TLabel;
|
||||
Memo1: TMemo;
|
||||
Resolution: TGroupBox;
|
||||
ComboBox1: TComboBox;
|
||||
CheckBox2: TCheckBox;
|
||||
GroupBox4: TGroupBox;
|
||||
Edit2: TEdit;
|
||||
CheckBox3: TCheckBox;
|
||||
CheckBox4: TCheckBox;
|
||||
Label2: TLabel;
|
||||
BitBtn3: TBitBtn;
|
||||
ComboBox2: TComboBox;
|
||||
Label3: TLabel;
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure BitBtn2Click(Sender: TObject);
|
||||
procedure BitBtn1Click(Sender: TObject);
|
||||
procedure BitBtn3Click(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure ComboBox2Change(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
CurrentConfig : String;
|
||||
|
||||
Procedure CreateModeList;
|
||||
Function AssembleParamString : string;
|
||||
Function GetMirIndex : integer;
|
||||
Function GetTexIndex : integer;
|
||||
Function GetFilter : string;
|
||||
Function GetAnisoIndex : integer;
|
||||
Function GetForceWaterIndex : integer;
|
||||
Procedure LoadConfig(Ident : String);
|
||||
Procedure SaveConfig(Ident : String);
|
||||
Function FindConfigs : integer;
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
uses cred;
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
var
|
||||
modes : array[0..255] of tdevMode;
|
||||
|
||||
function DisplayModeInfo(index : integer) : string;
|
||||
var
|
||||
amode : ^tdevMode;
|
||||
succes : boolean;
|
||||
i : integer;
|
||||
begin
|
||||
if index >= 255 then
|
||||
begin
|
||||
Result := 'STOP';
|
||||
exit;
|
||||
end;
|
||||
|
||||
if not EnumDisplaySettings(nil,index,modes[index]) then
|
||||
begin
|
||||
Result := 'STOP';
|
||||
exit;
|
||||
end;
|
||||
|
||||
amode := @modes[index];
|
||||
//force 16 or 32 bit modes
|
||||
if amode.dmBitsPerPel <> 32 then
|
||||
begin
|
||||
result := '';
|
||||
end else
|
||||
begin
|
||||
//search if you already have the specified resolution in the list...
|
||||
|
||||
for i := 0 to index-1 do
|
||||
begin
|
||||
if (modes[index].dmPelsWidth = modes[i].dmPelsWidth)
|
||||
and (modes[index].dmPelsHeight = modes[i].dmPelsHeight)
|
||||
and (modes[i].dmBitsPerPel = 32) then
|
||||
begin
|
||||
//yes? then just skip it
|
||||
result := '';
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
result := inttostr(amode.dmPelsWidth)+' x '+
|
||||
inttostr(amode.dmPelsHeight)+' x '+
|
||||
inttostr(amode.dmBitsPerPel);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.CreateModeList;
|
||||
var
|
||||
s : string;
|
||||
i : integer;
|
||||
begin
|
||||
i := 0;
|
||||
s := DisplayModeInfo(i);
|
||||
while s <> 'STOP' do
|
||||
begin
|
||||
if s <> '' then ComboBox1.Items.AddObject(s,Pointer(i));
|
||||
inc(i);
|
||||
s := DisplayModeInfo(i);
|
||||
end;
|
||||
if ComboBox1.Items.Count = 0 then
|
||||
begin
|
||||
ComboBox1.Items.Add('No 32 bit modes found');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Application.Title := 'Tenebrae Config';
|
||||
CreateModeList;
|
||||
ComboBox1.ItemIndex := 0;
|
||||
|
||||
if FindConfigs = 0 then
|
||||
begin
|
||||
SaveConfig('Standard');
|
||||
FindConfigs;
|
||||
end;
|
||||
ComboBox2.ItemIndex := 0;
|
||||
CurrentConfig := ComboBox2.Items.Strings[ComboBox2.ItemIndex];
|
||||
LoadConfig(CurrentConfig);
|
||||
end;
|
||||
|
||||
function TForm1.GetMirIndex : integer;
|
||||
begin
|
||||
if RadioButton1.Checked then
|
||||
begin
|
||||
result := 0;
|
||||
exit;
|
||||
end;
|
||||
if RadioButton2.Checked then
|
||||
begin
|
||||
result := 1;
|
||||
exit;
|
||||
end;
|
||||
if RadioButton3.Checked then
|
||||
begin
|
||||
result := 2;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TForm1.GetTexIndex : integer;
|
||||
begin
|
||||
if RadioButton4.Checked then
|
||||
begin
|
||||
result := 0;
|
||||
exit;
|
||||
end;
|
||||
if RadioButton5.Checked then
|
||||
begin
|
||||
result := 1;
|
||||
exit;
|
||||
end;
|
||||
if RadioButton6.Checked then
|
||||
begin
|
||||
result := 2;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TForm1.GetForceWaterIndex : integer;
|
||||
begin
|
||||
if CheckBox1.Checked then
|
||||
begin
|
||||
result := 1;
|
||||
exit;
|
||||
end;
|
||||
result := 0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
function TForm1.GetFilter : string;
|
||||
begin
|
||||
if CheckBox3.Checked then
|
||||
result := 'GL_LINEAR_MIPMAP_LINEAR'
|
||||
else
|
||||
result := 'GL_LINEAR_MIPMAP_NEAREST';
|
||||
end;
|
||||
|
||||
function TForm1.GetAnisoIndex : integer;
|
||||
begin
|
||||
if CheckBox4.Checked then
|
||||
result := 1
|
||||
else
|
||||
result := 0;
|
||||
end;
|
||||
|
||||
function TForm1.AssembleParamString : string;
|
||||
var
|
||||
s : string;
|
||||
amode : ^tdevMode;
|
||||
begin
|
||||
amode := @modes[integer(ComboBox1.Items.Objects[ComboBox1.ItemIndex])];
|
||||
|
||||
//screen res
|
||||
s := ' -width '+IntToStr(amode.dmPelsWidth)+' -height '+IntToStr(amode.dmPelsHeight)+' -bpp 32 ';
|
||||
//mirrors
|
||||
s := s + '+mir_detail ' + IntToStr(getMirIndex) + ' +mir_forcewater ' + IntToStr(GetForceWaterIndex) + ' ';
|
||||
//textures
|
||||
s := s + '+gl_picmip ' + IntToStr(getTexIndex) + ' ';
|
||||
//lightgen
|
||||
s := s + '+sh_radiusscale '+ Edit1.Text;
|
||||
//windowed
|
||||
if CheckBox2.Checked then
|
||||
s := s+' -window';
|
||||
//texture filtering
|
||||
s := s+' +gl_texturemode '+GetFilter+' ';
|
||||
|
||||
if CheckBox4.Checked then
|
||||
s := s+' -anisotropic ';
|
||||
//aditional params
|
||||
s := s+' '+edit2.text;
|
||||
|
||||
result := s;
|
||||
end;
|
||||
|
||||
procedure TForm1.LoadConfig(Ident : String);
|
||||
var
|
||||
IniFile : TIniFile;
|
||||
begin
|
||||
IniFile := TIniFile.Create(ExtractFileDir(ParamStr(0))+'\'+ident+'.tcfg');
|
||||
RadioButton1.Checked := IniFile.ReadBool('MIRROR','Disabled',false);
|
||||
RadioButton2.Checked := IniFile.ReadBool('MIRROR','World',true);
|
||||
RadioButton3.Checked := IniFile.ReadBool('MIRROR','Full',false);
|
||||
CheckBox1.Checked := IniFile.ReadBool('MIRROR','ForceWater',false);
|
||||
|
||||
RadioButton4.Checked := IniFile.ReadBool('TEXTURE','Full',true);
|
||||
RadioButton5.Checked := IniFile.ReadBool('TEXTURE','HalfSize',false);
|
||||
RadioButton6.Checked := IniFile.ReadBool('TEXTURE','QuadSize',true);
|
||||
CheckBox3.Checked := IniFile.ReadBool('TEXTURE','TriLinear',false);
|
||||
CheckBox4.Checked := IniFile.ReadBool('TEXTURE','Anisotropic',false);
|
||||
|
||||
ComboBox1.ItemIndex := IniFile.ReadInteger('RESOLUTION','Mode',0);
|
||||
CheckBox2.Checked := IniFile.ReadBool('RESOLUTION','Windowed',false);
|
||||
|
||||
Edit1.Text := IniFile.ReadString('LIGHTS','Radiusscale','0.5');
|
||||
|
||||
Edit2.Text := IniFile.ReadString('MISC','Extra','');
|
||||
|
||||
IniFile.Free;
|
||||
end;
|
||||
|
||||
procedure TForm1.SaveConfig(Ident : String);
|
||||
var
|
||||
IniFile : TIniFile;
|
||||
begin
|
||||
IniFile := TIniFile.Create(ExtractFileDir(ParamStr(0))+'\'+ident+'.tcfg');
|
||||
IniFile.WriteBool('MIRROR','Disabled',RadioButton1.Checked);
|
||||
IniFile.WriteBool('MIRROR','World',RadioButton2.Checked);
|
||||
IniFile.WriteBool('MIRROR','Full',RadioButton3.Checked);
|
||||
IniFile.WriteBool('MIRROR','ForceWater',CheckBox1.Checked);
|
||||
|
||||
IniFile.WriteBool('TEXTURE','Full',RadioButton4.Checked);
|
||||
IniFile.WriteBool('TEXTURE','HalfSize',RadioButton5.Checked);
|
||||
IniFile.WriteBool('TEXTURE','QuadSize',RadioButton6.Checked);
|
||||
IniFile.WriteBool('TEXTURE','TriLinear',CheckBox3.Checked);
|
||||
IniFile.WriteBool('TEXTURE','Anisotropic',CheckBox4.Checked);
|
||||
|
||||
IniFile.WriteInteger('RESOLUTION','Mode',ComboBox1.ItemIndex);
|
||||
IniFile.WriteBool('RESOLUTION','Windowed',CheckBox2.Checked);
|
||||
|
||||
IniFile.WriteString('LIGHTS','Radiusscale',Edit1.Text);
|
||||
|
||||
IniFile.WriteString('MISC','Extra',Edit2.Text);
|
||||
|
||||
Inifile.Free;
|
||||
end;
|
||||
|
||||
Function ExtractFileBase(v : String) : String;
|
||||
begin
|
||||
//hack assume extension is 5 chars (.tcfg)
|
||||
result := Copy(v,0,length(v)-5);
|
||||
end;
|
||||
|
||||
Function TForm1.FindConfigs : integer;
|
||||
var
|
||||
F : TSearchRec;
|
||||
Res, Count : Integer;
|
||||
begin
|
||||
Res := FindFirst(ExtractFileDir(ParamStr(0))+'\*.tcfg',0,F);
|
||||
Count := 0;
|
||||
ComboBox2.Items.Clear;
|
||||
while (Res = 0) do
|
||||
begin
|
||||
ComboBox2.Items.Add(ExtractFileBase(F.Name));
|
||||
Inc(Count);
|
||||
Res := FindNext(F);
|
||||
end;
|
||||
FindClose(F);
|
||||
|
||||
result := Count;
|
||||
end;
|
||||
|
||||
procedure TForm1.BitBtn2Click(Sender: TObject);
|
||||
var
|
||||
winbestand : array [0..1024] of char;
|
||||
toexec : String;
|
||||
begin
|
||||
toexec := 'tenebrae.exe' + AssembleParamString;
|
||||
if winexec(StrPCopy(winbestand, toexec),sw_show) < 31 then messagedlg('Windows'+
|
||||
' could not launch Tenebrae'+chr(13)+ToExec,mterror,[mbok],0);
|
||||
SaveConfig(CurrentConfig);
|
||||
application.terminate;
|
||||
end;
|
||||
|
||||
procedure TForm1.BitBtn1Click(Sender: TObject);
|
||||
begin
|
||||
SaveConfig(CurrentConfig);
|
||||
Application.Terminate;
|
||||
end;
|
||||
|
||||
procedure TForm1.BitBtn3Click(Sender: TObject);
|
||||
begin
|
||||
Form2.ShowModal;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
var
|
||||
newname : string;
|
||||
begin
|
||||
NewName := 'NewProfile'+IntToStr(ComboBox2.Items.Count);
|
||||
if not InputQuery('Enter profile name','Enter a name for the new profile',newname) then
|
||||
exit;
|
||||
SaveConfig(CurrentConfig);
|
||||
if newname = '' then
|
||||
begin
|
||||
newname := 'Necrophilia!';
|
||||
//Edit2.Text := 'The pale skin, memory''s off the...';
|
||||
//Edit1.Text := '... moonlight';
|
||||
end;
|
||||
SaveConfig(newname);
|
||||
CurrentConfig := newname;
|
||||
//FindConfigs;
|
||||
ComboBox2.Items.Add(newname);
|
||||
ComboBox2.ItemIndex := ComboBox2.Items.Count-1;
|
||||
end;
|
||||
|
||||
procedure TForm1.ComboBox2Change(Sender: TObject);
|
||||
begin
|
||||
SaveConfig(CurrentConfig);
|
||||
CurrentConfig := ComboBox2.Items.Strings[ComboBox2.ItemIndex];
|
||||
LoadConfig(CurrentConfig);
|
||||
end;
|
||||
|
||||
procedure TForm1.Button2Click(Sender: TObject);
|
||||
begin
|
||||
If ComboBox2.Items.Count < 2 then
|
||||
begin
|
||||
messagedlg('You need at least one profile',mterror,[mbok],0);
|
||||
exit;
|
||||
end;
|
||||
CurrentConfig := ComboBox2.Items.Strings[ComboBox2.ItemIndex];
|
||||
DeleteFile(ExtractFileDir(ParamStr(0))+'\'+CurrentConfig+'.tcfg');
|
||||
FindConfigs;
|
||||
ComboBox2.ItemIndex := 0;
|
||||
CurrentConfig := ComboBox2.Items.Strings[ComboBox2.ItemIndex];
|
||||
LoadConfig(CurrentConfig);
|
||||
end;
|
||||
|
||||
end.
|
Loading…
Reference in a new issue