Skip to content

Commit

Permalink
[Trunk] TES5LODGen update, LODGen options form
Browse files Browse the repository at this point in the history
git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1879 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
  • Loading branch information
zilav authored and Ortham committed May 17, 2015
1 parent a61a6ca commit 3e9d821
Show file tree
Hide file tree
Showing 7 changed files with 566 additions and 122 deletions.
2 changes: 1 addition & 1 deletion FileSelectFrm.dfm
Expand Up @@ -50,7 +50,7 @@ object frmFileSelect: TfrmFileSelect
object cbBackup: TCheckBox
Left = 8
Top = 582
Width = 97
Width = 113
Height = 17
Anchors = [akLeft, akBottom]
Caption = 'Backup plugins'
Expand Down
25 changes: 12 additions & 13 deletions TES5Edit.dpr
Expand Up @@ -26,9 +26,7 @@ uses
VirtualTrees in 'VirtualTrees.pas',
VTEditors in 'VTEditors.pas',
VirtualEditTree in 'VirtualEditTree.pas',
{$IFNDEF LiteVersion}
cxVTEditors,
{$ENDIF}
wbInit in 'wbInit.pas',
wbBSA in 'wbBSA.pas',
wbHelpers in 'wbHelpers.pas',
Expand All @@ -41,17 +39,18 @@ uses
wbSort in 'wbSort.pas',
wbLOD in 'wbLOD.pas',
wbLocalization in 'wbLocalization.pas',
frmViewMain in 'frmViewMain.pas' {frmMain},
FilterOptionsFrm in 'FilterOptionsFrm.pas' {frmFilterOptions},
FileSelectFrm in 'FileSelectFrm.pas' {frmFileSelect},
ViewElementsFrm in 'ViewElementsFrm.pas' {frmViewElements},
EditWarningFrm in 'EditWarningFrm.pas' {frmEditWarning},
frmWaitForm in 'frmWaitForm.pas' {frmWait},
frmLocalizationForm in 'frmLocalizationForm.pas' {frmLocalization},
frmLocalizePluginForm in 'frmLocalizePluginForm.pas' {frmLocalizePlugin},
frmScriptForm in 'frmScriptForm.pas' {frmScript},
frmOptionsForm in 'frmOptionsForm.pas' {frmOptions},
frmLogAnalyzerForm in 'frmLogAnalyzerForm.pas' {frmLogAnalyzer},
frmViewMain in 'frmViewMain.pas', {frmMain}
FilterOptionsFrm in 'FilterOptionsFrm.pas', {frmFilterOptions}
FileSelectFrm in 'FileSelectFrm.pas', {frmFileSelect}
ViewElementsFrm in 'ViewElementsFrm.pas', {frmViewElements}
EditWarningFrm in 'EditWarningFrm.pas', {frmEditWarning}
frmWaitForm in 'frmWaitForm.pas', {frmWait}
frmLocalizationForm in 'frmLocalizationForm.pas', {frmLocalization}
frmLocalizePluginForm in 'frmLocalizePluginForm.pas', {frmLocalizePlugin}
frmScriptForm in 'frmScriptForm.pas', {frmScript}
frmOptionsForm in 'frmOptionsForm.pas', {frmOptions}
frmLogAnalyzerForm in 'frmLogAnalyzerForm.pas', {frmLogAnalyzer}
frmLODGenForm in 'frmLODGenForm.pas', {frmLODGen}
wbDefinitionsFNV in 'wbDefinitionsFNV.pas',
wbDefinitionsFO3 in 'wbDefinitionsFO3.pas',
wbDefinitionsTES3 in 'wbDefinitionsTES3.pas',
Expand Down
214 changes: 214 additions & 0 deletions frmLODGenForm.dfm
@@ -0,0 +1,214 @@
object frmLODGen: TfrmLODGen
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'LODGen Options'
ClientHeight = 410
ClientWidth = 791
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
KeyPreview = True
OldCreateOrder = False
Position = poMainFormCenter
OnKeyDown = FormKeyDown
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 8
Top = 327
Width = 769
Height = 39
AutoSize = False
Caption =
'Only worldspaces that have existing lodsettings file "LODSetting' +
's\<Worldspace>.lod" are shown either in the Data folder, or in B' +
'SA archives. Archives are loaded similar to the game itself - th' +
'e ones specified in Skyrim.ini and those that match loaded plugi' +
'ns names.'
WordWrap = True
end
object Label2: TLabel
Left = 8
Top = 8
Width = 232
Height = 13
Caption = 'Select worldspace(s) to generate LOD for'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
end
object Label3: TLabel
Left = 376
Top = 46
Width = 401
Height = 33
AutoSize = False
Caption =
'Create distant LOD for static objects like mountains, rocks, hou' +
'ses, castles and the like. Requires lowpoly LOD mesh resources t' +
'o be present in the Data folder.'
WordWrap = True
end
object Label4: TLabel
Left = 376
Top = 198
Width = 401
Height = 50
AutoSize = False
Caption =
'Create distant LOD for trees. Requires 2D billboard images to be' +
' present in the Data folder or in BSA archives. Those are not in' +
'cluded with the game and must be installed separately.'
WordWrap = True
end
object clbWorldspace: TCheckListBox
Left = 8
Top = 24
Width = 329
Height = 297
ItemHeight = 13
PopupMenu = PopupMenu1
TabOrder = 1
end
object pnlBottom: TPanel
Left = 0
Top = 369
Width = 791
Height = 41
Align = alBottom
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
ExplicitLeft = -135
ExplicitTop = 407
ExplicitWidth = 935
DesignSize = (
791
41)
object btnOk: TButton
Left = 593
Top = 10
Width = 91
Height = 25
Anchors = [akTop, akRight]
Caption = 'Generate'
ModalResult = 1
TabOrder = 0
ExplicitLeft = 737
end
object btnCancel: TButton
Left = 690
Top = 10
Width = 91
Height = 25
Anchors = [akTop, akRight]
Caption = 'Cancel'
ModalResult = 2
TabOrder = 1
ExplicitLeft = 834
end
object pnlBevel: TPanel
AlignWithMargins = True
Left = 4
Top = 0
Width = 783
Height = 1
Margins.Left = 4
Margins.Top = 0
Margins.Right = 4
Margins.Bottom = 0
Align = alTop
TabOrder = 2
ExplicitWidth = 927
end
end
object cbObjectsLOD: TCheckBox
Left = 360
Top = 24
Width = 97
Height = 17
Caption = 'Objects LOD'
Checked = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
State = cbChecked
TabOrder = 2
OnClick = cbObjectsLODClick
end
object cbTreesLOD: TCheckBox
Left = 360
Top = 176
Width = 97
Height = 17
Caption = 'Trees LOD'
Checked = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
State = cbChecked
TabOrder = 3
end
object cbNoTangents: TCheckBox
Left = 376
Top = 87
Width = 145
Height = 17
Hint =
'Reduces size of generated LOD and frees memory for the game at t' +
'he expense of LOD quality'
Caption = 'No tangents'
ParentShowHint = False
ShowHint = True
TabOrder = 4
end
object cbNoVertexColors: TCheckBox
Left = 376
Top = 110
Width = 145
Height = 17
Hint =
'Reduces size of generated LOD and frees memory for the game at t' +
'he expense of LOD quality'
Caption = 'No vertex colors'
ParentShowHint = False
ShowHint = True
TabOrder = 5
end
object btnSplitTreesLOD: TButton
Left = 672
Top = 255
Width = 105
Height = 25
Caption = 'Split LOD Atlas'
TabOrder = 6
Visible = False
OnClick = btnSplitTreesLODClick
end
object PopupMenu1: TPopupMenu
Left = 168
Top = 104
object SelectAll1: TMenuItem
Caption = 'Select All'
OnClick = SelectAll1Click
end
object SelectNone1: TMenuItem
Caption = 'Select None'
OnClick = SelectNone1Click
end
end
end
106 changes: 106 additions & 0 deletions frmLODGenForm.pas
@@ -0,0 +1,106 @@
unit frmLODGenForm;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, CheckLst, Menus, wbInterface;

