GLScene 3 năm trước cách đây
mục cha
commit
806c2cec86
100 tập tin đã thay đổi với 2387 bổ sung2118 xóa
  1. 2 2
      AdvDemos/Archipelago/fArchipelagoC.cpp
  2. 2 2
      AdvDemos/Archipelago/fArchipelagoC.h
  3. 4 4
      AdvDemos/Archipelago/fArchipelagoD.pas
  4. 2 2
      AdvDemos/Forest/fForestD.pas
  5. 4 4
      AdvDemos/GLSViewer/Source/fMain.pas
  6. 114 96
      Demos/collisions/boxedin/fBoxedinD.pas
  7. 20 13
      Demos/extrusion/tentacles/fTentacleC.dfm
  8. 2 2
      Demos/glslshaders/Ocean/fOceanC.cpp
  9. 2 2
      Demos/glslshaders/Ocean/fOceanD.pas
  10. 2 2
      Demos/graph/points/fPointsC.cpp
  11. 43 24
      Demos/graph/points/fPointsC.dfm
  12. 58 57
      Demos/graph/points/fPointsD.pas
  13. 12 10
      Demos/graph/projection/fProjectionC.dfm
  14. 0 2
      Demos/media/Shaders/OIT_frag.glsl
  15. 0 2
      Demos/media/Shaders/OIT_vtx.glsl
  16. 0 1
      Demos/media/Shaders/ocean_fp.glsl
  17. 0 1
      Demos/media/Shaders/ocean_vp.glsl
  18. 0 1
      Demos/media/Shaders/shadowmap_fp.glsl
  19. 0 1
      Demos/media/Shaders/shadowmap_vp.glsl
  20. 0 1
      Demos/media/Shaders/shadowmapvis_fp.glsl
  21. 0 10
      Demos/media/Shaders/toon.frag
  22. 0 10
      Demos/media/Shaders/toon.vert
  23. 1 1
      Demos/meshes/ducky/fDuckyC.cpp
  24. 1 1
      Demos/meshes/ducky/fDuckyD.pas
  25. 9 9
      Demos/meshes/subdivide/fSubdivideC.cpp
  26. 9 9
      Demos/meshes/subdivide/fSubdivideD.pas
  27. 2 1
      Demos/meshes/tiles/TilesD.dpr
  28. 4 1
      Demos/meshes/tiles/TilesD.dproj
  29. 24 25
      Demos/meshes/tiles/fTilesC.cpp
  30. 68 38
      Demos/meshes/tiles/fTilesC.dfm
  31. 58 39
      Demos/utilities/ArchiveEdit/fMainD.dfm
  32. 5 4
      Demos/utilities/ArchiveEdit/fMainD.pas
  33. 4 4
      Demos/utilities/HTFUtils/fViewer.pas
  34. 8 8
      Packages/GLScene_Cg_DT.dproj
  35. 2 2
      Source/CUDA.APIComps.pas
  36. 4 4
      Source/Cg.Shader.pas
  37. 4 4
      Source/Formats.OCT.pas
  38. 6 6
      Source/Formats.VRML.pas
  39. 21 21
      Source/Formats.X.pas
  40. 2 2
      Source/Formats.m3DSTypes.pas
  41. 1 1
      Source/GLS.ArchiveManager.pas
  42. 18 18
      Source/GLS.BumpmapHDS.pas
  43. 2 2
      Source/GLS.Collision.pas
  44. 0 1
      Source/GLS.Coordinates.pas
  45. 13 13
      Source/GLS.CurvesAndSurfaces.pas
  46. 2 2
      Source/GLS.DCE.pas
  47. 1 1
      Source/GLS.EllipseCollision.pas
  48. 20 20
      Source/GLS.ExplosionFx.pas
  49. 20 20
      Source/GLS.Feedback.pas
  50. 1 1
      Source/GLS.File3DPDF.pas
  51. 56 56
      Source/GLS.File3DS.pas
  52. 13 13
      Source/GLS.FileASE.pas
  53. 130 0
      Source/GLS.FileDDS.pas
  54. 1 1
      Source/GLS.FileDEL.pas
  55. 2 2
      Source/GLS.FileGL2.pas
  56. 1 1
      Source/GLS.FileGLB.pas
  57. 1 1
      Source/GLS.FileGLTF.pas
  58. 2 2
      Source/GLS.FileLMTS.pas
  59. 12 12
      Source/GLS.FileMD5.pas
  60. 4 4
      Source/GLS.FileNMF.pas
  61. 4 4
      Source/GLS.FileNurbs.pas
  62. 17 17
      Source/GLS.FileOBJ.pas
  63. 1 1
      Source/GLS.FileSMD.pas
  64. 1 1
      Source/GLS.FileSTL.pas
  65. 1 1
      Source/GLS.FileTIN.pas
  66. 1 1
      Source/GLS.FileVOR.pas
  67. 21 21
      Source/GLS.FileVRML.pas
  68. 2 2
      Source/GLS.FireFX.pas
  69. 6 7
      Source/GLS.GeomObjects.pas
  70. 3 3
      Source/GLS.GeometryBB.pas
  71. 3 28
      Source/GLS.Graph.pas
  72. 5 5
      Source/GLS.Graphics.pas
  73. 0 2
      Source/GLS.HeightData.pas
  74. 15 22
      Source/GLS.HeightTileFileHDS.pas
  75. 3 3
      Source/GLS.Imposter.pas
  76. 3 3
      Source/GLS.Isolines.pas
  77. 52 68
      Source/GLS.Isosurface.pas
  78. 4 4
      Source/GLS.LinePFX.pas
  79. 4 4
      Source/GLS.Material.pas
  80. 11 11
      Source/GLS.MaterialEx.pas
  81. 13 13
      Source/GLS.MeshBSP.pas
  82. 19 19
      Source/GLS.MeshBuilder.pas
  83. 6 6
      Source/GLS.MeshCSG.pas
  84. 4 4
      Source/GLS.MeshLines.pas
  85. 1060 943
      Source/GLS.MeshUtils.pas
  86. 10 10
      Source/GLS.MultiPolygon.pas
  87. 13 13
      Source/GLS.Objects.pas
  88. 17 17
      Source/GLS.Octree.pas
  89. 39 39
      Source/GLS.ParametricSurfaces.pas
  90. 22 22
      Source/GLS.ParticleFX.pas
  91. 113 114
      Source/GLS.PersistentClasses.pas
  92. 2 2
      Source/GLS.PolygonTesselation.pas
  93. 26 26
      Source/GLS.ROAMPatch.pas
  94. 16 16
      Source/GLS.Ragdoll.pas
  95. 39 34
      Source/GLS.RandomHDS.pas
  96. 2 2
      Source/GLS.RenderContextInfo.pas
  97. 16 16
      Source/GLS.Scene.pas
  98. 11 12
      Source/GLS.Screen.pas
  99. 1 1
      Source/GLS.Selection.pas
  100. 2 2
      Source/GLS.ShadowVolume.pas

+ 2 - 2
AdvDemos/Archipelago/fArchipelagoC.cpp

@@ -467,8 +467,8 @@ void __fastcall TForm1::DOWakeProgress(TObject *Sender, const double deltaTime,
 	TGLVector sbp, sbr;
 
 	if (WakeVertices == NULL) {
-		WakeVertices = new TAffineVectorList();
-		WakeStretch = new TAffineVectorList();
+		WakeVertices = new TGLAffineVectorList();
+		WakeStretch = new TGLAffineVectorList();
 		WakeTime = new TSingleList();
 	}
 

+ 2 - 2
AdvDemos/Archipelago/fArchipelagoC.h

@@ -110,8 +110,8 @@ public:		// User declarations
 	bool WasAboveWater;
 	float HelpOpacity;
 
-	TAffineVectorList *WakeVertices;
-	TAffineVectorList *WakeStretch;
+	TGLAffineVectorList *WakeVertices;
+	TGLAffineVectorList *WakeStretch;
 	TSingleList *WakeTime;
 	void ResetMousePos(void);
 	float WaterPhase(const float px, const float py);

+ 4 - 4
AdvDemos/Archipelago/fArchipelagoD.pas

@@ -90,8 +90,8 @@ type
     WasAboveWater: Boolean;
     HelpOpacity: Single;
     DataPath : String;
-    WakeVertices: TAffineVectorList;
-    WakeStretch: TAffineVectorList;
+    WakeVertices: TGLAffineVectorList;
+    WakeStretch: TGLAffineVectorList;
     WakeTime: TSingleList;
     procedure ResetMousePos;
     function WaterPhase(const px, py: Single): Single;
@@ -529,8 +529,8 @@ var
 begin
   if WakeVertices = nil then
   begin
-    WakeVertices := TAffineVectorList.Create;
-    WakeStretch := TAffineVectorList.Create;
+    WakeVertices := TGLAffineVectorList.Create;
+    WakeStretch := TGLAffineVectorList.Create;
     WakeTime := TSingleList.Create;
   end;
 

+ 2 - 2
AdvDemos/Forest/fForestD.pas

@@ -120,7 +120,7 @@ type
      
     TestTree: TGLTree;
     TreesShown: Integer;
-    nearTrees: TPersistentObjectList;
+    nearTrees: TGLPersistentObjectList;
     imposter: TImposter;
     densityBitmap: TBitmap;
     mirrorTexture: TGLTextureHandle;
@@ -222,7 +222,7 @@ begin
   SetCursorPos(lmp.X, lmp.Y);
   ShowCursor(False);
 
-  nearTrees := TPersistentObjectList.Create;
+  nearTrees := TGLPersistentObjectList.Create;
 
   camTurn := -60;
   enableRectReflection := False;

+ 4 - 4
AdvDemos/GLSViewer/Source/fMain.pas

@@ -774,8 +774,8 @@ end;
 
 procedure TMainForm.acConvertToIndexedTrianglesExecute(Sender: TObject);
 var
-  v: TAffineVectorList;
-  I: TIntegerList;
+  v: TGLAffineVectorList;
+  I: TGLIntegerList;
   m: TGLMeshObject;
   fg: TFGVertexIndexList;
 begin
@@ -810,7 +810,7 @@ var
   I: Integer;
   mo: TGLMeshObject;
   fg: TFGVertexIndexList;
-  strips: TPersistentObjectList;
+  strips: TGLPersistentObjectList;
 begin
   acConvertToTriangles.Execute;
   mo := ffObject.MeshObjects[0];
@@ -821,7 +821,7 @@ begin
     for I := 0 to strips.Count - 1 do
     begin
       fg := TFGVertexIndexList.CreateOwned(mo.FaceGroups);
-      fg.VertexIndices := (strips[I] as TIntegerList);
+      fg.VertexIndices := (strips[I] as TGLIntegerList);
       if I = 0 then
         fg.Mode := fgmmTriangles
       else

+ 114 - 96
Demos/collisions/boxedin/fBoxedinD.pas

@@ -13,7 +13,6 @@ uses
   Vcl.StdCtrls,
   Vcl.ComCtrls,
 
-  
   GLS.Keyboard,
   GLS.VectorGeometry,
   GLS.Scene,
@@ -24,7 +23,7 @@ uses
   GLS.Cadencer,
   GLS.Navigator,
   GLS.GeomObjects,
- 
+
   GLS.Coordinates,
   GLS.Utils,
   GLS.BaseClasses,
@@ -55,18 +54,18 @@ type
     Lines1: TGLLines;
     LabelFPS: TLabel;
     procedure FormCreate(Sender: TObject);
-    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
-      newTime: Double);
+    procedure GLCadencer1Progress(Sender: TObject;
+      const deltaTime, newTime: Double);
     procedure Timer1Timer(Sender: TObject);
     procedure Button1Click(Sender: TObject);
   private
-     
-    colTotalTime : Single; // for timing collision detection
-    colCount : Integer;
-    procedure AddToTrail(const p : TGLVector);
+
+    colTotalTime: Single; // for timing collision detection
+    colCount: Integer;
+    procedure AddToTrail(const p: TGLVector);
   public
-     
-    mousex, mousey: integer;
+
+    mousex, mousey: Integer;
   end;
 
 var
@@ -78,112 +77,131 @@ implementation
 
 procedure TFormBoxedin.FormCreate(Sender: TObject);
 begin
-   SetGLSceneMediaDir();
-   FreeForm1.LoadFromFile('BoxedIn.3ds');
-
-   FreeForm1.BuildOctree;
-   Label1.Caption:='Octree Nodes    : '+inttostr(FreeForm1.Octree.NodeCount);
-   Label2.Caption:='Tri Count Octree: '+inttostr(FreeForm1.Octree.TriCountOctree);
-   Label3.Caption:='Tri Count Mesh  : '+inttostr(FreeForm1.Octree.TriCountMesh);
-
-   Lines1.AddNode(0, 0, 0);
-   Lines1.ObjectStyle:=Lines1.ObjectStyle+[osDirectDraw];
+  SetGLSceneMediaDir();
+  FreeForm1.LoadFromFile('BoxedIn.3ds');
+
+  FreeForm1.BuildOctree;
+  Label1.Caption := 'Octree Nodes    : ' + inttostr(FreeForm1.Octree.NodeCount);
+  Label2.Caption := 'Tri Count Octree: ' +
+    inttostr(FreeForm1.Octree.TriCountOctree);
+  Label3.Caption := 'Tri Count Mesh  : ' +
+    inttostr(FreeForm1.Octree.TriCountMesh);
+
+  Lines1.AddNode(0, 0, 0);
+  Lines1.ObjectStyle := Lines1.ObjectStyle + [osDirectDraw];
 end;
 
-procedure TFormBoxedin.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
+procedure TFormBoxedin.GLCadencer1Progress(Sender: TObject;
+  const deltaTime, newTime: Double);
 var
-   rayStart, rayVector : TGLVector;
-   velocity : Single;
-   pPoint : TGLVector;
-   pNormal : TGLVector;
-   t : Int64;
+  rayStart, rayVector: TGLVector;
+  velocity: Single;
+  pPoint: TGLVector;
+  pNormal: TGLVector;
+  t: Int64;
 begin
-   if IsKeyDown(VK_ESCAPE) then close;
-
-   Velocity:=Trackbar1.Position*deltaTime*50;
-
-   t:=StartPrecisionTimer;
-
-   with FreeForm1 do begin
-      SetVector(rayStart, Sphere2.AbsolutePosition);
-      SetVector(rayVector, Sphere2.AbsoluteDirection);
-      NormalizeVector(rayVector);
-      //Note: since collision may be performed on multiple meshes, we might need to know which hit
-      //      is closest (ie: d:=raystart - pPoint).
-      if OctreeSphereSweepIntersect(raystart, rayvector, velocity, Sphere2.Radius,
-                               @pPoint, @pNormal) then begin
-         // Show the polygon intersection point
-         NormalizeVector(pNormal);
-         Sphere1.Position.AsVector:=pPoint;
-         Sphere1.Direction.AsVector:=pNormal;
-
-         // Make it rebound...
-         with Sphere2.Direction do
-            AsAffineVector:=VectorReflect(AsAffineVector, AffineVectorMake(pNormal));
-         // Add some "english"...
-         with Sphere2.Direction do begin
-            X:=x+random/10;
-            Y:=y+random/10;
-            Z:=z+random/10;
-         end;
-         // Add intersect point to trail
-         AddToTrail(pPoint);
-      end else begin
-         Sphere2.Move(velocity); //No collision, so just move the ball.
+  if IsKeyDown(VK_ESCAPE) then
+    close;
+
+  velocity := TrackBar1.Position * deltaTime * 50;
+
+  t := StartPrecisionTimer;
+
+  with FreeForm1 do
+  begin
+    SetVector(rayStart, Sphere2.AbsolutePosition);
+    SetVector(rayVector, Sphere2.AbsoluteDirection);
+    NormalizeVector(rayVector);
+    // Note: since collision may be performed on multiple meshes, we might need to know which hit
+    // is closest (ie: d:=raystart - pPoint).
+    if OctreeSphereSweepIntersect(rayStart, rayVector, velocity, Sphere2.Radius,
+      @pPoint, @pNormal) then
+    begin
+      // Show the polygon intersection point
+      NormalizeVector(pNormal);
+      Sphere1.Position.AsVector := pPoint;
+      Sphere1.Direction.AsVector := pNormal;
+
+      // Make it rebound...
+      with Sphere2.Direction do
+        AsAffineVector := VectorReflect(AsAffineVector,
+          AffineVectorMake(pNormal));
+      // Add some "english"...
+      with Sphere2.Direction do
+      begin
+        X := X + random / 10;
+        Y := Y + random / 10;
+        Z := Z + random / 10;
       end;
-   end;
-   // Last trail point is always the sphere's current position
-   Lines1.Nodes.Last.AsVector:=Sphere2.Position.AsVector;
+      // Add intersect point to trail
+      AddToTrail(pPoint);
+    end
+    else
+    begin
+      Sphere2.Move(velocity); // No collision, so just move the ball.
+    end;
+  end;
+  // Last trail point is always the sphere's current position
+  Lines1.Nodes.Last.AsVector := Sphere2.Position.AsVector;
 
-   colTotalTime:=colTotalTime+StopPrecisionTimer(t);
-   Inc(colCount);
+  colTotalTime := colTotalTime + StopPrecisionTimer(t);
+  Inc(colCount);
 end;
 
-procedure TFormBoxedin.AddToTrail(const p : TGLVector);
+procedure TFormBoxedin.AddToTrail(const p: TGLVector);
 var
-   i, k : Integer;
+  i, k: Integer;
 begin
-   Lines1.Nodes.Last.AsVector:=p;
-   Lines1.AddNode(0, 0, 0);
-   if Lines1.Nodes.Count>20 then // limit trail to 20 points
-      Lines1.Nodes[0].Free;
-
-   for i:=0 to 19 do begin
-      k:=Lines1.Nodes.Count-i-1;
-      if k>=0 then
-         TGLLinesNode(Lines1.Nodes[k]).Color.Alpha:=0.95-i*0.05;
-   end;
+  Lines1.Nodes.Last.AsVector := p;
+  Lines1.AddNode(0, 0, 0);
+  if Lines1.Nodes.Count > 5 then // limit trail to 20 points
+    Lines1.Nodes[0].Free;
+
+  for i := 0 to 4 do // count to 19
+  begin
+    k := Lines1.Nodes.Count - i - 1;
+    if k >= 0 then
+      TGLLinesNode(Lines1.Nodes[k]).Color.Alpha := 0.95 - i * 0.05;
+  end;
 end;
 
 procedure TFormBoxedin.Timer1Timer(Sender: TObject);
 var
-   t : Single;
+  t: Single;
 begin
-   if colCount>0 then
-      t:=colTotalTime*1000/colCount
-   else t:=0;
- 	LabelFPS.Caption:=Format('%.2f FPS - %.3f ms for collisions/frame',
-                   [GLSceneViewer2.FramesPerSecond, t]);
+  if colCount > 0 then
+    t := colTotalTime * 1000 / colCount
+  else
+    t := 0;
+  LabelFPS.Caption := Format('%.2f FPS - %.3f ms for collisions/frame',
+    [GLSceneViewer2.FramesPerSecond, t]);
   GLSceneViewer2.ResetPerformanceMonitor;
-   colTotalTime:=0;
-   colCount:=0;
+  colTotalTime := 0;
+  colCount := 0;
 end;
 
 procedure TFormBoxedin.Button1Click(Sender: TObject);
 begin
-   //If the ball gets stuck in a pattern, hit the reset button.
-   With Sphere2.Position do begin
-     X:=random;
-     Y:=random;
-     Z:=random;
-   end;
-
-   With Sphere2.Direction do begin
-     X:=random;  if random > 0.5 then x:=-x;
-     Y:=random;  if random > 0.5 then y:=-y;
-     Z:=random;  if random > 0.5 then z:=-z;
-   end;
+  // If the ball gets stuck in a pattern, hit the reset button.
+  with Sphere2.Position do
+  begin
+    X := random;
+    Y := random;
+    Z := random;
+  end;
+
+  with Sphere2.Direction do
+  begin
+    X := random;
+    if random > 0.5 then
+      X := -X;
+    Y := random;
+    if random > 0.5 then
+      Y := -Y;
+    Z := random;
+    if random > 0.5 then
+      Z := -Z;
+  end;
 end;
 
 end.

+ 20 - 13
Demos/extrusion/tentacles/fTentacleC.dfm

@@ -2,35 +2,42 @@ object Form1: TForm1
   Left = 0
   Top = 0
   Caption = 'Tentacles'
-  ClientHeight = 373
-  ClientWidth = 541
+  ClientHeight = 466
+  ClientWidth = 676
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
-  Font.Height = -11
+  Font.Height = -14
   Font.Name = 'Tahoma'
   Font.Style = []
-  OldCreateOrder = False
   OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
+  PixelsPerInch = 120
+  TextHeight = 17
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     Top = 0
-    Width = 541
-    Height = 373
+    Width = 676
+    Height = 466
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Camera = GLCamera1
     Buffer.BackgroundColor = clBlack
-    FieldOfView = 149.984252929687500000
+    FieldOfView = 155.776901245117200000
     PenAsTouch = False
     Align = alClient
     TabOrder = 0
   end
   object PanelFPS: TPanel
-    Left = 208
-    Top = 8
-    Width = 121
-    Height = 17
+    Left = 260
+    Top = 10
+    Width = 151
+    Height = 21
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Caption = 'FPS'
     TabOrder = 1
   end

+ 2 - 2
Demos/glslshaders/Ocean/fOceanC.cpp

@@ -155,7 +155,7 @@ void __fastcall TForm1::DOOceanPlaneRender(TObject *Sender,
 
 {
 	int x, y;
-	TTexPointList *v;
+	TGLTexPointList *v;
 	bool cont;
 	TGLExtensionsAndEntryPoints *GL;
 
@@ -164,7 +164,7 @@ void __fastcall TForm1::DOOceanPlaneRender(TObject *Sender,
 	GL->EnableClientState(GL_VERTEX_ARRAY);
 
 	if (!vbo) {
-		v = new TTexPointList;
+		v = new TGLTexPointList;
 
 		v->Capacity = (cExtent + 1) * (cExtent + 1);
 		y = -cExtent;

+ 2 - 2
Demos/glslshaders/Ocean/fOceanD.pas

@@ -222,14 +222,14 @@ procedure TForm1.DOOceanPlaneRender(Sender: TObject;
   var rci: TGLRenderContextInfo);
 var
   x, y: Integer;
-  v: TTexPointList;
+  v: TGLTexPointList;
   cont: Boolean;
 begin
   GLUserShader1DoApply(Self, rci);
   gl.EnableClientState(GL_VERTEX_ARRAY);
   if not Assigned(vbo) then
   begin
-    v := TTexPointList.Create;
+    v := TGLTexPointList.Create;
     v.Capacity := Sqr(cExtent + 1);
     y := -cExtent;
     while y < cExtent do

+ 2 - 2
Demos/graph/points/fPointsC.cpp

@@ -43,10 +43,10 @@ void __fastcall TForm1::GLCadencer1Progress(TObject *Sender, const double deltaT
 {
    int i;
    float f, a, ab, ca, sa;
-   TAffineVectorList *p;
+   TGLAffineVectorList *p;
    TAffineVector *v;
 
-   p = new TAffineVectorList;
+   p = new TGLAffineVectorList;
    v = new TAffineVector;
 
    if (CBAnimate->Checked)

+ 43 - 24
Demos/graph/points/fPointsC.dfm

@@ -2,26 +2,29 @@ object Form1: TForm1
   Left = 0
   Top = 0
   Caption = 'Points'
-  ClientHeight = 413
-  ClientWidth = 487
+  ClientHeight = 516
+  ClientWidth = 609
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
-  Font.Height = -10
+  Font.Height = -13
   Font.Name = 'Tahoma'
   Font.Style = []
-  OldCreateOrder = False
   OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 12
+  PixelsPerInch = 120
+  TextHeight = 16
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
-    Top = 23
-    Width = 487
-    Height = 390
+    Top = 29
+    Width = 609
+    Height = 487
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Camera = GLCamera1
     Buffer.BackgroundColor = clTeal
-    FieldOfView = 151.237213134765600000
+    FieldOfView = 156.792495727539100000
     PenAsTouch = False
     Align = alClient
     OnMouseDown = GLSceneViewer1MouseDown
@@ -31,22 +34,34 @@ object Form1: TForm1
   object Panel1: TPanel
     Left = 0
     Top = 0
-    Width = 487
-    Height = 23
+    Width = 609
+    Height = 29
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Align = alTop
     TabOrder = 1
     object LabelFPS: TLabel
-      Left = 266
-      Top = 5
-      Width = 18
-      Height = 12
+      Left = 333
+      Top = 6
+      Width = 22
+      Height = 16
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Caption = 'FPS'
     end
     object CBPointParams: TCheckBox
-      Left = 8
-      Top = 4
-      Width = 89
-      Height = 16
+      Left = 10
+      Top = 5
+      Width = 111
+      Height = 20
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Caption = 'PointParameters'
       Checked = True
       State = cbChecked
@@ -54,10 +69,14 @@ object Form1: TForm1
       OnClick = CBPointParamsClick
     end
     object CBAnimate: TCheckBox
-      Left = 163
-      Top = 4
-      Width = 89
-      Height = 16
+      Left = 204
+      Top = 5
+      Width = 111
+      Height = 20
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Caption = 'Animate'
       Checked = True
       State = cbChecked

+ 58 - 57
Demos/graph/points/fPointsD.pas

@@ -23,7 +23,7 @@ uses
   GLS.Cadencer,
   GLS.Texture,
   GLS.Color,
- 
+
   GLS.Coordinates,
   GLS.BaseClasses;
 
@@ -42,105 +42,106 @@ type
     Timer1: TTimer;
     LabelFPS: TLabel;
     procedure FormCreate(Sender: TObject);
-    procedure GLSceneViewer1MouseDown(Sender: TObject;
-      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
     procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
       X, Y: Integer);
-    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
-      newTime: Double);
+    procedure GLCadencer1Progress(Sender: TObject;
+      const deltaTime, newTime: Double);
     procedure CBAnimateClick(Sender: TObject);
     procedure CBPointParamsClick(Sender: TObject);
     procedure Timer1Timer(Sender: TObject);
   private
-     
+
   public
-     
-    mx, my : Integer
-  end;
 
-var
-  FormPoints: TFormPoints;
+    mx, my: Integer end;
+
+  var
+    FormPoints: TFormPoints;
 
 implementation
 
 {$R *.DFM}
 
 const
-   cNbPoints = 180;
+  cNbPoints = 180;
 
 procedure TFormPoints.FormCreate(Sender: TObject);
 begin
-   // allocate points in the 1st point set
-   GLPoints1.Positions.Count:=cNbPoints;
-   // specify white color for the 1st point set
-   // (if a single color is defined, all points will use it,
-   // otherwise, it's a per-point coloring)
-   GLPoints1.Colors.Add(clrWhite);
-   // specify blue color for the 2nd point set
-   GLPoints2.Colors.Add(clrBlue);
+  // allocate points in the 1st point set
+  GLPoints1.Positions.Count := cNbPoints;
+  // specify white color for the 1st point set
+  // (if a single color is defined, all points will use it,
+  // otherwise, it's a per-point coloring)
+  GLPoints1.Colors.Add(clrWhite);
+  // specify blue color for the 2nd point set
+  GLPoints2.Colors.Add(clrBlue);
 end;
 
-procedure TFormPoints.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
+procedure TFormPoints.GLCadencer1Progress(Sender: TObject;
+  const deltaTime, newTime: Double);
 var
-   i : Integer;
-   f, a, ab, ca, sa : Single;
-   p : TAffineVectorList;
-   v : TAffineVector;
+  i: Integer;
+  f, a, ab, ca, sa: Single;
+  p: TGLAffineVectorList;
+  v: TAffineVector;
 begin
-   if CBAnimate.Checked then begin
-      // update the 1st point set with values from a math func
-      f:=1+Cos(newTime);
-      p:=GLPoints1.Positions;
-      ab:=newTime*0.1;
-      for i:=0 to cNbPoints-1 do
-      begin
-         a:=DegToRad(4*i)+ab;
-         SinCos(a, sa, ca);
-         v.X:=2*ca;
-         v.Y:=2*Cos(f*a);
-         v.Z:=2*sa;
-         p.Create[i]:=v;
-      end;
-      // replicate points in second set
-      GLPoints2.Positions:=GLPoints1.Positions;
-   end;
-   GLSceneViewer1.Invalidate;
+  if CBAnimate.Checked then
+  begin
+    // update the 1st point set with values from a math func
+    f := 1 + Cos(newTime);
+    p := GLPoints1.Positions;
+    ab := newTime * 0.1;
+    for i := 0 to cNbPoints - 1 do
+    begin
+      a := DegToRad(4 * i) + ab;
+      SinCos(a, sa, ca);
+      v.X := 2 * ca;
+      v.Y := 2 * Cos(f * a);
+      v.Z := 2 * sa;
+      p.Create[i] := v;
+    end;
+    // replicate points in second set
+    GLPoints2.Positions := GLPoints1.Positions;
+  end;
+  GLSceneViewer1.Invalidate;
 end;
 
 procedure TFormPoints.GLSceneViewer1MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 begin
-   mx:=x;
-   my:=y;
+  mx := X;
+  my := Y;
 end;
 
 procedure TFormPoints.GLSceneViewer1MouseMove(Sender: TObject;
   Shift: TShiftState; X, Y: Integer);
 begin
-   if Shift<>[] then begin
-      GLCamera1.MoveAroundTarget(my-y, mx-x);
-      mx:=x;
-      my:=y;
-   end;
+  if Shift <> [] then
+  begin
+    GLCamera1.MoveAroundTarget(my - Y, mx - X);
+    mx := X;
+    my := Y;
+  end;
 end;
 
 procedure TFormPoints.CBAnimateClick(Sender: TObject);
 begin
-   GLPoints1.Static:=not CBAnimate.Checked;
-   GLPoints2.Static:=not CBAnimate.Checked;
+  GLPoints1.Static := not CBAnimate.Checked;
+  GLPoints2.Static := not CBAnimate.Checked;
 end;
 
 procedure TFormPoints.CBPointParamsClick(Sender: TObject);
 begin
-   GLPoints1.PointParameters.Enabled:=CBPointParams.Checked;
-   GLPoints2.PointParameters.Enabled:=CBPointParams.Checked;
+  GLPoints1.PointParameters.Enabled := CBPointParams.Checked;
+  GLPoints2.PointParameters.Enabled := CBPointParams.Checked;
 end;
 
 procedure TFormPoints.Timer1Timer(Sender: TObject);
 begin
-   LabelFPS.Caption:=Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
-   GLSceneViewer1.ResetPerformanceMonitor;
+  LabelFPS.Caption := Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
+  GLSceneViewer1.ResetPerformanceMonitor;
 end;
 
 end.

+ 12 - 10
Demos/graph/projection/fProjectionC.dfm

@@ -2,31 +2,33 @@ object Form1: TForm1
   Left = 0
   Top = 0
   Caption = 'Projection'
-  ClientHeight = 405
-  ClientWidth = 559
+  ClientHeight = 506
+  ClientWidth = 699
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
-  Font.Height = -11
+  Font.Height = -14
   Font.Name = 'Tahoma'
   Font.Style = []
-  OldCreateOrder = False
   Position = poScreenCenter
-  WindowState = wsMaximized
   OnCreate = FormCreate
   OnMouseWheel = FormMouseWheel
-  PixelsPerInch = 96
-  TextHeight = 13
+  PixelsPerInch = 120
+  TextHeight = 17
   object SceneViewer: TGLSceneViewer
     Left = 0
     Top = 0
-    Width = 559
-    Height = 405
+    Width = 699
+    Height = 506
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Camera = GLCamera
     Buffer.BackgroundColor = clBlack
     Buffer.FaceCulling = False
     Buffer.AntiAliasing = aa4xHQ
-    FieldOfView = 146.991271972656300000
+    FieldOfView = 153.317077636718800000
     PenAsTouch = False
     Align = alClient
     OnMouseDown = SceneViewerMouseDown

+ 0 - 2
Demos/media/Shaders/OIT_frag.glsl

@@ -1,5 +1,3 @@
-#version 330 compatibility
-
 uniform sampler2DArray ColorLayers;
 uniform sampler2DArray DepthLayers;
 

+ 0 - 2
Demos/media/Shaders/OIT_vtx.glsl

@@ -1,5 +1,3 @@
-#version 120
-
 void main()
 {
    gl_Position = vec4(sign(gl_Vertex.xy), -1., 1.);

+ 0 - 1
Demos/media/Shaders/ocean_fp.glsl

@@ -1,4 +1,3 @@
-#version 120
 uniform sampler2D NormalMap;
 uniform samplerCube EnvironmentMap;
 

+ 0 - 1
Demos/media/Shaders/ocean_vp.glsl

@@ -1,4 +1,3 @@
-#version 120
 uniform float Time;
 uniform vec4  EyePos;
 

+ 0 - 1
Demos/media/Shaders/shadowmap_fp.glsl

@@ -1,4 +1,3 @@
-#version 120
 uniform sampler2D TextureMap;
 uniform sampler2DShadow ShadowMap;
 uniform sampler2D LightspotMap;

+ 0 - 1
Demos/media/Shaders/shadowmap_vp.glsl

@@ -1,4 +1,3 @@
-#version 120
 uniform mat4 EyeToLightMatrix;
 
 void main()

+ 0 - 1
Demos/media/Shaders/shadowmapvis_fp.glsl

@@ -1,4 +1,3 @@
-#version 120
 uniform sampler2DShadow ShadowMap;
 
 void main()

+ 0 - 10
Demos/media/Shaders/toon.frag

@@ -1,13 +1,3 @@
-//
-// Fragment shader for cartoon-style shading
-//
-// Author: Philip Rideout
-//
-// Copyright (c) 2004 3Dlabs Inc. Ltd.
-//
-// See 3Dlabs-License.txt for license information
-//
-
 uniform vec3 DiffuseColor;
 uniform vec3 PhongColor;
 uniform float Edge;

+ 0 - 10
Demos/media/Shaders/toon.vert

@@ -1,13 +1,3 @@
-//
-// Vertex shader for cartoon-style shading
-//
-// Author: Philip Rideout
-//
-// Copyright (c) 2004 3Dlabs Inc. Ltd.
-//
-// See 3Dlabs-License.txt for license information
-//
-
 varying vec3 Normal;
 
 void main(void)

+ 1 - 1
Demos/meshes/ducky/fDuckyC.cpp

@@ -23,7 +23,7 @@ __fastcall TForm1::TForm1(TComponent * Owner):TForm(Owner)
 
   // { Translate FreeForm based on the first mesh object's average
   // control point. Quick and dirty ... or maybe just dirty :P }
-  TAffineVectorList *cp =
+  TGLAffineVectorList *cp =
 	((TMOParametricSurface *) (GLActor1->MeshObjects->Items[0]))->ControlPoints;
   GLActor1->Position->Translate(VectorNegate(VectorScale(cp->Sum(),1.0/cp->Count)));
 

+ 1 - 1
Demos/meshes/ducky/fDuckyD.pas

@@ -68,7 +68,7 @@ implementation
 
 procedure TFormDucky.FormCreate(Sender: TObject);
 var
-  cp: TAffineVectorList;
+  cp: TGLAffineVectorList;
 begin
   SetGLSceneMediaDir();
   // Load the nurbs data

+ 9 - 9
Demos/meshes/subdivide/fSubdivideC.cpp

@@ -54,9 +54,9 @@ void __fastcall TForm1::BULoadClick(TObject *Sender)
 void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 {
    int i, j;
-   TAffineVectorList *tris, *norms, *tex, *buf, *morphTris, *morphNorms;
-   TIntegerList *indices, *texIndices;
-   TIntegerList *firstRemap, *subdivideRemap, *bufRemap;
+   TGLAffineVectorList *tris, *norms, *tex, *buf, *morphTris, *morphNorms;
+   TGLIntegerList *indices, *texIndices;
+   TGLIntegerList *firstRemap, *subdivideRemap, *bufRemap;
    __int64 t;
 
    BUSubdivide->Enabled = false;
@@ -66,10 +66,10 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 
    for (i = 0; i < GLActor1->MeshObjects->Count-1; i++ )
    {
-	  tex = new TAffineVectorList;
+	  tex = new TGLAffineVectorList;
 	  tris = GLActor1->MeshObjects->Items[i]->ExtractTriangles(tex);
 	  indices = BuildVectorCountOptimizedIndices(tris);
-	  firstRemap = (TIntegerList *)(indices->CreateClone());
+	  firstRemap = (TGLIntegerList *)(indices->CreateClone());
 	  RemapAndCleanupReferences(tris, indices);
 
 	  norms = BuildNormals(tris, indices);
@@ -84,7 +84,7 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 	  SubdivideTriangles(0, tex, texIndices);
 
 	  // Re-expand everything
-	  buf = new TAffineVectorList;
+	  buf = new TGLAffineVectorList;
 	  try
 	  {
 		 ConvertIndexedListToList(tris, indices, buf);
@@ -103,14 +103,14 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 	  // Pack & Optimize the expanded stuff
 	  indices->Free();
 	  indices = BuildVectorCountOptimizedIndices(tris, norms, tex);
-	  subdivideRemap = (TIntegerList *)(indices->CreateClone());
+	  subdivideRemap = (TGLIntegerList *)(indices->CreateClone());
 	  RemapReferences(norms, indices);
 	  RemapReferences(tex, indices);
 	  RemapAndCleanupReferences(tris, indices);
 
 	  IncreaseCoherency(indices, 13);
 
-	  bufRemap = new TIntegerList;
+	  bufRemap = new TGLIntegerList;
 	 for (j = 0; j < GLActor1->MeshObjects->MorphTargetCount()-1; j++)
 	 {
 		GLActor1->MeshObjects->MorphTo(j);
@@ -123,7 +123,7 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 
 		SubdivideTriangles(TrackBar1->Position*0.1, morphTris, bufRemap, morphNorms);
 
-		buf = new TAffineVectorList;
+		buf = new TGLAffineVectorList;
 		try
 		{
 		   ConvertIndexedListToList(morphTris, bufRemap, buf);

+ 9 - 9
Demos/meshes/subdivide/fSubdivideD.pas

@@ -103,9 +103,9 @@ end;
 procedure TFormSubdivide.BUSubdivideClick(Sender: TObject);
 var
   i, j: Integer;
-  tris, norms, tex, buf, morphTris, morphNorms: TAffineVectorList;
-  indices, texIndices: TIntegerlist;
-  firstRemap, subdivideRemap, bufRemap: TIntegerlist;
+  tris, norms, tex, buf, morphTris, morphNorms: TGLAffineVectorList;
+  indices, texIndices: TGLIntegerList;
+  firstRemap, subdivideRemap, bufRemap: TGLIntegerList;
   t: Int64;
 begin
   BUSubdivide.Enabled := False;
@@ -115,11 +115,11 @@ begin
 
   for i := 0 to GLActor1.MeshObjects.Count - 1 do
   begin
-    tex := TAffineVectorList.Create;
+    tex := TGLAffineVectorList.Create;
     with GLActor1.MeshObjects[i] do
       tris := ExtractTriangles(tex);
     indices := BuildVectorCountOptimizedIndices(tris);
-    firstRemap := TIntegerlist(indices.CreateClone);
+    firstRemap := TGLIntegerList(indices.CreateClone);
     RemapAndCleanupReferences(tris, indices);
 
     norms := BuildNormals(tris, indices);
@@ -134,7 +134,7 @@ begin
     SubdivideTriangles(0, tex, texIndices);
 
     // Re-expand everything
-    buf := TAffineVectorList.Create;
+    buf := TGLAffineVectorList.Create;
     try
       ConvertIndexedListToList(tris, indices, buf);
       tris.Assign(buf);
@@ -151,7 +151,7 @@ begin
     // Pack & Optimize the expanded stuff
     indices.Free;
     indices := BuildVectorCountOptimizedIndices(tris, norms, tex);
-    subdivideRemap := TIntegerlist(indices.CreateClone);
+    subdivideRemap := TGLIntegerList(indices.CreateClone);
     RemapReferences(norms, indices);
     RemapReferences(tex, indices);
     RemapAndCleanupReferences(tris, indices);
@@ -161,7 +161,7 @@ begin
     with GLActor1.MeshObjects[i] as TGLMorphableMeshObject do
     begin
 
-      bufRemap := TIntegerlist.Create;
+      bufRemap := TGLIntegerList.Create;
       for j := 0 to MorphTargets.Count - 1 do
       begin
         MorphTo(j);
@@ -175,7 +175,7 @@ begin
         SubdivideTriangles(TrackBar1.Position * 0.1, morphTris, bufRemap,
           morphNorms);
 
-        buf := TAffineVectorList.Create;
+        buf := TGLAffineVectorList.Create;
         try
           ConvertIndexedListToList(morphTris, bufRemap, buf);
           morphTris.Assign(buf);

+ 2 - 1
Demos/meshes/tiles/TilesD.dpr

@@ -16,11 +16,12 @@
 program TilesD;
 uses
   Forms,
-  fTilesD in 'fTilesD.pas';
+  fTilesD in 'fTilesD.pas' {FormTiles};
 
 {$R *.res}
 begin
   Application.Initialize;
   Application.CreateForm(TFormTiles, FormTiles);
+  Application.CreateForm(TFormTiles, FormTiles);
   Application.Run;
 end.

+ 4 - 1
Demos/meshes/tiles/TilesD.dproj

@@ -122,7 +122,10 @@
         <DelphiCompile Include="$(MainSource)">
             <MainSource>MainSource</MainSource>
         </DelphiCompile>
-        <DCCReference Include="fTilesD.pas"/>
+        <DCCReference Include="fTilesD.pas">
+            <Form>FormTiles</Form>
+            <FormType>dfm</FormType>
+        </DCCReference>
         <BuildConfiguration Include="Base">
             <Key>Base</Key>
         </BuildConfiguration>

+ 24 - 25
Demos/meshes/tiles/fTilesC.cpp

@@ -18,39 +18,38 @@
 #pragma link "GLS.TilePlane"
 #pragma link "GLS.SceneViewer"
 #pragma resource "*.dfm"
-TForm1 *Form1;
+TForm1* Form1;
 //---------------------------------------------------------------------------
-__fastcall TForm1::TForm1(TComponent* Owner)
-	: TForm(Owner)
-{
-}
+__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) {}
 //---------------------------------------------------------------------------
-void __fastcall TForm1::FormCreate(TObject *Sender)
+void __fastcall TForm1::FormCreate(TObject* Sender)
 {
-   int i, j;
-   SetGLSceneMediaDir();
-   GLMaterialLibrary->TexturePaths = GetCurrentDir();
-
-  GLMaterialLibrary->LibMaterialByName("beigemarble")->Material->Texture->Image->LoadFromFile("beigemarble.jpg");
-  GLMaterialLibrary->LibMaterialByName("marbletiles")->Material->Texture->Image->LoadFromFile("marbletiles.jpg");
-  GLMaterialLibrary->LibMaterialByName("walkway")->Material->Texture->Image->LoadFromFile("walkway.jpg");
+    int i, j;
+    SetGLSceneMediaDir();
+    GLMaterialLibrary->TexturePaths = GetCurrentDir();
 
-   // fill the tiled area with random tiles
-   RandSeed = 0;
+    GLMaterialLibrary->LibMaterialByName("beigemarble")
+        ->Material->Texture->Image->LoadFromFile("beigemarble.jpg");
+    GLMaterialLibrary->LibMaterialByName("marbletiles")
+        ->Material->Texture->Image->LoadFromFile("marbletiles.jpg");
+	GLMaterialLibrary->LibMaterialByName("walkway")
+        ->Material->Texture->Image->LoadFromFile("walkway.jpg");
 
- /*
+    // fill the tiled area with random tiles
+    RandSeed = 0;
+    /*
    for (i=-20;i<=20;i++)
 	 for (j=-20;j<=20;j++)
 	  GLTilePlane->Tiles[i,j] = Random(GLMaterialLibrary->Materials->Count-1)+1;
 */
-   // set all tile materials to anisotropic,
-   // add them to the material selection combo
-   for (i=0;i<(GLMaterialLibrary->Materials->Count-1);i++)
-   {
-	 GLMaterialLibrary->Materials->Items[i]->Material->Texture->FilteringQuality = tfAnisotropic;
-		 CBMaterial->Items->Add(GLMaterialLibrary->Materials->Items[i]->Name);
-   }
-   CBMaterial->ItemIndex = 0;
-
+    // set all tile materials to anisotropic,
+    // add them to the material selection combo
+    for (i = 0; i < (GLMaterialLibrary->Materials->Count - 1); i++) {
+        GLMaterialLibrary->Materials->Items[i]
+            ->Material->Texture->FilteringQuality = tfAnisotropic;
+        CBMaterial->Items->Add(GLMaterialLibrary->Materials->Items[i]->Name);
+    }
+    CBMaterial->ItemIndex = 0;
 }
 //---------------------------------------------------------------------------
+

+ 68 - 38
Demos/meshes/tiles/fTilesC.dfm

@@ -2,55 +2,70 @@ object Form1: TForm1
   Left = 0
   Top = 0
   Caption = 'Tiles'
-  ClientHeight = 422
-  ClientWidth = 650
+  ClientHeight = 528
+  ClientWidth = 813
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
-  Font.Height = -11
+  Font.Height = -14
   Font.Name = 'Tahoma'
   Font.Style = []
-  OldCreateOrder = False
   OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
+  PixelsPerInch = 120
+  TextHeight = 17
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     Top = 0
-    Width = 522
-    Height = 422
+    Width = 653
+    Height = 528
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Camera = GLCamera
-    FieldOfView = 153.337402343750000000
+    FieldOfView = 158.551101684570300000
     PenAsTouch = False
     Align = alClient
     TabOrder = 0
   end
   object Panel1: TPanel
-    Left = 522
+    Left = 653
     Top = 0
-    Width = 128
-    Height = 422
+    Width = 160
+    Height = 528
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Align = alRight
     BevelOuter = bvLowered
     Font.Charset = DEFAULT_CHARSET
     Font.Color = clWindowText
-    Font.Height = -11
+    Font.Height = -14
     Font.Name = 'Arial'
     Font.Style = []
     ParentFont = False
     TabOrder = 1
     object Label1: TLabel
-      Left = 8
-      Top = 8
-      Width = 62
-      Height = 14
+      Left = 10
+      Top = 10
+      Width = 83
+      Height = 16
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Caption = 'Tile Materials'
     end
     object Label2: TLabel
-      Left = 8
-      Top = 136
-      Width = 113
-      Height = 89
+      Left = 10
+      Top = 170
+      Width = 141
+      Height = 111
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       AutoSize = False
       Caption = 
         'Shift + Left button: pan'#13#10#13#10'Left button : paint with current mat' +
@@ -58,36 +73,52 @@ object Form1: TForm1
       WordWrap = True
     end
     object CBMaterial: TComboBox
-      Left = 8
-      Top = 24
-      Width = 113
-      Height = 22
+      Left = 10
+      Top = 30
+      Width = 141
+      Height = 24
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Style = csDropDownList
       TabOrder = 0
     end
     object BUPack: TButton
-      Left = 24
-      Top = 72
-      Width = 75
-      Height = 25
+      Left = 30
+      Top = 90
+      Width = 94
+      Height = 31
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Caption = 'Pack'
       TabOrder = 1
     end
     object CBShowGrid: TCheckBox
-      Left = 8
-      Top = 248
-      Width = 81
-      Height = 17
+      Left = 10
+      Top = 310
+      Width = 101
+      Height = 21
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Caption = 'Show Grid'
       Checked = True
       State = cbChecked
       TabOrder = 2
     end
     object CBSortByMaterials: TCheckBox
-      Left = 8
-      Top = 272
-      Width = 105
-      Height = 17
+      Left = 10
+      Top = 340
+      Width = 131
+      Height = 21
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
       Caption = 'Sort by materials'
       Checked = True
       State = cbChecked
@@ -203,7 +234,6 @@ object Form1: TForm1
         Material.Texture.Disabled = False
         TextureScale.Coordinates = {0000003F0000003F0000803F00000000}
       end>
-    TexturePaths = '..\\..\\..\\..\\media'
     Left = 24
     Top = 64
   end

+ 58 - 39
Demos/utilities/ArchiveEdit/fMainD.dfm

@@ -30,35 +30,16 @@ object Form1: TForm1
     Anchors = [akLeft, akTop, akRight]
     Shape = bsTopLine
   end
-  object TreeView: TTreeView
-    Left = 10
-    Top = 10
-    Width = 201
-    Height = 371
-    Margins.Left = 4
-    Margins.Top = 4
-    Margins.Right = 4
-    Margins.Bottom = 4
-    Anchors = [akLeft, akTop, akBottom]
-    Images = ImageList1
-    Indent = 29
-    ShowRoot = False
-    TabOrder = 0
-    ToolTips = False
-    OnChange = TreeViewChange
-    OnCollapsing = TreeViewCollapsing
-    OnKeyDown = TreeViewKeyDown
-  end
   object ListView: TListView
-    Left = 175
-    Top = 8
-    Width = 456
-    Height = 583
+    Left = 201
+    Top = 0
+    Width = 473
+    Height = 608
     Margins.Left = 4
     Margins.Top = 4
     Margins.Right = 4
     Margins.Bottom = 4
-    Anchors = [akLeft, akTop, akRight, akBottom]
+    Align = alClient
     Columns = <
       item
         AutoSize = True
@@ -75,31 +56,70 @@ object Form1: TForm1
       700061006B002000660069006C0065002E002E002E00}
     MultiSelect = True
     SmallImages = ImageList1
-    TabOrder = 1
+    TabOrder = 0
     ViewStyle = vsReport
     OnChange = ListViewChange
     OnClick = ListViewClick
     OnDblClick = ListViewDblClick
     OnKeyDown = ListViewKeyDown
+    ExplicitLeft = 209
+    ExplicitTop = 9
+    ExplicitWidth = 456
+    ExplicitHeight = 583
   end
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 10
-    Top = 389
+  object PanelTree: TPanel
+    Left = 0
+    Top = 0
     Width = 201
-    Height = 201
+    Height = 608
     Margins.Left = 4
     Margins.Top = 4
     Margins.Right = 4
     Margins.Bottom = 4
-    Camera = GLCamera1
-    VSync = vsmSync
-    Buffer.BackgroundColor = clWhite
-    Buffer.ContextOptions = [roDoubleBuffer, roStencilBuffer, roRenderToWindow]
-    Buffer.AntiAliasing = aa2x
-    FieldOfView = 90.285766601562500000
-    PenAsTouch = False
-    Anchors = [akLeft, akBottom]
-    TabOrder = 2
+    Align = alLeft
+    Caption = ' '
+    TabOrder = 1
+    object TreeView: TTreeView
+      Left = 1
+      Top = 1
+      Width = 199
+      Height = 367
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
+      Align = alClient
+      Images = ImageList1
+      Indent = 29
+      ShowRoot = False
+      TabOrder = 0
+      ToolTips = False
+      OnChange = TreeViewChange
+      OnCollapsing = TreeViewCollapsing
+      OnKeyDown = TreeViewKeyDown
+      ExplicitWidth = 174
+      ExplicitHeight = 328
+    end
+    object GLSceneViewer1: TGLSceneViewer
+      Left = 1
+      Top = 368
+      Width = 199
+      Height = 239
+      Margins.Left = 4
+      Margins.Top = 4
+      Margins.Right = 4
+      Margins.Bottom = 4
+      Camera = GLCamera1
+      VSync = vsmSync
+      Buffer.BackgroundColor = clWhite
+      Buffer.ContextOptions = [roDoubleBuffer, roStencilBuffer, roRenderToWindow]
+      Buffer.AntiAliasing = aa2x
+      FieldOfView = 89.712806701660160000
+      PenAsTouch = False
+      Align = alBottom
+      TabOrder = 1
+      ExplicitWidth = 174
+    end
   end
   object MainMenu1: TMainMenu
     Left = 184
@@ -252,7 +272,6 @@ object Form1: TForm1
   end
   object GLSimpleNavigation1: TGLSimpleNavigation
     Form = Owner
-    GLSceneViewer = GLSceneViewer1
     FormCaption = 'GLScene Pak Editor - %FPS'
     KeyCombinations = <
       item

+ 5 - 4
Demos/utilities/ArchiveEdit/fMainD.pas

@@ -33,7 +33,7 @@ uses
   GLS.Graphics,
   GLS.State,
   GLS.CompositeImage,
-  // FileFormats 3D
+
   GLS.FileJPEG,
   GLS.FilePAK,
   GLS.FileZLIB,
@@ -54,7 +54,6 @@ uses
 type
   TForm1 = class(TForm)
     MainMenu1: TMainMenu;
-    TreeView: TTreeView;
     OpenDialog1: TOpenDialog;
     SaveDialog1: TSaveDialog;
     ImageList1: TImageList;
@@ -80,7 +79,6 @@ type
     Fast1: TMenuItem;
     Default1: TMenuItem;
     GLScene1: TGLScene;
-    GLSceneViewer1: TGLSceneViewer;
     GLCamera1: TGLCamera;
     GLLightSource1: TGLLightSource;
     GLSprite1: TGLSprite;
@@ -89,6 +87,9 @@ type
     GLSimpleNavigation1: TGLSimpleNavigation;
     GLSArchiveManager1: TGLSArchiveManager;
     GLCube1: TGLCube;
+    PanelTree: TPanel;
+    TreeView: TTreeView;
+    GLSceneViewer1: TGLSceneViewer;
     procedure FormCreate(Sender: TObject);
     procedure TreeViewRefresh;
     procedure FileListRefresh;
@@ -119,7 +120,7 @@ type
   private
      
   public
-     
+
   end;
 
 var

+ 4 - 4
Demos/utilities/HTFUtils/fViewer.pas

@@ -222,7 +222,7 @@ procedure TViewerForm.PrepareBitmap;
 var
   i, sx, tx, ty: Integer;
   scanLine: PColor32Array;
-  tileInfo: PHeightTileInfo;
+  tileInfo: PGLHeightTileInfo;
   dataRow: PSmallIntArray;
   tile: PHeightTile;
   start, lap, stop, htfTime, drawTime, freq: Int64;
@@ -245,7 +245,7 @@ begin
 
     for i := 0 to tileList.Count - 1 do
     begin
-      tileInfo := PHeightTileInfo(tileList[i]);
+      tileInfo := PGLHeightTileInfo(tileList[i]);
 
       QueryPerformanceCounter(start);
 
@@ -273,7 +273,7 @@ begin
     if TBGrid.Down then
     begin
       for i := 0 to tileList.Count - 1 do
-        with PHeightTileInfo(tileList[i])^ do
+        with PGLHeightTileInfo(tileList[i])^ do
         begin
           bmp.FrameRectS(left - curX, top - curY, left + Width - curX + 1,
             top + Height - curY + 1, clWhite32);
@@ -312,7 +312,7 @@ procedure TViewerForm.PaintBoxMouseMove(Sender: TObject; Shift: TShiftState;
   X, Y: Integer);
 var
   tileIdx, n: Integer;
-  tileInfo: PHeightTileInfo;
+  tileInfo: PGLHeightTileInfo;
 begin
   if Shift <> [] then
   begin

+ 8 - 8
Packages/GLScene_Cg_DT.dproj

@@ -164,23 +164,23 @@
                         <Overwrite>true</Overwrite>
                     </Platform>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
-                    <Platform Name="OSX32">
+                <DeployFile LocalName="$(BDS)\Redist\iossim32\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
                         <Overwrite>true</Overwrite>
                     </Platform>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule">
-                    <Platform Name="OSX32">
+                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
                         <Overwrite>true</Overwrite>
                     </Platform>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\iossim32\libcgunwind.1.0.dylib" Class="DependencyModule">
-                    <Platform Name="iOSSimulator">
+                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="OSX32">
                         <Overwrite>true</Overwrite>
                     </Platform>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
-                    <Platform Name="iOSSimulator">
+                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule">
+                    <Platform Name="OSX32">
                         <Overwrite>true</Overwrite>
                     </Platform>
                 </DeployFile>

+ 2 - 2
Source/CUDA.APIComps.pas

@@ -56,7 +56,7 @@ type
   TCUDAComponent = class(TCUDAHandlesMaster)
   private
     FMaster: TCUDAComponent;
-    FItems: TPersistentObjectList;
+    FItems: TGLPersistentObjectList;
     procedure SetMaster(AMaster: TCUDAComponent);
     function GetItem(const i: Integer): TCUDAComponent;
     function GetItemsCount: Integer;
@@ -1062,7 +1062,7 @@ end;
 procedure TCUDAComponent.AddItem(AItem: TCUDAComponent);
 begin
   if not Assigned(FItems) then
-    FItems := TPersistentObjectList.Create;
+    FItems := TGLPersistentObjectList.Create;
   FItems.Add(AItem);
 end;
 

+ 4 - 4
Source/Cg.Shader.pas

@@ -186,8 +186,8 @@ type
     procedure EnableTexture;
     procedure DisableTexture;
     // Procedures for setting varying parameters with an array of values.
-    procedure SetParameterPointer(Values: TVectorList); overload;
-    procedure SetParameterPointer(Values: TAffineVectorList); overload;
+    procedure SetParameterPointer(Values: TGLVectorList); overload;
+    procedure SetParameterPointer(Values: TGLAffineVectorList); overload;
     procedure EnableClientState;
     procedure DisableClientState;
     // LongName retruns ShaderName.[program type].ProgramName.ParamName.
@@ -944,13 +944,13 @@ begin
   cgGLEnableClientState(FHandle);
 end;
 
-procedure TCgParameter.SetParameterPointer(Values: TAffineVectorList);
+procedure TCgParameter.SetParameterPointer(Values: TGLAffineVectorList);
 begin
   Assert(FVariability = CG_VARYING);
   cgGLSetParameterPointer(FHandle, 3, GL_FLOAT, 0, Values.List);
 end;
 
-procedure TCgParameter.SetParameterPointer(Values: TVectorList);
+procedure TCgParameter.SetParameterPointer(Values: TGLVectorList);
 begin
   Assert(FVariability = CG_VARYING);
   cgGLSetParameterPointer(FHandle, 4, GL_FLOAT, 0, Values.List);

+ 4 - 4
Source/Formats.OCT.pas

@@ -76,8 +76,8 @@ type
     (* Saves content to stream in OCT format.
       The Header is automatically prepared before streaming. *)
     procedure SaveToStream(aStream: TStream);
-    procedure AddTriangles(vertexCoords: TAffineVectorList;
-      texMapCoords: TAffineVectorList; const textureName: String);
+    procedure AddTriangles(vertexCoords: TGLAffineVectorList;
+      texMapCoords: TGLAffineVectorList; const textureName: String);
     procedure AddLight(const lightPos: TAffineVector; const lightColor: TGLVector;
       lightIntensity: Integer);
   end;
@@ -137,8 +137,8 @@ begin
   end;
 end;
 
-procedure TOCTFile.AddTriangles(vertexCoords: TAffineVectorList;
-  texMapCoords: TAffineVectorList; const textureName: String);
+procedure TOCTFile.AddTriangles(vertexCoords: TGLAffineVectorList;
+  texMapCoords: TGLAffineVectorList; const textureName: String);
 var
   i: Integer;
   baseIdx, texIdx: Integer;

+ 6 - 6
Source/Formats.VRML.pas

@@ -42,20 +42,20 @@ type
 
   TVRMLSingleArray = class(TVRMLNode)
   private
-    FValues: TSingleList;
+    FValues: TGLSingleList;
   public
     constructor Create; override;
     destructor Destroy; override;
-    property Values: TSingleList read FValues;
+    property Values: TGLSingleList read FValues;
   end;
 
   TVRMLIntegerArray = class(TVRMLNode)
   private
-    FValues: TIntegerList;
+    FValues: TGLIntegerList;
   public
     constructor Create; override;
     destructor Destroy; override;
-    property Values: TIntegerList read FValues;
+    property Values: TGLIntegerList read FValues;
   end;
 
   TVRMLMaterial = class(TVRMLNode)
@@ -272,7 +272,7 @@ end;
 constructor TVRMLSingleArray.Create;
 begin
   inherited;
-  FValues := TSingleList.Create;
+  FValues := TGLSingleList.Create;
 end;
 
 destructor TVRMLSingleArray.Destroy;
@@ -289,7 +289,7 @@ end;
 constructor TVRMLIntegerArray.Create;
 begin
   inherited;
-  FValues := TIntegerList.Create;
+  FValues := TGLIntegerList.Create;
 end;
 
 destructor TVRMLIntegerArray.Destroy;

+ 21 - 21
Source/Formats.X.pas

@@ -46,7 +46,7 @@ type
 
   TDXMaterialList = class;
 
-  TDXMaterial = class(TPersistentObject)
+  TDXMaterial = class(TGLPersistentObject)
   private
     FDiffuse: TVector4f;
     FSpecPower: Single;
@@ -81,20 +81,20 @@ type
 
   TDXMesh = class(TDXNode)
   private
-    FVertices, FNormals, FTexCoords: TAffineVectorList;
+    FVertices, FNormals, FTexCoords: TGLAffineVectorList;
     FVertexIndices, FNormalIndices, FMaterialIndices, FVertCountIndices
-      : TIntegerList;
+      : TGLIntegerList;
     FMaterialList: TDXMaterialList;
   public
     constructor Create; override;
     destructor Destroy; override;
-    property Vertices: TAffineVectorList read FVertices;
-    property Normals: TAffineVectorList read FNormals;
-    property TexCoords: TAffineVectorList read FTexCoords;
-    property VertexIndices: TIntegerList read FVertexIndices;
-    property NormalIndices: TIntegerList read FNormalIndices;
-    property MaterialIndices: TIntegerList read FMaterialIndices;
-    property VertCountIndices: TIntegerList read FVertCountIndices;
+    property Vertices: TGLAffineVectorList read FVertices;
+    property Normals: TGLAffineVectorList read FNormals;
+    property TexCoords: TGLAffineVectorList read FTexCoords;
+    property VertexIndices: TGLIntegerList read FVertexIndices;
+    property NormalIndices: TGLIntegerList read FNormalIndices;
+    property MaterialIndices: TGLIntegerList read FMaterialIndices;
+    property VertCountIndices: TGLIntegerList read FVertCountIndices;
     property MaterialList: TDXMaterialList read FMaterialList;
   end;
 
@@ -339,7 +339,7 @@ var
     Result.Z := 0;
   end;
 
-  procedure ReadMeshVectors(VectorList: TAffineVectorList);
+  procedure ReadMeshVectors(VectorList: TGLAffineVectorList);
   var
     i, NumVectors: Integer;
   begin
@@ -348,8 +348,8 @@ var
       VectorList.Add(ReadVector3f);
   end;
 
-  procedure ReadMeshIndices(IndexList: TIntegerList;
-    VertCountIndices: TIntegerList = nil);
+  procedure ReadMeshIndices(IndexList: TGLIntegerList;
+    VertCountIndices: TGLIntegerList = nil);
   var
     str: String;
     i, j, NumFaces, NumIndices, jStart: Integer;
@@ -390,7 +390,7 @@ var
     end;
   end;
 
-  procedure ReadTexCoords(VectorList: TAffineVectorList);
+  procedure ReadTexCoords(VectorList: TGLAffineVectorList);
   var
     i, NumVectors: Integer;
   begin
@@ -602,13 +602,13 @@ constructor TDXMesh.Create;
 begin
   inherited;
 
-  FVertices := TAffineVectorList.Create;
-  FNormals := TAffineVectorList.Create;
-  FTexCoords := TAffineVectorList.Create;
-  FVertexIndices := TIntegerList.Create;
-  FNormalIndices := TIntegerList.Create;
-  FMaterialIndices := TIntegerList.Create;
-  FVertCountIndices := TIntegerList.Create;
+  FVertices := TGLAffineVectorList.Create;
+  FNormals := TGLAffineVectorList.Create;
+  FTexCoords := TGLAffineVectorList.Create;
+  FVertexIndices := TGLIntegerList.Create;
+  FNormalIndices := TGLIntegerList.Create;
+  FMaterialIndices := TGLIntegerList.Create;
+  FVertCountIndices := TGLIntegerList.Create;
   FMaterialList := TDXMaterialList.Create;
 end;
 

+ 2 - 2
Source/Formats.m3DSTypes.pas

@@ -40,8 +40,8 @@ type
      PCardinalArray = ^TCardinalArray;
      TCardinalArray = array[0..MaxInt div (2*SizeOf(Cardinal))] of Cardinal;
 
-     PSingleList = ^TSingleList;
-     TSingleList = array[0..MaxInt div (2*SizeOf(Single))] of Single;
+     PSingleList = ^TGLSingleList;
+     TGLSingleList = array[0..MaxInt div (2*SizeOf(Single))] of Single;
 
      PPoint3DS = ^TPoint3DS;                     // 3D point structure
      TPoint3DS = record

+ 1 - 1
Source/GLS.ArchiveManager.pas

@@ -72,7 +72,7 @@ type
   end;
 
   // The list of registered classes
-  TGLArchiveFileFormatsList = class(TPersistentObjectList)
+  TGLArchiveFileFormatsList = class(TGLPersistentObjectList)
   public
     destructor Destroy; override;
     procedure Add(const Ext, Desc: string; DescID: integer;

+ 18 - 18
Source/GLS.BumpmapHDS.pas

@@ -108,20 +108,20 @@ type
 
 (*  Some useful methods for setting up bump maps. *)
 procedure CalcObjectSpaceLightVectors(Light : TAffineVector;
-                                      Vertices: TAffineVectorList;
-                                      Colors: TVectorList);
+                                      Vertices: TGLAffineVectorList;
+                                      Colors: TGLVectorList);
 procedure SetupTangentSpace(Vertices, Normals, TexCoords,
-                            Tangents, BiNormals : TAffineVectorList);
+                            Tangents, BiNormals : TGLAffineVectorList);
 procedure CalcTangentSpaceLightVectors(Light : TAffineVector;
                                        Vertices, Normals,
-                                       Tangents, BiNormals : TAffineVectorList;
-                                       Colors: TVectorList);
+                                       Tangents, BiNormals : TGLAffineVectorList;
+                                       Colors: TGLVectorList);
 function CreateObjectSpaceNormalMap(Width, Height : Integer;
-                                    HiNormals,HiTexCoords : TAffineVectorList) : TBitmap;
+                                    HiNormals,HiTexCoords : TGLAffineVectorList) : TBitmap;
 function CreateTangentSpaceNormalMap(Width, Height : Integer;
                                      HiNormals, HiTexCoords,
                                      LoNormals, LoTexCoords,
-                                     Tangents, BiNormals : TAffineVectorList) : TBitmap;
+                                     Tangents, BiNormals : TGLAffineVectorList) : TBitmap;
 
 
 // ------------------------------------------------------------------
@@ -349,7 +349,7 @@ end;
 
 //----------------- BumpMapping routines ---------------------
 
-procedure CalcObjectSpaceLightVectors(Light: TAffineVector; Vertices: TAffineVectorList; Colors: TVectorList);
+procedure CalcObjectSpaceLightVectors(Light: TAffineVector; Vertices: TGLAffineVectorList; Colors: TGLVectorList);
 var
   i: Integer;
   vec: TAffineVector;
@@ -362,7 +362,7 @@ begin
   end;
 end;
 
-procedure SetupTangentSpace(Vertices, Normals, TexCoords, Tangents, BiNormals: TAffineVectorList);
+procedure SetupTangentSpace(Vertices, Normals, TexCoords, Tangents, BiNormals: TGLAffineVectorList);
 var
   i, j: Integer;
   v, n, t: TAffineMatrix;
@@ -455,8 +455,8 @@ begin
 end;
 
 procedure CalcTangentSpaceLightVectors(Light: TAffineVector;
-  Vertices, Normals, Tangents, BiNormals: TAffineVectorList;
-  Colors: TVectorList);
+  Vertices, Normals, Tangents, BiNormals: TGLAffineVectorList;
+  Colors: TGLVectorList);
 var
   i: Integer;
   mat: TAffineMatrix;
@@ -601,7 +601,7 @@ begin
 end;
 
 procedure CalcObjectSpaceNormalMap(Width, Height: Integer;
-  NormalMap, Normals, TexCoords: TAffineVectorList);
+  NormalMap, Normals, TexCoords: TGLAffineVectorList);
 var
   i, X, Y, xs, xe, x1, y1, x2, y2, x3, y3: Integer;
   n, n1, n2, n3: TAffineVector;
@@ -687,12 +687,12 @@ begin
 end;
 
 function CreateObjectSpaceNormalMap(Width, Height: Integer;
-  HiNormals, HiTexCoords: TAffineVectorList): TBitmap;
+  HiNormals, HiTexCoords: TGLAffineVectorList): TBitmap;
 var
   i: Integer;
-  NormalMap: TAffineVectorList;
+  NormalMap: TGLAffineVectorList;
 begin
-  NormalMap := TAffineVectorList.Create;
+  NormalMap := TGLAffineVectorList.Create;
   NormalMap.AddNulls(Width * Height);
   CalcObjectSpaceNormalMap(Width, Height, NormalMap, HiNormals, HiTexCoords);
 
@@ -710,7 +710,7 @@ begin
 end;
 
 function CreateTangentSpaceNormalMap(Width, Height: Integer; HiNormals, HiTexCoords, LoNormals, LoTexCoords, Tangents,
-  BiNormals: TAffineVectorList): TBitmap;
+  BiNormals: TGLAffineVectorList): TBitmap;
 
   function NormalToTangentSpace(normal: TAffineVector; X, Y, x1, y1, x2, y2, x3, y3: Integer; m1, m2, m3: TAffineMatrix)
     : TAffineVector;
@@ -726,11 +726,11 @@ function CreateTangentSpaceNormalMap(Width, Height: Integer; HiNormals, HiTexCoo
 
 var
   i, X, Y, xs, xe, x1, y1, x2, y2, x3, y3: Integer;
-  NormalMap: TAffineVectorList;
+  NormalMap: TGLAffineVectorList;
   n: TAffineVector;
   m, m1, m2, m3: TAffineMatrix;
 begin
-  NormalMap := TAffineVectorList.Create;
+  NormalMap := TGLAffineVectorList.Create;
   NormalMap.AddNulls(Width * Height);
 
   CalcObjectSpaceNormalMap(Width, Height, NormalMap, HiNormals, HiTexCoords);

+ 2 - 2
Source/GLS.Collision.pas

@@ -506,7 +506,7 @@ end;
   Octree.GetTrianglesInCube returns no points, why? }
 function FastCheckCubeVsFace(obj1, obj2: TGLBaseSceneObject): Boolean;
 // var
-// triList : TAffineVectorList;
+// triList : TGLAffineVectorList;
 // m1to2, m2to1 : TGLMatrix;
 // i:integer;
 begin
@@ -542,7 +542,7 @@ type
 
 var
   i: Integer;
-  triList: TAffineVectorList;
+  triList: TGLAffineVectorList;
   tri: PTriangle;
   m1to2, m2to1: TGLMatrix;
   AABB2: TAABB;

+ 0 - 1
Source/GLS.Coordinates.pas

@@ -1183,4 +1183,3 @@ initialization
 RegisterClasses([TGLCoordinates2, TGLCoordinates3, TGLCoordinates4]);
 
 end.
-

+ 13 - 13
Source/GLS.CurvesAndSurfaces.pas

@@ -21,19 +21,19 @@ type
 
 function BezierCurvePoint(t: single; n: integer; cp: PAffineVectorArray): TAffineVector;
 function BezierSurfacePoint(s, t: single; m, n: integer; cp: PAffineVectorArray): TAffineVector;
-procedure GenerateBezierCurve(Steps: integer;  ControlPoints, Vertices: TAffineVectorList);
-procedure GenerateBezierSurface(Steps, Width, Height: integer; ControlPoints, Vertices: TAffineVectorList);
+procedure GenerateBezierCurve(Steps: integer;  ControlPoints, Vertices: TGLAffineVectorList);
+procedure GenerateBezierSurface(Steps, Width, Height: integer; ControlPoints, Vertices: TGLAffineVectorList);
 
 function BSplinePoint(t: single; n, k: integer; knots: PSingleArray;
   cp: PAffineVectorArray): TAffineVector;
 function BSplineSurfacePoint(s, t: single; m, n, k1, k2: integer;
   uknots, vknots: PSingleArray; cp: PAffineVectorArray): TAffineVector;
-procedure GenerateBSpline(Steps, Order: integer; KnotVector: TSingleList;
-  ControlPoints, Vertices: TAffineVectorList);
+procedure GenerateBSpline(Steps, Order: integer; KnotVector: TGLSingleList;
+  ControlPoints, Vertices: TGLAffineVectorList);
 procedure GenerateBSplineSurface(Steps, UOrder, VOrder, Width, Height: integer;
-  UKnotVector, VKnotVector: TSingleList;
-  ControlPoints, Vertices: TAffineVectorList);
-procedure GenerateKnotVector(KnotVector: TSingleList;
+  UKnotVector, VKnotVector: TGLSingleList;
+  ControlPoints, Vertices: TGLAffineVectorList);
+procedure GenerateKnotVector(KnotVector: TGLSingleList;
   NumberOfPoints, Order: integer; Continuity: TBSplineContinuity);
 
 // --------------------------------------------------------------------------
@@ -106,7 +106,7 @@ begin
 end;
 
 procedure GenerateBezierCurve(Steps: integer;
-  ControlPoints, Vertices: TAffineVectorList);
+  ControlPoints, Vertices: TGLAffineVectorList);
 var
   i: integer;
 begin
@@ -117,7 +117,7 @@ begin
 end;
 
 procedure GenerateBezierSurface(Steps, Width, Height: integer;
-  ControlPoints, Vertices: TAffineVectorList);
+  ControlPoints, Vertices: TGLAffineVectorList);
 var
   i, j: integer;
 begin
@@ -228,8 +228,8 @@ begin
   end;
 end;
 
-procedure GenerateBSpline(Steps, Order: integer; KnotVector: TSingleList;
-  ControlPoints, Vertices: TAffineVectorList);
+procedure GenerateBSpline(Steps, Order: integer; KnotVector: TGLSingleList;
+  ControlPoints, Vertices: TGLAffineVectorList);
 var
   i: integer;
 begin
@@ -241,7 +241,7 @@ begin
 end;
 
 procedure GenerateBSplineSurface(Steps, UOrder, VOrder, Width, Height: integer;
-  UKnotVector, VKnotVector: TSingleList; ControlPoints, Vertices: TAffineVectorList);
+  UKnotVector, VKnotVector: TGLSingleList; ControlPoints, Vertices: TGLAffineVectorList);
 var
   i, j: integer;
 begin
@@ -254,7 +254,7 @@ begin
         @UKnotVector.List[0], @VKnotVector.List[0], ControlPoints.List);
 end;
 
-procedure GenerateKnotVector(KnotVector: TSingleList;
+procedure GenerateKnotVector(KnotVector: TGLSingleList;
   NumberOfPoints, Order: integer; Continuity: TBSplineContinuity);
 var
   i, n, k: integer;

+ 2 - 2
Source/GLS.DCE.pas

@@ -549,7 +549,7 @@ function TGLDCEManager.MoveByDistance(var Body: TGLDCEDynamic;
 var
   // Friction and bounce
   TotalFriction, Bounce, f, m, restitution: single;
-  ContactList: TIntegerList;
+  ContactList: TGLIntegerList;
   // Temporary properties (Static or Dynamic)
   tFriction, tBounceFactor: single;
   TObject: TGLBaseSceneObject;
@@ -669,7 +669,7 @@ begin
   // Generate events and calculate average friction
   lastobj := -1;
   TotalFriction := Body.Friction;
-  ContactList := TIntegerList.Create;
+  ContactList := TGLIntegerList.Create;
   try
     for i := 0 to High(MP.Contacts) do
       with MP do

+ 1 - 1
Source/GLS.EllipseCollision.pas

@@ -52,7 +52,7 @@ type
   // Ellipsoid collision FreeForm
   TECFreeForm = record
     OctreeNodes: array of POctreeNode;
-    triangleFiler: ^TAffineVectorList;
+    triangleFiler: ^TGLAffineVectorList;
     InvertedNormals: Boolean;
     ObjectInfo: TECObjectInfo;
   end;

+ 20 - 20
Source/GLS.ExplosionFx.pas

@@ -42,27 +42,27 @@ uses
 type
   TGLBExplosionFX = class(TGLObjectPreEffect)
   private
-    FTriList: TAffineVectorList;
-    FRotList: TAffineVectorList;
-    FDirList: TAffineVectorList;
-    FPosList: TAffineVectorList;
+    FTriList: TGLAffineVectorList;
+    FRotList: TGLAffineVectorList;
+    FDirList: TGLAffineVectorList;
+    FPosList: TGLAffineVectorList;
     FEnabled: boolean;
     FFaceCount: integer;
     FSpeed: single;
     FDirection: TGLCoordinates;
     FMaxSteps: integer;
     FStep: integer;
-    procedure SetTriList(Value: TAffineVectorList);
-    procedure SetRotList(Value: TAffineVectorList);
-    procedure SetDirList(Value: TAffineVectorList);
-    procedure SetPosList(Value: TAffineVectorList);
+    procedure SetTriList(Value: TGLAffineVectorList);
+    procedure SetRotList(Value: TGLAffineVectorList);
+    procedure SetDirList(Value: TGLAffineVectorList);
+    procedure SetPosList(Value: TGLAffineVectorList);
     procedure SetDirection(value: TGLCoordinates);
     procedure SetEnabled(value: boolean);
   protected
-    property TriList: TAffineVectorList read FTriList write SetTriList;
-    property RotList: TAffineVectorList read FRotList write SetRotList;
-    property DirList: TAffineVectorList read FDirList write SetDirList;
-    property PosList: TAffineVectorList read FPosList write SetPosList;
+    property TriList: TGLAffineVectorList read FTriList write SetTriList;
+    property RotList: TGLAffineVectorList read FRotList write SetRotList;
+    property DirList: TGLAffineVectorList read FDirList write SetDirList;
+    property PosList: TGLAffineVectorList read FPosList write SetPosList;
     property FaceCount: integer read FFAceCount write FFaceCount;
     procedure CacheInfo;
   public
@@ -93,10 +93,10 @@ implementation
 constructor TGLBExplosionFx.Create(aOwner: TXCollection);
 begin
   inherited Create(AOwner);
-  FTriList := TAffineVectorList.Create;
-  FRotList := TAffineVectorList.Create;
-  FDirList := TAffineVectorList.Create;
-  FPosList := TAffineVectorList.Create;
+  FTriList := TGLAffineVectorList.Create;
+  FRotList := TGLAffineVectorList.Create;
+  FDirList := TGLAffineVectorList.Create;
+  FPosList := TGLAffineVectorList.Create;
   FDirection := TGLCoordinates.CreateInitialized(Self, NullHmgVector, csPoint);
 end;
 
@@ -121,22 +121,22 @@ begin
   Result := 'Explosion FX';
 end;
 
-procedure TGLBExplosionFx.SetTriList(Value: TAffineVectorList);
+procedure TGLBExplosionFx.SetTriList(Value: TGLAffineVectorList);
 begin
   FTriList.Assign(Value);
 end;
 
-procedure TGLBExplosionFx.SetRotList(Value: TAffineVectorList);
+procedure TGLBExplosionFx.SetRotList(Value: TGLAffineVectorList);
 begin
   FRotList.Assign(Value);
 end;
 
-procedure TGLBExplosionFx.SetDirList(Value: TAffineVectorList);
+procedure TGLBExplosionFx.SetDirList(Value: TGLAffineVectorList);
 begin
   FDirList.Assign(Value);
 end;
 
-procedure TGLBExplosionFx.SetPosList(Value: TAffineVectorList);
+procedure TGLBExplosionFx.SetPosList(Value: TGLAffineVectorList);
 begin
   FPosList.Assign(Value);
 end;

+ 20 - 20
Source/GLS.Feedback.pas

@@ -46,7 +46,7 @@ type
   TGLFeedback = class(TGLBaseSceneObject)
   private
     FActive: Boolean;
-    FBuffer: TSingleList;
+    FBuffer: TGLSingleList;
     FMaxBufferSize: Cardinal;
     FBuffered: Boolean;
     FCorrectionScaling: Single;
@@ -62,15 +62,15 @@ type
     (* Parse the the feedback buffer for polygon data and build
        a mesh into the assigned lists. *)
     procedure BuildMeshFromBuffer(
-      Vertices: TAffineVectorList = nil;
-      Normals: TAffineVectorList = nil;
-      Colors: TVectorList = nil;
-      TexCoords: TAffineVectorList = nil;
-      VertexIndices: TIntegerList = nil);
+      Vertices: TGLAffineVectorList = nil;
+      Normals: TGLAffineVectorList = nil;
+      Colors: TGLVectorList = nil;
+      TexCoords: TGLAffineVectorList = nil;
+      VertexIndices: TGLIntegerList = nil);
     // True when there is data in the buffer ready for parsing
     property Buffered: Boolean read FBuffered;
     // The feedback buffer
-    property Buffer: TSingleList read FBuffer;
+    property Buffer: TGLSingleList read FBuffer;
     (* Vertex positions in the buffer needs to be scaled by
        CorrectionScaling to get correct coordinates. *)
     property CorrectionScaling: Single read FCorrectionScaling;
@@ -96,7 +96,7 @@ constructor TGLFeedback.Create(AOwner: TComponent);
 begin
   inherited;
   FMaxBufferSize := $100000;
-  FBuffer := TSingleList.Create;
+  FBuffer := TGLSingleList.Create;
   FBuffer.Capacity := FMaxBufferSize div SizeOf(Single);
   FBuffered := False;
   FActive := False;
@@ -185,25 +185,25 @@ begin
 end;
 
 procedure TGLFeedback.BuildMeshFromBuffer(
-  Vertices: TAffineVectorList = nil;
-  Normals: TAffineVectorList = nil;
-  Colors: TVectorList = nil;
-  TexCoords: TAffineVectorList = nil;
-  VertexIndices: TIntegerList = nil);
+  Vertices: TGLAffineVectorList = nil;
+  Normals: TGLAffineVectorList = nil;
+  Colors: TGLVectorList = nil;
+  TexCoords: TGLAffineVectorList = nil;
+  VertexIndices: TGLIntegerList = nil);
 var
   value: Single;
   i, j, LCount, skip: Integer;
   vertex, color, texcoord: TGLVector;
-  tempVertices, tempNormals, tempTexCoords: TAffineVectorList;
-  tempColors: TVectorList;
-  tempIndices: TIntegerList;
+  tempVertices, tempNormals, tempTexCoords: TGLAffineVectorList;
+  tempColors: TGLVectorList;
+  tempIndices: TGLIntegerList;
   ColorBuffered, TexCoordBuffered: Boolean;
 begin
   Assert(FMode <> fm2D, 'Cannot build mesh from fm2D feedback mode.');
 
-  tempVertices := TAffineVectorList.Create;
-  tempColors := TVectorList.Create;
-  tempTexCoords := TAffineVectorList.Create;
+  tempVertices := TGLAffineVectorList.Create;
+  tempColors := TGLVectorList.Create;
+  tempTexCoords := TGLAffineVectorList.Create;
 
   ColorBuffered := (FMode = fm3DColor) or
     (FMode = fm3DColorTexture) or
@@ -292,7 +292,7 @@ begin
   end
   else
   begin
-    tempIndices := TIntegerList.Create;
+    tempIndices := TGLIntegerList.Create;
     tempIndices.AddSerie(0, 1, tempVertices.Count);
   end;
 

+ 1 - 1
Source/GLS.File3DPDF.pas

@@ -259,7 +259,7 @@ var
   FaceCount, ModelPositionCount, NormalCount, I, J: Integer;
   FacePositionList, NormalList, ModelPositionList, ModelNormalList, FaceShadingList: String;
   Lines: TStringList;
-  Indicies: TIntegerList;
+  Indicies: TGLIntegerList;
 
   function FormatVector(const AVector: TAffineVector): string;
   begin

+ 56 - 56
Source/GLS.File3DS.pas

@@ -48,7 +48,7 @@ type
   end;
 
   // An abstract class that describes how to interpolate animation keys.
-  TGLFile3DSAnimationKeys = class(TPersistentObject)
+  TGLFile3DSAnimationKeys = class(TGLPersistentObject)
   private
     FNumKeys: Integer;
     FKeys: array of TKeyHeader3DS;
@@ -61,8 +61,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); virtual;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); virtual; abstract;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TGLFile3DSScaleAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -72,8 +72,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TGLFile3DSRotationAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -83,8 +83,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TGLFile3DSPositionAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -94,8 +94,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TGLFile3DSColorAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -105,8 +105,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TTGLFile3DSPositionAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -116,8 +116,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TGLFile3DSSpotLightCutOffAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -127,8 +127,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TGLFile3DSLightHotSpotAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -138,8 +138,8 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
   TGLFile3DSRollAnimationKeys = class(TGLFile3DSAnimationKeys)
