^^ No Problem with English, my English is not better XD...
The question was only for me, to see how Code has solved the problem ;-)
I self use a Array and Records to reflect the Animation :
Littel Screatchie Excemple to understand Syncron Animation Draw and Time under Mir3 :
^^ I hope it helps a bit...
The question was only for me, to see how Code has solved the problem ;-)
I self use a Array and Records to reflect the Animation :
Littel Screatchie Excemple to understand Syncron Animation Draw and Time under Mir3 :
Code:
type
TAnimation = record
aRunFrame : Byte;
aMaxFrame : Byte;
aRunTime : LongInt;
aMaxRunTime : Integer;
end;
var
FAnimationArray : array [1..50] of TAnimation;
procedure TimeAnimateArry;
var
I : Integer;
begin
for I := 1 to 50 do
if (GetTickCount - FAnimationArray[I].aRunTime > FAnimationArray[I].aMaxRunTime) then
begin
if FAnimationArray[I].aMaxFrame = FAnimationArray[I].aRunFrame then
FAnimationArray[I].aRunFrame := 0
else Inc(FAnimationArray[I].aRunFrame);
FAnimationArray[I].aRunTime := GetTickCount;
end;
end;
procedure IniteAnimation;
begin
FillChar(FAnimationArray,49,0);
FAnimationArray[1].aMaxFrame := 2;
FAnimationArray[1].aMaxRunTime := 400;
FAnimationArray[1].aRunTime := GetTickCount;
FAnimationArray[2].aMaxFrame := 4;
FAnimationArray[2].aMaxRunTime := 350;
FAnimationArray[2].aRunTime := GetTickCount;
...
FAnimationArray[35].aMaxFrame := 22;
FAnimationArray[35].aMaxRunTime := 120;
FAnimationArray[35].aRunTime := GetTickCount;
...
end;
:::: Create System :::
constructor TRenderEngine.Create;
begin
inherited Create;
...
IniteAnimation;
end;
:::: in Render Engine ::::
TimeAnimateArry;
BeginScene;
...
EndScene;
^^ I hope it helps a bit...