OSDN Git Service

TStringListの代わりにTHashedStringListを使うように変更。
[winbottle/svg-dll.git] / SVG.dpr
diff --git a/SVG.dpr b/SVG.dpr
index fad21d0..098877e 100644 (file)
--- a/SVG.dpr
+++ b/SVG.dpr
@@ -1,6 +1,6 @@
 {
 SSTP Bottle Surface Preview Plug-In for "SVG"
-(C)2003 naru, Mikage Sawatari / SSTP Bottle
+(C)2003-2004 WinBottle Project / SSTP Bottle
 }
 
 library SVG;
@@ -18,7 +18,7 @@ const
 var
   MyPath: String;
   GhostFile: String;
-  Ghost2File: TStringList;
+  Ghost2File: THashedStringList;
 
   Pic: TPicture;       // \93Ç\82Ý\8eæ\82Á\82½\89æ\91\9c(*.png, *.bmp, *.jpg)
   PicFileName: String; // \82»\82Ì\83t\83@\83C\83\8b\96¼
@@ -41,7 +41,7 @@ begin
   end;
   if not FileExists(GhostFile) then
     ShowMessage('SVG.dll Warning: Ghost file is not specified');
-  Ghost2File := TStringList.Create;
+  Ghost2File := THashedStringList.Create;
   Pic := TPicture.Create;
   PicFileName := '';
 end;
@@ -62,7 +62,7 @@ end;
 // CanConfigure\82Í\81AConfigure\82ð\8cÄ\82Î\82ê\82Ä\82â\82é\82±\82Æ\82ª\82 \82é\82©\82Ç\82¤\82©\82ð\95Ô\82·\81B
 function GetVersion(DLLName: PChar; NameLen: integer;
   var Version: integer; var CanConfigure: boolean): integer; cdecl;
-const ThisDLL = 'SVG Surface Loader Ver. 2.3';
+const ThisDLL = 'SVG Surface Loader Ver. 2.5';
 begin
   Version := 1;
   CanConfigure := true;
@@ -221,17 +221,20 @@ begin
         SakuraName := Val;
         Ghost2File.Values[SakuraName] := FileName; //\8e\9f\82©\82ç\82Ì\83V\83\87\81[\83g\83J\83b\83g
         if SakuraName <> Ghost then //\95Ê\83S\81[\83X\83g\82Ì\92è\8b`\83t\83@\83C\83\8b\82È\82Ì\82Å\83p\83X
+        begin
+          Result := '';
           Exit;
+        end;
       end else if Key = 'surfacefile' then
       begin
         Result := Val;
       end else if (Key = 'surface') or (Length(Key) = 0) then
       begin
         // \83T\81[\83t\83B\83X
-        if System.Pos(':', Blocks[i]) <= 0 then
+        if System.Pos(':', Val) <= 0 then
           Continue;
-        SurStr := Copy(Blocks[i], 1, System.Pos(':', Blocks[i])-1);
-        PosStr := Copy(Blocks[i], System.Pos(':', Blocks[i])+1, High(integer));
+        SurStr := Copy(Val, 1, System.Pos(':', Val)-1);
+        PosStr := Copy(Val, System.Pos(':', Val)+1, High(integer));
         try
           if System.Pos('-', SurStr) > 0 then
           begin
@@ -339,6 +342,8 @@ begin
       for i := 0 to Ghosts.Count-1 do
       begin
         AGhost.CommaText := Ghosts[i];
+        if AGhost.Count = 0 then
+          Continue;
         if AGhost[0] <> 'GHOST' then
           Continue;
         DefFileName := Dir + AGhost[3];