Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TFL3dCobject.DrawCmp(const Geometry:FL3D_GEOM;const Transform:PD3DXMatrix;const Start,Count:UINT;const Level:Byte);
- var
- P : Integer;
- M : Integer;
- LMat : PD3DXMatrix;
- Last : Integer;
- Temp : TD3DXMatrix;
- begin
- for P := 0 to High(FParts) do
- with FParts[P] do
- if Model >= 0 then
- with F3dbs[Model] do
- if UINT(Level) < UINT(Length(Levels)) then
- with Levels[Level] do
- begin
- Last := -1;
- if Geometry = FL3D_GEOM_MODEL then
- LMat := D3DXMatrixMultiply(Temp,Mat,Transform^) else
- LMat := @Mat;
- for M := 0 to High(_3d) do
- with _3d[M] do
- begin
- if Last <> Material then
- begin
- Last := -1;
- if LMat <> nil then FL.FX.SetModel(LMat^);
- if not FL.FX.Apply(Geometry, FL.Materials[Material], FL.DC) then Continue;
- Last := Material;
- end;
- if Geometry = FL3D_GEOM_MODEL then
- FL.DC.Draw(VCount, VStart) else
- FL.DC.DrawInstanced(VCount, Count, VStart, Start);
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement