Fully rewritten for Lazarus. Has no backward compatibility with Delphi XE4 now. Now it can be compiled for Windows/Linux/MacOSX.
This commit is contained in:
59
ucommon.pas
Normal file
59
ucommon.pas
Normal file
@@ -0,0 +1,59 @@
|
||||
unit ucommon;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
cProgramName = 'Tim2View by [Lab 313]';
|
||||
cProgramVersion = '2.0 Release';
|
||||
cExtractedTimsDir = 'TIMS';
|
||||
cExtractedPngsDir = 'PNGS';
|
||||
cMaxFileSize = $2EAEED80;
|
||||
|
||||
cAutoExtractionTimFormat = '%s_%.6d_%.2db' + '.tim';
|
||||
cAutoExtractionPngFormat = '%s_%.6d_%.2db_%.2dc' + '.png';
|
||||
cCLUTGridColsCount = 32;
|
||||
|
||||
sStatusBarScanningFile = 'Scanning File...';
|
||||
sStatusBarTimsExtracting = 'TIMs Extracting...';
|
||||
sStatusBarPngsExtracting = 'PNGs Extracting...';
|
||||
sStatusBarExtracted = 'Exctracted Successfully!';
|
||||
sStatusBarParsingResult = 'Parsing Result...';
|
||||
sScanResultGood = 'Scan completed!';
|
||||
sSelectDirCaption = 'Please, select directory for scan...';
|
||||
sThisTimHasNoCLUT = 'No CLUT';
|
||||
|
||||
type
|
||||
TBytesArray = array [0 .. cMaxFileSize - 1] of byte;
|
||||
PBytesArray = ^TBytesArray;
|
||||
|
||||
function ExtractJustName(const Path: string): string;
|
||||
function Min(A, B: Integer): Integer;
|
||||
function Max(A, B: Integer): Integer;
|
||||
|
||||
implementation
|
||||
|
||||
uses sysutils;
|
||||
|
||||
function Min(A, B: Integer): Integer;
|
||||
begin
|
||||
if A < B then
|
||||
Result := A
|
||||
else
|
||||
Result := B;
|
||||
end;
|
||||
|
||||
function Max(A, B: Integer): Integer;
|
||||
begin
|
||||
if A >= B then
|
||||
Result := A
|
||||
else
|
||||
Result := B;
|
||||
end;
|
||||
|
||||
function ExtractJustName(const Path: string): string;
|
||||
begin
|
||||
Result := ExtractFileName(Path);
|
||||
Result := Copy(Result, 1, Length(Result) - Length(ExtractFileExt(Result)));
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user