aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UCovers.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-12 12:43:38 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-12 12:43:38 +0000
commit6e7b96ca3a7d47b0441bed904a9b8bb25c3223de (patch)
tree2c0fa5010e7e8c37000d7fdd52d9e919e3f0555a /Game/Code/Classes/UCovers.pas
parent08ad90ec9f574c7dc153c8d40169f3a58c9beb9a (diff)
downloadusdx-6e7b96ca3a7d47b0441bed904a9b8bb25c3223de.tar.gz
usdx-6e7b96ca3a7d47b0441bed904a9b8bb25c3223de.tar.xz
usdx-6e7b96ca3a7d47b0441bed904a9b8bb25c3223de.zip
* added missed dependency PNGImage.
* moved FUNCTION InitializePaths(), from uFiles to uMain as this is a more sane location for it. * updated files that used UFiles to point to UMain, and removed uFiles where its not needed. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@385 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UCovers.pas64
1 files changed, 35 insertions, 29 deletions
diff --git a/Game/Code/Classes/UCovers.pas b/Game/Code/Classes/UCovers.pas
index 5b0a06d4..0740c143 100644
--- a/Game/Code/Classes/UCovers.pas
+++ b/Game/Code/Classes/UCovers.pas
@@ -34,7 +34,11 @@ var
Covers: TCovers;
implementation
-uses UFiles, ULog, DateUtils;
+
+uses UMain,
+ // UFiles,
+ ULog,
+ DateUtils;
constructor TCovers.Create;
begin
@@ -56,48 +60,50 @@ var
Name: string;
// Data: array of byte;
begin
- if FileExists(GamePath + 'covers.cache') then begin
- AssignFile(F, GamePath + 'covers.cache');
- Reset(F, 1);
+ if FileExists(GamePath + 'covers.cache') then
+ begin
+ AssignFile(F, GamePath + 'covers.cache');
+ Reset(F, 1);
- WritetoFile := not FileIsReadOnly(GamePath + 'covers.cache');
+ WritetoFile := not FileIsReadOnly(GamePath + 'covers.cache');
- SetLength(Cover, 0);
+ SetLength(Cover, 0);
- while not EOF(F) do begin
- SetLength(Cover, Length(Cover)+1);
+ while not EOF(F) do
+ begin
+ SetLength(Cover, Length(Cover)+1);
- BlockRead(F, W, 2);
- Cover[High(Cover)].W := W;
+ BlockRead(F, W, 2);
+ Cover[High(Cover)].W := W;
- BlockRead(F, H, 2);
- Cover[High(Cover)].H := H;
+ BlockRead(F, H, 2);
+ Cover[High(Cover)].H := H;
- BlockRead(F, Bits, 1);
+ BlockRead(F, Bits, 1);
- Cover[High(Cover)].Size := W * H * (Bits div 8);
+ Cover[High(Cover)].Size := W * H * (Bits div 8);
- // test
-// W := 128;
-// H := 128;
-// Bits := 24;
-// Seek(F, FilePos(F) + 3);
+ // test
+ // W := 128;
+ // H := 128;
+ // Bits := 24;
+ // Seek(F, FilePos(F) + 3);
- BlockRead(F, NLen, 2);
- SetLength(Name, NLen);
+ BlockRead(F, NLen, 2);
+ SetLength(Name, NLen);
- BlockRead(F, Name[1], NLen);
- Cover[High(Cover)].Name := Name;
+ BlockRead(F, Name[1], NLen);
+ Cover[High(Cover)].Name := Name;
- Cover[High(Cover)].Position := FilePos(F);
- Seek(F, FilePos(F) + W*H*(Bits div 8));
+ Cover[High(Cover)].Position := FilePos(F);
+ Seek(F, FilePos(F) + W*H*(Bits div 8));
-// SetLength(Cover[High(Cover)].Data, W*H*(Bits div 8));
-// BlockRead(F, Cover[High(Cover)].Data[0], W*H*(Bits div 8));
+ // SetLength(Cover[High(Cover)].Data, W*H*(Bits div 8));
+ // BlockRead(F, Cover[High(Cover)].Data[0], W*H*(Bits div 8));
- end;
+ end; // While
- CloseFile(F);
+ CloseFile(F);
end; // fileexists
end;