From 6db1465f89985e8675db3fdac1aa7d662dda3722 Mon Sep 17 00:00:00 2001 From: s_alexander Date: Sat, 19 Apr 2008 15:23:35 +0000 Subject: tried to make songloading working with the old loader and keep all changes that were made since starting to work on a new one *hope that worked* you may delete your existing cover.cache (the cover cache is still NOT working) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1024 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/USong_TextFile.pas | 86 ------------------------------------ 1 file changed, 86 deletions(-) delete mode 100644 Game/Code/Classes/USong_TextFile.pas (limited to 'Game/Code/Classes/USong_TextFile.pas') diff --git a/Game/Code/Classes/USong_TextFile.pas b/Game/Code/Classes/USong_TextFile.pas deleted file mode 100644 index a3e605de..00000000 --- a/Game/Code/Classes/USong_TextFile.pas +++ /dev/null @@ -1,86 +0,0 @@ -unit USong_TextFile; - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -{$I switches.inc} - -uses - Classes, - SysUtils, - USong; - -type - {******************* - Child of the new TSong class. - implements filehandling to load a song from a text file - *******************} - TSong_TextFile = class(TSong) - protected - SongFile: TextFile; - - Function OpenSongFile: Boolean; - Function IsDataAvailable: Boolean; - Function GetNextLine(): String; - Procedure CloseSongFile; - end; - -implementation - -uses - ULog; - -//-------- -// Open the SongFile -//-------- -Function TSong_TextFile.OpenSongFile: Boolean; -begin - Result := False; - - if not FileExists(FilePath + FileName) then - Log.LogError('File does not exsist', FilePath + FileName) - else - begin - try - AssignFile(SongFile, FilePath + FileName); - Reset(SongFile); - Result := True; - except - Log.LogError('Faild to open file', FilePath + FileName) - end; - end; -end; - -//-------- -// More data in songfile available? -//-------- -Function TSong_TextFile.IsDataAvailable: Boolean; -begin - Result := not eof(SongFile); -end; - -//-------- -// Returns the next line from the SongFile -//-------- -Function TSong_TextFile.GetNextLine(): String; -begin - ReadLn(SongFile, Result); - Result := Trim(Result); -end; - -//-------- -// Close the SongFile -//-------- -Procedure TSong_TextFile.CloseSongFile; -begin - try - CloseFile(SongFile); - except - Log.LogError('Error closing file', FilePath + FileName); - end; -end; - -end. \ No newline at end of file -- cgit v1.2.3