3 {
4 -----------------------------------
5 WADEDITOR.PAS ÂÅÐÑÈß ÎÒ 26.08.08
7 Ïîääåðæêà âàäîâ âåðñèè 1
8 -----------------------------------
9 }
11 interface
13 uses
17 type
21 private
27 public
41 {
42 const
43 DFWAD_NOERROR = 0;
44 DFWAD_ERROR_WADNOTFOUND = -1;
45 DFWAD_ERROR_CANTOPENWAD = -2;
46 DFWAD_ERROR_RESOURCENOTFOUND = -3;
47 DFWAD_ERROR_FILENOTWAD = -4;
48 DFWAD_ERROR_WADNOTLOADED = -5;
49 DFWAD_ERROR_READRESOURCE = -6;
50 DFWAD_ERROR_READWAD = -7;
51 DFWAD_ERROR_WRONGVERSION = -8;
52 }
55 procedure g_ProcessResourceStr (ResourceStr: String; var FileName, SectionName, ResourceName: String); overload;
56 procedure g_ProcessResourceStr (ResourceStr: String; FileName, SectionName, ResourceName: PString); overload;
59 implementation
61 uses
65 procedure g_ProcessResourceStr (ResourceStr: String; var FileName, SectionName, ResourceName: String);
66 var
69 begin
70 //e_WriteLog(Format('g_ProcessResourceStr0: [%s]', [ResourceStr]), MSG_NOTIFY);
73 Break;
81 SectionName := Copy(ResourceStr, i+1, Length(ResourceStr)-Length(ResourceName)-Length(FileName)-2);
85 procedure g_ProcessResourceStr (ResourceStr: AnsiString; FileName, SectionName, ResourceName: PAnsiString);
86 var
89 begin
90 //e_WriteLog(Format('g_ProcessResourceStr1: [%s]', [ResourceStr]), MSG_NOTIFY);
93 Break;
96 begin
99 end
100 else
107 begin
110 end
111 else
119 { TWADEditor_1 }
121 begin
127 begin
134 begin
140 begin
142 if fFileName <> '' then e_WriteLog(Format('TWADEditor_1.ReadFile: [%s] closed', [fFileName]), MSG_NOTIFY);
147 function TWADEditor_1.GetResource (Section, Resource: string; var pData: Pointer; var Len: Integer): Boolean;
148 var
153 begin
158 begin
161 //e_WriteLog(Format('DFWAD: searching for [%s : %s] in [%s]; current is [%s : %s] (%d, %d)', [Section, Resource, fFileName, fi.path, fi.name, SFSStrComp(fi.path, Section), SFSStrComp(fi.name, Resource)]), MSG_NOTIFY);
163 begin
164 // i found her!
168 begin
170 break;
177 e_WriteLog(Format('DFWAD: file [%s%s] FOUND in [%s]; size is %d bytes', [Section, Resource, fFileName, Len]), MSG_NOTIFY);
178 exit;
181 e_WriteLog(Format('DFWAD: file [%s%s] not found in [%s]', [Section, Resource, fFileName]), MSG_WARNING);
186 var
189 begin
194 begin
198 begin
207 begin
220 var
224 var
229 begin
238 try
241 begin
243 Exit;
245 except
247 Exit;
260 begin