@@ -149,11 +149,11 @@ type
     procedure LoadData(const ANumKeys: Integer; const Keys: PKeyHeaderList; const AData: Pointer); override;
     procedure Apply(var DataTransf: TGLFile3DSAnimationData; const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
   end;
 
-  TGLFile3DSAnimationKeyList = class(TPersistentObject)
+  TGLFile3DSAnimationKeyList = class(TGLPersistentObject)
   private
     FAnimKeysList: array of TGLFile3DSAnimationKeys;
   protected
@@ -162,8 +162,8 @@ type
     procedure AddKeys(const AItem: TGLFile3DSAnimationKeys);
     procedure ClearKeys;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
     destructor Destroy; override;
   end;
 
@@ -185,10 +185,10 @@ type
     procedure MorphTo(morphTargetIndex: Integer); override;
     procedure Lerp(morphTargetIndex1, morphTargetIndex2: Integer; lerpFactor: Single); override;
     procedure GetExtents(out min, max: TAffineVector); override;
-    function ExtractTriangles(texCoords: TAffineVectorList = nil; normals: TAffineVectorList = nil): TAffineVectorList;
+    function ExtractTriangles(texCoords: TGLAffineVectorList = nil; normals: TGLAffineVectorList = nil): TGLAffineVectorList;
       override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
     procedure Assign(Source: TPersistent); override;
     constructor Create; override;
     destructor Destroy; override;
@@ -215,8 +215,8 @@ type
     procedure LoadAnimation(const AData: Pointer); override;
     procedure SetFrame(const AFrame: real); override;
     procedure Assign(Source: TPersistent); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
     destructor Destroy; override;
   end;
 
@@ -239,8 +239,8 @@ type
     procedure LoadData(Owner: TGLBaseMesh; AData: PCamera3DS);
     procedure LoadAnimation(const AData: Pointer); override;
     procedure SetFrame(const AFrame: real); override;
-    procedure WriteToFiler(Writer: TVirtualWriter); override;
-    procedure ReadFromFiler(Reader: TVirtualReader); override;
+    procedure WriteToFiler(Writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(Reader: TGLVirtualReader); override;
     destructor Destroy; override;
   end;
 
@@ -504,14 +504,14 @@ begin
     inherited Assign(Source);
 end;
 
-procedure TGLFile3DSAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   Writer.WriteInteger(FNumKeys);
   if FNumKeys > 0 then
     Writer.Write(FKeys[0], FNumKeys * SizeOf(TKeyHeader3DS));
 end;
 
-procedure TGLFile3DSAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   FNumKeys := Reader.ReadInteger;
   SetLength(FKeys, FNumKeys);
@@ -567,7 +567,7 @@ begin
     FScale[I] := (Source as TGLFile3DSScaleAnimationKeys).FScale[I];
 end;
 
-procedure TGLFile3DSScaleAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSScaleAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -575,7 +575,7 @@ begin
     Writer.Write(FScale[0], FNumKeys * SizeOf(TPoint3DS));
 end;
 
-procedure TGLFile3DSScaleAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSScaleAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -642,7 +642,7 @@ begin
     FRot[I] := (Source as TGLFile3DSRotationAnimationKeys).FRot[I];
 end;
 
-procedure TGLFile3DSRotationAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSRotationAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -650,7 +650,7 @@ begin
     Writer.Write(FRot[0], FNumKeys * SizeOf(TKFRotKey3DS));
 end;
 
-procedure TGLFile3DSRotationAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSRotationAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -694,7 +694,7 @@ begin
     FPos[I] := (Source as TGLFile3DSPositionAnimationKeys).FPos[I];
 end;
 
-procedure TGLFile3DSPositionAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSPositionAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -702,7 +702,7 @@ begin
     Writer.Write(FPos[0], FNumKeys * SizeOf(TPoint3DS));
 end;
 
-procedure TGLFile3DSPositionAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSPositionAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -739,7 +739,7 @@ begin
     FCol[I] := (Source as TGLFile3DSColorAnimationKeys).FCol[I];
 end;
 
-procedure TGLFile3DSColorAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSColorAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -747,7 +747,7 @@ begin
     Writer.Write(FCol[0], FNumKeys * SizeOf(TFColor3DS));
 end;
 
-procedure TGLFile3DSColorAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSColorAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -791,7 +791,7 @@ begin
     FTPos[I] := (Source as TTGLFile3DSPositionAnimationKeys).FTPos[I];
 end;
 
-procedure TTGLFile3DSPositionAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TTGLFile3DSPositionAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -799,7 +799,7 @@ begin
     Writer.Write(FTPos[0], FNumKeys * SizeOf(TPoint3DS));
 end;
 
-procedure TTGLFile3DSPositionAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TTGLFile3DSPositionAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -837,7 +837,7 @@ begin
     FFall[I] := (Source as TGLFile3DSSpotLightCutOffAnimationKeys).FFall[I];
 end;
 
-procedure TGLFile3DSSpotLightCutOffAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSSpotLightCutOffAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -845,7 +845,7 @@ begin
     Writer.Write(FFall[0], FNumKeys * SizeOf(Single));
 end;
 
-procedure TGLFile3DSSpotLightCutOffAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSSpotLightCutOffAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -883,7 +883,7 @@ begin
     FHot[I] := (Source as TGLFile3DSLightHotSpotAnimationKeys).FHot[I];
 end;
 
-procedure TGLFile3DSLightHotSpotAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSLightHotSpotAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -891,7 +891,7 @@ begin
     Writer.Write(FHot[0], FNumKeys * SizeOf(Single));
 end;
 
-procedure TGLFile3DSLightHotSpotAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSLightHotSpotAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -928,7 +928,7 @@ begin
     FRoll[I] := (Source as TGLFile3DSRollAnimationKeys).FRoll[I];
 end;
 
-procedure TGLFile3DSRollAnimationKeys.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSRollAnimationKeys.WriteToFiler(Writer: TGLVirtualWriter);
 begin
   inherited;
 
@@ -936,7 +936,7 @@ begin
     Writer.Write(FRoll[0], FNumKeys * SizeOf(Single));
 end;
 
-procedure TGLFile3DSRollAnimationKeys.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSRollAnimationKeys.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -992,7 +992,7 @@ begin
     inherited Assign(Source);
 end;
 
-procedure TGLFile3DSAnimationKeyList.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSAnimationKeyList.WriteToFiler(Writer: TGLVirtualWriter);
 var
   I: Integer;
   Val: TGLFile3DSAnimKeysClassType;
@@ -1006,7 +1006,7 @@ begin
   end;
 end;
 
-procedure TGLFile3DSAnimationKeyList.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSAnimationKeyList.ReadFromFiler(Reader: TGLVirtualReader);
 var
   I, cnt: Integer;
   Val: TGLFile3DSAnimKeysClassType;
@@ -1103,7 +1103,7 @@ begin
   end;
 end;
 
-function TGLFile3DSDummyObject.ExtractTriangles(texCoords, normals: TAffineVectorList): TAffineVectorList;
+function TGLFile3DSDummyObject.ExtractTriangles(texCoords, normals: TGLAffineVectorList): TGLAffineVectorList;
 var
   I: Integer;
 begin
@@ -1117,7 +1117,7 @@ begin
   end;
 end;
 
-procedure TGLFile3DSDummyObject.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSDummyObject.WriteToFiler(Writer: TGLVirtualWriter);
 var
   str: string;
 begin
@@ -1132,7 +1132,7 @@ begin
   FAnimList.WriteToFiler(Writer);
 end;
 
-procedure TGLFile3DSDummyObject.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSDummyObject.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -1297,7 +1297,7 @@ begin
     FLightSrc.Assign((Source as TGLFile3DSOmniLightObject).FLightSrc);
 end;
 
-procedure TGLFile3DSOmniLightObject.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSOmniLightObject.WriteToFiler(Writer: TGLVirtualWriter);
 var
   str: string;
 begin
@@ -1310,7 +1310,7 @@ begin
   Writer.WriteString(str);
 end;
 
-procedure TGLFile3DSOmniLightObject.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSOmniLightObject.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -1449,7 +1449,7 @@ begin
   FTargetObj.Position.SetPoint(FAnimTransf.TargetPos);
 end;
 
-procedure TGLFile3DSCameraObject.WriteToFiler(Writer: TVirtualWriter);
+procedure TGLFile3DSCameraObject.WriteToFiler(Writer: TGLVirtualWriter);
 var
   str: string;
 begin
@@ -1462,7 +1462,7 @@ begin
   Writer.WriteString(str);
 end;
 
-procedure TGLFile3DSCameraObject.ReadFromFiler(Reader: TVirtualReader);
+procedure TGLFile3DSCameraObject.ReadFromFiler(Reader: TGLVirtualReader);
 begin
   inherited;
 

+ 13 - 13
Source/GLS.FileASE.pas

@@ -89,7 +89,7 @@ type
   TGLASEMeshObject = class(TObject)
   private
     FFaces: TGLASEFaceList;
-    FVertices: TAffineVectorList;
+    FVertices: TGLAffineVectorList;
     FMatrix: TGLMatrix;
     FInheritedPosition: TAffineVector;
     FInheritedScale: TAffineVector;
@@ -100,18 +100,18 @@ type
     FScale: TAffineVector;
     FScaleAxisAngle: Single;
     FScaleAxis: TAffineVector;
-    FTexChannels: array [0..GL_ASE_MAX_TEXURE_CHANNELS - 1] of TAffineVectorList;
+    FTexChannels: array [0..GL_ASE_MAX_TEXURE_CHANNELS - 1] of TGLAffineVectorList;
     FTexChannelsCount: Integer;
     FHasNormals: Boolean;
     FMaterialID: Integer;
-    function AddTexChannel: TAffineVectorList;
-    function GetTextChannel(Channel: Integer): TAffineVectorList;
+    function AddTexChannel: TGLAffineVectorList;
+    function GetTextChannel(Channel: Integer): TGLAffineVectorList;
   public
     constructor Create;
     destructor Destroy; override;
     property Faces: TGLASEFaceList read FFaces;
-    property Vertices: TAffineVectorList read FVertices;
-    property TextChannel[Channel: Integer]: TAffineVectorList read GetTextChannel;
+    property Vertices: TGLAffineVectorList read FVertices;
+    property TextChannel[Channel: Integer]: TGLAffineVectorList read GetTextChannel;
     property TextChannelsCount: Integer read FTexChannelsCount;
     property Matrix: TGLMatrix read FMatrix;
     property InheritedPosition: TAffineVector read FInheritedPosition;
@@ -801,14 +801,14 @@ var
   norm, tex, light: Boolean;
   lmt: array [0..2] of TAffineVector;
   subID: Integer;
-  vi: TIntegerList;
+  vi: TGLIntegerList;
 begin
   norm := aASEMesh.HasNormals;
   tex := aASEMesh.TextChannelsCount > 0;
   light := tex and (aASEMesh.TextChannelsCount > 1);
   subID := -1;
 
-  vi := TIntegerList.Create;
+  vi := TGLIntegerList.Create;
   if tex or norm then begin
     // here used NOT optimized storage
 
@@ -935,7 +935,7 @@ end;
 constructor TGLASEMeshObject.Create;
 begin
   FFaces := TGLASEFaceList.Create;
-  FVertices := TAffineVectorList.Create;
+  FVertices := TGLAffineVectorList.Create;
   FTexChannelsCount := 0;
   FHasNormals := False;
   FMaterialID := -1;
@@ -952,15 +952,15 @@ begin
   inherited;
 end;
 
-function TGLASEMeshObject.AddTexChannel: TAffineVectorList;
+function TGLASEMeshObject.AddTexChannel: TGLAffineVectorList;
 begin
   Assert(FTexChannelsCount < GL_ASE_MAX_TEXURE_CHANNELS, 'texture channels count maximum reached');
-  Result := TAffineVectorList.Create;
+  Result := TGLAffineVectorList.Create;
   FTexChannels[FTexChannelsCount] := Result;
   Inc(FTexChannelsCount);
 end;
 
-function TGLASEMeshObject.GetTextChannel(Channel: Integer): TAffineVectorList;
+function TGLASEMeshObject.GetTextChannel(Channel: Integer): TGLAffineVectorList;
 begin
   Result := FTexChannels[Channel];
 end;
@@ -1474,7 +1474,7 @@ procedure TGLASEVectorFile.ParseMeshTextureVertices(var aLineIndex: Integer; aMe
 var
   Data: string;
   Index: Integer;
-  channel: TAffineVectorList;
+  channel: TGLAffineVectorList;
 begin
   Inc(aLineIndex);
   Data := FStringData[aLineIndex];

+ 130 - 0
Source/GLS.FileDDS.pas

@@ -18,10 +18,14 @@ uses
 
   GLS.Context,
   GLS.Graphics,
+  GLS.Texture,
   GLS.TextureFormat,
+  GLS.CompositeImage,
+  GLS.MultiSampleImage,
   GLS.RGBE,
   GLS.ApplicationFileIO,
   GLS.VectorGeometry,
+  GLS.Material,
   GLS.Strings;
 
 type
@@ -44,6 +48,28 @@ type
       const IntFormat: TGLInternalFormat); reintroduce;
   end;
 
+
+// get or create material in material library
+function GetOrCreateLibMaterial(aMaterialLibrary: TGLMaterialLibrary;
+  aMaterialName: string): TGLLibMaterial;
+
+function LibMat(aMatLib: TGLMaterialLibrary; aMatName: string): TGLLibMaterial;
+
+// load DDS to texture
+{
+function DDStex(aMatLib: TGLMaterialLibrary; aTexName, aDDSFileName: string;
+  aSecondTexName: string = ''; aDDSLevel: integer = 0): TGLLibMaterial; overload;
+}
+function DDStex(aMatLib: TGLMaterialLibrary; aTexName, aDDSFileName: string;
+  aSecondTexName: string = ''; aDDSLevel: integer = 0): TGLLibMaterial; overload;
+
+function DDStex(aTexture: TGLTexture; aDDSFileName: string;
+  aDDSLevel: integer = 0): TGLTexture; overload;
+
+function DDStex(aTextureEx: TGLTextureExItem; aDDSFileName: string;
+  aDDSLevel: integer = 0): TGLTextureExItem; overload;
+
+
 var
   (* Variable determines which resolution to use textures,
      high - it loads all levels,
@@ -57,6 +83,110 @@ implementation
 
 uses
   Formats.DXTC;
+
+// --------------------------------------------------------------------
+function GetOrCreateLibMaterial(aMaterialLibrary: TGLMaterialLibrary;
+  aMaterialName: string): TGLLibMaterial;
+begin
+  result := nil;
+  if aMaterialLibrary = nil then
+    exit;
+  result := aMaterialLibrary.LibMaterialByName(aMaterialName);
+  if result = nil then
+  begin
+    result := aMaterialLibrary.Materials.Add;
+    result.Name := aMaterialName;
+  end;
+end;
+
+// ---------------------------------------------------------------------
+function LibMat(aMatLib: TGLMaterialLibrary; aMatName: string): TGLLibMaterial;
+begin
+  if aMatLib = nil then
+    exit;
+  result := aMatLib.LibMaterialByName(aMatName);
+  if result = nil then
+  begin
+    result := aMatLib.Materials.Add;
+    result.Name := aMatName;
+  end;
+end;
+
+// DDStex
+// --------------------------------------------------------------------
+function DDStex(aMatLib: TGLMaterialLibrary; aTexName, aDDSFileName: string;
+  aSecondTexName: string = ''; aDDSLevel: integer = 0): TGLLibMaterial;
+begin
+  result := GetOrCreateLibMaterial(aMatLib, aTexName);
+  result.Texture2Name := aSecondTexName;
+  DDStex(result.Material.Texture, aDDSFileName, aDDSLevel);
+end;
+
+
+// ---------------------------------------------------------------------
+{
+function DDStex(aMatLib: TGLMaterialLibrary; aTexName, aDDSFileName: string;
+  aSecondTexName: string = ''; aDDSLevel: integer = 0): TGLLibMaterial;
+var
+  Level: TGLDDSDetailLevels;
+begin
+  Level := vDDSDetailLevel;
+  case aDDSLevel of
+    1: vDDSDetailLevel := ddsMediumDet;
+    2: vDDSDetailLevel := ddsLowDet;
+  else
+    vDDSDetailLevel := ddsHighDet;
+  end;
+
+  Result := LibMat(aMatLib, aTexName);
+  Result.Texture2Name := aSecondTexName;
+
+  with Result.Material.Texture do
+  begin
+    ImageClassName := 'TGLCompositeImage';
+    Image.LoadFromFile(aDDSFileName);
+    Disabled := false;
+  end;
+  vDDSDetailLevel := Level;
+end;
+}
+
+// DDStex
+// --------------------------------------------------------------------
+function DDStex(aTextureEx: TGLTextureExItem; aDDSFileName: string;
+  aDDSLevel: integer = 0): TGLTextureExItem;
+begin
+  DDStex(aTextureEx.Texture, aDDSFileName, aDDSLevel);
+  result := aTextureEx;
+end;
+
+// DDStex
+// --------------------------------------------------------------------
+function DDStex(aTexture: TGLTexture; aDDSFileName: string;
+  aDDSLevel: integer = 0): TGLTexture;
+var
+  def: TGLDDSDetailLevels;
+begin
+  def := vDDSDetailLevel;
+  case aDDSLevel of
+    1: vDDSDetailLevel := ddsMediumDet;
+    2: vDDSDetailLevel := ddsLowDet;
+  else
+    vDDSDetailLevel := ddsHighDet;
+  end;
+  with aTexture do
+  begin
+    ImageClassName := 'TGLCompositeImage';
+    if FileExists(aDDSFileName) then
+      Image.LoadFromFile(aDDSFileName);
+    Disabled := false;
+  end;
+  result := aTexture;
+  vDDSDetailLevel := def;
+end;
+
+
+
 // ------------------
 // ------------------ TGLDDSImage ------------------
 // ------------------

+ 1 - 1
Source/GLS.FileDEL.pas

@@ -59,7 +59,7 @@ var
    Tnam: string;
    Id_Mat, NVert, NTri : Integer;
 
-   VertArr :  TGLPoint3DArray;
+   VertArr :  TPoint3DArray;
    n1, n2, n3 : Integer;
 
 

+ 2 - 2
Source/GLS.FileGL2.pas

@@ -170,7 +170,7 @@ var
   quat     : TQuaternion;
   pos      : TAffineVector;
   basepose : TGLSkeletonFrame;
-  bonelist : TIntegerList;
+  bonelist : TGLIntegerList;
   bone     : TGLSkeletonBone;
 
 begin
@@ -181,7 +181,7 @@ begin
 
     TGLActor(Owner).Reference:=aarSkeleton;
 
-    bonelist:=TIntegerList.Create;
+    bonelist:=TGLIntegerList.Create;
     for i:=0 to GLAFile.AnimHeader.numBones-1 do
       bonelist.Add(i);
     while bonelist.count>0 do begin

+ 1 - 1
Source/GLS.FileGLB.pas

@@ -87,7 +87,7 @@ var
   faceGroup: TFGVertexNormalTexIndexList;
   v: TAffineVector;
 
-  boneIDs: TVertexBoneWeightDynArray;
+  boneIDs: TGLVertexBoneWeightDynArray;
   weightCount: Integer;
 begin
   sl := TStringList.Create;

+ 1 - 1
Source/GLS.FileGLTF.pas

@@ -87,7 +87,7 @@ var
   faceGroup: TFGVertexNormalTexIndexList;
   v: TAffineVector;
 
-  boneIDs: TVertexBoneWeightDynArray;
+  boneIDs: TGLVertexBoneWeightDynArray;
   weightCount: Integer;
 begin
   sl := TStringList.Create;

+ 2 - 2
Source/GLS.FileLMTS.pas

@@ -132,7 +132,7 @@ var
   _4cc: Cardinal;
   C: Integer;
   fName: string;
-  vi: Tintegerlist;
+  vi: TGLIntegerList;
   libmat: TGLLibmaterial;
   lmnames, matnames: TStringlist;
   MatInfoHeader: array [0 .. 3] of AnsiChar;
@@ -145,7 +145,7 @@ begin
   MO := TGLMeshObject.CreateOwned(owner.MeshObjects);
   MO.Mode := momFaceGroups;
 
-  vi := Tintegerlist.create;
+  vi := TGLIntegerList.create;
 
   LL := owner.LightmapLibrary;
   ML := owner.MaterialLibrary;

+ 12 - 12
Source/GLS.FileMD5.pas

@@ -29,9 +29,9 @@ type
     FMD5String, FTempString, FBoneNames: TStringList;
     FCurrentPos: Integer;
     FBasePose: TGLSkeletonFrame;
-    FFramePositions: TAffineVectorList;
+    FFramePositions: TGLAffineVectorList;
     FFrameQuaternions: TQuaternionList;
-    FJointFlags: TIntegerList;
+    FJointFlags: TGLIntegerList;
     FNumFrames, FFirstFrame, FFrameRate, FNumJoints: Integer;
     function ReadLine: String;
   public
@@ -203,18 +203,18 @@ procedure TGLMD5VectorFile.LoadFromStream(aStream: TStream);
     mesh: TGLSkeletonMeshObject;
     fg: TFGVertexIndexList;
     vnum, wnum, numverts, numweights: Integer;
-    VertexWeightID, VertexWeightCount, VertexBoneRef: TIntegerList;
-    VertexWeight: TSingleList;
-    VertexWeighted: TAffineVectorList;
+    VertexWeightID, VertexWeightCount, VertexBoneRef: TGLIntegerList;
+    VertexWeight: TGLSingleList;
+    VertexWeighted: TGLAffineVectorList;
     blendedVert, transformedVert: TAffineVector;
     i, j, k: Integer;
     mat: TGLMatrix;
   begin
-    VertexWeightID := TIntegerList.Create;
-    VertexWeightCount := TIntegerList.Create;
-    VertexBoneRef := TIntegerList.Create;
-    VertexWeight := TSingleList.Create;
-    VertexWeighted := TAffineVectorList.Create;
+    VertexWeightID := TGLIntegerList.Create;
+    VertexWeightCount := TGLIntegerList.Create;
+    VertexBoneRef := TGLIntegerList.Create;
+    VertexWeight := TGLSingleList.Create;
+    VertexWeighted := TGLAffineVectorList.Create;
 
     numverts := 0;
 
@@ -333,7 +333,7 @@ procedure TGLMD5VectorFile.LoadFromStream(aStream: TStream);
   begin
     if not Assigned(FJointFlags) then
     begin
-      FJointFlags := TIntegerList.Create;
+      FJointFlags := TGLIntegerList.Create;
       Assert(Owner.Skeleton.Frames.Count > 0,
         'The md5mesh file must be loaded before md5anim files!');
       FJointFlags.Count := Owner.Skeleton.Frames[0].Position.Count;
@@ -479,7 +479,7 @@ begin
         if (temp = 'numjoints') then
         begin
           FNumJoints := StrToInt(FTempString[1]);
-          FFramePositions := TAffineVectorList.Create;
+          FFramePositions := TGLAffineVectorList.Create;
           FFrameQuaternions := TQuaternionList.Create;
           if Owner.Skeleton.Frames.Count = 0 then
           begin

+ 4 - 4
Source/GLS.FileNMF.pas

@@ -137,12 +137,12 @@ procedure TGLNMFVectorFile.SaveToStream(aStream: TStream);
 var
   i, j: Integer;
   nmf: TFileNMF;
-  Vertices, TempVertices, Normals, TexCoords: TAffineVectorList;
+  Vertices, TempVertices, Normals, TexCoords: TGLAffineVectorList;
 begin
   nmf := TFileNMF.Create;
-  Vertices := TAffineVectorList.Create;
-  Normals := TAffineVectorList.Create;
-  TexCoords := TAffineVectorList.Create;
+  Vertices := TGLAffineVectorList.Create;
+  Normals := TGLAffineVectorList.Create;
+  TexCoords := TGLAffineVectorList.Create;
   try
     for i := 0 to Owner.MeshObjects.Count - 1 do
     begin

+ 4 - 4
Source/GLS.FileNurbs.pas

@@ -53,7 +53,7 @@ procedure TGLNurbsVectorFile.LoadFromStream(stream: TStream);
   end;
 
   function ReadSingleArray(sl: TStrings; idx: Integer;
-    list: TSingleList): Integer;
+    list: TGLSingleList): Integer;
   var
     k: Integer;
     buf: String;
@@ -79,7 +79,7 @@ procedure TGLNurbsVectorFile.LoadFromStream(stream: TStream);
   end;
 
   function ReadVectorArray(sl: TStrings; idx: Integer;
-    list: TAffineVectorList): Integer;
+    list: TGLAffineVectorList): Integer;
   var
     buf: String;
     vals: TStringList;
@@ -110,7 +110,7 @@ var
   i, j: Integer;
   surface: TMOParametricSurface;
   invert: Boolean;
-  invControlPoints: TAffineVectorList;
+  invControlPoints: TGLAffineVectorList;
 begin
   ss := TStringStream.Create('');
   sl := TStringList.Create;
@@ -161,7 +161,7 @@ begin
 
     if invert then
     begin
-      invControlPoints := TAffineVectorList.Create;
+      invControlPoints := TGLAffineVectorList.Create;
       for i := surface.CountV - 1 downto 0 do
         for j := 0 to surface.CountU - 1 do
           invControlPoints.Add(surface.ControlPoints[i * surface.CountU + j]);

+ 17 - 17
Source/GLS.FileOBJ.pas

@@ -154,7 +154,7 @@ type
   private
     FMode: TOBJFGMode;
     FName: string;
-    FPolygonVertices: TIntegerList;
+    FPolygonVertices: TGLIntegerList;
     FCurrentVertexCount: integer;
     FShowNormals: boolean;
     procedure PolygonComplete; (* Current polygon completed. Adds FCurrentVertexCount
@@ -164,17 +164,17 @@ type
     procedure Assign(Source: TPersistent); override;
     constructor CreateOwned(aOwner: TglFaceGroups); override;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     procedure Add(VertexIdx, NormalIdx, TexCoordIdx: Integer);
     procedure BuildList(var mrci: TGLRenderContextInfo); override;
-    procedure AddToTriangles(aList: TAffineVectorList;
-      aTexCoords: TAffineVectorList = nil;
-      aNormals: TAffineVectorList = nil); override;
+    procedure AddToTriangles(aList: TGLAffineVectorList;
+      aTexCoords: TGLAffineVectorList = nil;
+      aNormals: TGLAffineVectorList = nil); override;
     function TriangleCount: Integer; override;
     property Mode: TOBJFGMode read FMode write SetMode;
     property Name: string read FName write FName;
-    property PolygonVertices: TIntegerList read FPolygonVertices;
+    property PolygonVertices: TGLIntegerList read FPolygonVertices;
     property ShowNormals: boolean read FShowNormals write FShowNormals;
   end;
 
@@ -211,7 +211,7 @@ begin
   Assert(VertexIndices.Count = 0, 'Decide on the mode before adding vertices.');
   FMode := aMode;
   if FMode = objfgmmPolygons then
-    FPolygonVertices := TIntegerList.Create
+    FPolygonVertices := TGLIntegerList.Create
   else
   begin
     FPolygonVertices.Free;
@@ -360,12 +360,12 @@ begin
   end;
 end;
 
-procedure TOBJFGVertexNormalTexIndexList.AddToTriangles(aList: TAffineVectorList;
-  aTexCoords: TAffineVectorList = nil;
-  aNormals: TAffineVectorList = nil);
+procedure TOBJFGVertexNormalTexIndexList.AddToTriangles(aList: TGLAffineVectorList;
+  aTexCoords: TGLAffineVectorList = nil;
+  aNormals: TGLAffineVectorList = nil);
 var
   i, j, n, n0: Integer;
-  vertexList, texCoordList, normalsList: TAffineVectorList;
+  vertexList, texCoordList, normalsList: TGLAffineVectorList;
 begin
   vertexList := Owner.Owner.Vertices;
   texCoordList := Owner.Owner.TexCoords;
@@ -1254,7 +1254,7 @@ var
   procedure WriteFaceGroups;
   var
     j, i, k: Integer;
-    fg: TglFaceGroup;
+    fg: TGLFaceGroup;
     MoName: string;
   begin
     k := 0;
@@ -1388,7 +1388,7 @@ begin
     else
     begin
       if FPolygonVertices = nil then
-        FPolygonVertices := TIntegerList.Create;
+        FPolygonVertices := TGLIntegerList.Create;
       FPolygonVertices.Assign(TOBJFGVertexNormalTexIndexList(Source).FPolygonVertices);
     end;
   end
@@ -1397,7 +1397,7 @@ begin
 end;
 
 procedure TOBJFGVertexNormalTexIndexList.ReadFromFiler(
-  reader: TVirtualReader);
+  reader: TGLVirtualReader);
 var
   archiveVersion: Integer;
 begin
@@ -1412,7 +1412,7 @@ begin
 
     if FMode = objfgmmPolygons then
     begin
-      FPolygonVertices := TIntegerList.Create;
+      FPolygonVertices := TGLIntegerList.Create;
       FPolygonVertices.ReadFromFiler(reader);
     end;  
   end
@@ -1421,7 +1421,7 @@ begin
 end;
 
 procedure TOBJFGVertexNormalTexIndexList.WriteToFiler(
-  writer: TVirtualWriter);
+  writer: TGLVirtualWriter);
 begin
   inherited WriteToFiler(writer);
   with writer do

+ 1 - 1
Source/GLS.FileSMD.pas

@@ -90,7 +90,7 @@ var
   faceGroup: TFGVertexNormalTexIndexList;
   v: TAffineVector;
 
-  boneIDs: TVertexBoneWeightDynArray;
+  boneIDs: TGLVertexBoneWeightDynArray;
   weightCount: Integer;
 begin
   sl := TStringList.Create;

+ 1 - 1
Source/GLS.FileSTL.pas

@@ -286,7 +286,7 @@ var
   I: Integer;
   DataFace: TSTLFace;
   Header: TSTLHeader;
-  List: TAffineVectorList;
+  List: TGLAffineVectorList;
 const
   cHeaderTag = 'STL export';
 begin

+ 1 - 1
Source/GLS.FileTIN.pas

@@ -55,7 +55,7 @@ var
    Tnam: string;
    Id_Mat, NVert, NTri : Integer;
 
-   VertArr :  TGLPoint3DArray;
+   VertArr :  TPoint3DArray;
    n1, n2, n3 : Integer;
 
 

+ 1 - 1
Source/GLS.FileVOR.pas

@@ -197,7 +197,7 @@ var
   I: Integer;
   DataFace: TVORFace;
   Header: TVORHeader;
-  List: TAffineVectorList;
+  List: TGLAffineVectorList;
 const
   cHeaderTag = 'VOR export';
 begin

+ 21 - 21
Source/GLS.FileVRML.pas

@@ -35,8 +35,8 @@ type
 implementation
 // ------------------------------------------------------------------
 
-procedure TessellatePolygon(PolyVerts: TAffineVectorList;
-  PolyIndices, TriIndices: TIntegerList);
+procedure TessellatePolygon(PolyVerts: TGLAffineVectorList;
+  PolyIndices, TriIndices: TGLIntegerList);
 
   function IsPolyClockWise: Boolean;
   var
@@ -79,10 +79,10 @@ var
   i, j, prev, next, min_vert, min_prev, min_next: Integer;
   PolyCW, NoPointsInTriangle: Boolean;
   V: TAffineMatrix;
-  temp: TIntegerList;
+  temp: TGLIntegerList;
   min_dist, d, area: Single;
 begin
-  temp := TIntegerList.Create;
+  temp := TGLIntegerList.Create;
   try
     PolyCW := IsPolyClockWise;
     temp.Assign(PolyIndices);
@@ -241,12 +241,12 @@ var
     newfg: TFGVertexIndexList;
     fg: TFGVertexNormalTexIndexList;
     vertices, normals, texcoords, triNormals, newVertices, newNormals,
-      newTexCoords: TAffineVectorList;
-    optimized: TIntegerList;
+      newTexCoords: TGLAffineVectorList;
+    optimized: TGLIntegerList;
     cosAngle: Single;
     normal: TAffineVector;
     s, t: array [0 .. 2] of Integer;
-    n: array [0 .. 2] of TIntegerList;
+    n: array [0 .. 2] of TGLIntegerList;
     smooth, hasVertices, hasNormals, hasNormalIndices, hasTexCoords,
       hasTexCoordIndices: Boolean;
   begin
@@ -260,16 +260,16 @@ var
     if not hasVertices then
       Exit;
 
-    vertices := TAffineVectorList.Create;
-    normals := TAffineVectorList.Create;
-    texcoords := TAffineVectorList.Create;
-    newVertices := TAffineVectorList.Create;
-    newNormals := TAffineVectorList.Create;
-    newTexCoords := TAffineVectorList.Create;
-    triNormals := TAffineVectorList.Create;
-    n[0] := TIntegerList.Create;
-    n[1] := TIntegerList.Create;
-    n[2] := TIntegerList.Create;
+    vertices := TGLAffineVectorList.Create;
+    normals := TGLAffineVectorList.Create;
+    texcoords := TGLAffineVectorList.Create;
+    newVertices := TGLAffineVectorList.Create;
+    newNormals := TGLAffineVectorList.Create;
+    newTexCoords := TGLAffineVectorList.Create;
+    triNormals := TGLAffineVectorList.Create;
+    n[0] := TGLIntegerList.Create;
+    n[1] := TGLIntegerList.Create;
+    n[2] := TGLIntegerList.Create;
     for i := 0 to mesh.FaceGroups.Count - 1 do
     begin
       fg := TFGVertexNormalTexIndexList(mesh.FaceGroups[i]);
@@ -438,10 +438,10 @@ var
   procedure RecursNodes(node: TVRMLNode);
   var
     i, j, n: Integer;
-    points: TSingleList;
-    indices, fgindices: TIntegerList;
+    points: TGLSingleList;
+    indices, fgindices: TGLIntegerList;
     fg: TFGVertexNormalTexIndexList;
-    face: TIntegerList;
+    face: TGLIntegerList;
     tempLibMat: TGLLibMaterial;
     saveTransform, mat: TGLMatrix;
     saveMaterial: TGLLibMaterial;
@@ -522,7 +522,7 @@ var
     begin
       fg := TFGVertexNormalTexIndexList.CreateOwned(mesh.FaceGroups);
       mesh.Mode := momFaceGroups;
-      face := TIntegerList.Create;
+      face := TGLIntegerList.Create;
       if Assigned(currentMaterial) then
         fg.MaterialName := currentMaterial.Name;
       for n := 0 to node.Count - 1 do

+ 2 - 2
Source/GLS.FireFX.pas

@@ -656,7 +656,7 @@ var
   i: Integer;
   innerColor: TGLVector;
   lastTr: TAffineVector;
-  distList: TSingleList;
+  distList: TGLSingleList;
   objList: TList;
   fp: PGLFireParticle;
 begin
@@ -683,7 +683,7 @@ begin
 
   if n > 1 then
   begin
-    distList := TSingleList.Create;
+    distList := TGLSingleList.Create;
     objList := TList.Create;
     for i := 0 to n - 1 do
     begin

+ 6 - 7
Source/GLS.GeomObjects.pas

@@ -1,7 +1,6 @@
 //
 // The graphics rendering engine GLScene http://glscene.org
 //
-
 unit GLS.GeomObjects;
 
 (*
@@ -355,8 +354,8 @@ type
       write SetBottomArrowHeadRadius;
   end;
 
-  TArrowArcPart = (aaArc, aaTopArrow, aaBottomArrow);
-  TGLArrowArcPart = set of TArrowArcPart;
+  TGLArrowArcPart = (aaArc, aaTopArrow, aaBottomArrow);
+  TGLArrowArcParts = set of TGLArrowArcPart;
 
   (* Draws an arrowhead (Sliced Torus + cone).
     The arrow head is a cone that shares the attributes of the Torus
@@ -369,7 +368,7 @@ type
     fArcRadius: Single;
     FStartAngle: Single;
     FStopAngle: Single;
-    FParts: TGLArrowArcPart;
+    FParts: TGLArrowArcParts;
     FTopRadius: Single;
     fTopArrowHeadHeight: Single;
     fTopArrowHeadRadius: Single;
@@ -386,7 +385,7 @@ type
     procedure SetTopArrowHeadRadius(const aValue: Single);
     procedure SetBottomArrowHeadHeight(const aValue: Single);
     procedure SetBottomArrowHeadRadius(const aValue: Single);
-    procedure SetParts(aValue: TGLArrowArcPart);
+    procedure SetParts(aValue: TGLArrowArcParts);
     procedure SetHeadStackingStyle(const val: TGLArrowHeadStyle);
   public
     constructor Create(AOwner: TComponent); override;
@@ -399,7 +398,7 @@ type
     property TopRadius: Single read FTopRadius write SetTopRadius;
     property HeadStackingStyle: TGLArrowHeadStyle read FHeadStackingStyle
       write SetHeadStackingStyle default ahssStacked;
-    property Parts: TGLArrowArcPart read FParts write SetParts
+    property Parts: TGLArrowArcParts read FParts write SetParts
       default [aaArc, aaTopArrow];
     property TopArrowHeadHeight: Single read fTopArrowHeadHeight
       write SetTopArrowHeadHeight;
@@ -2665,7 +2664,7 @@ begin
   end;
 end;
 
-procedure TGLArrowArc.SetParts(aValue: TGLArrowArcPart);
+procedure TGLArrowArc.SetParts(aValue: TGLArrowArcParts);
 begin
   if aValue <> FParts then
   begin

+ 3 - 3
Source/GLS.GeometryBB.pas

@@ -128,7 +128,7 @@ function PointInAABB(const P: TGLVector; const Aabb: TAABB): Boolean; overload;
 // Checks if a plane (given by the normal+d) intersects the AABB
 function PlaneIntersectAABB(const Normal: TAffineVector; D: Single; const Aabb: TAABB): Boolean;
 // Compute the intersection between a plane and the AABB
-function PlaneAABBIntersection(const plane : THmgPlane; const AABB : TAABB) : TAffineVectorList;
+function PlaneAABBIntersection(const plane : THmgPlane; const AABB : TAABB) : TGLAffineVectorList;
 (*
   Original source code by Tomas Akenine-Möller
   Based on the paper "Fast 3D Triangle-Box Overlap Testing"
@@ -751,7 +751,7 @@ begin
     Max := X2;
 end;
 
-function PlaneAABBIntersection(const plane : THmgPlane;const AABB : TAABB) : TAffineVectorList;
+function PlaneAABBIntersection(const plane : THmgPlane;const AABB : TAABB) : TGLAffineVectorList;
 var
   i, j, annexe : Integer;
   index : array[0..2] of Integer;
@@ -771,7 +771,7 @@ begin
   box[0] := AABB.min;
   box[1] := AABB.max;
 
-  Result := TAffineVectorList.Create;
+  Result := TGLAffineVectorList.Create;
 
   // loop on vertices
   for i := 0 to 7 do

+ 3 - 28
Source/GLS.Graph.pas

@@ -135,6 +135,7 @@ type
     this enhances perspective and quality, at the expense of computing
     power. *)
   TGLXYZGridLinesStyle = (glsLine, glsSegments);
+
   // An XYZ Grid object. Renders an XYZ grid using lines
   TGLXYZGrid = class(TGLLineBase)
   private
@@ -166,8 +167,7 @@ type
     property Parts: TGLXYZGridParts read FParts write SetParts default [gpX, gpY];
     property LinesStyle: TGLXYZGridLinesStyle read FLinesStyle write SetLinesStyle
       default glsSegments;
-    (* Adjusts lines smoothing (or antialiasing).
-      Obsolete, now maps to Antialiased property. *)
+    // Adjusts lines smoothing (or antialiasing). Obsolete, now maps to Antialiased property
     property LinesSmoothing: Boolean write SetLinesSmoothing stored False;
   end;
 
@@ -179,14 +179,12 @@ implementation
 // ------------------ TGLSamplingScale ------------------
 // ------------------
 
-
 constructor TGLSamplingScale.Create(AOwner: TPersistent);
 begin
   inherited Create(AOwner);
   FStep := 0.1;
 end;
 
- 
 destructor TGLSamplingScale.Destroy;
 begin
   inherited Destroy;
@@ -214,7 +212,6 @@ begin
   NotifyChange(Self);
 end;
 
-
 procedure TGLSamplingScale.SetMax(const val: Single);
 begin
   FMax := val;
@@ -223,14 +220,12 @@ begin
   NotifyChange(Self);
 end;
 
-
 procedure TGLSamplingScale.SetOrigin(const val: Single);
 begin
   FOrigin := val;
   NotifyChange(Self);
 end;
 
-
 procedure TGLSamplingScale.SetStep(const val: Single);
 begin
   if val > 0 then
@@ -240,7 +235,6 @@ begin
   NotifyChange(Self);
 end;
 
-
 function TGLSamplingScale.StepBase: Single;
 begin
   if FOrigin <> FMin then
@@ -256,19 +250,16 @@ begin
     Result := FMin;
 end;
 
-
 function TGLSamplingScale.MaxStepCount: Integer;
 begin
   Result := Round(0.5 + (Max - Min) / Step);
 end;
 
-
 function TGLSamplingScale.IsValid: Boolean;
 begin
   Result := (Max <> Min);
 end;
 
-
 procedure TGLSamplingScale.SetBaseStepMaxToVars(var Base, Step, Max: Single;
   samplingEnabled: Boolean = True);
 begin
@@ -297,7 +288,6 @@ begin
   FOptions := [hfoTwoSided];
 end;
 
-
 destructor TGLHeightField.Destroy;
 begin
   FXSamplingScale.Free;
@@ -305,7 +295,6 @@ begin
   inherited Destroy;
 end;
 
-
 procedure TGLHeightField.Assign(Source: TPersistent);
 begin
   if Source is TGLHeightField then
@@ -319,7 +308,6 @@ begin
   inherited Assign(Source);
 end;
 
-
 procedure TGLHeightField.NotifyChange(Sender: TObject);
 begin
   if Sender is TGLSamplingScale then
@@ -327,7 +315,6 @@ begin
   inherited NotifyChange(Sender);
 end;
 
-
 procedure TGLHeightField.BuildList(var rci: TGLRenderContextInfo);
 type
   TRowData = packed record
@@ -336,9 +323,9 @@ type
     TexPoint: TTexPoint;
     Normal: TAffineVector;
   end;
-
   TRowDataArray = array [0 .. Maxint shr 6] of TRowData;
   PRowData = ^TRowDataArray;
+
 const
   cHFCMtoEnum: array [hfcmEmission .. hfcmAmbientAndDiffuse] of Cardinal =
     (GL_EMISSION, GL_AMBIENT, GL_DIFFUSE, GL_AMBIENT_AND_DIFFUSE);
@@ -504,19 +491,16 @@ begin
   end;
 end;
 
-
 procedure TGLHeightField.SetXSamplingScale(const val: TGLSamplingScale);
 begin
   FXSamplingScale.Assign(val);
 end;
 
-
 procedure TGLHeightField.SetYSamplingScale(const val: TGLSamplingScale);
 begin
   FYSamplingScale.Assign(val);
 end;
 
-
 procedure TGLHeightField.SetOptions(const val: TGLHeightFieldOptions);
 begin
   if FOptions <> val then
@@ -526,14 +510,12 @@ begin
   end;
 end;
 
-
 procedure TGLHeightField.SetOnGetHeight(const val: TGLHeightFieldGetHeightEvent);
 begin
   FOnGetHeight := val;
   StructureChanged;
 end;
 
-
 procedure TGLHeightField.SetOnGetHeight2(const val
   : TGLHeightFieldGetHeight2Event);
 begin
@@ -541,7 +523,6 @@ begin
   StructureChanged;
 end;
 
-
 procedure TGLHeightField.SetColorMode(const val: TGLHeightFieldColorMode);
 begin
   if val <> FColorMode then
@@ -551,7 +532,6 @@ begin
   end;
 end;
 
-
 procedure TGLHeightField.DefaultHeightField(const x, y: Single; var z: Single;
   var color: TGLColorVector; var texPoint: TTexPoint);
 begin
@@ -560,7 +540,6 @@ begin
   color := clrGray80;
 end;
 
-
 procedure TGLHeightField.Height2Field(const x, y: Single; var z: Single;
   var color: TGLColorVector; var texPoint: TTexPoint);
 begin
@@ -581,7 +560,6 @@ begin
   FLinesStyle := glsSegments;
 end;
 
-
 destructor TGLXYZGrid.Destroy;
 begin
   FXSamplingScale.Free;
@@ -590,7 +568,6 @@ begin
   inherited Destroy;
 end;
 
-
 procedure TGLXYZGrid.Assign(Source: TPersistent);
 begin
   if Source is TGLXYZGrid then
@@ -614,13 +591,11 @@ begin
   FYSamplingScale.Assign(val);
 end;
 
-
 procedure TGLXYZGrid.SetZSamplingScale(const val: TGLSamplingScale);
 begin
   FZSamplingScale.Assign(val);
 end;
 
-
 procedure TGLXYZGrid.SetParts(const val: TGLXYZGridParts);
 begin
   if FParts <> val then

+ 5 - 5
Source/GLS.Graphics.pas

@@ -31,7 +31,6 @@ uses
   {$IFDEF USE_GRAPHICS32} GR32, {$ENDIF}
 
   GLS.VectorTypes,
-//  GLS.OpenGLTokens,
   GLS.State,
   GLS.ApplicationFileIO,
   GLS.PersistentClasses,
@@ -322,7 +321,7 @@ type
   end;
 
   // Stores registered raster file formats.
-  TGLRasterFileFormatsList = class(TPersistentObjectList)
+  TGLRasterFileFormatsList = class(TGLPersistentObjectList)
   public
     destructor Destroy; override;
     procedure Add(const Ext, Desc: string; DescID: Integer; AClass:
@@ -1233,7 +1232,7 @@ begin
     Exit;
 
   UnMipmap;
-  // Use GLScene image utils
+  // Use image utils
   Size := GetWidth * GetHeight * 4;
   GetMem(newData, Size);
   try
@@ -1269,7 +1268,7 @@ begin
     fLevelCount := GetImageLodNumber(GetWidth, GetHeight, GetDepth, True);
     UpdateLevelsInfo;
     ReallocMem(FData, DataSize);
-    {Message Hint 'TGLBaseImage.GenerateMipmap not yet implemented for volume images' }
+    // Message Hint 'TGLBaseImage.GenerateMipmap not yet implemented for volume images'
   end
   else
   begin
@@ -2057,6 +2056,7 @@ begin
   end;
 end;
 {$ENDIF}
+
 // ------------------
 // ------------------ TGLImage ------------------
 // ------------------
@@ -2426,7 +2426,7 @@ begin
         end;
       end;
   else
-    { Internal Decode TColor - Palette }
+    // Internal Decode TColor - Palette
     for j := 1 to aPngImage.Height do
     begin
       AlphaScan := aPngImage.AlphaScanline[aPngImage.Height - j];

+ 0 - 2
Source/GLS.HeightData.pas

@@ -1,7 +1,6 @@
 //
 // The graphics rendering engine GLScene http://glscene.org
 //
-
 unit GLS.HeightData;
 
 (*
@@ -916,7 +915,6 @@ begin
   //
 end;
 
-
 // When Threads are used, this runs from the sub-thread, so this MUST be thread-safe.
 // Any Non-thread-safe code should be placed in "BeforePreparingData"
 procedure TGLHeightDataSource.StartPreparingData(HeightData: TGLHeightData);

+ 15 - 22
Source/GLS.HeightTileFileHDS.pas

@@ -1,7 +1,6 @@
 //
 // The graphics rendering engine GLScene http://glscene.org
 //
-
 unit GLS.HeightTileFileHDS;
 
 (* HeightDataSource for the HTF (HeightTileFile) format *)
@@ -32,28 +31,22 @@ uses
 
 type
 
-  PByte = ^Byte;
-
   TIntegerArray = array [0 .. MaxInt shr 3] of Integer;
   PIntegerArray = ^TIntegerArray;
-  PInteger = ^Integer;
 
   TSmallIntArray = array [0 .. MaxInt shr 2] of SmallInt;
   PSmallIntArray = ^TSmallIntArray;
-  PSmallInt = ^SmallInt;
 
   TShortIntArray = array [0 .. MaxInt shr 2] of ShortInt;
   PShortIntArray = ^TShortIntArray;
-  PShortInt = ^ShortInt;
 
   TGLHeightTileInfo = packed record
     left, top, width, height: Integer;
     min, max, average: SmallInt;
     fileOffset: Int64; // offset to tile data in the file
   end;
-
-  PHeightTileInfo = ^TGLHeightTileInfo;
-  PPHeightTileInfo = ^PHeightTileInfo;
+  PGLHeightTileInfo = ^TGLHeightTileInfo;
+  PPHeightTileInfo = ^PGLHeightTileInfo;
 
   TGLHeightTile = packed record
     info: TGLHeightTileInfo;
@@ -90,7 +83,7 @@ type
     FHeightTile: TGLHeightTile;
     FInBuf: array of ShortInt;
   protected
-    function GetTiles(index: Integer): PHeightTileInfo;
+    function GetTiles(index: Integer): PGLHeightTileInfo;
     function QuadTableX(x: Integer): Integer;
     function QuadTableY(y: Integer): Integer;
     procedure PackTile(aWidth, aHeight: Integer; src: PSmallIntArray);
@@ -115,7 +108,7 @@ type
       All of the row must be contained in the world, otherwise result is undefined. *)
     procedure ExtractRow(x, y, len: Integer; dest: PSmallIntArray);
     // Returns the tile that contains x and y.
-    function XYTileInfo(anX, anY: Integer): PHeightTileInfo;
+    function XYTileInfo(anX, anY: Integer): PGLHeightTileInfo;
     (* Returns the height at given coordinates.
       This is definetely NOT the fastest way to access HTF data and should
       only be used as utility function. *)
@@ -123,8 +116,8 @@ type
     // Clears the list then add all tiles that overlap the rectangular area.
     procedure TilesInRect(aLeft, aTop, aRight, aBottom: Integer; destList: TList);
     function TileCount: Integer;
-    property Tiles[index: Integer]: PHeightTileInfo read GetTiles;
-    function IndexOfTile(aTile: PHeightTileInfo): Integer;
+    property Tiles[index: Integer]: PGLHeightTileInfo read GetTiles;
+    function IndexOfTile(aTile: PGLHeightTileInfo): Integer;
     function TileCompressedSize(tileIndex: Integer): Integer;
     property SizeX: Integer read FHeader.SizeX;
     property SizeY: Integer read FHeader.SizeY;
@@ -635,7 +628,7 @@ function TGLHeightTileFile.GetTile(aLeft, aTop: Integer;
   pTileInfo: PPHeightTileInfo = nil): PHeightTile;
 var
   I, n: Integer;
-  tileInfo: PHeightTileInfo;
+  tileInfo: PGLHeightTileInfo;
 begin
   with FHeightTile.info do
     if (left = aLeft) and (top = aTop) then
@@ -692,7 +685,7 @@ procedure TGLHeightTileFile.ExtractRow(x, y, len: Integer;
 var
   rx: Integer;
   n: Cardinal;
-  tileInfo: PHeightTileInfo;
+  tileInfo: PGLHeightTileInfo;
   tile: PHeightTile;
 begin
   while len > 0 do
@@ -712,7 +705,7 @@ begin
   end;
 end;
 
-function TGLHeightTileFile.XYTileInfo(anX, anY: Integer): PHeightTileInfo;
+function TGLHeightTileFile.XYTileInfo(anX, anY: Integer): PGLHeightTileInfo;
 var
   tileList: TList;
 begin
@@ -720,7 +713,7 @@ begin
   try
     TilesInRect(anX, anY, anX + 1, anY + 1, tileList);
     if tileList.count > 0 then
-      Result := PHeightTileInfo(tileList.First)
+      Result := PGLHeightTileInfo(tileList.First)
     else
       Result := nil;
   finally
@@ -730,7 +723,7 @@ end;
 
 function TGLHeightTileFile.XYHeight(anX, anY: Integer): SmallInt;
 var
-  tileInfo: PHeightTileInfo;
+  tileInfo: PGLHeightTileInfo;
   tile: PHeightTile;
 begin
   // Current tile per chance?
@@ -760,7 +753,7 @@ procedure TGLHeightTileFile.TilesInRect(aLeft, aTop, aRight, aBottom: Integer;
 var
   I, n, qx, qy, idx: Integer;
   p: PIntegerArray;
-  tileInfo: PHeightTileInfo;
+  tileInfo: PGLHeightTileInfo;
 begin
   destList.count := 0;
   // Clamp to world
@@ -806,12 +799,12 @@ begin
   Result := Length(FTileIndex);
 end;
 
-function TGLHeightTileFile.GetTiles(index: Integer): PHeightTileInfo;
+function TGLHeightTileFile.GetTiles(index: Integer): PGLHeightTileInfo;
 begin
   Result := @FTileIndex[index];
 end;
 
-function TGLHeightTileFile.IndexOfTile(aTile: PHeightTileInfo): Integer;
+function TGLHeightTileFile.IndexOfTile(aTile: PGLHeightTileInfo): Integer;
 var
   c: Cardinal;
 begin
@@ -905,7 +898,7 @@ procedure TGLHeightTileFileHDS.StartPreparingData(HeightData: TGLHeightData);
 var
   oldType: TGLHeightDataType;
   htfTile: PHeightTile;
-  htfTileInfo: PHeightTileInfo;
+  htfTileInfo: PGLHeightTileInfo;
   x, y: Integer;
   YPos: Integer;
   inY, outY: Integer;

+ 3 - 3
Source/GLS.Imposter.pas

@@ -115,7 +115,7 @@ type
   private
     FBackColor: TGLColor;
     FBuildOffset: TGLCoordinates;
-    FImposterRegister: TPersistentObjectList;
+    FImposterRegister: TGLPersistentObjectList;
     FRenderPoint: TGLRenderPoint;
     FImposterOptions: TImposterOptions;
     FAlphaTreshold: Single;
@@ -129,7 +129,7 @@ type
     procedure SetBuildOffset(AValue: TGLCoordinates);
     procedure SetImposterReference(AValue: TImposterReference);
     procedure InitializeImpostorTexture(const TextureSize: TPoint);
-    property ImposterRegister: TPersistentObjectList read FImposterRegister;
+    property ImposterRegister: TGLPersistentObjectList read FImposterRegister;
     procedure UnregisterImposter(imposter: TImposter);
     function CreateNewImposter: TImposter; virtual;
     procedure PrepareImposters(Sender: TObject; var rci: TGLRenderContextInfo);
@@ -547,7 +547,7 @@ end;
 constructor TGLImposterBuilder.Create(AOwner: TComponent);
 begin
   inherited;
-  FImposterRegister := TPersistentObjectList.Create;
+  FImposterRegister := TGLPersistentObjectList.Create;
   FBackColor := TGLColor.CreateInitialized(Self, clrTransparent);
   FBuildOffset := TGLCoordinates.CreateInitialized(Self, NullHmgPoint, CsPoint);
   FImposterOptions := cDefaultImposterOptions;

+ 3 - 3
Source/GLS.Isolines.pas

@@ -39,7 +39,7 @@ type
   TVectorL4I = array [0 .. 4] of Integer;
   TCastArray = array [0 .. 2, 0 .. 2, 0 .. 2] of Integer;
 
-  TVertex2DArr = array [0 .. 32767] of TGLPoint2D;
+  TVertex2DArr = array [0 .. 32767] of TPoint2DRec;
   PVertex2DArr = ^TVertex2DArr;
 
   PGLIsoline = ^TGLIsoline;
@@ -102,7 +102,7 @@ function GetNextIsoline(var Isoline: TGLIsoline): Boolean;
 
 // Defines contouring segments inside a triangle using elevations
 procedure TriangleElevationSegments(const p1, p2, p3: TAffineVector;
-  ElevationDelta: Single; Segments: TAffineVectorList);
+  ElevationDelta: Single; Segments: TGLAffineVectorList);
 
 //----------------------------------------------------------------------
 implementation
@@ -390,7 +390,7 @@ begin
 end;
 
 procedure TriangleElevationSegments(const p1, p2, p3: TAffineVector;
-  ElevationDelta: Single; Segments: TAffineVectorList);
+  ElevationDelta: Single; Segments: TGLAffineVectorList);
 
   function SegmentIntersect(const a, b: TAffineVector; e: Single): Integer;
   var

+ 52 - 68
Source/GLS.Isosurface.pas

@@ -44,12 +44,9 @@ const
   ALLOC_SIZE = 65536;
 
 type
-  TSingle3DArray = array of array of array of Single;
-  TVertexArray = array of TVector3f;
-  TIntegerArray = array of Integer;
   TGLMarchingCube = class(TObject)
   private
-    FIsoValue: TGLScalarValue;
+    FIsoValue: TScalarValue;
     // sliceSize:Longword;
     PVertsX: PIntegerArray;
     PVertsY: PIntegerArray;
@@ -58,10 +55,10 @@ type
     _Ntrigs: Integer;
     _Sverts: Integer;
     _Strigs: Integer;
-    PVertices: PGLVertArray;
-    PTriangles: PGLTrianRecArray;
+    PVertices: PVertArray;
+    PTriangles: PTriangleRecArray;
     _i, _j, _k: Longword;
-    _Cube: array [0 .. 7] of TGLVoxel;
+    _Cube: array [0 .. 7] of TVoxelRec;
     _lut_entry: Byte;
     // _case:Byte;
     // _config:Byte;
@@ -87,7 +84,7 @@ type
     FStepX: Single;
     FStepY: Single;
     FStepZ: Single;
-    VoxelData: PGLVoxelData;
+    VoxelData: PVoxelData;
     procedure Process_cube;
     (* function test_face(face:byte):Boolean;
       function test_interior(s:Byte):boolean *)
@@ -106,40 +103,39 @@ type
     procedure Set_x_vert(a_val, i, j, k: Integer);
     procedure Set_y_vert(a_val, i, j, k: Integer);
     procedure Set_z_vert(a_val, i, j, k: Integer);
-    function GetVoxelValue(i, j, k: Integer): TGLScalarValue;
-    procedure SetVoxelValue(i, j, k: Integer; HfValue: TGLScalarValue);
-    function GetVoxelData(i, j, k: Integer): TGLVoxel;
-    function Voxel(i, j, k: Integer): PGLVoxel;
+    function GetVoxelValue(i, j, k: Integer): TScalarValue;
+    procedure SetVoxelValue(i, j, k: Integer; HfValue: TScalarValue);
+    function GetVoxelData(i, j, k: Integer): TVoxelRec;
+    function Voxel(i, j, k: Integer): PVoxelRec;
     function calc_u(v1, v2: Single): Extended; virtual;
   public
-    ScalarField: TGLScalarField;
+    ScalarField: TScalarField;
     constructor Create; overload; virtual;
     constructor Create(SizeX, SizeY, SizeZ: Integer;
-      AIsoValue: TGLScalarValue = 0.0; xMin: Single = -0.5; xMax: Single = 0.5;
+      AIsoValue: TScalarValue = 0.0; xMin: Single = -0.5; xMax: Single = 0.5;
       yMin: Single = -0.5; yMax: Single = 0.5; zMin: Single = -0.5;
       zMax: Single = 0.5); overload; virtual;
     procedure ReDim(ASizeX, ASizeY, ASizeZ: Integer;
       xMin, xMax, yMin, yMax, zMin, zMax: Single); virtual;
     destructor Destroy; override;
     procedure Run; overload;
-    procedure Run(IsoValue: TGLScalarValue); overload;
-    function Internal(AValue: TGLScalarValue): Boolean; virtual;
+    procedure Run(IsoValue: TScalarValue); overload;
+    function Internal(AValue: TScalarValue): Boolean; virtual;
     procedure FillVoxelData; overload; virtual;
-    procedure FillVoxelData(AIsoValue: TGLScalarValue;
-      AScalarField: TGLScalarField = nil); overload; virtual;
-    procedure FillVoxelData(AIsoValue: TGLScalarValue;
-      AScalarField: TGLScalarFieldInt); overload; virtual;
+    procedure FillVoxelData(AIsoValue: TScalarValue;
+      AScalarField: TScalarField = nil); overload; virtual;
+    procedure FillVoxelData(AIsoValue: TScalarValue;
+      AScalarField: TScalarFieldInt); overload; virtual;
     procedure CalcVertices(Vertices: TGLVertexList; Alpha: Single = 1);
     procedure CalcMeshObject(AMeshObject: TGLMeshObject; Alpha: Single = 1);
-    property IsoValue: TGLScalarValue read FIsoValue write FIsoValue;
-    // TODO SetIsoValue to Run
+    property IsoValue: TScalarValue read FIsoValue write FIsoValue; // TODO
   end;
 
   (* 3D isosurface extractor class. This class allows to calculate and exctract
     isosurfaces from scalar field voxel models using a given isovalue *)
   TIsoSurfaceExtractor = class(TObject)
   private
-    Data: TSingle3DArray;
+    Data: TArray3DExt;
     Dimensions: array ['x' .. 'z'] of Integer;
     // Build Index depending on whether the edges are outside or inside the surface
     function BuildIndex(var ADatavals: array of Single; Isovalue: Single): word;
@@ -148,9 +144,9 @@ type
   public
     constructor Create(); overload;
     constructor Create(Xdim, Ydim, Zdim: Integer;
-      var AData: TSingle3DArray); overload;
+      var AData: TArray3DExt); overload;
     destructor Destroy(); override;
-    procedure AssignData(Xdim, Ydim, Zdim: Integer; var AData: TSingle3DArray);
+    procedure AssignData(Xdim, Ydim, Zdim: Integer; var AData: TArray3DExt);
     // Launch Marching Cubes
     procedure MarchingCubes(Isovalue: Single; out Vertices: TVertexArray;
       out Triangles: TIntegerArray; isPolished: boolean);
@@ -160,31 +156,19 @@ type
   end;
 
 // Sphere surface
-function SFSphere(X, Y, Z: Extended): TGLScalarValue;
+function SFSphere(X, Y, Z: Extended): TScalarValue;
 // Minkowski space (http://mathworld.wolfram.com)
-function SFMinkowski(X, Y, Z: Extended): TGLScalarValue;
+function SFMinkowski(X, Y, Z: Extended): TScalarValue;
 // Klein Bottle (http://mathworld.wolfram.com)
-function SFKleinBottle(X, Y, Z: Extended): TGLScalarValue;
+function SFKleinBottle(X, Y, Z: Extended): TScalarValue;
 // Chmutov-surface-1 (http://mathworld.wolfram.com)
-function SFChmutov1(X, Y, Z: Extended): TGLScalarValue;
+function SFChmutov1(X, Y, Z: Extended): TScalarValue;
 // Chmutov-surface-2 (http://mathworld.wolfram.com)
-function SFChmutov2(X, Y, Z: Extended): TGLScalarValue;
+function SFChmutov2(X, Y, Z: Extended): TScalarValue;
 // Toroidal surface (phantasy!)
-function SFToroidal(X, Y, Z: Extended): TGLScalarValue;
+function SFToroidal(X, Y, Z: Extended): TScalarValue;
 // Double torus Surface (phantasy!)
-function SFDoubleTorus(X, Y, Z: Extended): TGLScalarValue;
-
-const
-  DemoScalarField: array [0 .. 6] of
-  record
-    // xMin, xMax, yMin, yMax, zMin, zMax:Single; // default -0.5..0.5
-    ScalarField: TGLScalarField;
-    IsoValue: TGLScalarValue
-  end = ((ScalarField: SFSphere; IsoValue: 0.3), (ScalarField: SFMinkowski;
-  IsoValue: 0.0), (ScalarField: SFKleinBottle; IsoValue: 0.0),
-  (ScalarField: SFChmutov1; IsoValue: 3.0), (ScalarField: SFChmutov2;
-  IsoValue: 3.0), (ScalarField: SFToroidal; IsoValue: 3.0),
-  (ScalarField: SFDoubleTorus; IsoValue: 0.015));
+function SFDoubleTorus(X, Y, Z: Extended): TScalarValue;
 
 // -------------------------------------------------------------------------
 implementation
@@ -509,12 +493,12 @@ const
     (0, 2, 3, 6), (0, 3, 7, 6), (0, 7, 4, 6), (0, 4, 5, 6));
 
 // Test surface functions
-function SFSphere(X, Y, Z: Extended): TGLScalarValue;
+function SFSphere(X, Y, Z: Extended): TScalarValue;
 begin
   Result := sqr(X) + sqr(Y) + sqr(Z)
 end;
 
-function SFToroidal(X, Y, Z: Extended): TGLScalarValue;
+function SFToroidal(X, Y, Z: Extended): TScalarValue;
 const
   FScale = 7;
   a = 2.5;
@@ -527,7 +511,7 @@ begin
     (sqr(sqrt(sqr(Z) + sqr(X)) - a) + sqr(Y));
 end;
 
-function SFDoubleTorus(X, Y, Z: Extended): TGLScalarValue;
+function SFDoubleTorus(X, Y, Z: Extended): TScalarValue;
 const
   FScale = 2.25;
 begin
@@ -539,7 +523,7 @@ begin
     PowerInteger(Y, 4) + sqr(Z)
 end;
 
-function SFChmutov1(X, Y, Z: Extended): TGLScalarValue;
+function SFChmutov1(X, Y, Z: Extended): TScalarValue;
 const
   FScale = 2.5;
 begin
@@ -550,7 +534,7 @@ begin
     (PowerInteger(X, 4) + PowerInteger(Y, 4) + PowerInteger(Z, 4));
 end;
 
-function SFChmutov2(X, Y, Z: Extended): TGLScalarValue;
+function SFChmutov2(X, Y, Z: Extended): TScalarValue;
 const
   FScale = 2.5;
 begin
@@ -561,7 +545,7 @@ begin
     sqr(Z) * sqr(3 - 4 * sqr(Z)));
 end;
 
-function SFKleinBottle(X, Y, Z: Extended): TGLScalarValue;
+function SFKleinBottle(X, Y, Z: Extended): TScalarValue;
 const
   FScale = 7.5;
 begin
@@ -573,7 +557,7 @@ begin
     (sqr(X) + sqr(Y) + sqr(Z) - 2 * Y - 1);
 end;
 
-function SFMinkowski(X, Y, Z: Extended): TGLScalarValue;
+function SFMinkowski(X, Y, Z: Extended): TScalarValue;
 const
   FScale = 7;
 begin
@@ -752,7 +736,7 @@ begin
 end;
 
 constructor TIsoSurfaceExtractor.Create(Xdim, Ydim, Zdim: Integer;
-  var AData: TSingle3DArray);
+  var AData: TArray3DExt);
 begin
   Create();
   AssignData(Xdim, Ydim, Zdim, AData);
@@ -764,7 +748,7 @@ begin
 end;
 
 procedure TIsoSurfaceExtractor.AssignData(Xdim, Ydim, Zdim: Integer;
-  var AData: TSingle3DArray);
+  var AData: TArray3DExt);
 begin
   Dimensions['x'] := Xdim;
   Dimensions['y'] := Ydim;
@@ -970,7 +954,7 @@ begin
       if (_Ntrigs >= _Strigs) then
       begin
         _Strigs := 2 * _Strigs;
-        ReallocMem(PTriangles, _Strigs * SizeOf(TGLTrianRec));
+        ReallocMem(PTriangles, _Strigs * SizeOf(TTriangleRec));
       end;
 
       with PTriangles^[_Ntrigs] do
@@ -1211,7 +1195,7 @@ begin
 end;
 
 constructor TGLMarchingCube.Create(SizeX, SizeY, SizeZ: Integer;
-  AIsoValue: TGLScalarValue = 0.0; xMin: Single = -0.5; xMax: Single = 0.5;
+  AIsoValue: TScalarValue = 0.0; xMin: Single = -0.5; xMax: Single = 0.5;
   yMin: Single = -0.5; yMax: Single = 0.5; zMin: Single = -0.5;
   zMax: Single = 0.5);
 begin
@@ -1234,12 +1218,12 @@ begin
   inherited;
 end;
 
-function TGLMarchingCube.getVoxelValue(i, j, k: Integer): TGLScalarValue;
+function TGLMarchingCube.getVoxelValue(i, j, k: Integer): TScalarValue;
 begin
   Result := VoxelData^[i + j * FSizeX + k * FSizeX * FSizeY].Density
 end;
 
-function TGLMarchingCube.getVoxelData(i, j, k: Integer): TGLVoxel;
+function TGLMarchingCube.getVoxelData(i, j, k: Integer): TVoxelRec;
 begin
   Result := VoxelData^[i + j * FSizeX + k * FSizeX * FSizeY]
 end;
@@ -1306,13 +1290,13 @@ begin
   _Sverts := ALLOC_SIZE;
   _Strigs := ALLOC_SIZE;
 
-  GetMem(PVertices, _Sverts * SizeOf(TGLVertRec));
-  GetMem(PTriangles, _Strigs * SizeOf(TGLTrianRec));
+  GetMem(PVertices, _Sverts * SizeOf(TVertexRec));
+  GetMem(PTriangles, _Strigs * SizeOf(TTriangleRec));
 end;
 
 procedure TGLMarchingCube.Init_space;
 begin
-  VoxelData := AllocMem(FSizeX * FSizeY * FSizeZ * SizeOf(TGLVoxel));
+  VoxelData := AllocMem(FSizeX * FSizeY * FSizeZ * SizeOf(TVoxelRec));
 end;
 
 procedure TGLMarchingCube.Init_temps;
@@ -1329,7 +1313,7 @@ begin
   FillChar(PVertsZ^, spaceSize * SizeOf(Integer), -1);
 end;
 
-function TGLMarchingCube.Internal(AValue: TGLScalarValue): Boolean;
+function TGLMarchingCube.Internal(AValue: TScalarValue): Boolean;
 begin
   Result := AValue <= FIsoValue
 end;
@@ -1385,13 +1369,13 @@ begin
   clean_temps;
 end;
 
-procedure TGLMarchingCube.Run(IsoValue: TGLScalarValue);
+procedure TGLMarchingCube.Run(IsoValue: TScalarValue);
 begin
   FIsoValue := IsoValue;
   Run
 end;
 
-procedure TGLMarchingCube.setVoxelValue(i, j, k: Integer; HfValue: TGLScalarValue);
+procedure TGLMarchingCube.setVoxelValue(i, j, k: Integer; HfValue: TScalarValue);
 begin
   VoxelData^[i + j * FSizeX + k * FSizeX * FSizeY].Density := HfValue
 end;
@@ -1416,11 +1400,11 @@ begin
   if _Nverts >= _Sverts then
   begin
     _Sverts := 2 * _Sverts;
-    ReallocMem(PVertices, _Sverts * SizeOf(TGLVertRec))
+    ReallocMem(PVertices, _Sverts * SizeOf(TVertexRec))
   end;
 end;
 
-function TGLMarchingCube.voxel(i, j, k: Integer): PGLVoxel;
+function TGLMarchingCube.voxel(i, j, k: Integer): PVoxelRec;
 begin
   if (k >= FSizeZ) or (j >= FSizeY) or (i >= FSizeX) then
     Result := nil
@@ -1454,7 +1438,7 @@ begin
   end;
 end;
 
-procedure TGLMarchingCube.FillVoxelData(AIsoValue: TGLScalarValue; AScalarField: TGLScalarField = nil);
+procedure TGLMarchingCube.FillVoxelData(AIsoValue: TScalarValue; AScalarField: TScalarField = nil);
 begin
   FIsoValue := AIsoValue;
   if Assigned(AScalarField) then
@@ -1462,7 +1446,7 @@ begin
   FillVoxelData;
 end;
 
-procedure TGLMarchingCube.FillVoxelData(AIsoValue: TGLScalarValue; AScalarField: TGLScalarFieldInt);
+procedure TGLMarchingCube.FillVoxelData(AIsoValue: TScalarValue; AScalarField: TScalarFieldInt);
 var
   iX, iY, iZ: Integer;
   X, Y, Z: Single;
@@ -1523,7 +1507,7 @@ var
     Result.V[3] := 0.3
   end;
 
-  function GetColor(H: TGLScalarValue): TGLVector;
+  function GetColor(H: TScalarValue): TGLVector;
   begin
     Result := VectorMake(0.890, 0.855, 0.788, Alpha)
     (*

+ 4 - 4
Source/GLS.LinePFX.pas

@@ -34,8 +34,8 @@ type
     FLength: Single;
   protected
   public
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     // Direction of the line.
     property Direction: TAffineVector read FDirection write FDirection;
     // Length of the line
@@ -194,7 +194,7 @@ end;
 // ------------------ TGLLineParticle ------------------
 // ------------------
 
-procedure TGLLineParticle.WriteToFiler(writer: TVirtualWriter);
+procedure TGLLineParticle.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited WriteToFiler(writer);
   with writer do
@@ -205,7 +205,7 @@ begin
   end;
 end;
 
-procedure TGLLineParticle.ReadFromFiler(reader: TVirtualReader);
+procedure TGLLineParticle.ReadFromFiler(reader: TGLVirtualReader);
 var
   archiveVersion: Integer;
 begin

+ 4 - 4
Source/GLS.Material.pas

@@ -596,8 +596,8 @@ type
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     procedure DestroyHandles;
-    procedure WriteToFiler(writer: TVirtualWriter);
-    procedure ReadFromFiler(reader: TVirtualReader);
+    procedure WriteToFiler(writer: TGLVirtualWriter);
+    procedure ReadFromFiler(reader: TGLVirtualReader);
     procedure SaveToStream(aStream: TStream); virtual;
     procedure LoadFromStream(aStream: TStream); virtual;
     procedure AddMaterialsFromStream(aStream: TStream);
@@ -2404,7 +2404,7 @@ begin
   Result := (FMaterials.Count > 0);
 end;
 
-procedure TGLMaterialLibrary.WriteToFiler(writer: TVirtualWriter);
+procedure TGLMaterialLibrary.WriteToFiler(writer: TGLVirtualWriter);
 var
   i, j: Integer;
   libMat: TGLLibMaterial;
@@ -2574,7 +2574,7 @@ begin
   end;
 end;
 
-procedure TGLMaterialLibrary.ReadFromFiler(reader: TVirtualReader);
+procedure TGLMaterialLibrary.ReadFromFiler(reader: TGLVirtualReader);
 var
   archiveVersion: Integer;
   libMat: TGLLibMaterial;

+ 11 - 11
Source/GLS.MaterialEx.pas

@@ -74,16 +74,16 @@ type
       IGLMaterialLibrarySupported)
   private
     FNameHashKey: Integer;
-    FUserList: TPersistentObjectList;
+    FUserList: TGLPersistentObjectList;
     FDefferedInit: Boolean;
     FNotifying: Boolean;
     FIsValid: Boolean;
-    function GetUserList: TPersistentObjectList;
+    function GetUserList: TGLPersistentObjectList;
     function GetMaterialLibraryEx: TGLMaterialLibraryEx;
   protected
     procedure SetName(const AValue: TGLMaterialComponentName); override;
     procedure NotifyChange(Sender: TObject); virtual;
-    property UserList: TPersistentObjectList read GetUserList;
+    property UserList: TGLPersistentObjectList read GetUserList;
     procedure DoOnPrepare(Sender: TGLContext); virtual; abstract;
   public
     destructor Destroy; override;
@@ -893,12 +893,12 @@ type
     FShaders: array[TGLShaderType] of TGLShaderEx;
     FIsValid: Boolean;
     FInfoLog: string;
-    FUniforms: TPersistentObjectList;
+    FUniforms: TGLPersistentObjectList;
     FAutoFill: Boolean;
     function GetLibShaderName(AType: TGLShaderType): string;
     procedure SetLibShaderName(AType: TGLShaderType; const AValue: string);
     function GetUniform(const AName: string): IShaderParameter;
-    class procedure ReleaseUniforms(AList: TPersistentObjectList);
+    class procedure ReleaseUniforms(AList: TGLPersistentObjectList);
     property LibVertexShaderName: TGLMaterialComponentName index shtVertex
       read GetLibShaderName write SetLibShaderName;
     property LibFragmentShaderName: TGLMaterialComponentName index shtFragment
@@ -1325,11 +1325,11 @@ begin
     Result := 0;
 end;
 
-function TGLBaseMaterialCollectionItem.GetUserList: TPersistentObjectList;
+function TGLBaseMaterialCollectionItem.GetUserList: TGLPersistentObjectList;
 begin
   if FUserList = nil then
   begin
-    FUserList := TPersistentObjectList.Create;
+    FUserList := TGLPersistentObjectList.Create;
     FNotifying := False;
   end;
   Result := FUserList;
@@ -4419,7 +4419,7 @@ begin
   FHandle := TGLProgramHandle.Create;
   FHandle.OnPrapare := DoOnPrepare;
   FEnabled := False;
-  FUniforms := TPersistentObjectList.Create;
+  FUniforms := TGLPersistentObjectList.Create;
   FAutoFill := True;
 end;
 
