hedgewars/uLandObjects.pas
changeset 7640 e9e6b4d740f6
parent 7555 acadabfb2dd1
child 8025 07862ab415c8
child 8026 4a4f21070479
equal deleted inserted replaced
7639:41e6de947531 7640:e9e6b4d740f6
   208 until y > (LAND_HEIGHT-125);
   208 until y > (LAND_HEIGHT-125);
   209 
   209 
   210 if x1 > 0 then
   210 if x1 > 0 then
   211 begin
   211 begin
   212     bRes:= true;
   212     bRes:= true;
   213     tmpsurf:= LoadImage(UserPathz[ptCurrTheme] + '/Girder', ifTransparent or ifIgnoreCaps);
   213     tmpsurf:= LoadDataImageAltPath(ptCurrTheme, ptGraphics, 'Girder', ifCritical or ifTransparent or ifIgnoreCaps);
   214     if tmpsurf = nil then
       
   215         tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Girder', ifTransparent or ifIgnoreCaps);
       
   216     if tmpsurf = nil then
       
   217         tmpsurf:= LoadImage(UserPathz[ptGraphics] + '/Girder', ifTransparent or ifIgnoreCaps);
       
   218     if tmpsurf = nil then
       
   219         tmpsurf:= LoadImage(Pathz[ptGraphics] + '/Girder', ifCritical or ifTransparent or ifIgnoreCaps);
       
   220 
   214 
   221     rr.x:= x1;
   215     rr.x:= x1;
   222     while rr.x < x2 do
   216     while rr.x < x2 do
   223         begin
   217         begin
   224         // For testing only. Intent is to flag this on objects with masks, or use it for an ice ray gun
   218         // For testing only. Intent is to flag this on objects with masks, or use it for an ice ray gun
   561         begin
   555         begin
   562         inc(ThemeObjects.Count);
   556         inc(ThemeObjects.Count);
   563         with ThemeObjects.objs[Pred(ThemeObjects.Count)] do
   557         with ThemeObjects.objs[Pred(ThemeObjects.Count)] do
   564             begin
   558             begin
   565             i:= Pos(',', s);
   559             i:= Pos(',', s);
   566             Surf:= LoadImage(UserPathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
   560             Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
   567             if Surf = nil then
       
   568                 Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifCritical or ifTransparent or ifIgnoreCaps);
       
   569             Width:= Surf^.w;
   561             Width:= Surf^.w;
   570             Height:= Surf^.h;
   562             Height:= Surf^.h;
   571             Delete(s, 1, i);
   563             Delete(s, 1, i);
   572             i:= Pos(',', s);
   564             i:= Pos(',', s);
   573             Maxcnt:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   565             Maxcnt:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   621         begin
   613         begin
   622         inc(SprayObjects.Count);
   614         inc(SprayObjects.Count);
   623         with SprayObjects.objs[Pred(SprayObjects.Count)] do
   615         with SprayObjects.objs[Pred(SprayObjects.Count)] do
   624             begin
   616             begin
   625             i:= Pos(',', s);
   617             i:= Pos(',', s);
   626             Surf:= LoadImage(UserPathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
   618             Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
   627             if Surf = nil then
       
   628                 Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifCritical or ifTransparent or ifIgnoreCaps);
       
   629             Width:= Surf^.w;
   619             Width:= Surf^.w;
   630             Height:= Surf^.h;
   620             Height:= Surf^.h;
   631             Delete(s, 1, i);
   621             Delete(s, 1, i);
   632             Maxcnt:= StrToInt(Trim(s));
   622             Maxcnt:= StrToInt(Trim(s));
   633             end;
   623             end;