Advertisement
Guest User

Untitled

a guest
Jun 14th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.20 KB | None | 0 0
  1. procedure TFL3dCobject.DrawCmp(const Geometry:FL3D_GEOM;const Transform:PD3DXMatrix;const Start,Count:UINT;const Level:Byte);
  2. var
  3. P      : Integer;
  4. M      : Integer;
  5. LMat   : PD3DXMatrix;
  6. Last   : Integer;
  7. Temp   : TD3DXMatrix;
  8. begin
  9. for P := 0 to High(FParts) do
  10.   with FParts[P] do
  11.     if Model >= 0 then
  12.       with F3dbs[Model] do
  13.         if UINT(Level) < UINT(Length(Levels)) then
  14.           with Levels[Level] do
  15.           begin
  16.             Last := -1;
  17.             if Geometry = FL3D_GEOM_MODEL then
  18.               LMat := D3DXMatrixMultiply(Temp,Mat,Transform^) else
  19.               LMat := @Mat;
  20.             for M := 0 to High(_3d) do
  21.               with _3d[M] do
  22.               begin
  23.                 if Last <> Material then
  24.                 begin
  25.                   Last := -1;
  26.                   if LMat <> nil then FL.FX.SetModel(LMat^);
  27.                   if not FL.FX.Apply(Geometry, FL.Materials[Material], FL.DC) then Continue;
  28.                   Last := Material;
  29.                 end;
  30.                 if Geometry = FL3D_GEOM_MODEL then
  31.                   FL.DC.Draw(VCount, VStart) else
  32.                   FL.DC.DrawInstanced(VCount, Count, VStart, Start);
  33.               end;
  34.           end;
  35. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement