ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Tools/BinEdit.pas
(Generate patch)

Comparing oup/current/Tools/BinEdit.pas (file contents):
Revision 174 by alloc, Wed May 2 15:16:00 2007 UTC vs.
Revision 177 by alloc, Sat May 12 13:22:11 2007 UTC

# Line 58 | Line 58 | type
58    private
59      fileid: Integer;
60      ConID: Integer;
61 +    rawlist: TRawDataList;
62    public
63    end;
64  
# Line 66 | Line 67 | var
67  
68   implementation
69  
70 < uses ValueEdit, Main, Functions, DatStructureLoader{, RawEdit};
70 > uses ValueEdit, Main, Functions, DatStructureLoader, RawEdit;
71   {$R *.dfm}
72  
73   type
# Line 160 | Line 161 | begin
161      Self.ClearStructViewer;
162      mem := nil;
163      ConManager.Connection[ConID].LoadDatFile(fileid, TStream(mem));
164 +    rawlist := ConManager.Connection[ConID].GetRawList(fileid);
165      hex.LoadFromStream(mem);
166      mem.Free;
167      ClearValues;
# Line 172 | Line 174 | begin
174      Self.ClearStructViewer;
175      ClearValues;
176      hex.DataSize := 0;
177 +    SetLength(rawlist, 0);
178    end;
179   end;
180  
# Line 180 | Line 183 | end;
183   function TForm_BinEdit.GetValue(datatype: Word; offset: Integer): String;
184   var
185    Data: TByteData;
186 <  i:    Word;
186 >  i:    Integer;
187    tempi: Integer;
188    floatformat: TFormatSettings;
189   begin
# Line 218 | Line 221 | begin
221        Result := IntToBin(hex.Data[offset]);
222      11:
223      begin
224 <      tempi := ConManager.Connection[ConID].GetRawInfo(fileid, offset).RawAddr;
225 <      if tempi >= 0 then
226 <        Result := '0x' + IntToHex(tempi, 8)
227 <      else
228 <        Result := 'unused';
224 >      if Length(rawlist) > 0 then
225 >        for i := 0 to High(rawlist) do
226 >          if rawlist[i].SrcOffset = offset then
227 >          begin
228 >            if rawlist[i].RawAddr > 0 then
229 >              Result := '0x' + IntToHex(rawlist[i].RawAddr, 8)
230 >            else
231 >              Result := 'unused';
232 >            Break;
233 >          end;
234      end;
235      12:
236        if hex.Data[offset] = 1 then
# Line 744 | Line 752 | procedure TForm_BinEdit.VSTDblClick(Send
752   var
753    node: PVirtualNode;
754    nodedata: PNodeData;
755 +  rawinfo: TRawDataInfo;
756    form: TForm_ToolTemplate;
757   begin
758    if VST.FocusedColumn = 3 then
# Line 761 | Line 770 | begin
770      begin
771        if (nodedata.DataType = 11) and (nodedata.Value <> 'unused') then
772        begin
773 <        if ConManager.Connection[ConID].GetRawInfo(fileid, nodedata.offset).RawSize > 0 then
774 <          Form_Main.open_child('rawedit', ConID, fileid);
773 >        rawinfo := ConManager.Connection[ConID].GetRawInfo(fileid, nodedata.offset);
774 >        if rawinfo.RawSize > 0 then
775 >        begin
776 >          form := nil;
777 >          form := Form_Main.open_child('rawedit', ConID, fileid);
778 >          if Assigned(form) then
779 >            TForm_RawEdit(form).LoadRaw(rawinfo);
780 >        end;
781        end;
782        if (nodedata.DataType = 12) and (nodedata.Value <> 'no link') then
783        begin

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)