Changeset 214
- Timestamp:
- Jun 12, 2007, 7:35:56 PM (17 years ago)
- Location:
- oup/current
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/FileClasses/TXAN.pas
r213 r214 10 10 protected 11 11 procedure InitDatLinks; override; 12 procedure InitRawList; override; 13 public 12 14 procedure InitDataFields; override; 13 procedure InitRawList; override;14 15 end; 15 16 … … 22 23 var 23 24 tempi: Integer; 24 temps: String;25 templist: TStringList;26 25 begin 27 26 inherited; 28 27 FDataFields := TBlock.Create(Self, nil, 0, 'Base', '', nil); 29 templist := TStringList.Create;30 28 with FDataFields do 31 29 begin … … 49 47 AddField(TUnused, $1A, 'Unused', '', @tempi); 50 48 49 tempi := 2; 51 50 with AddField(TArray, $1C, 'AnimTextures array', '', @tempi) do 52 51 begin … … 54 53 end; 55 54 end; 56 templist.Free;57 55 end; 58 56 -
oup/current/FileClasses/TXMP.pas
r213 r214 10 10 protected 11 11 procedure InitDatLinks; override; 12 procedure InitRawList; override; 13 public 12 14 procedure InitDataFields; override; 13 procedure InitRawList; override;14 15 end; 15 16 -
oup/current/FileClasses/_EmptyFile.pas
r212 r214 10 10 protected 11 11 procedure InitDatLinks; override; 12 procedure InitRawList; override; 13 public 12 14 procedure InitDataFields; override; 13 procedure InitRawList; override;14 15 end; 15 16 … … 21 22 procedure TFile_Empty.InitDataFields; 22 23 begin 24 inherited; 23 25 FDataFields := TBlock.Create(Self, nil, 0, 'Base', '', nil); 24 26 end; -
oup/current/FileClasses/_FileTypes.pas
r213 r214 4 4 5 5 uses 6 TypeDefs, _DataTypes, Classes ;6 TypeDefs, _DataTypes, Classes, Forms; 7 7 8 8 … … 23 23 FDataFields: TBlock; 24 24 FRawParts: TRawDataList; 25 26 FEditor: TFrame; 27 FOpened: Boolean; 25 28 26 29 procedure InitDatLinks; virtual; abstract; … … 39 42 40 43 procedure InitDataFields; virtual; 44 procedure InitEditor; virtual; 41 45 42 46 property FileStream: TMemoryStream read FFileStream; … … 50 54 property Changed: Boolean read FChanged write FChanged; 51 55 56 property Editor: TFrame read FEditor; 57 property Opened: Boolean read FOpened write FOpened; 58 52 59 property ChildCount: Integer read GetChildCount; 53 60 property LinkByOffset[Offset: Integer]: TDatLink read GetDatLinkByOffset; … … 78 85 constructor TFile.Create(ConnectionID, FileID: Integer); 79 86 var 80 i: Integer;81 87 fileinfo: TFileInfo; 82 88 begin … … 100 106 InitRawList(); 101 107 FDataFields := nil; 108 FEditor := nil; 102 109 103 110 if not (Self is TFile_Empty) then … … 164 171 165 172 function TFile.GetFieldByOffset(Offset: Integer): TDataField; 166 var167 i: Integer;168 173 begin 169 174 Result := FDataFields.FieldByOffset[Offset]; … … 229 234 end; 230 235 236 procedure TFile.InitEditor; 237 begin 238 Exit; 239 end; 240 231 241 function GetDatLinkValue(stream: TStream; offset: Integer): Integer; 232 242 begin -
oup/current/FileClasses/_MetaManager.pas
r213 r214 2 2 interface 3 3 4 uses _FileTypes, TXAN, TXMP, _EmptyFile;4 uses _FileTypes, SUBT, TXAN, TXMP, _EmptyFile; 5 5 6 6 type … … 12 12 13 13 const 14 FileDescs: array[0..1] of TFileDesc = ( 14 FileDescs: array[0..2] of TFileDesc = ( 15 (ext: 'SUBT'; ftype: TFile_SUBT), 15 16 (ext: 'TXAN'; ftype: TFile_TXAN), 16 17 (ext: 'TXMP'; ftype: TFile_TXMP) … … 34 35 property FileById[Id: Integer]: TFile read GetFileById; 35 36 end; 37 38 var 39 Meta: TMetaManager; 36 40 37 41 implementation -
oup/current/OniUnPacker.bdsproj
r212 r214 177 177 <Language Name="RootDir"></Language> 178 178 </Language> 179 179 180 <Excluded_Packages> 180 181 <Excluded_Packages Name="d:\programme\borland\bds\3.0\Bin\dbwebxprt.bpl">Borland Web Wizard Package</Excluded_Packages> -
oup/current/OniUnPacker.dpr
r212 r214 36 36 _MetaManager in 'FileClasses\_MetaManager.pas', 37 37 _EmptyFile in 'FileClasses\_EmptyFile.pas', 38 TXAN in 'FileClasses\TXAN.pas'; 38 TXAN in 'FileClasses\TXAN.pas', 39 SUBT in 'FileClasses\SUBT.pas'; 39 40 40 41 {$R *.res} -
oup/current/Tools/MetaEditor.dfm
r212 r214 3 3 Top = 0 4 4 Caption = 'Form_Meta' 5 ClientHeight = 3 656 ClientWidth = 4 465 ClientHeight = 393 6 ClientWidth = 472 7 7 Color = clBtnFace 8 Constraints.MinHeight = 100 9 Constraints.MinWidth = 200 8 10 Font.Charset = DEFAULT_CHARSET 9 11 Font.Color = clWindowText … … 17 19 OnClose = FormClose 18 20 OnCreate = FormCreate 19 DesignSize = (20 44621 365)22 21 PixelsPerInch = 96 23 22 TextHeight = 13 24 object Label3: TLabel 25 Left = 3 26 Top = 6 27 Width = 61 28 Height = 13 29 Caption = 'Connection: ' 23 object Splitter1: TSplitter 24 Left = 384 25 Top = 29 26 Width = 8 27 Height = 364 28 Align = alRight 29 AutoSnap = False 30 Beveled = True 31 MinSize = 75 32 ExplicitLeft = 301 33 ExplicitHeight = 336 30 34 end 31 35 object VST: TVirtualStringTree 32 Left = 433 Top = 4434 Width = 40935 Height = 3 2136 A nchors = [akLeft, akTop, akRight, akBottom]36 Left = 0 37 Top = 29 38 Width = 384 39 Height = 364 40 Align = alClient 37 41 AnimationDuration = 0 38 42 Header.AutoSizeIndex = 0 … … 46 50 TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoDeleteMovedNodes] 47 51 TreeOptions.MiscOptions = [toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning] 52 OnFocusChanged = VSTFocusChanged 53 OnFocusChanging = VSTFocusChanging 48 54 OnGetText = VSTGetText 49 55 OnPaintText = VSTPaintText 50 56 OnInitChildren = VSTInitChildren 57 ExplicitLeft = 4 58 ExplicitTop = 44 59 ExplicitWidth = 301 60 ExplicitHeight = 321 51 61 Columns = < 52 62 item … … 68 78 end> 69 79 end 70 object Button1: TButton 71 Left = 204 72 Top = 1 73 Width = 75 74 Height = 25 75 Anchors = [akTop, akRight] 76 Caption = 'Load' 77 Default = True 80 object Panel1: TPanel 81 Left = 0 82 Top = 0 83 Width = 472 84 Height = 29 85 Align = alTop 86 BevelOuter = bvNone 78 87 TabOrder = 1 79 OnClick = Button1Click 88 ExplicitWidth = 446 89 DesignSize = ( 90 472 91 29) 92 object Label3: TLabel 93 Left = 3 94 Top = 6 95 Width = 61 96 Height = 13 97 Caption = 'Connection: ' 98 end 99 object Button1: TButton 100 Left = 379 101 Top = 1 102 Width = 75 103 Height = 25 104 Anchors = [akTop, akRight] 105 Caption = 'Load' 106 Default = True 107 TabOrder = 0 108 OnClick = Button1Click 109 ExplicitLeft = 196 110 end 111 object combo_connection: TComboBox 112 Left = 64 113 Top = 3 114 Width = 309 115 Height = 21 116 Style = csDropDownList 117 Anchors = [akLeft, akTop, akRight] 118 DropDownCount = 12 119 ItemHeight = 13 120 TabOrder = 1 121 ExplicitWidth = 126 122 end 80 123 end 81 object combo_connection: TComboBox 82 Left = 64 83 Top = 3 84 Width = 134 85 Height = 21 86 Style = csDropDownList 87 Anchors = [akLeft, akTop, akRight] 88 DropDownCount = 12 89 ItemHeight = 13 124 object Panel2: TPanel 125 Left = 392 126 Top = 29 127 Width = 80 128 Height = 364 129 Align = alRight 130 BevelOuter = bvNone 131 Caption = 'Panel2' 90 132 TabOrder = 2 133 ExplicitLeft = 329 134 ExplicitHeight = 336 91 135 end 92 136 end -
oup/current/Tools/MetaEditor.pas
r213 r214 3 3 uses 4 4 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 5 Dialogs, VirtualTrees, _MetaManager, StdCtrls ;5 Dialogs, VirtualTrees, _MetaManager, StdCtrls, ExtCtrls; 6 6 7 7 type 8 8 TForm_Meta = class(TForm) 9 9 VST: TVirtualStringTree; 10 Panel1: TPanel; 10 11 Button1: TButton; 12 combo_connection: TComboBox; 11 13 Label3: TLabel; 12 combo_connection: TComboBox; 14 Splitter1: TSplitter; 15 Panel2: TPanel; 13 16 procedure FormClose(Sender: TObject; var Action: TCloseAction); 14 17 procedure FormCreate(Sender: TObject); … … 21 24 const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; 22 25 TextType: TVSTTextType); 26 procedure VSTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; 27 Column: TColumnIndex); 28 procedure VSTFocusChanging(Sender: TBaseVirtualTree; OldNode, 29 NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex; 30 var Allowed: Boolean); 23 31 private 24 32 public 25 MetaManager: TMetaManager;26 33 end; 27 34 … … 64 71 begin 65 72 data := VST.GetNodeData(node); 66 for i := 0 to Meta Manager.FileById[TFile(data.Field).FileID].ChildCount - 1 do67 begin 68 id := Meta Manager.FileById[TFile(data.Field).FileID].LinkByIndex[i].DestID;69 Meta Manager.InitFile(id);70 newdata.Field := Meta Manager.FileById[id];73 for i := 0 to Meta.FileById[TFile(data.Field).FileID].ChildCount - 1 do 74 begin 75 id := Meta.FileById[TFile(data.Field).FileID].LinkByIndex[i].DestID; 76 Meta.InitFile(id); 77 newdata.Field := Meta.FileById[id]; 71 78 newnode := AddVSTEntry(VST, Node, newdata); 72 if Meta Manager.FileById[id].ChildCount > 0 then79 if Meta.FileById[id].ChildCount > 0 then 73 80 VST.HasChildren[newnode] := True; 74 81 end; 75 ChildCount := Meta Manager.FileById[TFile(data.Field).FileID].ChildCount;82 ChildCount := Meta.FileById[TFile(data.Field).FileID].ChildCount; 76 83 end; 77 84 … … 94 101 QueryPerformanceFrequency(c); 95 102 QueryPerformanceCounter(a); 96 MetaManager := TMetaManager.Create(conid); 103 if not Assigned(Meta) then 104 Meta := TMetaManager.Create(conid); 97 105 QueryPerformanceCounter(b); 98 106 ShowMessage('Loading Done - ' + FloatToStr((b-a)/c) + 's'); … … 100 108 VST.Clear; 101 109 VST.BeginUpdate; 102 for i := 0 to Meta Manager.FileCount - 1 do103 begin 104 if Assigned(Meta Manager.FileById[i]) then110 for i := 0 to Meta.FileCount - 1 do 111 begin 112 if Assigned(Meta.FileById[i]) then 105 113 begin 106 data.Field := Meta Manager.FileById[i];114 data.Field := Meta.FileById[i]; 107 115 node := AddVSTEntry(VST, nil, data); 108 if Meta Manager.FileById[i].ChildCount > 0 then116 if Meta.FileById[i].ChildCount > 0 then 109 117 VST.HasChildren[node] := True; 110 118 end; … … 116 124 procedure TForm_Meta.FormClose(Sender: TObject; var Action: TCloseAction); 117 125 begin 118 Meta Manager.Free;126 Meta.Free; 119 127 Action := caFree; 120 128 end; … … 158 166 159 167 168 169 procedure TForm_Meta.VSTFocusChanged(Sender: TBaseVirtualTree; 170 Node: PVirtualNode; Column: TColumnIndex); 171 var 172 data: PNodeData; 173 begin 174 data := Sender.GetNodeData(Node); 175 if data.Field is TFile then 176 begin 177 TFile(data.Field).InitEditor; 178 if Assigned(TFile(data.Field).Editor) then 179 begin 180 panel2.InsertControl(TFile(data.Field).Editor); 181 TFile(data.Field).Opened := True; 182 end; 183 end; 184 end; 185 186 procedure TForm_Meta.VSTFocusChanging(Sender: TBaseVirtualTree; OldNode, 187 NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex; 188 var Allowed: Boolean); 189 var 190 data: PNodeData; 191 i: Integer; 192 begin 193 data := Sender.GetNodeData(NewNode); 194 if data.Field is TFile then 195 begin 196 TFile(data.Field).InitEditor; 197 if Assigned(TFile(data.Field).Editor) then 198 Allowed := not TFile(data.Field).Opened 199 else 200 Allowed := True; 201 end; 202 if Allowed and Assigned(OldNode) then 203 begin 204 data := Sender.GetNodeData(OldNode); 205 if data.Field is TFile then 206 begin 207 if TFile(data.Field).Opened then 208 begin 209 if panel2.ControlCount > 0 then 210 for i := 0 to panel2.ControlCount - 1 do 211 panel2.RemoveControl(panel2.Controls[i]); 212 TFile(data.Field).Opened := False; 213 end; 214 end; 215 end; 216 end; 160 217 161 218 procedure TForm_Meta.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; -
oup/current/Tools/TxmpReplace.pas
r209 r214 225 225 226 226 procedure TForm_TxmpReplace.FormCreate(Sender: TObject); 227 var228 TXMP: TFile_TXMP;229 227 begin 230 228 inherited;
Note:
See TracChangeset
for help on using the changeset viewer.