mirror of
https://github.com/moparisthebest/Simba
synced 2024-12-25 00:39:04 -05:00
Fixed a lil bug in the FontCopy function, and added new method to the bitmap manager -> GetNewIndex.
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@458 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
d20f973f61
commit
691bddcde6
@ -96,6 +96,7 @@ type
|
||||
FreeSpots : Array of integer;
|
||||
BmpArray : TMufasaBmpArray;
|
||||
BmpsCurr,BmpsHigh,FreeSpotsHigh,FreeSpotsLen : integer;
|
||||
function GetNewIndex : integer;
|
||||
public
|
||||
function GetBMP(Index : integer) : TMufasaBitmap;
|
||||
property Bmp[Index : integer]: TMufasaBitmap read GetBMP;
|
||||
@ -164,6 +165,24 @@ end;
|
||||
|
||||
{ TMBitmaps }
|
||||
|
||||
function TMBitmaps.GetNewIndex: integer;
|
||||
begin
|
||||
if BmpsCurr < BmpsHigh then
|
||||
begin;
|
||||
inc(BmpsCurr);
|
||||
Result := BmpsCurr;
|
||||
end else if (FreeSpotsHigh > -1) then
|
||||
begin;
|
||||
Result := FreeSpots[FreeSpotsHigh];
|
||||
dec(FreeSpotsHigh);
|
||||
end else
|
||||
begin;
|
||||
SetLength(BmpArray, BmpsHigh + 6);
|
||||
BmpsHigh := BmpsHigh + 5;
|
||||
inc(BmpsCurr);
|
||||
Result := BmpsCurr;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMBitmaps.GetBMP(Index: integer): TMufasaBitmap;
|
||||
begin
|
||||
@ -177,21 +196,7 @@ end;
|
||||
|
||||
function TMBitmaps.CreateBMP(w,h : integer): Integer;
|
||||
begin
|
||||
if BmpsCurr < BmpsHigh then
|
||||
begin;
|
||||
inc(BmpsCurr);
|
||||
Result := BmpsCurr;
|
||||
end else if (FreeSpotsHigh > -1) then
|
||||
begin;
|
||||
Result := FreeSpots[FreeSpotsHigh];
|
||||
dec(FreeSpotsHigh);
|
||||
end else
|
||||
begin;
|
||||
SetLength(BmpArray, BmpsHigh + 6);
|
||||
BmpsHigh := BmpsHigh + 5;
|
||||
inc(BmpsCurr);
|
||||
Result := BmpsCurr;
|
||||
end;
|
||||
result := GetNewIndex;
|
||||
BmpArray[Result] := TMufasaBitmap.Create;
|
||||
BmpArray[Result].SetSize(w,h);
|
||||
BmpArray[Result].Index:= Result;
|
||||
@ -199,21 +204,7 @@ end;
|
||||
|
||||
function TMBitmaps.AddBMP(_bmp: TMufasaBitmap): Integer;
|
||||
begin
|
||||
if BmpsCurr < BmpsHigh then
|
||||
begin;
|
||||
inc(BmpsCurr);
|
||||
Result := BmpsCurr;
|
||||
end else if (FreeSpotsHigh > -1) then
|
||||
begin;
|
||||
Result := FreeSpots[FreeSpotsHigh];
|
||||
dec(FreeSpotsHigh);
|
||||
end else
|
||||
begin;
|
||||
SetLength(BmpArray, BmpsHigh + 6);
|
||||
BmpsHigh := BmpsHigh + 5;
|
||||
inc(BmpsCurr);
|
||||
Result := BmpsCurr;
|
||||
end;
|
||||
Result := GetNewIndex;
|
||||
BmpArray[Result] := _bmp;
|
||||
end;
|
||||
|
||||
|
@ -92,7 +92,7 @@ var
|
||||
begin
|
||||
Result := TMFont.Create;
|
||||
Result.Name := Self.Name;
|
||||
Move(Self.Data.ascii[0], Self.Data.ascii[0], length(Self.Data.ascii) * SizeOf(Integer));
|
||||
Move(Self.Data.ascii[0], Result.Data.ascii[0], length(Self.Data.ascii) * SizeOf(TocrGlyphMetric));
|
||||
l := Length(Self.Data.Pos);
|
||||
SetLength(Result.Data.pos, l);
|
||||
for i := 0 to l - 1 do
|
||||
@ -204,7 +204,6 @@ begin
|
||||
if Shadow then
|
||||
F.Name := F.Name + '_s';
|
||||
f.Data := ocrdata;
|
||||
|
||||
Fonts.Add(f);
|
||||
{$IFDEF FONTDEBUG}
|
||||
writeln('Loaded Font ' + f.Name);
|
||||
|
Loading…
Reference in New Issue
Block a user