Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#16

AW: Beschleunigung von Laderoutine

  Alt 16. Aug 2016, 12:07
So geht's jetzt.
Mal sehen ob ich an anderer stelle noch was optimieren kann.

Delphi-Quellcode:
  // is ShowCover
  if ShowCover then
  begin
    if CoverPath <> 'then
    begin
      if CoverPath <> Path then
        ScanDirectory(CoverPath, 'jpg, jpeg, png', False);

      if aCovers.count > 0 then
        LstCoverPath.Clear;

      if (aCovers.count > QuadCount) then
      begin
        // delete first Cover
        aCovers.Delete(0);
        // move textures from destination to source
        for I := 0 to (aCovers.count - 1) do
        begin
          quadTexture[I] := quadTexture[I + 1];
          // add to List
          LstCoverPath.Add(aCovers[I]);
          // Load last Testure
          if I = (QuadCount - 1) then
          begin
            // extract Filename
            aFileName := ExtractFileName(aCovers[I]);
            // extract extension
            aFileName := Copy(aFileName, 1, Length(aFileName) - Length(ExtractFileExt(aFileName)));
            // uppercase
            aFileName := AnsiUpperCase(aFileName);

            Name := ExtractFileName(GetAlbumArtistName);
            if Name <> 'then
              Name := Copy(Name, 1, Length(Name) - Length(ExtractFileExt(Name)));
            if (aFileName = 'FOLDER') or (aFileName = Name) then
            begin
              if quadTexture[I] <> NoCoverTexture then
                glDeleteTextures(1, @quadTexture[I]);

              LoadTexture(aCovers[I], quadTexture[I], False);
            end;
          end;
        end;
      end
      else
      begin
        for I := 0 to (aCovers.count - 1) do
        begin
          // extract Filename
          aFileName := ExtractFileName(aCovers[I]);
          // extract extension
          aFileName := Copy(aFileName, 1, Length(aFileName) - Length(ExtractFileExt(aFileName)));
          // uppercase
          aFileName := AnsiUpperCase(aFileName);

          Name := ExtractFileName(GetAlbumArtistName);
          if Name <> 'then
            Name := Copy(Name, 1, Length(Name) - Length(ExtractFileExt(Name)));
          if (aFileName = 'FOLDER') or (aFileName = Name) then
          begin
            if quadTexture[I] = NoCoverTexture then
              LoadTexture(aCovers[I], quadTexture[I], False);

            // add to List
            LstCoverPath.Add(aCovers[I]);
          end;
        end; // end for i
      end;

      transAlpha := 1.0;
      if (LastAddCover = 0) or (LastAddCover = Round(NoCoverTexture)) then
        Result := False;
      if LstCoverPath.count <> 0 then
      begin
        InitAlbumIniPath;
        SaveINI;
      end;
    end;
  end; //end ShowCover
Danke für die Hilfe..

gruss

Geändert von EWeiss (16. Aug 2016 um 12:29 Uhr)
  Mit Zitat antworten Zitat