type
TfrmLODGen = class(TForm)
clbWorldspace: TCheckListBox;
pnlBottom: TPanel;
btnOk: TButton;
btnCancel: TButton;
pnlBevel: TPanel;
Label1: TLabel;
cbObjectsLOD: TCheckBox;
Label2: TLabel;
cbTreesLOD: TCheckBox;
Label3: TLabel;
cbNoTangents: TCheckBox;
cbNoVertexColors: TCheckBox;
Label4: TLabel;
btnSplitTreesLOD: TButton;
PopupMenu1: TPopupMenu;
SelectAll1: TMenuItem;
SelectNone1: TMenuItem;
procedure cbObjectsLODClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btnSplitTreesLODClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure SelectAll1Click(Sender: TObject);
procedure SelectNone1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
SplitTreesLOD: procedure (const aWorldspace: IwbMainRecord) of object;
end;

var
frmLODGen: TfrmLODGen;

implementation

{$R *.dfm}

procedure TfrmLODGen.btnSplitTreesLODClick(Sender: TObject);
var
i: integer;
begin
if not Assigned(SplitTreesLOD) then
Exit;

for i := 0 to Pred(clbWorldspace.Count) do
if clbWorldspace.Checked[i] then
SplitTreesLOD(IwbMainRecord(Integer(clbWorldspace.Items.Objects[i])));
end;

procedure TfrmLODGen.cbObjectsLODClick(Sender: TObject);
begin
cbNoTangents.Enabled := cbObjectsLOD.Checked;
cbNoVertexColors.Enabled := cbObjectsLOD.Checked;
end;

procedure TfrmLODGen.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then
ModalResult := mrCancel;
end;

procedure TfrmLODGen.FormShow(Sender: TObject);
begin
cbObjectsLODClick(nil);
end;

procedure TfrmLODGen.SelectAll1Click(Sender: TObject);
var
i: Integer;
begin
clbWorldspace.Items.BeginUpdate;
try
for i := 0 to Pred(clbWorldspace.Items.Count) do
if clbWorldspace.ItemEnabled[i] then
clbWorldspace.Checked[i] := True;
finally
clbWorldspace.Items.EndUpdate;
end;
end;

procedure TfrmLODGen.SelectNone1Click(Sender: TObject);
var
i: Integer;
begin
clbWorldspace.Items.BeginUpdate;
try
for i := 0 to Pred(clbWorldspace.Items.Count) do
if clbWorldspace.ItemEnabled[i] then
clbWorldspace.Checked[i] := False;
finally
clbWorldspace.Items.EndUpdate;
end;
end;

end.
Binary file modified frmViewMain.dfm
Binary file not shown.

0 comments on commit 3e9d821

Please sign in to comment.