@@ -4448,7 +4448,7 @@ end;
 procedure TGLBaseShaderModel.DoOnPrepare(Sender: TGLContext);
 var
   T: TGLShaderType;
-  LUniforms: TPersistentObjectList;
+  LUniforms: TGLPersistentObjectList;
   LUniform, LUniform2: TGLShaderUniform;
   ID: Cardinal;
   I, J, C: Integer;
@@ -4538,7 +4538,7 @@ begin
               end;
 
               // Get uniforms
-              LUniforms := TPersistentObjectList.Create;
+              LUniforms := TGLPersistentObjectList.Create;
 
               gl.GetProgramiv(ID, GL_ACTIVE_UNIFORMS, @C);
               for I := 0 to C - 1 do
@@ -4827,7 +4827,7 @@ begin
 end;
 
 class procedure TGLBaseShaderModel.ReleaseUniforms(
-  AList: TPersistentObjectList);
+  AList: TGLPersistentObjectList);
 var
   I: Integer;
 begin

+ 13 - 13
Source/GLS.MeshBSP.pas

@@ -142,7 +142,7 @@ type
       const maxTrianglesPerLeaf: Integer = MaxInt);
     (*  Goes through all triangle edges, looking for tjunctions.
       The candidates are indices of points to lookup a tjunction vertices. *)
-    procedure FixTJunctions(const tJunctionsCandidates: TIntegerList);
+    procedure FixTJunctions(const tJunctionsCandidates: TGLIntegerList);
     (*  BSP node split plane.
       Divides space between positive and negative half-space, positive
       half-space being the one were the evaluation of an homogeneous
@@ -386,14 +386,14 @@ var
   i, j, n: Integer;
   nodeParents: array of Integer;
   remapIndex: array of Integer;
-  indicesToCheck: TIntegerList;
+  indicesToCheck: TGLIntegerList;
   node: TFGBSPNode;
 begin
   n := faceGroups.Count;
   if n = 0 then
     Exit;
   SetLength(nodeParents, n);
-  indicesToCheck := TIntegerList.Create;
+  indicesToCheck := TGLIntegerList.Create;
   try
     // build nodes parent information
     FillChar(nodeParents[0], SizeOf(Integer) * n, 255);
@@ -645,7 +645,7 @@ var
   ns, np, nn: Integer;
   evalPlane: THmgPlane;
   bestEval, eval: Single;
-  vertices: TAffineVectorList;
+  vertices: TGLAffineVectorList;
 begin
   Result := NullHmgVector;
   bestEval := 1E30;
@@ -690,7 +690,7 @@ procedure TFGBSPNode.EvaluateSplitPlane(const splitPlane: THmgPlane;
 var
   i, n, inci, lookupIdx: Integer;
   a, b, c: Boolean;
-  vertices: TAffineVectorList;
+  vertices: TGLAffineVectorList;
 const
   // case resolution lookup tables (node's tris unaccounted for)
   cTriangleSplit: array [0 .. 7] of Integer = (0, 1, 1, 1, 1, 1, 1, 0);
@@ -827,8 +827,8 @@ procedure TFGBSPNode.PerformSplit(const splitPlane: THmgPlane;
   const maxTrianglesPerLeaf: Integer = MaxInt);
 var
   fgPos, fgNeg: TFGBSPNode;
-  fgPosIndices, fgNegIndices: TIntegerList;
-  indices: TIntegerList;
+  fgPosIndices, fgNegIndices: TGLIntegerList;
+  indices: TGLIntegerList;
 
   procedure SplitTriangleMid(strayID, strayNext, strayPrev: Integer;
     eNext, ePrev: Single);
@@ -880,7 +880,7 @@ var
 var
   i, i1, i2, i3, se1, se2, se3: Integer;
   e1, e2, e3: Single;
-  vertices: TAffineVectorList;
+  vertices: TGLAffineVectorList;
   subSplitPlane: THmgPlane;
 begin
   Assert((PositiveSubNodeIndex = 0) and (NegativeSubNodeIndex = 0));
@@ -894,7 +894,7 @@ begin
   fgNegIndices := fgNeg.VertexIndices;
   // initiate split
   Self.FSplitPlane := splitPlane;
-  indices := TIntegerList.Create;
+  indices := TGLIntegerList.Create;
   vertices := Owner.Owner.vertices;
   i := 0;
   while i < VertexIndices.Count do
@@ -1035,10 +1035,10 @@ begin
   end;
 end;
 
-procedure TFGBSPNode.FixTJunctions(const tJunctionsCandidates: TIntegerList);
+procedure TFGBSPNode.FixTJunctions(const tJunctionsCandidates: TGLIntegerList);
 
   function FindTJunction(iA, iB, iC: Integer;
-    candidatesList: TIntegerList): Integer;
+    candidatesList: TGLIntegerList): Integer;
   var
     i, k: Integer;
     vertices: PAffineVectorArray;
@@ -1093,10 +1093,10 @@ procedure TFGBSPNode.FixTJunctions(const tJunctionsCandidates: TIntegerList);
 var
   i, tj: Integer;
   indices: PIntegerArray;
-  mark: TIntegerList;
+  mark: TGLIntegerList;
 begin
   Assert(Mode in [fgmmTriangles, fgmmFlatTriangles]);
-  mark := TIntegerList.Create;
+  mark := TGLIntegerList.Create;
   mark.AddSerie(1, 0, VertexIndices.Count);
   indices := VertexIndices.List;
   i := 0;

+ 19 - 19
Source/GLS.MeshBuilder.pas

@@ -345,8 +345,8 @@ procedure OptimizeMesh(aMeshObject: TGLMeshObject;
 var
   i: Integer;
   fg: TGLFaceGroup;
-  coords, TexCoords, Normals: TAffineVectorList;
-  il: TIntegerList;
+  coords, TexCoords, Normals: TGLAffineVectorList;
+  il: TGLIntegerList;
   materialName: String;
 begin
   if (mooMergeObjects in options) then
@@ -370,8 +370,8 @@ begin
     begin
       if aMeshObject.FaceGroups.Count = 1 then
         materialName := aMeshObject.FaceGroups[0].materialName;
-      TexCoords := TAffineVectorList.Create;
-      Normals := TAffineVectorList.Create;
+      TexCoords := TGLAffineVectorList.Create;
+      Normals := TGLAffineVectorList.Create;
       coords := aMeshObject.ExtractTriangles(TexCoords, Normals);
       try
         il := BuildVectorCountOptimizedIndices(coords, Normals, TexCoords);
@@ -426,20 +426,20 @@ procedure FacesSmooth(aMeshObj: TGLMeshObject;
   InvertNormals: boolean = false);
 Var
   i, J, k, L: Integer;
-  WeldedVertex: TAffineVectorList;
-  TmpIntegerList: TIntegerList;
+  WeldedVertex: TGLAffineVectorList;
+  TmpIntegerList: TGLIntegerList;
   IndexMap: TStringList;
   n: TAffineVector;
-  indicesMap: TIntegerList;
+  indicesMap: TGLIntegerList;
   Index: Integer;
-  FaceList: TIntegerList;
-  NormalList: TAffineVectorList;
-  FaceNormalList: TAffineVectorList;
+  FaceList: TGLIntegerList;
+  NormalList: TGLAffineVectorList;
+  FaceNormalList: TGLAffineVectorList;
   FaceGroup: TGLFaceGroup;
   fg, FG1: TFGVertexIndexList;
   Threshold: Single;
   Angle: Single;
-  ReferenceMap: TIntegerList;
+  ReferenceMap: TGLIntegerList;
   ID1, ID2: Integer;
   Index1, Index2, Index3: Integer;
 
@@ -465,10 +465,10 @@ Var
 begin
   Threshold := aThreshold * Pi / 180.0;
   // build the vectices reference map
-  ReferenceMap := TIntegerList.Create;
-  WeldedVertex := TAffineVectorList.Create;
+  ReferenceMap := TGLIntegerList.Create;
+  WeldedVertex := TGLAffineVectorList.Create;
   WeldedVertex.Assign(aMeshObj.Vertices);
-  indicesMap := TIntegerList.Create;
+  indicesMap := TGLIntegerList.Create;
   // first of all, weld the very closed vertices
   WeldVertices(WeldedVertex, indicesMap, aWeldDistance);
   // then, rebuild the map list
@@ -476,7 +476,7 @@ begin
   for i := 0 to WeldedVertex.Count - 1 do
   begin
     ReferenceMap.Assign(indicesMap);
-    TmpIntegerList := TIntegerList.Create;
+    TmpIntegerList := TGLIntegerList.Create;
     Index := ReferenceMap.IndexOf(i);
     while Index >= 0 do
     begin
@@ -491,10 +491,10 @@ begin
   WeldedVertex.Free;
   indicesMap.Free;
   // creates a TexPoint list for save face infomation, where s=facegroup index, t=face index
-  FaceList := TIntegerList.Create;
-  NormalList := TAffineVectorList.Create;
-  FaceNormalList := TAffineVectorList.Create;
-  // NormalIndex := TIntegerList.Create;
+  FaceList := TGLIntegerList.Create;
+  NormalList := TGLAffineVectorList.Create;
+  FaceNormalList := TGLAffineVectorList.Create;
+  // NormalIndex := TGLIntegerList.Create;
   for i := 0 to aMeshObj.FaceGroups.Count - 1 do
   begin
     FaceGroup := aMeshObj.FaceGroups[i];

+ 6 - 6
Source/GLS.MeshCSG.pas

@@ -508,8 +508,8 @@ procedure CSG_Operation(obj1, obj2: TGLMeshObject; Operation: TCSGOperation;
   Res: TGLMeshObject; const MaterialName1, MaterialName2: string);
 
 var
-  v1, t1, n1: TAffineVectorList;
-  v2, t2, n2: TAffineVectorList;
+  v1, t1, n1: TGLAffineVectorList;
+  v2, t2, n2: TGLAffineVectorList;
   BSP1, BSP2: TBSPMeshObject;
   FG1, FG2: TFGBSPNode;
   i: Integer;
@@ -526,8 +526,8 @@ begin
   FG1 := TFGBSPNode.CreateOwned(BSP1.FaceGroups);
   FG2 := TFGBSPNode.CreateOwned(BSP2.FaceGroups);
 
-  t1 := TAffineVectorList.create;
-  n1 := TAffineVectorList.create;
+  t1 := TGLAffineVectorList.create;
+  n1 := TGLAffineVectorList.create;
   v1 := obj1.ExtractTriangles(t1, n1);
 
   v1.TransformAsPoints(obj1.Owner.Owner.Matrix^);
@@ -538,8 +538,8 @@ begin
   BSP1.TexCoords := t1;
   FG1.VertexIndices.AddSerie(0, 1, BSP1.Vertices.Count);
 
-  t2 := TAffineVectorList.create;
-  n2 := TAffineVectorList.create;
+  t2 := TGLAffineVectorList.create;
+  n2 := TGLAffineVectorList.create;
   v2 := obj2.ExtractTriangles(t2, n2);
   v2.TransformAsPoints(obj2.Owner.Owner.Matrix^);
 

+ 4 - 4
Source/GLS.MeshLines.pas

@@ -142,8 +142,8 @@ type
     function GetUpdating: Boolean;
     function PointNearLine(const LineItem: TLineItem; const X,Z: Single; Tolerance: single = 1): boolean;
     function PointNearSegment(const StartNode, EndNode: TLineNode; const X,Z: Single; LineWidth: single; Tolerance: single = 1): boolean;
-    procedure StitchStrips(idx: TIntegerList);
-    procedure AddStitchMarker(idx: TIntegerList);
+    procedure StitchStrips(idx: TGLIntegerList);
+    procedure AddStitchMarker(idx: TGLIntegerList);
     procedure SetShowNodes(const Value: Boolean);
     procedure SetNoZWrite(const Value: Boolean);
     procedure SetLightmapIndex(const value: Integer);
@@ -779,7 +779,7 @@ begin
   Result:= sqrt(sqr(xt - X) + sqr(yt - Z)) <= lDist;
 end;
 
-procedure TGLMeshLines.StitchStrips(idx: TIntegerList);
+procedure TGLMeshLines.StitchStrips(idx: TGLIntegerList);
 var
   i: integer;
   i0, i1, i2: integer;
@@ -799,7 +799,7 @@ begin
   end;
 end;
 
-procedure TGLMeshLines.AddStitchMarker(idx: TIntegerList);
+procedure TGLMeshLines.AddStitchMarker(idx: TGLIntegerList);
 begin
   idx.Add(-1);
   idx.Add(-2);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1060 - 943
Source/GLS.MeshUtils.pas


+ 10 - 10
Source/GLS.MultiPolygon.pas

@@ -7,7 +7,7 @@ unit GLS.MultiPolygon;
 (* Object with support for complex polygons. 
    When the tesselator finds an intersection of edges it wants us to give him some storage
    for this new vertex, and he wants a pointer (see tessCombine). The pointers taken from
-   TAffineVectorList become invalid after enlarging the capacity (makes a ReAllocMem), which
+   TGLAffineVectorList become invalid after enlarging the capacity (makes a ReAllocMem), which
    can happen implicitly while adding. The TGLVectorPool keeps all pointers valid until the
    destruction itself.
    Reactivated the TGLVectorPool object. The GLS.VectorLists are not suitable for this job.
@@ -93,14 +93,14 @@ type
     procedure GetExtents(var min, max: TAffineVector);
   end;
 
-  TGLPolygonList = class(TPersistentObjectList)
+  TGLPolygonList = class(TGLPersistentObjectList)
   private
-    FAktList: TAffineVectorList;
-    function GetList(I: Integer): TAffineVectorList;
+    FAktList: TGLAffineVectorList;
+    function GetList(I: Integer): TGLAffineVectorList;
   public
     procedure Add;
-    property AktList: TAffineVectorList read FAktList;
-    property List[I: Integer]: TAffineVectorList read GetList;
+    property AktList: TGLAffineVectorList read FAktList;
+    property List[I: Integer]: TGLAffineVectorList read GetList;
   end;
 
   (* Multipolygon is defined with multiple contours.
@@ -167,7 +167,7 @@ type
   end;
 
   (* Page oriented pointer array, with persistent pointer target memory.
-    In TVectorList a pointer to a vector will not be valid any more after
+    In TGLVectorList a pointer to a vector will not be valid any more after
     a call to SetCapacity, which might be done implicitely during Add.
     The TGLVectorPool keeps memory in its original position during its
     whole lifetime. *)
@@ -235,14 +235,14 @@ end;
 
 procedure TGLPolygonList.Add;
 begin
-  FAktList := TAffineVectorList.Create;
+  FAktList := TGLAffineVectorList.Create;
   inherited Add(FAktList);
 end;
 
 
-function TGLPolygonList.GetList(i: Integer): TAffineVectorList;
+function TGLPolygonList.GetList(i: Integer): TGLAffineVectorList;
 begin
-  Result := TAffineVectorList(Items[i]);
+  Result := TGLAffineVectorList(Items[i]);
 end;
 
 // ------------------

+ 13 - 13
Source/GLS.Objects.pas

@@ -269,8 +269,8 @@ type
     and Colors properties *)
   TGLPoints = class(TGLImmaterialSceneObject)
   private
-    FPositions: TAffineVectorList;
-    FColors: TVectorList;
+    FPositions: TGLAffineVectorList;
+    FColors: TGLVectorList;
     FSize: Single;
     FStyle: TGLPointStyle;
     FPointParameters: TGLPointParameters;
@@ -280,8 +280,8 @@ type
     procedure SetNoZWrite(const val: Boolean);
     procedure SetStatic(const val: Boolean);
     procedure SetSize(const val: Single);
-    procedure SetPositions(const val: TAffineVectorList); inline;
-    procedure SetColors(const val: TVectorList);
+    procedure SetPositions(const val: TGLAffineVectorList); inline;
+    procedure SetColors(const val: TGLVectorList);
     procedure SetStyle(const val: TGLPointStyle);
     procedure SetPointParameters(const val: TGLPointParameters);
   public
@@ -290,13 +290,13 @@ type
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     // Points positions.  If empty, a single point is assumed at (0, 0, 0)
-    property Positions: TAffineVectorList read FPositions write SetPositions;
+    property Positions: TGLAffineVectorList read FPositions write SetPositions;
     (* Defines the points colors:
       if empty, point color will be opaque white
       if contains a single color, all points will use that color
       if contains N colors, the first N points (at max) will be rendered
       using the corresponding colors *)
-    property Colors: TVectorList read FColors write SetColors;
+    property Colors: TGLVectorList read FColors write SetColors;
   published
     // If true points do not write their Z to the depth buffer.
     property NoZWrite: Boolean read FNoZWrite write SetNoZWrite;
@@ -446,7 +446,7 @@ type
     FOptions: TGLLinesOptions;
     FNURBSOrder: Integer;
     FNURBSTolerance: Single;
-    FNURBSKnots: TSingleList;
+    FNURBSKnots: TGLSingleList;
   protected
     procedure SetSplineMode(const val: TGLLineSplineMode);
     procedure SetDivision(const Value: Integer);
@@ -458,7 +458,7 @@ type
     destructor Destroy; override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    property NURBSKnots: TSingleList read FNURBSKnots;
+    property NURBSKnots: TGLSingleList read FNURBSKnots;
     property NURBSOrder: Integer read FNURBSOrder write SetNURBSOrder;
     property NURBSTolerance: Single read FNURBSTolerance
       write SetNURBSTolerance;
@@ -1581,9 +1581,9 @@ begin
   ObjectStyle := ObjectStyle + [osDirectDraw, osNoVisibilityCulling];
   FStyle := psSquare;
   FSize := cDefaultPointSize;
-  FPositions := TAffineVectorList.Create;
+  FPositions := TGLAffineVectorList.Create;
   FPositions.Add(NullVector);
-  FColors := TVectorList.Create;
+  FColors := TGLVectorList.Create;
   FPointParameters := TGLPointParameters.Create(Self);
 end;
 
@@ -1729,13 +1729,13 @@ begin
   end;
 end;
 
-procedure TGLPoints.SetPositions(const val: TAffineVectorList);
+procedure TGLPoints.SetPositions(const val: TGLAffineVectorList);
 begin
   FPositions.Assign(val);
   StructureChanged;
 end;
 
-procedure TGLPoints.SetColors(const val: TVectorList);
+procedure TGLPoints.SetColors(const val: TGLVectorList);
 begin
   FColors.Assign(val);
   StructureChanged;
@@ -2084,7 +2084,7 @@ begin
   inherited Create(AOwner);
   FDivision := 10;
   FSplineMode := lsmLines;
-  FNURBSKnots := TSingleList.Create;
+  FNURBSKnots := TGLSingleList.Create;
   FNURBSOrder := 0;
   FNURBSTolerance := 50;
 end;

+ 17 - 17
Source/GLS.Octree.pas

@@ -95,14 +95,14 @@ type
     MeshCount: Integer; // number of meshes currently cut into the Octree
     ResultArray: array of POctreeNode;
     // holds the result nodes of various calls
-    TriangleFiler: TAffineVectorList;
+    TriangleFiler: TGLAffineVectorList;
     procedure WalkSphereToLeaf(Onode: POctreeNode; const P: TGLVector;
       Radius: Single);
     (*  Initializes the tree from the triangle list.
       All triangles must be contained in the world extent to be properly
       taken into account. *)
     procedure InitializeTree(const AWorldMinExtent, AWorldMaxExtent
-      : TAffineVector; const ATriangles: TAffineVectorList;
+      : TAffineVector; const ATriangles: TGLAffineVectorList;
       const ATreeDepth: Integer);
     procedure DisposeTree;
     destructor Destroy; override;
@@ -115,13 +115,13 @@ type
     function TriangleIntersect(const V1, V2, V3: TAffineVector): Boolean;
     //  Returns all triangles in the AABB.
     function GetTrianglesFromNodesIntersectingAABB(const ObjAABB: TAABB)
-      : TAffineVectorList;
+      : TGLAffineVectorList;
     //  Returns all triangles in an arbitrarily placed cube
     function GetTrianglesFromNodesIntersectingCube(const ObjAABB: TAABB;
-      const ObjToSelf, SelfToObj: TGLMatrix): TAffineVectorList;
+      const ObjToSelf, SelfToObj: TGLMatrix): TGLAffineVectorList;
     //  Checks if an AABB intersects a face on the octree
     function AABBIntersect(const AABB: TAABB; const M1to2, M2to1: TGLMatrix;
-      Triangles: TAffineVectorList = nil): Boolean;
+      Triangles: TGLAffineVectorList = nil): Boolean;
     // function SphereIntersect(position:TAffineVector; radius:single);
   end;
 
@@ -877,7 +877,7 @@ begin
 end;
 
 procedure TGLOctree.InitializeTree(const AWorldMinExtent, AWorldMaxExtent
-  : TAffineVector; const ATriangles: TAffineVectorList;
+  : TAffineVector; const ATriangles: TGLAffineVectorList;
   const ATreeDepth: Integer);
 var
   N: Integer;
@@ -888,7 +888,7 @@ begin
 
   // set up the filer data for this mesh
   if TriangleFiler = nil then
-    TriangleFiler := TAffineVectorList.Create;
+    TriangleFiler := TGLAffineVectorList.Create;
   TriangleFiler.Assign(ATriangles);
 
   New(Newnode);
@@ -1411,9 +1411,9 @@ begin
 end;
 
 function TGLOctree.AABBIntersect(const AABB: TAABB; const M1to2, M2to1: TGLMatrix;
-  Triangles: TAffineVectorList = nil): Boolean;
+  Triangles: TGLAffineVectorList = nil): Boolean;
 var
-  TriList: TAffineVectorList;
+  TriList: TGLAffineVectorList;
   I: Integer;
 begin
   // get triangles in nodes intersected by the aabb
@@ -1448,7 +1448,7 @@ begin
 end;
 
 function TGLOctree.GetTrianglesFromNodesIntersectingAABB(const ObjAABB: TAABB)
-  : TAffineVectorList;
+  : TGLAffineVectorList;
 var
   AABB1: TAABB;
 
@@ -1478,7 +1478,7 @@ var
 var
   I, K: Integer;
   P: POctreeNode;
-  TriangleIndices: TIntegerList;
+  TriangleIndices: TGLIntegerList;
 
 begin
   // Calc AABBs
@@ -1488,8 +1488,8 @@ begin
   if Assigned(RootNode) then
     HandleNode(RootNode);
 
-  Result := TAffineVectorList.Create;
-  TriangleIndices := TIntegerList.Create;
+  Result := TGLAffineVectorList.Create;
+  TriangleIndices := TGLIntegerList.Create;
   try
     // fill the triangles from all nodes in the resultarray to AL
     for I := 0 to High(ResultArray) do
@@ -1512,7 +1512,7 @@ begin
 end;
 
 function TGLOctree.GetTrianglesFromNodesIntersectingCube(const ObjAABB: TAABB;
-  const ObjToSelf, SelfToObj: TGLMatrix): TAffineVectorList;
+  const ObjToSelf, SelfToObj: TGLMatrix): TGLAffineVectorList;
 var
   AABB1: TAABB;
   M1To2, M2To1: TGLMatrix;
@@ -1543,7 +1543,7 @@ var
 var
   I, K: Integer;
   P: POctreeNode;
-  TriangleIndices: TIntegerList;
+  TriangleIndices: TGLIntegerList;
 begin
   // Calc AABBs
   AABB1 := ObjAABB;
@@ -1555,8 +1555,8 @@ begin
   if Assigned(RootNode) then
     HandleNode(RootNode);
 
-  Result := TAffineVectorList.Create;
-  TriangleIndices := TIntegerList.Create;
+  Result := TGLAffineVectorList.Create;
+  TriangleIndices := TGLIntegerList.Create;
   try
     // fill the triangles from all nodes in the resultarray to AL
     for I := 0 to High(ResultArray) do

+ 39 - 39
Source/GLS.ParametricSurfaces.pas

@@ -63,10 +63,10 @@ type
   TMOParametricSurface = class(TGLMeshObject)
   private
     FControlPoints,
-    FWeightedControlPoints: TAffineVectorList;
+    FWeightedControlPoints: TGLAffineVectorList;
     FKnotsU,
     FKnotsV,
-    FWeights: TSingleList;
+    FWeights: TGLSingleList;
     FOrderU,
     FOrderV,
     FCountU,
@@ -76,17 +76,17 @@ type
     FContinuity: TBSplineContinuity;
     FRenderer: TParametricSurfaceRenderer;
     FBasis: TParametricSurfaceBasis;
-    procedure SetControlPoints(Value: TAffineVectorList);
-    procedure SetKnotsU(Value: TSingleList);
-    procedure SetKnotsV(Value: TSingleList);
-    procedure SetWeights(Value: TSingleList);
+    procedure SetControlPoints(Value: TGLAffineVectorList);
+    procedure SetKnotsU(Value: TGLSingleList);
+    procedure SetKnotsV(Value: TGLSingleList);
+    procedure SetWeights(Value: TGLSingleList);
     procedure SetRenderer(Value: TParametricSurfaceRenderer);
     procedure SetBasis(Value: TParametricSurfaceBasis);
   public
     constructor Create; override;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     procedure BuildList(var mrci: TGLRenderContextInfo); override;
     procedure Prepare; override;
     procedure Clear; override;
@@ -97,14 +97,14 @@ type
        generate the mesh data. Fills in Vertices, Normals, etc. *)
     procedure GenerateMesh;
     // Control points define the parametric surface.
-    property ControlPoints: TAffineVectorList read FControlPoints write SetControlPoints;
+    property ControlPoints: TGLAffineVectorList read FControlPoints write SetControlPoints;
     (* KnotsU and KnotsV are the knot vectors in the U and V direction. Knots
        define the continuity of curves and how control points influence the
        parametric values to build the surface. *)
-    property KnotsU: TSingleList read FKnotsU write SetKnotsU;
-    property KnotsV: TSingleList read FKnotsV write SetKnotsV;
+    property KnotsU: TGLSingleList read FKnotsU write SetKnotsU;
+    property KnotsV: TGLSingleList read FKnotsV write SetKnotsV;
     // Weights define how much a control point effects the surface.
-    property Weights: TSingleList read FWeights write SetWeights;
+    property Weights: TGLSingleList read FWeights write SetWeights;
     // OrderU and OrderV defines the curve order in the U and V direction
     property OrderU: Integer read FOrderU write FOrderU;
     property OrderV: Integer read FOrderV write FOrderV;
@@ -142,20 +142,20 @@ type
   private
     FCountU, FCountV: Integer;
     FControlPointIndices,
-    FTexCoordIndices: TIntegerList;
+    FTexCoordIndices: TGLIntegerList;
     FResolution: Integer;
     FMinU, FMaxU,
     FMinV, FMaxV: Single;
     FTempControlPoints,
-    FTempTexCoords: TAffineVectorList;
+    FTempTexCoords: TGLAffineVectorList;
   protected
-    procedure SetControlPointIndices(const Value: TIntegerList);
-    procedure SetTexCoordIndices(const Value: TIntegerList);
+    procedure SetControlPointIndices(const Value: TGLIntegerList);
+    procedure SetTexCoordIndices(const Value: TGLIntegerList);
   public
     constructor Create; override;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     procedure BuildList(var mrci: TGLRenderContextInfo); override;
     procedure Prepare; override;
     property CountU: Integer read FCountU write FCountU;
@@ -165,8 +165,8 @@ type
     property MaxU: Single read FMaxU write FMaxU;
     property MinV: Single read FMinV write FMinV;
     property MaxV: Single read FMaxV write FMaxV;
-    property ControlPointIndices: TIntegerList read FControlPointIndices write SetControlPointIndices;
-    property TexCoordIndices: TIntegerList read FTexCoordIndices write SetTexCoordIndices;
+    property ControlPointIndices: TGLIntegerList read FControlPointIndices write SetControlPointIndices;
+    property TexCoordIndices: TGLIntegerList read FTexCoordIndices write SetTexCoordIndices;
   end;
 
 // ----------------------------------------------------------------------
@@ -180,11 +180,11 @@ implementation
 constructor TMOParametricSurface.Create;
 begin
   inherited;
-  FControlPoints := TAffineVectorList.Create;
-  FWeightedControlPoints := TAffineVectorList.Create;
-  FKnotsU := TSingleList.Create;
-  FKnotsV := TSingleList.Create;
-  FWeights := TSingleList.Create;
+  FControlPoints := TGLAffineVectorList.Create;
+  FWeightedControlPoints := TGLAffineVectorList.Create;
+  FKnotsU := TGLSingleList.Create;
+  FKnotsV := TGLSingleList.Create;
+  FWeights := TGLSingleList.Create;
   Resolution := 20;
 end;
 
@@ -198,7 +198,7 @@ begin
   inherited;
 end;
 
-procedure TMOParametricSurface.WriteToFiler(writer: TVirtualWriter);
+procedure TMOParametricSurface.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited WriteToFiler(writer);
   with writer do
@@ -220,7 +220,7 @@ begin
   end;
 end;
 
-procedure TMOParametricSurface.ReadFromFiler(reader: TVirtualReader);
+procedure TMOParametricSurface.ReadFromFiler(reader: TGLVirtualReader);
 var
   archiveVersion: Integer;
 begin
@@ -390,22 +390,22 @@ begin
 
 end;
 
-procedure TMOParametricSurface.SetControlPoints(Value: TAffineVectorList);
+procedure TMOParametricSurface.SetControlPoints(Value: TGLAffineVectorList);
 begin
   FControlPoints.Assign(Value);
 end;
 
-procedure TMOParametricSurface.SetKnotsU(Value: TSingleList);
+procedure TMOParametricSurface.SetKnotsU(Value: TGLSingleList);
 begin
   FKnotsU.Assign(Value);
 end;
 
-procedure TMOParametricSurface.SetKnotsV(Value: TSingleList);
+procedure TMOParametricSurface.SetKnotsV(Value: TGLSingleList);
 begin
   FKnotsV.Assign(Value);
 end;
 
-procedure TMOParametricSurface.SetWeights(Value: TSingleList);
+procedure TMOParametricSurface.SetWeights(Value: TGLSingleList);
 begin
   FWeights.Assign(Value);
 end;
@@ -436,10 +436,10 @@ end;
 constructor TFGBezierSurface.Create;
 begin
   inherited;
-  FControlPointIndices := TIntegerList.Create;
-  FTexCoordIndices := TIntegerList.Create;
-  FTempControlPoints := TAffineVectorList.Create;
-  FTempTexCoords := TAffineVectorList.Create;
+  FControlPointIndices := TGLIntegerList.Create;
+  FTexCoordIndices := TGLIntegerList.Create;
+  FTempControlPoints := TGLAffineVectorList.Create;
+  FTempTexCoords := TGLAffineVectorList.Create;
 
   // Default values
   FCountU := 4;
@@ -460,7 +460,7 @@ begin
   inherited;
 end;
 
-procedure TFGBezierSurface.WriteToFiler(writer: TVirtualWriter);
+procedure TFGBezierSurface.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited WriteToFiler(writer);
   with writer do
@@ -478,7 +478,7 @@ begin
   end;
 end;
 
-procedure TFGBezierSurface.ReadFromFiler(reader: TVirtualReader);
+procedure TFGBezierSurface.ReadFromFiler(reader: TGLVirtualReader);
 var
   archiveVersion: Integer;
 begin
@@ -535,12 +535,12 @@ begin
   mrci.GLStates.PopAttrib;
 end;
 
-procedure TFGBezierSurface.SetControlPointIndices(const Value: TIntegerList);
+procedure TFGBezierSurface.SetControlPointIndices(const Value: TGLIntegerList);
 begin
   FControlPointIndices.Assign(Value);
 end;
 
-procedure TFGBezierSurface.SetTexCoordIndices(const Value: TIntegerList);
+procedure TFGBezierSurface.SetTexCoordIndices(const Value: TGLIntegerList);
 begin
   FTexCoordIndices.Assign(Value);
 end;

+ 22 - 22
Source/GLS.ParticleFX.pas

@@ -58,7 +58,7 @@ type
      The class implements properties for position, velocity and time, whatever
      you need in excess of that will have to be placed in subclasses (this
      class should remain as compact as possible). *)
-  TGLParticle = class(TPersistentObject)
+  TGLParticle = class(TGLPersistentObject)
   private
     FID, FTag: Integer;
     FManager: TGLParticleFXManager; // NOT persistent
@@ -74,8 +74,8 @@ type
   public
     constructor Create; override;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     property Manager: TGLParticleFXManager read FManager write FManager;
     // Particle's ID, given at birth. ID is a value unique per manager.
     property ID: Integer read FID;
