Advertisement
blackdoomer

doom2df old renderer speed question for ketmar

Dec 30th, 2024
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.05 KB | Source Code | 0 0
  1. // old algo (alas, no visible set)
  2. procedure g_Map_DrawPanels (PanelType: Word; hasAmbient: Boolean; constref ambColor: TDFColor);
  3.  
  4.   procedure DrawGeneral (constref panels: TPanelArray); inline;
  5.   var
  6.     i: Integer;
  7.   begin
  8.     if panels <> nil then
  9.     begin
  10.       for i := 0 to High(panels) do
  11.         if not panels[i].Door then panels[i].Draw(hasAmbient, ambColor);
  12.     end;
  13.   end;
  14.  
  15.   procedure DrawDoors (constref panels: TPanelArray); inline;
  16.   var
  17.     i: Integer;
  18.   begin
  19.     if panels <> nil then
  20.     begin
  21.       for i := 0 to High(panels) do
  22.         if panels[i].Enabled then panels[i].Draw(hasAmbient, ambColor);
  23.     end;
  24.   end;
  25.  
  26. begin
  27.   case PanelType of
  28.     PANEL_WALL:       DrawGeneral(gWalls);
  29.     PANEL_CLOSEDOOR:  DrawDoors(gWalls);
  30.     PANEL_BACK:       DrawGeneral(gRenderBackgrounds);
  31.     PANEL_FORE:       DrawGeneral(gRenderForegrounds);
  32.     PANEL_WATER:      DrawGeneral(gWater);
  33.     PANEL_ACID1:      DrawGeneral(gAcid1);
  34.     PANEL_ACID2:      DrawGeneral(gAcid2);
  35.     PANEL_STEP:       DrawGeneral(gSteps);
  36.   end;
  37. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement