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

Comparing oup/current/Global/DatStructureLoader.pas (file contents):
Revision 112 by alloc, Thu Feb 22 00:37:39 2007 UTC vs.
Revision 204 by alloc, Sun May 27 20:03:41 2007 UTC

# Line 68 | Line 68 | begin
68        Result := 4;
69      100..300:
70        Result := datatype - 100;
71 +    500..614:
72 +      Result := 4;
73      1000..9999:
74        Result := datatype - 1000;
75      10000..65535:
76        Result := datatype - 10000;
77 +  else
78 +    Result := 0;
79    end;
80   end;
81  
# Line 128 | Line 132 | end;
132  
133   function LoadStructureDefinition(ConnectionID, FileID: Integer): TStructDef;
134   var
131  i:      Integer;
135    current_type: Byte; //0: Global, 1: Undynamic, 2: Dynamic
136    current_base, current_package, current_package_size: Integer;
137    packages: Integer;
# Line 177 | Line 180 | begin
180                3:
181                begin
182                  current_type := 1;
183 <                current_base := HexToLong(fields[2]);
183 >                current_base := StrToInt(fields[2]);
184                  SetLength(Result.Subs, Length(Result.Subs) + 1);
185                  Result.Subs[High(Result.Subs)].SubName :=
186                    MidStr(fields[0], 2, Length(fields[0]) - 1);
# Line 186 | Line 189 | begin
189                6:
190                begin
191                  current_type    := 2;
192 <                current_base    := HexToLong(fields[2]);
192 >                current_base    := StrToInt(fields[2]);
193                  current_package := 0;
194                  current_package_size := StrToInt(fields[5]);
195                  if fields[4][1] <> '$' then
196                  begin
197                    case StrToInt(fields[4]) of
198                      1:
199 <                      packages := Data[HexToLong(fields[3])];
199 >                      packages := Data[StrToInt(fields[3])];
200                      2:
201 <                      packages := Data[HexToLong(fields[3])] + Data[HexToLong(fields[3]) + 1] * 256;
201 >                      packages := Data[StrToInt(fields[3])] + Data[StrToInt(fields[3]) + 1] * 256;
202                      4:
203 <                      packages := Data[HexToLong(fields[3])] + Data[HexToLong(fields[3]) + 1] *
204 <                        256 + Data[HexToLong(fields[3]) + 2] * 256 * 256 + Data[HexToLong(fields[3]) + 3] * 256 * 256 * 256;
203 >                      packages := Data[StrToInt(fields[3])] + Data[StrToInt(fields[3]) + 1] *
204 >                        256 + Data[StrToInt(fields[3]) + 2] * 256 * 256 + Data[StrToInt(fields[3]) + 3] * 256 * 256 * 256;
205                    end;
206                  end
207                  else
208                  begin
209 <                  packages := HexToLong(fields[4]);
209 >                  packages := StrToInt(fields[4]);
210                  end;
211                  SetLength(Result.Subs, Length(Result.Subs) + packages);
212                  for current_package := 0 to packages - 1 do
# Line 237 | Line 240 | begin
240                    structentry.description := '';
241                  if current_type in [0, 1] then
242                  begin
243 <                  structentry.offset := HexToLong(fields[1]) + current_base;
243 >                  structentry.offset := StrToInt(fields[1]) + current_base;
244                    if Length(Result.Subs) = 0 then
245                    begin
246                      SetLength(Result.Global, Length(Result.Global) + 1);
# Line 256 | Line 259 | begin
259                    for current_package := 0 to packages - 1 do
260                    begin
261                      structentry.offset :=
262 <                      current_base + current_package * current_package_size + HexToLong(fields[1]);
262 >                      current_base + current_package * current_package_size + StrToInt(fields[1]);
263                      with Result.Subs[High(Result.Subs) - packages + current_package + 1] do
264                      begin
265                        SetLength(Entries, Length(Entries) + 1);

Diff Legend

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