@@ -106,10 +106,10 @@ type
   (* List of particles.
    This list is managed with particles and performance in mind, make sure to
    check methods doc. *)
-  TGLParticleList = class(TPersistentObject)
+  TGLParticleList = class(TGLPersistentObject)
   private
     FOwner: TGLParticleFXManager; // NOT persistent
-    FItemList: TPersistentObjectList;
+    FItemList: TGLPersistentObjectList;
     FDirectList: PGLParticleArray; // NOT persistent
   protected
     function GetItems(index: Integer): TGLParticle;
@@ -118,8 +118,8 @@ type
   public
     constructor Create; override;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     // Refers owner manager
     property Owner: TGLParticleFXManager read FOwner write FOwner;
     property Items[index: Integer]: TGLParticle read GetItems write SetItems; default;
@@ -502,7 +502,7 @@ type
     procedure ComputeOuterColor(var lifeTime: Single; var outer: TGLColorVector);
     function ComputeSizeScale(var lifeTime: Single; var sizeScale: Single): Boolean;
     function ComputeRotateAngle(var lifeTime, rotateAngle: Single): Boolean;
-    procedure RotateVertexBuf(buf: TAffineVectorList; lifeTime: Single;
+    procedure RotateVertexBuf(buf: TGLAffineVectorList; lifeTime: Single;
       const axis: TAffineVector; offsetAngle: Single);
   public
     constructor Create(aOwner: TComponent); override;
@@ -572,8 +572,8 @@ type
   private
     FNbSides: Integer;
     Fvx, Fvy: TAffineVector; // NOT persistent
-    FVertices: TAffineVectorList; // NOT persistent
-    FVertBuf: TAffineVectorList; // NOT persistent
+    FVertices: TGLAffineVectorList; // NOT persistent
+    FVertBuf: TGLAffineVectorList; // NOT persistent
   protected
     procedure SetNbSides(const val: Integer);
     function TexturingMode: Cardinal; override;
@@ -609,8 +609,8 @@ type
   private
     FTexHandle: TGLTextureHandle;
     Fvx, Fvy, Fvz: TAffineVector; // NOT persistent
-    FVertices: TAffineVectorList; // NOT persistent
-    FVertBuf: TAffineVectorList; // NOT persistent
+    FVertices: TGLAffineVectorList; // NOT persistent
+    FVertBuf: TGLAffineVectorList; // NOT persistent
     FAspectRatio: Single;
     FRotation: Single;
     FShareSprites: TGLBaseSpritePFXManager;
@@ -817,7 +817,7 @@ begin
     FVelocity.V[Index] := aValue;
 end;
 
-procedure TGLParticle.WriteToFiler(writer: TVirtualWriter);
+procedure TGLParticle.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited WriteToFiler(writer);
   with writer do
@@ -830,7 +830,7 @@ begin
   end;
 end;
 
-procedure TGLParticle.ReadFromFiler(reader: TVirtualReader);
+procedure TGLParticle.ReadFromFiler(reader: TGLVirtualReader);
 var
   archiveVersion: integer;
 begin
@@ -855,7 +855,7 @@ end;
 constructor TGLParticleList.Create;
 begin
   inherited Create;
-  FItemList := TPersistentObjectList.Create;
+  FItemList := TGLPersistentObjectList.Create;
   FitemList.GrowthDelta := 64;
   FDirectList := nil;
 end;
@@ -866,7 +866,7 @@ begin
   inherited Destroy;
 end;
 
-procedure TGLParticleList.WriteToFiler(writer: TVirtualWriter);
+procedure TGLParticleList.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited WriteToFiler(writer);
   with writer do
@@ -876,7 +876,7 @@ begin
   end;
 end;
 
-procedure TGLParticleList.ReadFromFiler(reader: TVirtualReader);
+procedure TGLParticleList.ReadFromFiler(reader: TGLVirtualReader);
 var
   archiveVersion: integer;
 begin
@@ -2282,7 +2282,7 @@ begin
   end;
 end;
 
-procedure TGLLifeColoredPFXManager.RotateVertexBuf(buf: TAffineVectorList;
+procedure TGLLifeColoredPFXManager.RotateVertexBuf(buf: TGLAffineVectorList;
   lifeTime: Single; const axis: TAffineVector; offsetAngle: Single);
 var
   rotateAngle: Single;
@@ -2431,14 +2431,14 @@ begin
     Fvx.V[i] := matrix.V[i].X * FParticleSize;
     Fvy.V[i] := matrix.V[i].Y * FParticleSize;
   end;
-  FVertices := TAffineVectorList.Create;
+  FVertices := TGLAffineVectorList.Create;
   FVertices.Capacity := FNbSides;
   for i := 0 to FNbSides - 1 do
   begin
     SinCosine(i * c2PI / FNbSides, s, c);
     FVertices.Add(VectorCombine(FVx, Fvy, c, s));
   end;
-  FVertBuf := TAffineVectorList.Create;
+  FVertBuf := TGLAffineVectorList.Create;
   FVertBuf.Count := FVertices.Count;
 end;
 
@@ -2645,7 +2645,7 @@ begin
     Fvz.V[i] := matrix.V[i].Z;
   end;
 
-  FVertices := TAffineVectorList.Create;
+  FVertices := TGLAffineVectorList.Create;
   for i := 0 to 3 do
   begin
     SinCosine(i * cPIdiv2 + cPIdiv4, s, c);
@@ -2657,7 +2657,7 @@ begin
     FVertices.TransformAsPoints(matrix);
   end;
 
-  FVertBuf := TAffineVectorList.Create;
+  FVertBuf := TGLAffineVectorList.Create;
   FVertBuf.Count := FVertices.Count;
 end;
 

+ 113 - 114
Source/GLS.PersistentClasses.pas

@@ -17,7 +17,6 @@ interface
 uses
   System.Classes,
   System.SysUtils,
-
   GLS.Strings;
 
 type
@@ -25,7 +24,7 @@ type
   PObject = ^TObject;
 
   //Virtual layer similar to VCL's TReader (but reusable)
-  TVirtualReader = class
+  TGLVirtualReader = class
   private
     FStream: TStream;
   public
@@ -45,7 +44,7 @@ type
   end;
 
   //Virtual layer similar to VCL's TWriter (but reusable)
-  TVirtualWriter = class
+  TGLVirtualWriter = class
   private
     FStream: TStream;
   public
@@ -61,17 +60,16 @@ type
     procedure WriteTStrings(const aStrings: TStrings; storeObjects: Boolean = True);
   end;
 
-  TVirtualReaderClass = class of TVirtualReader;
-  TVirtualWriterClass = class of TVirtualWriter;
+  TVirtualReaderClass = class of TGLVirtualReader;
+  TVirtualWriterClass = class of TGLVirtualWriter;
 
   (*Interface for persistent objects.
      This interface does not really allow polymorphic persistence,
-     but is rather intended as a way to unify persistence calls
-     for iterators *)
-  IPersistentObject = interface(IInterface)
+     but is rather intended as a way to unify persistence calls for iterators *)
+  IGLPersistentObject = interface(IInterface)
   ['{A9A0198A-F11B-4325-A92C-2F24DB41652B}']
-    procedure WriteToFiler(writer: TVirtualWriter);
-    procedure ReadFromFiler(reader: TVirtualReader);
+    procedure WriteToFiler(writer: TGLVirtualWriter);
+    procedure ReadFromFiler(reader: TGLVirtualReader);
   end;
 
   (* Base class for persistent objects.
@@ -80,9 +78,9 @@ type
      file or string), assignment and cloning.
      The other requirement being the use of a virtual constructor, which allows
      polymorphic construction (don't forget to register your subclasses).
-     Note that TPersistentObject implements IUnknown, but does *not* implement
+     Note that TGLPersistentObject implements IUnknown, but does *not* implement
      reference counting *)
-  TPersistentObject = class(TPersistent, IPersistentObject)
+  TGLPersistentObject = class(TPersistent, IGLPersistentObject)
   protected
     procedure RaiseFilerException(const archiveVersion: Integer);
     function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
@@ -90,15 +88,15 @@ type
     function _Release: Integer; stdcall;
   public
     constructor Create; virtual;
-    constructor CreateFromFiler(reader: TVirtualReader);
+    constructor CreateFromFiler(reader: TGLVirtualReader);
     destructor Destroy; override;
     procedure Assign(source: TPersistent); override;
-    function CreateClone: TPersistentObject; dynamic;
+    function CreateClone: TGLPersistentObject; dynamic;
     class function FileSignature: string; virtual;
     class function FileVirtualWriter: TVirtualWriterClass; virtual;
     class function FileVirtualReader: TVirtualReaderClass; virtual;
-    procedure WriteToFiler(writer: TVirtualWriter); dynamic;
-    procedure ReadFromFiler(reader: TVirtualReader); dynamic;
+    procedure WriteToFiler(writer: TGLVirtualWriter); dynamic;
+    procedure ReadFromFiler(reader: TGLVirtualReader); dynamic;
     procedure SaveToStream(stream: TStream; writerClass: TVirtualWriterClass = nil); dynamic;
     procedure LoadFromStream(stream: TStream; readerClass: TVirtualReaderClass = nil); dynamic;
     procedure SaveToFile(const fileName: string; writerClass: TVirtualWriterClass = nil); dynamic;
@@ -107,10 +105,11 @@ type
     procedure LoadFromString(const data: string; readerClass: TVirtualReaderClass = nil); dynamic;
   end;
 
-  TPersistentObjectClass = class of TPersistentObject;
+  TPersistentObjectClass = class of TGLPersistentObject;
+
+  PGLPointerObjectList = ^TGLPointerObjectList;
+  TGLPointerObjectList = array[0..MaxInt div (2*SizeOf(Pointer))] of TObject;
 
-  TPointerObjectList = array[0..MaxInt div (2*SizeOf(Pointer))] of TObject;
-  PPointerObjectList = ^TPointerObjectList;
   TObjectListSortCompare = function(item1, item2: TObject): Integer;
 
   (*A persistent Object list.
@@ -118,13 +117,13 @@ type
     persistence of contained data. Unlike the VCL's TObjectList, this one
     does NOT free its objects upon destruction or Clear, use Clean and CleanFree
     for that, and as such can be used for object referral lists too.
-    But only TPersistentObject items will be streamed appropriately.
+    But only TGLPersistentObject items will be streamed appropriately.
     The list can be used in a stack-like fashion with Push & Pop, and can
     perform basic boolean set operations.
     Note: the IndexOf implementation is up to 3 times faster than that of TList *)
-  TPersistentObjectList = class(TPersistentObject)
+  TGLPersistentObjectList = class(TGLPersistentObject)
   private
-    FList: PPointerObjectList;
+    FList: PGLPointerObjectList;
     FCount: Integer;
     FCapacity: Integer;
     FGrowthDelta: Integer;
@@ -144,9 +143,9 @@ type
   public
     constructor Create; override;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
-    procedure ReadFromFilerWithEvent(reader: TVirtualReader;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
+    procedure ReadFromFilerWithEvent(reader: TGLVirtualReader;
       afterSenderObjectCreated: TNotifyEvent);
     function Add(const item: TObject): Integer; inline;
     procedure AddNils(nbVals: Cardinal);
@@ -161,10 +160,10 @@ type
     procedure DeleteAndFreeItems(index: Integer; nbVals: Cardinal);
     function RemoveAndFree(item: TObject): Integer;
     property GrowthDelta: integer read FGrowthDelta write FGrowthDelta;
-    function Expand: TPersistentObjectList;
+    function Expand: TGLPersistentObjectList;
     property Items[Index: Integer]: TObject read Get write Put; default;
     property Count: Integer read FCount write SetCount;
-    property List: PPointerObjectList read FList;
+    property List: PGLPointerObjectList read FList;
     property Capacity: Integer read FCapacity write SetCapacity;
     //Makes sure capacity is at least aCapacity.
     procedure RequiredCapacity(aCapacity: Integer);
@@ -185,13 +184,13 @@ type
     procedure Push(item: TObject);
     function Pop: TObject;
     procedure PopAndFree;
-    function AddObjects(const objectList: TPersistentObjectList): Integer;
-    procedure RemoveObjects(const objectList: TPersistentObjectList);
+    function AddObjects(const objectList: TGLPersistentObjectList): Integer;
+    procedure RemoveObjects(const objectList: TGLPersistentObjectList);
     procedure Sort(compareFunc: TObjectListSortCompare);
   end;
 
   //Wraps a TReader-compatible reader.
-  TGLBinaryReader = class(TVirtualReader)
+  TGLBinaryReader = class(TGLVirtualReader)
   protected
     function ReadValue: TValueType;
     function ReadWideString(vType: TValueType): WideString;
@@ -208,7 +207,7 @@ type
   end;
 
   //Wraps a TWriter-compatible writer.
-  TGLBinaryWriter = class(TVirtualWriter)
+  TGLBinaryWriter = class(TGLVirtualWriter)
   protected
     procedure WriteAnsiString(const aString: AnsiString); virtual;
     procedure WriteWideString(const aString: WideString); virtual;
@@ -223,7 +222,7 @@ type
   end;
 
   //Reads object persistence in Text format.
-  TGLTextReader = class(TVirtualReader)
+  TGLTextReader = class(TGLVirtualReader)
   private
     FValueType: string;
     FData: string;
@@ -242,7 +241,7 @@ type
   end;
 
   //Writes object persistence in Text format.
-  TGLTextWriter = class(TVirtualWriter)
+  TGLTextWriter = class(TGLVirtualWriter)
   private
     FIndentLevel: Integer;
   protected
@@ -393,20 +392,20 @@ begin
 end;
 
 // ------------------
-// ------------------ TVirtualReader ------------------
+// ------------------ TGLVirtualReader ------------------
 // ------------------
 
-constructor TVirtualReader.Create(Stream: TStream);
+constructor TGLVirtualReader.Create(Stream: TStream);
 begin
   FStream := Stream;
 end;
 
-procedure TVirtualReader.ReadTypeError;
+procedure TGLVirtualReader.ReadTypeError;
 begin
   raise EReadError.CreateFmt('%s, read type error', [ClassName]);
 end;
 
-procedure TVirtualReader.ReadTStrings(aStrings: TStrings);
+procedure TGLVirtualReader.ReadTStrings(aStrings: TStrings);
 var
   i: Integer;
   objectsStored: Boolean;
@@ -431,15 +430,15 @@ begin
 end;
 
 // ------------------
-// ------------------ TVirtualWriter ------------------
+// ------------------ TGLVirtualWriter ------------------
 // ------------------
 
-constructor TVirtualWriter.Create(Stream: TStream);
+constructor TGLVirtualWriter.Create(Stream: TStream);
 begin
   FStream := Stream;
 end;
 
-procedure TVirtualWriter.WriteTStrings(const aStrings: TStrings;
+procedure TGLVirtualWriter.WriteTStrings(const aStrings: TStrings;
   storeObjects: Boolean = True);
 var
   i: Integer;
@@ -463,26 +462,26 @@ begin
 end;
 
 // ------------------
-// ------------------ TPersistentObject ------------------
+// ------------------ TGLPersistentObject ------------------
 // ------------------
 
-constructor TPersistentObject.Create;
+constructor TGLPersistentObject.Create;
 begin
   inherited Create;
 end;
 
-constructor TPersistentObject.CreateFromFiler(reader: TVirtualReader);
+constructor TGLPersistentObject.CreateFromFiler(reader: TGLVirtualReader);
 begin
   Create;
   ReadFromFiler(reader);
 end;
 
-destructor TPersistentObject.Destroy;
+destructor TGLPersistentObject.Destroy;
 begin
   inherited Destroy;
 end;
 
-procedure TPersistentObject.Assign(source: TPersistent);
+procedure TGLPersistentObject.Assign(source: TPersistent);
 var
   ms: TStringStream; // faster than a TMemoryStream...
 begin
@@ -490,7 +489,7 @@ begin
   begin
     ms := TStringStream.Create('');
     try
-      TPersistentObject(source).SaveToStream(ms);
+      TGLPersistentObject(source).SaveToStream(ms);
       ms.Position := 0;
       LoadFromStream(ms);
     finally
@@ -501,45 +500,45 @@ begin
     inherited;
 end;
 
-function TPersistentObject.CreateClone: TPersistentObject;
+function TGLPersistentObject.CreateClone: TGLPersistentObject;
 begin
   Result := TPersistentObjectClass(Self.ClassType).Create;
   Result.Assign(Self);
 end;
 
-class function TPersistentObject.FileSignature: string;
+class function TGLPersistentObject.FileSignature: string;
 begin
   Result := '';
 end;
 
-class function TPersistentObject.FileVirtualWriter: TVirtualWriterClass;
+class function TGLPersistentObject.FileVirtualWriter: TVirtualWriterClass;
 begin
   Result := TGLBinaryWriter;
 end;
 
-class function TPersistentObject.FileVirtualReader: TVirtualReaderClass;
+class function TGLPersistentObject.FileVirtualReader: TVirtualReaderClass;
 begin
   Result := TGLBinaryReader;
 end;
 
-procedure TPersistentObject.WriteToFiler(writer: TVirtualWriter);
+procedure TGLPersistentObject.WriteToFiler(writer: TGLVirtualWriter);
 begin
   // nothing
   Assert(Assigned(writer));
 end;
 
-procedure TPersistentObject.ReadFromFiler(reader: TVirtualReader);
+procedure TGLPersistentObject.ReadFromFiler(reader: TGLVirtualReader);
 begin
   // nothing
   Assert(Assigned(reader));
 end;
 
-procedure TPersistentObject.RaiseFilerException(const archiveVersion: Integer);
+procedure TGLPersistentObject.RaiseFilerException(const archiveVersion: Integer);
 begin
   raise EFilerException.Create(ClassName + strUnknownArchiveVersion + IntToStr(archiveVersion)); //IGNORE
 end;
 
-function TPersistentObject.QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
+function TGLPersistentObject.QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
 begin
   if GetInterface(IID, Obj) then
     Result := S_OK
@@ -547,21 +546,21 @@ begin
     Result := E_NOINTERFACE;
 end;
 
-function TPersistentObject._AddRef: Integer; stdcall;
+function TGLPersistentObject._AddRef: Integer; stdcall;
 begin
   // ignore
   Result := 1;
 end;
 
-function TPersistentObject._Release: Integer; stdcall;
+function TGLPersistentObject._Release: Integer; stdcall;
 begin
   // ignore
   Result := 0;
 end;
 
-procedure TPersistentObject.SaveToStream(stream: TStream; writerClass: TVirtualWriterClass = nil);
+procedure TGLPersistentObject.SaveToStream(stream: TStream; writerClass: TVirtualWriterClass = nil);
 var
-  wr: TVirtualWriter;
+  wr: TGLVirtualWriter;
   fileSig: AnsiString;
 begin
   if writerClass = nil then
@@ -579,9 +578,9 @@ begin
   end;
 end;
 
-procedure TPersistentObject.LoadFromStream(stream: TStream; readerClass: TVirtualReaderClass = nil);
+procedure TGLPersistentObject.LoadFromStream(stream: TStream; readerClass: TVirtualReaderClass = nil);
 var
-  rd: TVirtualReader;
+  rd: TGLVirtualReader;
   sig: AnsiString;
 begin
   if readerClass = nil then
@@ -601,7 +600,7 @@ begin
   end;
 end;
 
-procedure TPersistentObject.SaveToFile(const fileName: string; writerClass: TVirtualWriterClass = nil);
+procedure TGLPersistentObject.SaveToFile(const fileName: string; writerClass: TVirtualWriterClass = nil);
 var
   fs: TStream;
 begin
@@ -615,7 +614,7 @@ begin
   end;
 end;
 
-procedure TPersistentObject.LoadFromFile(const fileName: string; readerClass: TVirtualReaderClass = nil);
+procedure TGLPersistentObject.LoadFromFile(const fileName: string; readerClass: TVirtualReaderClass = nil);
 var
   fs: TStream;
 begin
@@ -629,7 +628,7 @@ begin
   end;
 end;
 
-function TPersistentObject.SaveToString(writerClass: TVirtualWriterClass = nil): string;
+function TGLPersistentObject.SaveToString(writerClass: TVirtualWriterClass = nil): string;
 var
   ss: TStringStream;
 begin
@@ -642,7 +641,7 @@ begin
   end;
 end;
 
-procedure TPersistentObject.LoadFromString(const data: string; readerClass: TVirtualReaderClass = nil);
+procedure TGLPersistentObject.LoadFromString(const data: string; readerClass: TVirtualReaderClass = nil);
 var
   ss: TStringStream;
 begin
@@ -655,22 +654,22 @@ begin
 end;
 
 // ------------------
-// ------------------ TPersistentObjectList ------------------
+// ------------------ TGLPersistentObjectList ------------------
 // ------------------
 
-constructor TPersistentObjectList.Create;
+constructor TGLPersistentObjectList.Create;
 begin
   inherited Create;
   FGrowthDelta := cDefaultListGrowthDelta;
 end;
 
-destructor TPersistentObjectList.Destroy;
+destructor TGLPersistentObjectList.Destroy;
 begin
   Clear;
   inherited Destroy;
 end;
 
-function TPersistentObjectList.Add(const item: TObject): Integer;
+function TGLPersistentObjectList.Add(const item: TObject): Integer;
 begin
   Result := FCount;
   if Result = FCapacity then
@@ -679,7 +678,7 @@ begin
   Inc(FCount);
 end;
 
-procedure TPersistentObjectList.AddNils(nbVals: Cardinal);
+procedure TGLPersistentObjectList.AddNils(nbVals: Cardinal);
 begin
   if Integer(nbVals) + Count > Capacity then
     SetCapacity(Integer(nbVals) + Count);
@@ -687,7 +686,7 @@ begin
   FCount := FCount + Integer(nbVals);
 end;
 
-function TPersistentObjectList.AddObjects(const objectList: TPersistentObjectList): Integer;
+function TGLPersistentObjectList.AddObjects(const objectList: TGLPersistentObjectList): Integer;
 begin
   if Assigned(objectList) then
   begin
@@ -700,7 +699,7 @@ begin
     Result := 0;
 end;
 
-procedure TPersistentObjectList.RemoveObjects(const objectList: TPersistentObjectList);
+procedure TGLPersistentObjectList.RemoveObjects(const objectList: TGLPersistentObjectList);
 var
   i: Integer;
 begin
@@ -708,7 +707,7 @@ begin
     Remove(objectList[i]);
 end;
 
-procedure TPersistentObjectList.Clear;
+procedure TGLPersistentObjectList.Clear;
 begin
   if Assigned(Self) and Assigned(FList) then
   begin
@@ -717,7 +716,7 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.Delete(index: Integer);
+procedure TGLPersistentObjectList.Delete(index: Integer);
 begin
 {$IFOPT R+}
   if Cardinal(Index) >= Cardinal(FCount) then
@@ -728,7 +727,7 @@ begin
     System.Move(FList[index + 1], FList[index], (FCount - index) * SizeOf(TObject));
 end;
 
-procedure TPersistentObjectList.DeleteItems(index: Integer; nbVals: Cardinal);
+procedure TGLPersistentObjectList.DeleteItems(index: Integer; nbVals: Cardinal);
 begin
 {$IFOPT R+}
   Assert(Cardinal(index) < Cardinal(FCount));
@@ -745,10 +744,10 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.Exchange(index1, index2: Integer);
+procedure TGLPersistentObjectList.Exchange(index1, index2: Integer);
 var
   item: TObject;
-  locList: PPointerObjectList;
+  locList: PGLPointerObjectList;
 begin
 {$IFOPT R+}
   if (Cardinal(Index1) >= Cardinal(FCount)) or
@@ -761,14 +760,14 @@ begin
   locList^[index2] := item;
 end;
 
-function TPersistentObjectList.Expand: TPersistentObjectList;
+function TGLPersistentObjectList.Expand: TGLPersistentObjectList;
 begin
   if FCount = FCapacity then
     SetCapacity(FCapacity + FGrowthDelta);
   Result := Self;
 end;
 
-function TPersistentObjectList.GetFirst: TObject;
+function TGLPersistentObjectList.GetFirst: TObject;
 begin
 {$IFOPT R+}
   if Cardinal(FCount) = 0 then
@@ -777,7 +776,7 @@ begin
   Result := FList^[0];
 end;
 
-procedure TPersistentObjectList.SetFirst(item: TObject);
+procedure TGLPersistentObjectList.SetFirst(item: TObject);
 begin
 {$IFOPT R+}
   if Cardinal(FCount) = 0 then
@@ -786,12 +785,12 @@ begin
   FList^[0] := item;
 end;
 
-procedure TPersistentObjectList.Error;
+procedure TGLPersistentObjectList.Error;
 begin
   raise EListError.Create(strListIndexError);
 end;
 
-function TPersistentObjectList.Get(Index: Integer): TObject;
+function TGLPersistentObjectList.Get(Index: Integer): TObject;
 begin
 {$IFOPT R+}
   if Cardinal(Index) >= Cardinal(FCount) then
@@ -800,7 +799,7 @@ begin
   Result := FList^[Index];
 end;
 
-function TPersistentObjectList.IndexOf(Item: TObject): Integer;
+function TGLPersistentObjectList.IndexOf(Item: TObject): Integer;
 var
   I: Integer;
 begin
@@ -818,7 +817,7 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.Insert(index: Integer; item: TObject);
+procedure TGLPersistentObjectList.Insert(index: Integer; item: TObject);
 begin
 {$IFOPT R+}
   if Cardinal(index) > Cardinal(FCount) then
@@ -833,7 +832,7 @@ begin
   Inc(FCount);
 end;
 
-procedure TPersistentObjectList.InsertNils(index: Integer; nbVals: Cardinal);
+procedure TGLPersistentObjectList.InsertNils(index: Integer; nbVals: Cardinal);
 var
   nc: Integer;
 begin
@@ -853,7 +852,7 @@ begin
   end;
 end;
 
-function TPersistentObjectList.GetLast: TObject;
+function TGLPersistentObjectList.GetLast: TObject;
 begin
 {$IFOPT R+}
   if Cardinal(FCount) = 0 then
@@ -862,7 +861,7 @@ begin
   Result := FList^[FCount - 1];
 end;
 
-procedure TPersistentObjectList.SetLast(item: TObject);
+procedure TGLPersistentObjectList.SetLast(item: TObject);
 begin
 {$IFOPT R+}
   if Cardinal(FCount) = 0 then
@@ -871,7 +870,7 @@ begin
   FList^[FCount - 1] := item;
 end;
 
-procedure TPersistentObjectList.Move(CurIndex, NewIndex: Integer);
+procedure TGLPersistentObjectList.Move(CurIndex, NewIndex: Integer);
 var
   item: Pointer;
 begin
@@ -898,7 +897,7 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.Put(Index: Integer; Item: TObject);
+procedure TGLPersistentObjectList.Put(Index: Integer; Item: TObject);
 begin
 {$IFOPT R+}
   if Cardinal(Index) >= Cardinal(FCount) then
@@ -907,17 +906,17 @@ begin
   FList^[Index] := Item;
 end;
 
-function TPersistentObjectList.Remove(item: TObject): Integer;
+function TGLPersistentObjectList.Remove(item: TObject): Integer;
 begin
   Result := IndexOf(item);
   if Result >= 0 then
     Delete(Result);
 end;
 
-procedure TPersistentObjectList.Pack;
+procedure TGLPersistentObjectList.Pack;
 var
   i, j, n: Integer;
-  p: PPointerObjectList;
+  p: PGLPointerObjectList;
   pk: PObject;
 begin
   p := List;
@@ -944,7 +943,7 @@ begin
   SetCount(n + 1);
 end;
 
-procedure TPersistentObjectList.SetCapacity(newCapacity: Integer);
+procedure TGLPersistentObjectList.SetCapacity(newCapacity: Integer);
 begin
   if newCapacity <> FCapacity then
   begin
@@ -955,13 +954,13 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.RequiredCapacity(aCapacity: Integer);
+procedure TGLPersistentObjectList.RequiredCapacity(aCapacity: Integer);
 begin
   if FCapacity < aCapacity then
     SetCapacity(aCapacity);
 end;
 
-procedure TPersistentObjectList.SetCount(newCount: Integer);
+procedure TGLPersistentObjectList.SetCount(newCount: Integer);
 begin
   if newCount > FCapacity then
     SetCapacity(newCount);
@@ -970,7 +969,7 @@ begin
   FCount := NewCount;
 end;
 
-procedure TPersistentObjectList.DeleteAndFree(index: Integer);
+procedure TGLPersistentObjectList.DeleteAndFree(index: Integer);
 var
   obj: TObject;
 begin
@@ -979,7 +978,7 @@ begin
   obj.Free;
 end;
 
-procedure TPersistentObjectList.DeleteAndFreeItems(index: Integer; nbVals: Cardinal);
+procedure TGLPersistentObjectList.DeleteAndFreeItems(index: Integer; nbVals: Cardinal);
 var
   i, n: Integer;
 begin
@@ -994,7 +993,7 @@ begin
   DeleteItems(index, nbVals);
 end;
 
-function TPersistentObjectList.RemoveAndFree(item: TObject): Integer;
+function TGLPersistentObjectList.RemoveAndFree(item: TObject): Integer;
 begin
   Result := IndexOf(item);
   if Result >= 0 then
@@ -1004,7 +1003,7 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.DoClean;
+procedure TGLPersistentObjectList.DoClean;
 var
   i: Integer;
 begin
@@ -1018,13 +1017,13 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.Clean;
+procedure TGLPersistentObjectList.Clean;
 begin
   DoClean;
   Clear;
 end;
 
-procedure TPersistentObjectList.CleanFree;
+procedure TGLPersistentObjectList.CleanFree;
 begin
   if Self <> nil then
   begin
@@ -1033,7 +1032,7 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.WriteToFiler(writer: TVirtualWriter);
+procedure TGLPersistentObjectList.WriteToFiler(writer: TGLVirtualWriter);
 (*
    Object List Filer Format :
       Integer (Version)
@@ -1063,9 +1062,9 @@ begin
           WriteBoolean(False);
           WriteInteger(0);
         end
-        else if (FList^[i] is TPersistentObject) then
+        else if (FList^[i] is TGLPersistentObject) then
         begin
-          // yeah, a TPersistentObject
+          // yeah, a TGLPersistentObject
           aType := FList^[i].ClassType;
           objId := objTypes.IndexOf(aType);
           if objId < 0 then
@@ -1079,7 +1078,7 @@ begin
             // class already registered
             WriteInteger(objId);
           end;
-          TPersistentObject(FList^[i]).WriteToFiler(writer);
+          TGLPersistentObject(FList^[i]).WriteToFiler(writer);
         end
         else
         begin
@@ -1095,9 +1094,9 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.ReadFromFilerWithEvent(reader: TVirtualReader; afterSenderObjectCreated: TNotifyEvent);
+procedure TGLPersistentObjectList.ReadFromFilerWithEvent(reader: TGLVirtualReader; afterSenderObjectCreated: TNotifyEvent);
 var
-  obj: TPersistentObject;
+  obj: TGLPersistentObject;
   m: TPersistentObjectClass;
   version: integer;
   objTypes: TList;
@@ -1154,22 +1153,22 @@ begin
   end;
 end;
 
-procedure TPersistentObjectList.ReadFromFiler(reader: TVirtualReader);
+procedure TGLPersistentObjectList.ReadFromFiler(reader: TGLVirtualReader);
 begin
   ReadFromFilerWithEvent(reader, AfterObjectCreatedByReader);
 end;
 
-procedure TPersistentObjectList.AfterObjectCreatedByReader(Sender: TObject);
+procedure TGLPersistentObjectList.AfterObjectCreatedByReader(Sender: TObject);
 begin
   // nothing
 end;
 
-procedure TPersistentObjectList.Push(item: TObject);
+procedure TGLPersistentObjectList.Push(item: TObject);
 begin
   Add(item);
 end;
 
-function TPersistentObjectList.Pop: TObject;
+function TGLPersistentObjectList.Pop: TObject;
 begin
   if FCount > 0 then
   begin
@@ -1180,12 +1179,12 @@ begin
     Result := nil;
 end;
 
-procedure TPersistentObjectList.PopAndFree;
+procedure TGLPersistentObjectList.PopAndFree;
 begin
   Pop.Free;
 end;
 
-procedure POListQuickSort(SortList: PPointerObjectList; L, R: Integer;
+procedure POListQuickSort(SortList: PGLPointerObjectList; L, R: Integer;
   compareFunc: TObjectListSortCompare);
 var
   I, J: Integer;
@@ -1215,7 +1214,7 @@ begin
   until I >= R;
 end;
 
-procedure TPersistentObjectList.Sort(compareFunc: TObjectListSortCompare);
+procedure TGLPersistentObjectList.Sort(compareFunc: TObjectListSortCompare);
 begin
   if Count > 1 then
     POListQuickSort(FList, 0, Count - 1, compareFunc);
@@ -1805,6 +1804,6 @@ end;
 initialization
 // ------------------------------------------------------------------
 
-  RegisterClass(TPersistentObjectList);
+  RegisterClass(TGLPersistentObjectList);
 
 end.

+ 2 - 2
Source/GLS.PolygonTesselation.pas

@@ -24,7 +24,7 @@ uses
 
 (* Tesselates the polygon outlined by the Vertexes. And adds them to the first
    facegroup of the Mesh. *)
-procedure DoTesselate(Vertexes: TAffineVectorList; Mesh: TGLBaseMesh;
+procedure DoTesselate(Vertexes: TGLAffineVectorList; Mesh: TGLBaseMesh;
   normal: PAffineVector = nil; invertNormals: Boolean = False);
 
 //---------------------------------------------------------------------------
@@ -86,7 +86,7 @@ begin
   SetVector(PAffineVector(outData)^, coords[0], coords[1], coords[2]);
 end;
 
-procedure DoTesselate(Vertexes: TAffineVectorList; Mesh: TGLBaseMesh; normal: PAffineVector = nil; invertNormals: Boolean = False);
+procedure DoTesselate(Vertexes: TGLAffineVectorList; Mesh: TGLBaseMesh; normal: PAffineVector = nil; invertNormals: Boolean = False);
 var
   Tess: PGLUTesselator;
   i: Integer;

+ 26 - 26
Source/GLS.ROAMPatch.pas

@@ -66,10 +66,10 @@ type
   protected
     procedure SetHeightData(Val: TGLHeightData);
     procedure SetOcclusionSkip(Val: Integer);
-    procedure RenderROAM(Vertices: TAffineVectorList;
-      VertexIndices: TIntegerList; TexCoords: TTexPointList);
-    procedure RenderAsStrips(Vertices: TAffineVectorList;
-      VertexIndices: TIntegerList; TexCoords: TTexPointList);
+    procedure RenderROAM(Vertices: TGLAffineVectorList;
+      VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList);
+    procedure RenderAsStrips(Vertices: TGLAffineVectorList;
+      VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList);
   public
     constructor Create;
     destructor Destroy; override;
@@ -89,19 +89,19 @@ type
       The lists are assumed to have enough capacity to allow AddNC calls
       (additions without capacity check). High-resolution renders use
       display lists, and are assumed to be made together. *)
-    procedure RenderHighRes(Vertices: TAffineVectorList;
-      VertexIndices: TIntegerList; TexCoords: TTexPointList; ForceROAM: Boolean);
+    procedure RenderHighRes(Vertices: TGLAffineVectorList;
+      VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList; ForceROAM: Boolean);
     (*  Render the patch by accumulating triangles.
       The lists are assumed to have enough capacity to allow AddNC calls
       (additions without capacity check).
       Once at least autoFlushVertexCount vertices have been accumulated,
       perform a FlushAccum *)
-    procedure RenderAccum(Vertices: TAffineVectorList;
-      VertexIndices: TIntegerList; TexCoords: TTexPointList;
+    procedure RenderAccum(Vertices: TGLAffineVectorList;
+      VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList;
       AutoFlushVertexCount: Integer);
     // Render all vertices accumulated in the arrays and set their count back to zero.
-    class procedure FlushAccum(Vertices: TAffineVectorList;
-      VertexIndices: TIntegerList; TexCoords: TTexPointList);
+    class procedure FlushAccum(Vertices: TGLAffineVectorList;
+      VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList);
     property HeightData: TGLHeightData read FHeightData write SetHeightData;
     property VertexScale: TAffineVector read FVertexScale write FVertexScale;
     property VertexOffset: TAffineVector read FVertexOffset write FVertexOffset;
@@ -130,7 +130,7 @@ type
 procedure SetROAMTrianglesCapacity(nb: Integer);
 function GetROAMTrianglesCapacity: Integer;
 //  Draw contours on rendering terrain patches
-procedure DrawContours(Vertices: TAffineVectorList; VertexIndices: TIntegerList;
+procedure DrawContours(Vertices: TGLAffineVectorList; VertexIndices: TGLIntegerList;
   ContourInterval: Integer; ContourWidth: Integer; DecVal: Integer);
 
 // ------------------------------------------------------------------
@@ -147,8 +147,8 @@ var
 
   RenderRaster: PSmallIntRaster;
   RenderIndices: PIntegerArray;
-  RenderVertices: TAffineVectorList;
-  RenderTexCoords: TTexPointList;
+  RenderVertices: TGLAffineVectorList;
+  RenderTexCoords: TGLTexPointList;
 
   TessMaxVariance: Cardinal;
   TessMaxDepth: Cardinal;
@@ -175,11 +175,11 @@ begin
   Result := vTriangleNodesCapacity;
 end;
 
-procedure DrawContours(Vertices: TAffineVectorList; VertexIndices: TIntegerList;
+procedure DrawContours(Vertices: TGLAffineVectorList; VertexIndices: TGLIntegerList;
   ContourInterval: Integer; ContourWidth: Integer; DecVal: Integer);
 var
   i: Integer;
-  Isolines: TAffineVectorList;
+  Isolines: TGLAffineVectorList;
   CurColor: TGLVector;
 
 begin
@@ -188,7 +188,7 @@ begin
     gl.PolygonOffset(1, 1);
     gl.Enable(GL_POLYGON_OFFSET_FILL);
     i := VertexIndices.Count - 3;
-    Isolines := TAffineVectorList.Create;
+    Isolines := TGLAffineVectorList.Create;
     while i >= 0 do
     begin
       TriangleElevationSegments(Vertices[VertexIndices[i]],
@@ -679,8 +679,8 @@ begin
   until not Fail;
 end;
 
-procedure TGLROAMPatch.RenderHighRes(Vertices: TAffineVectorList;
-  VertexIndices: TIntegerList; TexCoords: TTexPointList; ForceROAM: Boolean);
+procedure TGLROAMPatch.RenderHighRes(Vertices: TGLAffineVectorList;
+  VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList; ForceROAM: Boolean);
 
 var
   Primitive: Cardinal;
@@ -726,8 +726,8 @@ begin
   gl.CallList(FListHandle.Handle);
 end;
 
-procedure TGLROAMPatch.RenderAccum(Vertices: TAffineVectorList;
-  VertexIndices: TIntegerList; TexCoords: TTexPointList;
+procedure TGLROAMPatch.RenderAccum(Vertices: TGLAffineVectorList;
+  VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList;
   AutoFlushVertexCount: Integer);
 var
   OcclusionPassed: Boolean;
@@ -777,8 +777,8 @@ begin
     FTriangleCount := 0;
 end;
 
-class procedure TGLROAMPatch.FlushAccum(Vertices: TAffineVectorList;
-  VertexIndices: TIntegerList; TexCoords: TTexPointList);
+class procedure TGLROAMPatch.FlushAccum(Vertices: TGLAffineVectorList;
+  VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList);
 begin
   if VertexIndices.Count = 0 then
     Exit;
@@ -841,8 +841,8 @@ begin
   end;
 end;
 
-procedure TGLROAMPatch.RenderROAM(Vertices: TAffineVectorList;
-  VertexIndices: TIntegerList; TexCoords: TTexPointList);
+procedure TGLROAMPatch.RenderROAM(Vertices: TGLAffineVectorList;
+  VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList);
 
   procedure ROAMRenderPoint(var p: TROAMRenderPoint; anX, anY: Integer);
   begin
@@ -875,8 +875,8 @@ begin
   VertexIndices.Count := (Cardinal(RenderIndices) - Cardinal(VertexIndices.List)) div SizeOf(Integer);
 end;
 
-procedure TGLROAMPatch.RenderAsStrips(Vertices: TAffineVectorList;
-  VertexIndices: TIntegerList; TexCoords: TTexPointList);
+procedure TGLROAMPatch.RenderAsStrips(Vertices: TGLAffineVectorList;
+  VertexIndices: TGLIntegerList; TexCoords: TGLTexPointList);
 
 var
   X, Y, baseTop, rowLength: Integer;

+ 16 - 16
Source/GLS.Ragdoll.pas

@@ -24,7 +24,7 @@ type
   TGLRagdolJoint = class
   end;
 
-  TGLRagdolBoneList = class(TPersistentObjectList)
+  TGLRagdolBoneList = class(TGLPersistentObjectList)
   private
     FRagdoll: TGLRagdoll;
   protected
@@ -32,8 +32,8 @@ type
   public
     constructor Create(Ragdoll: TGLRagdoll); reintroduce;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     property Ragdoll: TGLRagdoll read FRagdoll;
     property Items[Index: Integer]: TGLRagdolBone read GetRagdollBone; default;
   end;
@@ -74,8 +74,8 @@ type
     constructor CreateOwned(aOwner: TGLRagdolBoneList);
     constructor Create(Ragdoll: TGLRagdoll);
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     property Owner: TGLRagdolBoneList read FOwner;
     property Name: String read FName write FName;
     property BoneID: Integer read FBoneID write FBoneID;
@@ -88,7 +88,7 @@ type
     property Items[Index: Integer]: TGLRagdolBone read GetRagdollBone; default;
   end;
 
-  TGLRagdoll = class(TPersistentObject)
+  TGLRagdoll = class(TGLPersistentObject)
   private
     FOwner: TGLBaseMesh;
     FRootBone: TGLRagdolBone;
@@ -97,8 +97,8 @@ type
   public
     constructor Create(aOwner: TGLBaseMesh); reintroduce;
     destructor Destroy; override;
-    procedure WriteToFiler(writer: TVirtualWriter); override;
-    procedure ReadFromFiler(reader: TVirtualReader); override;
+    procedure WriteToFiler(writer: TGLVirtualWriter); override;
+    procedure ReadFromFiler(reader: TGLVirtualReader); override;
     // Must be set before build the ragdoll
     procedure SetRootBone(RootBone: TGLRagdolBone);
     // Create the bounding box and setup the ragdoll do be started later
@@ -140,13 +140,13 @@ begin
   Result := TGLRagdolBone(List^[Index]);
 end;
 
-procedure TGLRagdolBoneList.ReadFromFiler(reader: TVirtualReader);
+procedure TGLRagdolBoneList.ReadFromFiler(reader: TGLVirtualReader);
 begin
   inherited;
   // Not implemented
 end;
 
-procedure TGLRagdolBoneList.WriteToFiler(writer: TVirtualWriter);
+procedure TGLRagdolBoneList.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited;
   // Not implemented
@@ -165,14 +165,14 @@ procedure TGLRagdolBone.CreateBoundingBox;
 var
   bone: TGLSkeletonBone;
   i, j: Integer;
-  BoneVertices: TAffineVectorList;
+  BoneVertices: TGLAffineVectorList;
   BoneVertex, max, min: TAffineVector;
   invMat, mat: TGLMatrix;
 begin
   bone := Ragdoll.Owner.Skeleton.BoneByID(FBoneID);
 
   // Get all vertices weighted to this bone
-  BoneVertices := TAffineVectorList.Create;
+  BoneVertices := TGLAffineVectorList.Create;
   for i := 0 to Ragdoll.Owner.MeshObjects.Count - 1 do
     with TGLSkeletonMeshObject(Ragdoll.Owner.MeshObjects[i]) do
       for j := 0 to Vertices.Count - 1 do
@@ -280,7 +280,7 @@ begin
   Result := TGLRagdolBone(List^[Index]);
 end;
 
-procedure TGLRagdolBone.ReadFromFiler(reader: TVirtualReader);
+procedure TGLRagdolBone.ReadFromFiler(reader: TGLVirtualReader);
 begin
   inherited;
 
@@ -306,7 +306,7 @@ begin
     Items[i].UpdateChild;
 end;
 
-procedure TGLRagdolBone.WriteToFiler(writer: TVirtualWriter);
+procedure TGLRagdolBone.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited;
 end;
@@ -361,7 +361,7 @@ begin
   inherited Destroy;
 end;
 
-procedure TGLRagdoll.ReadFromFiler(reader: TVirtualReader);
+procedure TGLRagdoll.ReadFromFiler(reader: TGLVirtualReader);
 begin
   inherited;
 end;
@@ -405,7 +405,7 @@ begin
   FOwner.Skeleton.MorphMesh(True);
 end;
 
-procedure TGLRagdoll.WriteToFiler(writer: TVirtualWriter);
+procedure TGLRagdoll.WriteToFiler(writer: TGLVirtualWriter);
 begin
   inherited;
 

+ 39 - 34
Source/GLS.RandomHDS.pas

@@ -1,7 +1,6 @@
 //
 // The graphics rendering engine GLScene http://glscene.org
 //
-
 unit GLS.RandomHDS;
 
 (*
@@ -266,8 +265,8 @@ type
       and sea steps. *)
     procedure BuildLandscape;
     (* - Compute the light effects
-      - Compute the casted shadows
-      - Perform a basic smoothing if TextureScale>1 *)
+       - Compute the casted shadows
+       - Perform a basic smoothing if TextureScale>1 *)
     procedure BuildLightMap; overload;
     procedure BuildLightMap(const aLightDirection: TGLVector); overload;
     // Normals are needed for lighting and slope-based textures
@@ -298,7 +297,10 @@ type
       though. Some tweaking may be needed *)
     procedure DoErosionByLife;
     (* Create sharp valleys and canyons. If DepositRate>0, it will also fill the
-      low pools, producing flat "lakes" and "ponds" *)
+      low pools, producing flat "lakes" and "ponds".
+      Drop some rain on every cell of the landscape and let it run downward,
+      taking soil on its way. When it arrives into a pool,
+      let it deposit all that has been eroded *)
     procedure DoErosionByRain;
     // Create a beach and a cliff around the islands
     procedure DoErosionBySea;
@@ -386,10 +388,11 @@ type
   TGLLandTile = TGLCustomRandomHDS;
 
   TRelativeCoordinate = record
-    DX, DZ: integer 
+    DX, DZ: integer
   end;
   TOnCreateLandTile =  procedure(x, z, Seed: integer; var aLandscape: TGLLandTile) of object;
   TIsDefaultTile =  function(X, Z: integer): boolean of object;
+
   TGLTiledRndLandscape = class(TGLBaseRandomHDS)
   private 
     FLandTileComputing: boolean; // Is a landtile being computed?
@@ -500,12 +503,12 @@ type
       a unique seed for each landtile *)
     property ExtentX: integer read FExtentX write SetExtentX;
     property ExtentZ: integer read FExtentZ write SetExtentZ;
-    { Distance at which a new landtile begin to be built. Increasing this value
-      allows for a higher camera speed but it will also increase the memory requirements. }
+    (* Distance at which a new landtile begin to be built. Increasing this value
+      allows for a higher camera speed but it will also increase the memory requirements. *)
     property GenerationRadius: integer read FGenerationRadius write SetGenerationRadius;
     // Number of landtile to keep in memory. Should not be modified.
     property LandTileCapacity: integer read FLandTileCapacity write SetLandTileCapacity;
-    // Probability that a given landtile is non-default 
+    // Probability that a given landtile is non-default
     property LandTileDensity: single read FLandTileDensity write SetLandTileDensity;
     // Base seed for the entire archipelago
     property Seed: integer read FSeed write SetSeed;
@@ -559,7 +562,7 @@ type
     // Ranges for the roughness parameter in the fractal algorithm 
     property RoughnessMax: single read FRoughnessMax write SetRoughnessMax;
     property RoughnessMin: single read FRoughnessMin write SetRoughnessMin;
-    // If true, the sea will show dynamic waves. Slow. 
+    // If true, the sea will show dynamic waves. Slow.
     property SeaDynamic: boolean read FSeaDynamic write SetSeaDynamic;
     (* Reference to a material in the TerrainRenderer's material library. This
       material will be used to drape the water plane. *)
@@ -847,9 +850,9 @@ begin
   FTextureScale := Value;
 end;
 
-//
+// ----------------------------------------------
 // TGLCustomRandomHDS
-//
+// ----------------------------------------------
 procedure TGLCustomRandomHDS.BoundaryClamp(var x, y: single);
 begin
   ClampValue(x, 0, FSize);
@@ -930,8 +933,8 @@ begin
   if FLandCover then
     BuildTexture;
 
-  { Free memory. If you need often to recompute texture, you may want to keep
-    one or both maps, providing the heightfield or the light source have not changed. }
+  (* Free memory. If you need often to recompute texture, you may want to keep
+    one or both maps, providing the heightfield or the light source have not changed. *)
   if not FKeepNormals then
     FNormal := nil;
   FLightMap := nil;
@@ -962,7 +965,7 @@ begin
   NormalizeVector(l);
   NegateVector(l);
 
-  { Compute lighting }
+  // Compute lighting
   for i := 0 to FSize do
   begin
     FTaskProgress := Round(i / FSize * 100);
@@ -977,7 +980,7 @@ begin
     end; // for
   end; // for i
 
-  { Shadows }
+  // Shadows
   if FShadows then
   begin
     FTask := 'Shadow casting';
@@ -1013,7 +1016,7 @@ begin
     end; // for i
   end; // if
 
-  { Smoothing }
+  // Smoothing
   if FLightSmoothing then
   begin
     FTask := 'Light-map smoothing';
@@ -1254,9 +1257,10 @@ end; // *)
   fTask:='Texture creation';
   fTaskProgress:=0;
 
-  {Draw bitmap}
+  //Draw bitmap
   try
-  with Bmp do begin
+  with Bmp do
+  begin
   PixelFormat:=pf24bit;
   Width:=fSize*TextureScale;
   Height:=fSize*TextureScale;
@@ -1264,7 +1268,8 @@ end; // *)
   for y:=0 to fSize*TextureScale-1 do begin
   fTaskProgress:=Round(y/(fSize*TextureScale)*100);
   Application.ProcessMessages;
-  for x:=0 to fSize*TextureScale-1 do begin
+  for x:=0 to fSize*TextureScale-1 do
+  begin
   i:=x div TextureScale;
   j:=y div TextureScale;
   z:=Interpolate(x/TextureScale,y/TextureScale);
@@ -1283,8 +1288,9 @@ end; // *)
   end;//with
   //Bmp.SaveToFile('test.bmp');
 
-  {Use it as texture}
-  with Mat.Material.Texture do begin
+  // Use it as texture
+  with Mat.Material.Texture do
+  begin
   Image.Assign(Bmp);
   Image.NotifyChange(Self);
   Enabled:=true;
@@ -1400,7 +1406,7 @@ var
   x, y, i: integer;
   z, z1: single;
 begin
-  { Smoothing by a 3-by-3 mean filter }
+  // Smoothing by a 3-by-3 mean filter
   FTask := 'Erosion by life';
   FTaskProgress := 0;
   for y := 0 to FSize do
@@ -1422,8 +1428,6 @@ begin
 end;
 
 procedure TGLCustomRandomHDS.DoErosionByRain;
-{ Drop some rain on every cell of the landscape and let it run downward, taking soil
-  on its way. When it arrives into a pool, let it deposit all that has been eroded. }
 const
   Ks = 0.001; // Soil solubility
 var
@@ -1445,7 +1449,7 @@ begin
   MinZ := 0;
   Next := 0;
 
-  { Rain }
+  // Rain
   for y0 := 0 to FSize do
   begin
     FTaskProgress := Round(y0 / (FSize) * 100);
@@ -1530,7 +1534,7 @@ end; // *)
   dz,mindz	:single;
   begin
   c:=1/VSF/sqrt(sqr(Scale.X)+sqr(Scale.Z));
-  {Water flow map computation}
+  // Water flow map computation
   SetLength(Flow,fSize+1,fSize+1);
   for y:=0 to fSize do begin
   for x:=0 to fSize do begin
@@ -1568,7 +1572,7 @@ end; // *)
   end;//for
   From:=0;
 
-  {Rain}
+  //Rain
   for y0:=0 to fSize do begin
   for x0:=0 to fSize do begin
   x:=x0;
@@ -1591,7 +1595,7 @@ end; // *)
   end;//for x0
   end;//for y0
 
-  {Apply erosion}
+  //Apply erosion
   for y:=0 to fSize do begin
   for x:=0 to fSize do begin
   //fHeight[x,y]:=fHeight[x,y]+Flow[x,y].Erosion*0.002*Intensity*fRangeHeight;
@@ -1620,7 +1624,7 @@ end; // *)
   SetLength(Erosion,fSize+2,fSize+2);
   for y:=0 to fSize+1 do for x:=0 to fSize+1 do Erosion[x,y]:=0;
 
-  {Erosion computation}
+  //Erosion computation
   for y:=0 to fSize+1 do begin
   for x:=0 to fSize+1 do begin
   z:=fHeight[x,y];
@@ -1654,7 +1658,7 @@ end; // *)
   end;//for x
   end;//for y
 
-  {Apply erosion to each cell}
+  //Apply erosion to each cell
   for y:=0 to fSize do begin
   for x:=0 to fSize do begin
   fHeight[x,y]:=fHeight[x,y]+Erosion[x,y]*0.005*Intensity*fRangeHeight;
@@ -1682,7 +1686,7 @@ end; // *)
   for i:=1 to 1 do begin
   //for y:=0 to fSize+1 do for x:=0 to fSize+1 do Erosion[x,y]:=0;
 
-  {Erosion computation}
+  //Erosion computation
   for y:=5 to fSize-4 do begin
   for x:=5 to fSize-4 do begin
   z:=fHeight[x,y];
@@ -1704,7 +1708,7 @@ end; // *)
   end;//for x
   end;//for y
 
-  {Apply erosion to each cell}
+  //Apply erosion to each cell
   for y:=0 to fSize do begin
   for x:=0 to fSize do begin
   fHeight[x,y]:=fHeight[x,y]+Erosion[x,y]*100*Intensity;
@@ -1967,8 +1971,9 @@ begin
   FKeepNormals := Value;
 end;
 
-{ TGLFractalHDS }
-
+// --------------------------------------
+// TGLFractalHDS
+// --------------------------------------
 procedure TGLFractalHDS.BuildHeightField(const aDepth, aSeed, aAmplitude: integer);
 begin
   fDepth := aDepth;

+ 2 - 2
Source/GLS.RenderContextInfo.pas

@@ -88,8 +88,8 @@ type
     IgnoreBlendingRequests: Boolean;
     IgnoreDepthRequests: Boolean;
     Amalgamating: Boolean;
-    Lights: TPersistentObjectList;
-    AfterRenderEffects: TPersistentObjectList;
+    Lights: TGLPersistentObjectList;
+    AfterRenderEffects: TGLPersistentObjectList;
     CurrentMaterialLevel: TGLMaterialLevel;
     PrimitiveMask: TGLMeshPrimitives;
     OrderCounter: Integer;

+ 16 - 16
Source/GLS.Scene.pas

@@ -55,8 +55,8 @@ type
 
 const
   cDefaultProxyOptions = [pooEffects, pooObjects, pooTransformation];
-  GLSCENE_REVISION = '$Revision: 2021$';
-  GLSCENE_VERSION = 'v2.1 %s';
+  GLSCENE_REVISION = '$Revision: 2022$';
+  GLSCENE_VERSION = 'v2.2 %s';
 
 type
 
@@ -171,7 +171,7 @@ type
     FBoundingBoxPersonalUnscaled: THmgBoundingBox;
     FBoundingBoxOfChildren: THmgBoundingBox;
     FBoundingBoxIncludingChildren: THmgBoundingBox;
-    FChildren: TPersistentObjectList; // created on 1st use
+    FChildren: TGLPersistentObjectList; // created on 1st use
     FVisible: Boolean;
     FUpdateCount: Integer;
     FShowAxes: Boolean;
@@ -188,8 +188,8 @@ type
     FTagObject: TObject;
     FTagFloat: Single;
 
-    objList: TPersistentObjectList;
-    distList: TSingleList;
+    objList: TGLPersistentObjectList;
+    distList: TGLSingleList;
     ///  FOriginalFiler: TFiler;   //used to allow persistent events in behaviours & effects
     (* If somebody could look at DefineProperties, ReadBehaviours, ReadEffects
      and verify code is safe to use then it could be uncommented *)
@@ -1139,7 +1139,7 @@ type
     FUpdateCount: Integer;
     FObjects: TGLSceneRootObject;
     FBaseContext: TGLContext; //reference, not owned!
-    FLights, FBuffers: TPersistentObjectList;
+    FLights, FBuffers: TGLPersistentObjectList;
     FCurrentGLCamera: TGLCamera;
     FCurrentBuffer: TGLSceneBuffer;
     FObjectsSorting: TGLObjectsSorting;
@@ -1195,7 +1195,7 @@ type
     // Load the scene from a text files. See LoadFromFile for details.
     procedure LoadFromTextFile(const fileName: string);
     property CurrentGLCamera: TGLCamera read FCurrentGLCamera;
-    property Lights: TPersistentObjectList read FLights;
+    property Lights: TGLPersistentObjectList read FLights;
     property Objects: TGLSceneRootObject read FObjects;
     property CurrentBuffer: TGLSceneBuffer read FCurrentBuffer;
     (* List of objects that request to be initialized when rendering context is active.
@@ -1274,7 +1274,7 @@ type
     // Internal state
     FRendering: Boolean;
     FRenderingContext: TGLContext;
-    FAfterRenderEffects: TPersistentObjectList;
+    FAfterRenderEffects: TGLPersistentObjectList;
     FViewMatrixStack: array of TGLMatrix;
     FProjectionMatrixStack: array of TGLMatrix;
     FBaseProjectionMatrix: TGLMatrix;
@@ -1887,14 +1887,14 @@ begin
   FPickable := True;
   FObjectsSorting := osInherited;
   FVisibilityCulling := vcInherited;
-  FChildren := TPersistentObjectList.Create;
+  FChildren := TGLPersistentObjectList.Create;
 
   fBBChanges := [oBBcChild, oBBcStructure];
   FBoundingBoxPersonalUnscaled := NullBoundingBox;
   FBoundingBoxOfChildren := NullBoundingBox;
   FBoundingBoxIncludingChildren := NullBoundingBox;
-  distList := TSingleList.Create;
-  objList := TPersistentObjectList.Create;
+  distList := TGLSingleList.Create;
+  objList := TGLPersistentObjectList.Create;
 end;
 
 constructor TGLBaseSceneObject.CreateAsChild(aParentOwner: TGLBaseSceneObject);
@@ -3249,7 +3249,7 @@ end;
 procedure TGLBaseSceneObject.RecTransformationChanged;
 var
   i: Integer;
-  list: PPointerObjectList;
+  list: PGLPointerObjectList;
   matSet: TGLObjectChanges;
 begin
   matSet := [ocAbsoluteMatrix, ocInvAbsoluteMatrix];
@@ -3742,7 +3742,7 @@ procedure TGLBaseSceneObject.RenderChildren(firstChildIndex, lastChildIndex:
 var
   i: Integer;
 
-  plist: PPointerObjectList;
+  plist: PGLPointerObjectList;
   obj: TGLBaseSceneObject;
   oldSorting: TGLObjectsSorting;
   oldCulling: TGLVisibilityCulling;
@@ -5586,7 +5586,7 @@ begin
   FCurrentBuffer := nil;
   FObjects := TGLSceneRootObject.Create(Self);
   FObjects.Name := 'ObjectRoot';
-  FLights := TPersistentObjectList.Create;
+  FLights := TGLPersistentObjectList.Create;
   FObjectsSorting := osRenderBlendedLast;
   FVisibilityCulling := vcNone;
   // actual maximum number of lights is stored in TGLSceneViewer
@@ -5666,7 +5666,7 @@ end;
 procedure TGLScene.AddBuffer(aBuffer: TGLSceneBuffer);
 begin
   if not Assigned(FBuffers) then
-    FBuffers := TPersistentObjectList.Create;
+    FBuffers := TGLPersistentObjectList.Create;
   if FBuffers.IndexOf(aBuffer) < 0 then
   begin
     FBuffers.Add(aBuffer);
@@ -6200,7 +6200,7 @@ begin
   FShadeModel := smDefault;
   FFogEnable := False;
   FLayer := clMainPlane;
-  FAfterRenderEffects := TPersistentObjectList.Create;
+  FAfterRenderEffects := TGLPersistentObjectList.Create;
   FContextOptions := [roDoubleBuffer, roRenderToWindow, roDebugContext];
   ResetPerformanceMonitor;
 end;

+ 11 - 12
Source/GLS.Screen.pas

@@ -23,18 +23,18 @@ type
   TResolution = 0 .. MaxVideoModes;
 
   // window attributes
-  TWindowAttribute = (woDesktop, woStayOnTop, woTransparent);
-  TWindowAttributes = set of TWindowAttribute;
+  TGLWindowAttribute = (woDesktop, woStayOnTop, woTransparent);
+  TGLWindowAttributes = set of TGLWindowAttribute;
 
   // window-to-screen fitting
-  TWindowFitting = (wfDefault, wfFitWindowToScreen, wfFitScreenToWindow);
+  TGLWindowFitting = (wfDefault, wfFitWindowToScreen, wfFitScreenToWindow);
 
   TGLDisplayOptions = class(TPersistent)
   private
     FFullScreen: Boolean;
     FScreenResolution: TResolution;
-    FWindowAttributes: TWindowAttributes;
-    FWindowFitting: TWindowFitting;
+    FWindowAttributes: TGLWindowAttributes;
+    FWindowFitting: TGLWindowFitting;
   public
     procedure Assign(Source: TPersistent); override;
   published
@@ -42,21 +42,20 @@ type
       default False;
     property ScreenResolution: TResolution read FScreenResolution
       write FScreenResolution default 0;
-    property WindowAttributes: TWindowAttributes read FWindowAttributes
+    property WindowAttributes: TGLWindowAttributes read FWindowAttributes
       write FWindowAttributes default [];
-    property WindowFitting: TWindowFitting read FWindowFitting
+    property WindowFitting: TGLWindowFitting read FWindowFitting
       write FWindowFitting default wfDefault;
   end;
 
-  TVideoMode = packed record
+  TGLVideoMode = packed record
     Width: Word;
     Height: Word;
     ColorDepth: Byte;
     MaxFrequency: Byte;
     Description: String;
   end;
-
-  PVideoMode = ^TVideoMode;
+  PGLVideoMode = ^TGLVideoMode;
 
 function GetIndexFromResolution(XRes, YRes, BPP: Integer): TResolution;
 procedure ReadVideoModes;
@@ -78,7 +77,7 @@ function GLGetScreenHeight: Integer;
 var
   vNumberVideoModes: Integer = 0;
   vCurrentVideoMode: Integer = 0;
-  vVideoModes: array of TVideoMode;
+  vVideoModes: array of TGLVideoMode;
 
 // ------------------------------------------------------------------------------
 implementation
@@ -157,7 +156,7 @@ procedure TryToAddToList(deviceMode: TDevMode);
 // Adds a video mode to the list if it's not a duplicate and can actually be set.
 var
   I: Integer;
-  vm: PVideoMode;
+  vm: PGLVideoMode;
 begin
   // See if this is a duplicate mode (can happen because of refresh
   // rates, or because we explicitly try all the low-res modes)

+ 1 - 1
Source/GLS.Selection.pas

@@ -38,7 +38,7 @@ type
 
   (* List class for object picking.
      This list is used to store the results of a PickObjects call. *)
-  TGLPickList = class(TPersistentObjectList)
+  TGLPickList = class(TGLPersistentObjectList)
   private
     function GetFar(aValue: Integer): Single;
     function GetHit(aValue: Integer): TObject;

+ 2 - 2
Source/GLS.ShadowVolume.pas

@@ -119,7 +119,7 @@ type
   // Specifies an individual shadow casting light.
   TGLShadowVolumeLight = class(TGLShadowVolumeCaster)
   private
-    FSilhouettes: TPersistentObjectList;
+    FSilhouettes: TGLPersistentObjectList;
   protected
     function GetLightSource: TGLLightSource;
     procedure SetLightSource(const ls: TGLLightSource);
@@ -326,7 +326,7 @@ end;
 constructor TGLShadowVolumeLight.Create(ACollection: TCollection);
 begin
   inherited Create(ACollection);
-  FSilhouettes := TPersistentObjectList.Create;
+  FSilhouettes := TGLPersistentObjectList.Create;
 end;
 
 destructor TGLShadowVolumeLight.Destroy;

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác