Ver Fonte

Upgraded

GLScene há 3 anos atrás
pai
commit
806c2cec86
100 ficheiros alterados com 2387 adições e 2118 exclusões
  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;
 	TGLVector sbp, sbr;
 
 
 	if (WakeVertices == NULL) {
 	if (WakeVertices == NULL) {
-		WakeVertices = new TAffineVectorList();
-		WakeStretch = new TAffineVectorList();
+		WakeVertices = new TGLAffineVectorList();
+		WakeStretch = new TGLAffineVectorList();
 		WakeTime = new TSingleList();
 		WakeTime = new TSingleList();
 	}
 	}
 
 

+ 2 - 2
AdvDemos/Archipelago/fArchipelagoC.h

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

+ 4 - 4
AdvDemos/Archipelago/fArchipelagoD.pas

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

+ 2 - 2
AdvDemos/Forest/fForestD.pas

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

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

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

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

@@ -13,7 +13,6 @@ uses
   Vcl.StdCtrls,
   Vcl.StdCtrls,
   Vcl.ComCtrls,
   Vcl.ComCtrls,
 
 
-  
   GLS.Keyboard,
   GLS.Keyboard,
   GLS.VectorGeometry,
   GLS.VectorGeometry,
   GLS.Scene,
   GLS.Scene,
@@ -24,7 +23,7 @@ uses
   GLS.Cadencer,
   GLS.Cadencer,
   GLS.Navigator,
   GLS.Navigator,
   GLS.GeomObjects,
   GLS.GeomObjects,
- 
+
   GLS.Coordinates,
   GLS.Coordinates,
   GLS.Utils,
   GLS.Utils,
   GLS.BaseClasses,
   GLS.BaseClasses,
@@ -55,18 +54,18 @@ type
     Lines1: TGLLines;
     Lines1: TGLLines;
     LabelFPS: TLabel;
     LabelFPS: TLabel;
     procedure FormCreate(Sender: TObject);
     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 Timer1Timer(Sender: TObject);
     procedure Button1Click(Sender: TObject);
     procedure Button1Click(Sender: TObject);
   private
   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
   public
-     
-    mousex, mousey: integer;
+
+    mousex, mousey: Integer;
   end;
   end;
 
 
 var
 var
@@ -78,112 +77,131 @@ implementation
 
 
 procedure TFormBoxedin.FormCreate(Sender: TObject);
 procedure TFormBoxedin.FormCreate(Sender: TObject);
 begin
 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;
 end;
 
 
-procedure TFormBoxedin.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
+procedure TFormBoxedin.GLCadencer1Progress(Sender: TObject;
+  const deltaTime, newTime: Double);
 var
 var
-   rayStart, rayVector : TGLVector;
-   velocity : Single;
-   pPoint : TGLVector;
-   pNormal : TGLVector;
-   t : Int64;
+  rayStart, rayVector: TGLVector;
+  velocity: Single;
+  pPoint: TGLVector;
+  pNormal: TGLVector;
+  t: Int64;
 begin
 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;
-   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;
 end;
 
 
-procedure TFormBoxedin.AddToTrail(const p : TGLVector);
+procedure TFormBoxedin.AddToTrail(const p: TGLVector);
 var
 var
-   i, k : Integer;
+  i, k: Integer;
 begin
 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;
 end;
 
 
 procedure TFormBoxedin.Timer1Timer(Sender: TObject);
 procedure TFormBoxedin.Timer1Timer(Sender: TObject);
 var
 var
-   t : Single;
+  t: Single;
 begin
 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;
   GLSceneViewer2.ResetPerformanceMonitor;
-   colTotalTime:=0;
-   colCount:=0;
+  colTotalTime := 0;
+  colCount := 0;
 end;
 end;
 
 
 procedure TFormBoxedin.Button1Click(Sender: TObject);
 procedure TFormBoxedin.Button1Click(Sender: TObject);
 begin
 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;
 
 
 end.
 end.

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

@@ -2,35 +2,42 @@ object Form1: TForm1
   Left = 0
   Left = 0
   Top = 0
   Top = 0
   Caption = 'Tentacles'
   Caption = 'Tentacles'
-  ClientHeight = 373
-  ClientWidth = 541
+  ClientHeight = 466
+  ClientWidth = 676
   Color = clBtnFace
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Color = clWindowText
-  Font.Height = -11
+  Font.Height = -14
   Font.Name = 'Tahoma'
   Font.Name = 'Tahoma'
   Font.Style = []
   Font.Style = []
-  OldCreateOrder = False
   OnCreate = FormCreate
   OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
+  PixelsPerInch = 120
+  TextHeight = 17
   object GLSceneViewer1: TGLSceneViewer
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     Left = 0
     Top = 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
     Camera = GLCamera1
     Buffer.BackgroundColor = clBlack
     Buffer.BackgroundColor = clBlack
-    FieldOfView = 149.984252929687500000
+    FieldOfView = 155.776901245117200000
     PenAsTouch = False
     PenAsTouch = False
     Align = alClient
     Align = alClient
     TabOrder = 0
     TabOrder = 0
   end
   end
   object PanelFPS: TPanel
   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'
     Caption = 'FPS'
     TabOrder = 1
     TabOrder = 1
   end
   end

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

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

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

@@ -222,14 +222,14 @@ procedure TForm1.DOOceanPlaneRender(Sender: TObject;
   var rci: TGLRenderContextInfo);
   var rci: TGLRenderContextInfo);
 var
 var
   x, y: Integer;
   x, y: Integer;
-  v: TTexPointList;
+  v: TGLTexPointList;
   cont: Boolean;
   cont: Boolean;
 begin
 begin
   GLUserShader1DoApply(Self, rci);
   GLUserShader1DoApply(Self, rci);
   gl.EnableClientState(GL_VERTEX_ARRAY);
   gl.EnableClientState(GL_VERTEX_ARRAY);
   if not Assigned(vbo) then
   if not Assigned(vbo) then
   begin
   begin
-    v := TTexPointList.Create;
+    v := TGLTexPointList.Create;
     v.Capacity := Sqr(cExtent + 1);
     v.Capacity := Sqr(cExtent + 1);
     y := -cExtent;
     y := -cExtent;
     while y < cExtent do
     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;
    int i;
    float f, a, ab, ca, sa;
    float f, a, ab, ca, sa;
-   TAffineVectorList *p;
+   TGLAffineVectorList *p;
    TAffineVector *v;
    TAffineVector *v;
 
 
-   p = new TAffineVectorList;
+   p = new TGLAffineVectorList;
    v = new TAffineVector;
    v = new TAffineVector;
 
 
    if (CBAnimate->Checked)
    if (CBAnimate->Checked)

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

@@ -2,26 +2,29 @@ object Form1: TForm1
   Left = 0
   Left = 0
   Top = 0
   Top = 0
   Caption = 'Points'
   Caption = 'Points'
-  ClientHeight = 413
-  ClientWidth = 487
+  ClientHeight = 516
+  ClientWidth = 609
   Color = clBtnFace
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Color = clWindowText
-  Font.Height = -10
+  Font.Height = -13
   Font.Name = 'Tahoma'
   Font.Name = 'Tahoma'
   Font.Style = []
   Font.Style = []
-  OldCreateOrder = False
   OnCreate = FormCreate
   OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 12
+  PixelsPerInch = 120
+  TextHeight = 16
   object GLSceneViewer1: TGLSceneViewer
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     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
     Camera = GLCamera1
     Buffer.BackgroundColor = clTeal
     Buffer.BackgroundColor = clTeal
-    FieldOfView = 151.237213134765600000
+    FieldOfView = 156.792495727539100000
     PenAsTouch = False
     PenAsTouch = False
     Align = alClient
     Align = alClient
     OnMouseDown = GLSceneViewer1MouseDown
     OnMouseDown = GLSceneViewer1MouseDown
@@ -31,22 +34,34 @@ object Form1: TForm1
   object Panel1: TPanel
   object Panel1: TPanel
     Left = 0
     Left = 0
     Top = 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
     Align = alTop
     TabOrder = 1
     TabOrder = 1
     object LabelFPS: TLabel
     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'
       Caption = 'FPS'
     end
     end
     object CBPointParams: TCheckBox
     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'
       Caption = 'PointParameters'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -54,10 +69,14 @@ object Form1: TForm1
       OnClick = CBPointParamsClick
       OnClick = CBPointParamsClick
     end
     end
     object CBAnimate: TCheckBox
     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'
       Caption = 'Animate'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked

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

@@ -23,7 +23,7 @@ uses
   GLS.Cadencer,
   GLS.Cadencer,
   GLS.Texture,
   GLS.Texture,
   GLS.Color,
   GLS.Color,
- 
+
   GLS.Coordinates,
   GLS.Coordinates,
   GLS.BaseClasses;
   GLS.BaseClasses;
 
 
@@ -42,105 +42,106 @@ type
     Timer1: TTimer;
     Timer1: TTimer;
     LabelFPS: TLabel;
     LabelFPS: TLabel;
     procedure FormCreate(Sender: TObject);
     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;
     procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
       X, Y: Integer);
       X, Y: Integer);
-    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
-      newTime: Double);
+    procedure GLCadencer1Progress(Sender: TObject;
+      const deltaTime, newTime: Double);
     procedure CBAnimateClick(Sender: TObject);
     procedure CBAnimateClick(Sender: TObject);
     procedure CBPointParamsClick(Sender: TObject);
     procedure CBPointParamsClick(Sender: TObject);
     procedure Timer1Timer(Sender: TObject);
     procedure Timer1Timer(Sender: TObject);
   private
   private
-     
+
   public
   public
-     
-    mx, my : Integer
-  end;
 
 
-var
-  FormPoints: TFormPoints;
+    mx, my: Integer end;
+
+  var
+    FormPoints: TFormPoints;
 
 
 implementation
 implementation
 
 
 {$R *.DFM}
 {$R *.DFM}
 
 
 const
 const
-   cNbPoints = 180;
+  cNbPoints = 180;
 
 
 procedure TFormPoints.FormCreate(Sender: TObject);
 procedure TFormPoints.FormCreate(Sender: TObject);
 begin
 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;
 end;
 
 
-procedure TFormPoints.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
+procedure TFormPoints.GLCadencer1Progress(Sender: TObject;
+  const deltaTime, newTime: Double);
 var
 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
 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;
 end;
 
 
 procedure TFormPoints.GLSceneViewer1MouseDown(Sender: TObject;
 procedure TFormPoints.GLSceneViewer1MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 begin
 begin
-   mx:=x;
-   my:=y;
+  mx := X;
+  my := Y;
 end;
 end;
 
 
 procedure TFormPoints.GLSceneViewer1MouseMove(Sender: TObject;
 procedure TFormPoints.GLSceneViewer1MouseMove(Sender: TObject;
   Shift: TShiftState; X, Y: Integer);
   Shift: TShiftState; X, Y: Integer);
 begin
 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;
 end;
 
 
 procedure TFormPoints.CBAnimateClick(Sender: TObject);
 procedure TFormPoints.CBAnimateClick(Sender: TObject);
 begin
 begin
-   GLPoints1.Static:=not CBAnimate.Checked;
-   GLPoints2.Static:=not CBAnimate.Checked;
+  GLPoints1.Static := not CBAnimate.Checked;
+  GLPoints2.Static := not CBAnimate.Checked;
 end;
 end;
 
 
 procedure TFormPoints.CBPointParamsClick(Sender: TObject);
 procedure TFormPoints.CBPointParamsClick(Sender: TObject);
 begin
 begin
-   GLPoints1.PointParameters.Enabled:=CBPointParams.Checked;
-   GLPoints2.PointParameters.Enabled:=CBPointParams.Checked;
+  GLPoints1.PointParameters.Enabled := CBPointParams.Checked;
+  GLPoints2.PointParameters.Enabled := CBPointParams.Checked;
 end;
 end;
 
 
 procedure TFormPoints.Timer1Timer(Sender: TObject);
 procedure TFormPoints.Timer1Timer(Sender: TObject);
 begin
 begin
-   LabelFPS.Caption:=Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
-   GLSceneViewer1.ResetPerformanceMonitor;
+  LabelFPS.Caption := Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
+  GLSceneViewer1.ResetPerformanceMonitor;
 end;
 end;
 
 
 end.
 end.

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

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

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

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

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

@@ -1,5 +1,3 @@
-#version 120
-
 void main()
 void main()
 {
 {
    gl_Position = vec4(sign(gl_Vertex.xy), -1., 1.);
    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 sampler2D NormalMap;
 uniform samplerCube EnvironmentMap;
 uniform samplerCube EnvironmentMap;
 
 

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

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

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

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

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

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

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

@@ -1,4 +1,3 @@
-#version 120
 uniform sampler2DShadow ShadowMap;
 uniform sampler2DShadow ShadowMap;
 
 
 void main()
 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 DiffuseColor;
 uniform vec3 PhongColor;
 uniform vec3 PhongColor;
 uniform float Edge;
 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;
 varying vec3 Normal;
 
 
 void main(void)
 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
   // { Translate FreeForm based on the first mesh object's average
   // control point. Quick and dirty ... or maybe just dirty :P }
   // control point. Quick and dirty ... or maybe just dirty :P }
-  TAffineVectorList *cp =
+  TGLAffineVectorList *cp =
 	((TMOParametricSurface *) (GLActor1->MeshObjects->Items[0]))->ControlPoints;
 	((TMOParametricSurface *) (GLActor1->MeshObjects->Items[0]))->ControlPoints;
   GLActor1->Position->Translate(VectorNegate(VectorScale(cp->Sum(),1.0/cp->Count)));
   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);
 procedure TFormDucky.FormCreate(Sender: TObject);
 var
 var
-  cp: TAffineVectorList;
+  cp: TGLAffineVectorList;
 begin
 begin
   SetGLSceneMediaDir();
   SetGLSceneMediaDir();
   // Load the nurbs data
   // 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)
 void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 {
 {
    int i, j;
    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;
    __int64 t;
 
 
    BUSubdivide->Enabled = false;
    BUSubdivide->Enabled = false;
@@ -66,10 +66,10 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 
 
    for (i = 0; i < GLActor1->MeshObjects->Count-1; i++ )
    for (i = 0; i < GLActor1->MeshObjects->Count-1; i++ )
    {
    {
-	  tex = new TAffineVectorList;
+	  tex = new TGLAffineVectorList;
 	  tris = GLActor1->MeshObjects->Items[i]->ExtractTriangles(tex);
 	  tris = GLActor1->MeshObjects->Items[i]->ExtractTriangles(tex);
 	  indices = BuildVectorCountOptimizedIndices(tris);
 	  indices = BuildVectorCountOptimizedIndices(tris);
-	  firstRemap = (TIntegerList *)(indices->CreateClone());
+	  firstRemap = (TGLIntegerList *)(indices->CreateClone());
 	  RemapAndCleanupReferences(tris, indices);
 	  RemapAndCleanupReferences(tris, indices);
 
 
 	  norms = BuildNormals(tris, indices);
 	  norms = BuildNormals(tris, indices);
@@ -84,7 +84,7 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 	  SubdivideTriangles(0, tex, texIndices);
 	  SubdivideTriangles(0, tex, texIndices);
 
 
 	  // Re-expand everything
 	  // Re-expand everything
-	  buf = new TAffineVectorList;
+	  buf = new TGLAffineVectorList;
 	  try
 	  try
 	  {
 	  {
 		 ConvertIndexedListToList(tris, indices, buf);
 		 ConvertIndexedListToList(tris, indices, buf);
@@ -103,14 +103,14 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 	  // Pack & Optimize the expanded stuff
 	  // Pack & Optimize the expanded stuff
 	  indices->Free();
 	  indices->Free();
 	  indices = BuildVectorCountOptimizedIndices(tris, norms, tex);
 	  indices = BuildVectorCountOptimizedIndices(tris, norms, tex);
-	  subdivideRemap = (TIntegerList *)(indices->CreateClone());
+	  subdivideRemap = (TGLIntegerList *)(indices->CreateClone());
 	  RemapReferences(norms, indices);
 	  RemapReferences(norms, indices);
 	  RemapReferences(tex, indices);
 	  RemapReferences(tex, indices);
 	  RemapAndCleanupReferences(tris, indices);
 	  RemapAndCleanupReferences(tris, indices);
 
 
 	  IncreaseCoherency(indices, 13);
 	  IncreaseCoherency(indices, 13);
 
 
-	  bufRemap = new TIntegerList;
+	  bufRemap = new TGLIntegerList;
 	 for (j = 0; j < GLActor1->MeshObjects->MorphTargetCount()-1; j++)
 	 for (j = 0; j < GLActor1->MeshObjects->MorphTargetCount()-1; j++)
 	 {
 	 {
 		GLActor1->MeshObjects->MorphTo(j);
 		GLActor1->MeshObjects->MorphTo(j);
@@ -123,7 +123,7 @@ void __fastcall TForm1::BUSubdivideClick(TObject *Sender)
 
 
 		SubdivideTriangles(TrackBar1->Position*0.1, morphTris, bufRemap, morphNorms);
 		SubdivideTriangles(TrackBar1->Position*0.1, morphTris, bufRemap, morphNorms);
 
 
-		buf = new TAffineVectorList;
+		buf = new TGLAffineVectorList;
 		try
 		try
 		{
 		{
 		   ConvertIndexedListToList(morphTris, bufRemap, buf);
 		   ConvertIndexedListToList(morphTris, bufRemap, buf);

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

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

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

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

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

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

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

@@ -18,39 +18,38 @@
 #pragma link "GLS.TilePlane"
 #pragma link "GLS.TilePlane"
 #pragma link "GLS.SceneViewer"
 #pragma link "GLS.SceneViewer"
 #pragma resource "*.dfm"
 #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 (i=-20;i<=20;i++)
 	 for (j=-20;j<=20;j++)
 	 for (j=-20;j<=20;j++)
 	  GLTilePlane->Tiles[i,j] = Random(GLMaterialLibrary->Materials->Count-1)+1;
 	  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
   Left = 0
   Top = 0
   Top = 0
   Caption = 'Tiles'
   Caption = 'Tiles'
-  ClientHeight = 422
-  ClientWidth = 650
+  ClientHeight = 528
+  ClientWidth = 813
   Color = clBtnFace
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Color = clWindowText
-  Font.Height = -11
+  Font.Height = -14
   Font.Name = 'Tahoma'
   Font.Name = 'Tahoma'
   Font.Style = []
   Font.Style = []
-  OldCreateOrder = False
   OnCreate = FormCreate
   OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
+  PixelsPerInch = 120
+  TextHeight = 17
   object GLSceneViewer1: TGLSceneViewer
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     Left = 0
     Top = 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
     Camera = GLCamera
-    FieldOfView = 153.337402343750000000
+    FieldOfView = 158.551101684570300000
     PenAsTouch = False
     PenAsTouch = False
     Align = alClient
     Align = alClient
     TabOrder = 0
     TabOrder = 0
   end
   end
   object Panel1: TPanel
   object Panel1: TPanel
-    Left = 522
+    Left = 653
     Top = 0
     Top = 0
-    Width = 128
-    Height = 422
+    Width = 160
+    Height = 528
+    Margins.Left = 4
+    Margins.Top = 4
+    Margins.Right = 4
+    Margins.Bottom = 4
     Align = alRight
     Align = alRight
     BevelOuter = bvLowered
     BevelOuter = bvLowered
     Font.Charset = DEFAULT_CHARSET
     Font.Charset = DEFAULT_CHARSET
     Font.Color = clWindowText
     Font.Color = clWindowText
-    Font.Height = -11
+    Font.Height = -14
     Font.Name = 'Arial'
     Font.Name = 'Arial'
     Font.Style = []
     Font.Style = []
     ParentFont = False
     ParentFont = False
     TabOrder = 1
     TabOrder = 1
     object Label1: TLabel
     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'
       Caption = 'Tile Materials'
     end
     end
     object Label2: TLabel
     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
       AutoSize = False
       Caption = 
       Caption = 
         'Shift + Left button: pan'#13#10#13#10'Left button : paint with current mat' +
         'Shift + Left button: pan'#13#10#13#10'Left button : paint with current mat' +
@@ -58,36 +73,52 @@ object Form1: TForm1
       WordWrap = True
       WordWrap = True
     end
     end
     object CBMaterial: TComboBox
     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
       Style = csDropDownList
       TabOrder = 0
       TabOrder = 0
     end
     end
     object BUPack: TButton
     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'
       Caption = 'Pack'
       TabOrder = 1
       TabOrder = 1
     end
     end
     object CBShowGrid: TCheckBox
     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'
       Caption = 'Show Grid'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
       TabOrder = 2
       TabOrder = 2
     end
     end
     object CBSortByMaterials: TCheckBox
     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'
       Caption = 'Sort by materials'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -203,7 +234,6 @@ object Form1: TForm1
         Material.Texture.Disabled = False
         Material.Texture.Disabled = False
         TextureScale.Coordinates = {0000003F0000003F0000803F00000000}
         TextureScale.Coordinates = {0000003F0000003F0000803F00000000}
       end>
       end>
-    TexturePaths = '..\\..\\..\\..\\media'
     Left = 24
     Left = 24
     Top = 64
     Top = 64
   end
   end

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

@@ -30,35 +30,16 @@ object Form1: TForm1
     Anchors = [akLeft, akTop, akRight]
     Anchors = [akLeft, akTop, akRight]
     Shape = bsTopLine
     Shape = bsTopLine
   end
   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
   object ListView: TListView
-    Left = 175
-    Top = 8
-    Width = 456
-    Height = 583
+    Left = 201
+    Top = 0
+    Width = 473
+    Height = 608
     Margins.Left = 4
     Margins.Left = 4
     Margins.Top = 4
     Margins.Top = 4
     Margins.Right = 4
     Margins.Right = 4
     Margins.Bottom = 4
     Margins.Bottom = 4
-    Anchors = [akLeft, akTop, akRight, akBottom]
+    Align = alClient
     Columns = <
     Columns = <
       item
       item
         AutoSize = True
         AutoSize = True
@@ -75,31 +56,70 @@ object Form1: TForm1
       700061006B002000660069006C0065002E002E002E00}
       700061006B002000660069006C0065002E002E002E00}
     MultiSelect = True
     MultiSelect = True
     SmallImages = ImageList1
     SmallImages = ImageList1
-    TabOrder = 1
+    TabOrder = 0
     ViewStyle = vsReport
     ViewStyle = vsReport
     OnChange = ListViewChange
     OnChange = ListViewChange
     OnClick = ListViewClick
     OnClick = ListViewClick
     OnDblClick = ListViewDblClick
     OnDblClick = ListViewDblClick
     OnKeyDown = ListViewKeyDown
     OnKeyDown = ListViewKeyDown
+    ExplicitLeft = 209
+    ExplicitTop = 9
+    ExplicitWidth = 456
+    ExplicitHeight = 583
   end
   end
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 10
-    Top = 389
+  object PanelTree: TPanel
+    Left = 0
+    Top = 0
     Width = 201
     Width = 201
-    Height = 201
+    Height = 608
     Margins.Left = 4
     Margins.Left = 4
     Margins.Top = 4
     Margins.Top = 4
     Margins.Right = 4
     Margins.Right = 4
     Margins.Bottom = 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
   end
   object MainMenu1: TMainMenu
   object MainMenu1: TMainMenu
     Left = 184
     Left = 184
@@ -252,7 +272,6 @@ object Form1: TForm1
   end
   end
   object GLSimpleNavigation1: TGLSimpleNavigation
   object GLSimpleNavigation1: TGLSimpleNavigation
     Form = Owner
     Form = Owner
-    GLSceneViewer = GLSceneViewer1
     FormCaption = 'GLScene Pak Editor - %FPS'
     FormCaption = 'GLScene Pak Editor - %FPS'
     KeyCombinations = <
     KeyCombinations = <
       item
       item

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

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

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

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

+ 8 - 8
Packages/GLScene_Cg_DT.dproj

@@ -164,23 +164,23 @@
                         <Overwrite>true</Overwrite>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </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>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </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>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </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>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </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>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </DeployFile>

+ 2 - 2
Source/CUDA.APIComps.pas

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

+ 4 - 4
Source/Cg.Shader.pas

@@ -186,8 +186,8 @@ type
     procedure EnableTexture;
     procedure EnableTexture;
     procedure DisableTexture;
     procedure DisableTexture;
     // Procedures for setting varying parameters with an array of values.
     // 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 EnableClientState;
     procedure DisableClientState;
     procedure DisableClientState;
     // LongName retruns ShaderName.[program type].ProgramName.ParamName.
     // LongName retruns ShaderName.[program type].ProgramName.ParamName.
@@ -944,13 +944,13 @@ begin
   cgGLEnableClientState(FHandle);
   cgGLEnableClientState(FHandle);
 end;
 end;
 
 
-procedure TCgParameter.SetParameterPointer(Values: TAffineVectorList);
+procedure TCgParameter.SetParameterPointer(Values: TGLAffineVectorList);
 begin
 begin
   Assert(FVariability = CG_VARYING);
   Assert(FVariability = CG_VARYING);
   cgGLSetParameterPointer(FHandle, 3, GL_FLOAT, 0, Values.List);
   cgGLSetParameterPointer(FHandle, 3, GL_FLOAT, 0, Values.List);
 end;
 end;
 
 
-procedure TCgParameter.SetParameterPointer(Values: TVectorList);
+procedure TCgParameter.SetParameterPointer(Values: TGLVectorList);
 begin
 begin
   Assert(FVariability = CG_VARYING);
   Assert(FVariability = CG_VARYING);
   cgGLSetParameterPointer(FHandle, 4, GL_FLOAT, 0, Values.List);
   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.
     (* Saves content to stream in OCT format.
       The Header is automatically prepared before streaming. *)
       The Header is automatically prepared before streaming. *)
     procedure SaveToStream(aStream: TStream);
     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;
     procedure AddLight(const lightPos: TAffineVector; const lightColor: TGLVector;
       lightIntensity: Integer);
       lightIntensity: Integer);
   end;
   end;
@@ -137,8 +137,8 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TOCTFile.AddTriangles(vertexCoords: TAffineVectorList;
-  texMapCoords: TAffineVectorList; const textureName: String);
+procedure TOCTFile.AddTriangles(vertexCoords: TGLAffineVectorList;
+  texMapCoords: TGLAffineVectorList; const textureName: String);
 var
 var
   i: Integer;
   i: Integer;
   baseIdx, texIdx: Integer;
   baseIdx, texIdx: Integer;

+ 6 - 6
Source/Formats.VRML.pas

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

+ 21 - 21
Source/Formats.X.pas

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

+ 2 - 2
Source/Formats.m3DSTypes.pas

@@ -40,8 +40,8 @@ type
      PCardinalArray = ^TCardinalArray;
      PCardinalArray = ^TCardinalArray;
      TCardinalArray = array[0..MaxInt div (2*SizeOf(Cardinal))] of Cardinal;
      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
      PPoint3DS = ^TPoint3DS;                     // 3D point structure
      TPoint3DS = record
      TPoint3DS = record

+ 1 - 1
Source/GLS.ArchiveManager.pas

@@ -72,7 +72,7 @@ type
   end;
   end;
 
 
   // The list of registered classes
   // The list of registered classes
-  TGLArchiveFileFormatsList = class(TPersistentObjectList)
+  TGLArchiveFileFormatsList = class(TGLPersistentObjectList)
   public
   public
     destructor Destroy; override;
     destructor Destroy; override;
     procedure Add(const Ext, Desc: string; DescID: integer;
     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. *)
 (*  Some useful methods for setting up bump maps. *)
 procedure CalcObjectSpaceLightVectors(Light : TAffineVector;
 procedure CalcObjectSpaceLightVectors(Light : TAffineVector;
-                                      Vertices: TAffineVectorList;
-                                      Colors: TVectorList);
+                                      Vertices: TGLAffineVectorList;
+                                      Colors: TGLVectorList);
 procedure SetupTangentSpace(Vertices, Normals, TexCoords,
 procedure SetupTangentSpace(Vertices, Normals, TexCoords,
-                            Tangents, BiNormals : TAffineVectorList);
+                            Tangents, BiNormals : TGLAffineVectorList);
 procedure CalcTangentSpaceLightVectors(Light : TAffineVector;
 procedure CalcTangentSpaceLightVectors(Light : TAffineVector;
                                        Vertices, Normals,
                                        Vertices, Normals,
-                                       Tangents, BiNormals : TAffineVectorList;
-                                       Colors: TVectorList);
+                                       Tangents, BiNormals : TGLAffineVectorList;
+                                       Colors: TGLVectorList);
 function CreateObjectSpaceNormalMap(Width, Height : Integer;
 function CreateObjectSpaceNormalMap(Width, Height : Integer;
-                                    HiNormals,HiTexCoords : TAffineVectorList) : TBitmap;
+                                    HiNormals,HiTexCoords : TGLAffineVectorList) : TBitmap;
 function CreateTangentSpaceNormalMap(Width, Height : Integer;
 function CreateTangentSpaceNormalMap(Width, Height : Integer;
                                      HiNormals, HiTexCoords,
                                      HiNormals, HiTexCoords,
                                      LoNormals, LoTexCoords,
                                      LoNormals, LoTexCoords,
-                                     Tangents, BiNormals : TAffineVectorList) : TBitmap;
+                                     Tangents, BiNormals : TGLAffineVectorList) : TBitmap;
 
 
 
 
 // ------------------------------------------------------------------
 // ------------------------------------------------------------------
@@ -349,7 +349,7 @@ end;
 
 
 //----------------- BumpMapping routines ---------------------
 //----------------- BumpMapping routines ---------------------
 
 
-procedure CalcObjectSpaceLightVectors(Light: TAffineVector; Vertices: TAffineVectorList; Colors: TVectorList);
+procedure CalcObjectSpaceLightVectors(Light: TAffineVector; Vertices: TGLAffineVectorList; Colors: TGLVectorList);
 var
 var
   i: Integer;
   i: Integer;
   vec: TAffineVector;
   vec: TAffineVector;
@@ -362,7 +362,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure SetupTangentSpace(Vertices, Normals, TexCoords, Tangents, BiNormals: TAffineVectorList);
+procedure SetupTangentSpace(Vertices, Normals, TexCoords, Tangents, BiNormals: TGLAffineVectorList);
 var
 var
   i, j: Integer;
   i, j: Integer;
   v, n, t: TAffineMatrix;
   v, n, t: TAffineMatrix;
@@ -455,8 +455,8 @@ begin
 end;
 end;
 
 
 procedure CalcTangentSpaceLightVectors(Light: TAffineVector;
 procedure CalcTangentSpaceLightVectors(Light: TAffineVector;
-  Vertices, Normals, Tangents, BiNormals: TAffineVectorList;
-  Colors: TVectorList);
+  Vertices, Normals, Tangents, BiNormals: TGLAffineVectorList;
+  Colors: TGLVectorList);
 var
 var
   i: Integer;
   i: Integer;
   mat: TAffineMatrix;
   mat: TAffineMatrix;
@@ -601,7 +601,7 @@ begin
 end;
 end;
 
 
 procedure CalcObjectSpaceNormalMap(Width, Height: Integer;
 procedure CalcObjectSpaceNormalMap(Width, Height: Integer;
-  NormalMap, Normals, TexCoords: TAffineVectorList);
+  NormalMap, Normals, TexCoords: TGLAffineVectorList);
 var
 var
   i, X, Y, xs, xe, x1, y1, x2, y2, x3, y3: Integer;
   i, X, Y, xs, xe, x1, y1, x2, y2, x3, y3: Integer;
   n, n1, n2, n3: TAffineVector;
   n, n1, n2, n3: TAffineVector;
@@ -687,12 +687,12 @@ begin
 end;
 end;
 
 
 function CreateObjectSpaceNormalMap(Width, Height: Integer;
 function CreateObjectSpaceNormalMap(Width, Height: Integer;
-  HiNormals, HiTexCoords: TAffineVectorList): TBitmap;
+  HiNormals, HiTexCoords: TGLAffineVectorList): TBitmap;
 var
 var
   i: Integer;
   i: Integer;
-  NormalMap: TAffineVectorList;
+  NormalMap: TGLAffineVectorList;
 begin
 begin
-  NormalMap := TAffineVectorList.Create;
+  NormalMap := TGLAffineVectorList.Create;
   NormalMap.AddNulls(Width * Height);
   NormalMap.AddNulls(Width * Height);
   CalcObjectSpaceNormalMap(Width, Height, NormalMap, HiNormals, HiTexCoords);
   CalcObjectSpaceNormalMap(Width, Height, NormalMap, HiNormals, HiTexCoords);
 
 
@@ -710,7 +710,7 @@ begin
 end;
 end;
 
 
 function CreateTangentSpaceNormalMap(Width, Height: Integer; HiNormals, HiTexCoords, LoNormals, LoTexCoords, Tangents,
 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)
   function NormalToTangentSpace(normal: TAffineVector; X, Y, x1, y1, x2, y2, x3, y3: Integer; m1, m2, m3: TAffineMatrix)
     : TAffineVector;
     : TAffineVector;
@@ -726,11 +726,11 @@ function CreateTangentSpaceNormalMap(Width, Height: Integer; HiNormals, HiTexCoo
 
 
 var
 var
   i, X, Y, xs, xe, x1, y1, x2, y2, x3, y3: Integer;
   i, X, Y, xs, xe, x1, y1, x2, y2, x3, y3: Integer;
-  NormalMap: TAffineVectorList;
+  NormalMap: TGLAffineVectorList;
   n: TAffineVector;
   n: TAffineVector;
   m, m1, m2, m3: TAffineMatrix;
   m, m1, m2, m3: TAffineMatrix;
 begin
 begin
-  NormalMap := TAffineVectorList.Create;
+  NormalMap := TGLAffineVectorList.Create;
   NormalMap.AddNulls(Width * Height);
   NormalMap.AddNulls(Width * Height);
 
 
   CalcObjectSpaceNormalMap(Width, Height, NormalMap, HiNormals, HiTexCoords);
   CalcObjectSpaceNormalMap(Width, Height, NormalMap, HiNormals, HiTexCoords);

+ 2 - 2
Source/GLS.Collision.pas

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

+ 0 - 1
Source/GLS.Coordinates.pas

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

+ 13 - 13
Source/GLS.CurvesAndSurfaces.pas

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

+ 2 - 2
Source/GLS.DCE.pas

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

+ 1 - 1
Source/GLS.EllipseCollision.pas

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

+ 20 - 20
Source/GLS.ExplosionFx.pas

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

+ 20 - 20
Source/GLS.Feedback.pas

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

+ 1 - 1
Source/GLS.File3DPDF.pas

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

+ 56 - 56
Source/GLS.File3DS.pas

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

+ 13 - 13
Source/GLS.FileASE.pas

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

+ 130 - 0
Source/GLS.FileDDS.pas

@@ -18,10 +18,14 @@ uses
 
 
   GLS.Context,
   GLS.Context,
   GLS.Graphics,
   GLS.Graphics,
+  GLS.Texture,
   GLS.TextureFormat,
   GLS.TextureFormat,
+  GLS.CompositeImage,
+  GLS.MultiSampleImage,
   GLS.RGBE,
   GLS.RGBE,
   GLS.ApplicationFileIO,
   GLS.ApplicationFileIO,
   GLS.VectorGeometry,
   GLS.VectorGeometry,
+  GLS.Material,
   GLS.Strings;
   GLS.Strings;
 
 
 type
 type
@@ -44,6 +48,28 @@ type
       const IntFormat: TGLInternalFormat); reintroduce;
       const IntFormat: TGLInternalFormat); reintroduce;
   end;
   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
 var
   (* Variable determines which resolution to use textures,
   (* Variable determines which resolution to use textures,
      high - it loads all levels,
      high - it loads all levels,
@@ -57,6 +83,110 @@ implementation
 
 
 uses
 uses
   Formats.DXTC;
   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 ------------------
 // ------------------ TGLDDSImage ------------------
 // ------------------
 // ------------------

+ 1 - 1
Source/GLS.FileDEL.pas

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

+ 2 - 2
Source/GLS.FileGL2.pas

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

+ 1 - 1
Source/GLS.FileGLB.pas

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

+ 1 - 1
Source/GLS.FileGLTF.pas

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

+ 2 - 2
Source/GLS.FileLMTS.pas

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

+ 12 - 12
Source/GLS.FileMD5.pas

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

+ 4 - 4
Source/GLS.FileNMF.pas

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

+ 4 - 4
Source/GLS.FileNurbs.pas

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

+ 17 - 17
Source/GLS.FileOBJ.pas

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

+ 1 - 1
Source/GLS.FileSMD.pas

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

+ 1 - 1
Source/GLS.FileSTL.pas

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

+ 1 - 1
Source/GLS.FileTIN.pas

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

+ 1 - 1
Source/GLS.FileVOR.pas

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

+ 21 - 21
Source/GLS.FileVRML.pas

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

+ 2 - 2
Source/GLS.FireFX.pas

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

+ 6 - 7
Source/GLS.GeomObjects.pas

@@ -1,7 +1,6 @@
 //
 //
 // The graphics rendering engine GLScene http://glscene.org
 // The graphics rendering engine GLScene http://glscene.org
 //
 //
-
 unit GLS.GeomObjects;
 unit GLS.GeomObjects;
 
 
 (*
 (*
@@ -355,8 +354,8 @@ type
       write SetBottomArrowHeadRadius;
       write SetBottomArrowHeadRadius;
   end;
   end;
 
 
-  TArrowArcPart = (aaArc, aaTopArrow, aaBottomArrow);
-  TGLArrowArcPart = set of TArrowArcPart;
+  TGLArrowArcPart = (aaArc, aaTopArrow, aaBottomArrow);
+  TGLArrowArcParts = set of TGLArrowArcPart;
 
 
   (* Draws an arrowhead (Sliced Torus + cone).
   (* Draws an arrowhead (Sliced Torus + cone).
     The arrow head is a cone that shares the attributes of the Torus
     The arrow head is a cone that shares the attributes of the Torus
@@ -369,7 +368,7 @@ type
     fArcRadius: Single;
     fArcRadius: Single;
     FStartAngle: Single;
     FStartAngle: Single;
     FStopAngle: Single;
     FStopAngle: Single;
-    FParts: TGLArrowArcPart;
+    FParts: TGLArrowArcParts;
     FTopRadius: Single;
     FTopRadius: Single;
     fTopArrowHeadHeight: Single;
     fTopArrowHeadHeight: Single;
     fTopArrowHeadRadius: Single;
     fTopArrowHeadRadius: Single;
@@ -386,7 +385,7 @@ type
     procedure SetTopArrowHeadRadius(const aValue: Single);
     procedure SetTopArrowHeadRadius(const aValue: Single);
     procedure SetBottomArrowHeadHeight(const aValue: Single);
     procedure SetBottomArrowHeadHeight(const aValue: Single);
     procedure SetBottomArrowHeadRadius(const aValue: Single);
     procedure SetBottomArrowHeadRadius(const aValue: Single);
-    procedure SetParts(aValue: TGLArrowArcPart);
+    procedure SetParts(aValue: TGLArrowArcParts);
     procedure SetHeadStackingStyle(const val: TGLArrowHeadStyle);
     procedure SetHeadStackingStyle(const val: TGLArrowHeadStyle);
   public
   public
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
@@ -399,7 +398,7 @@ type
     property TopRadius: Single read FTopRadius write SetTopRadius;
     property TopRadius: Single read FTopRadius write SetTopRadius;
     property HeadStackingStyle: TGLArrowHeadStyle read FHeadStackingStyle
     property HeadStackingStyle: TGLArrowHeadStyle read FHeadStackingStyle
       write SetHeadStackingStyle default ahssStacked;
       write SetHeadStackingStyle default ahssStacked;
-    property Parts: TGLArrowArcPart read FParts write SetParts
+    property Parts: TGLArrowArcParts read FParts write SetParts
       default [aaArc, aaTopArrow];
       default [aaArc, aaTopArrow];
     property TopArrowHeadHeight: Single read fTopArrowHeadHeight
     property TopArrowHeadHeight: Single read fTopArrowHeadHeight
       write SetTopArrowHeadHeight;
       write SetTopArrowHeadHeight;
@@ -2665,7 +2664,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TGLArrowArc.SetParts(aValue: TGLArrowArcPart);
+procedure TGLArrowArc.SetParts(aValue: TGLArrowArcParts);
 begin
 begin
   if aValue <> FParts then
   if aValue <> FParts then
   begin
   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
 // Checks if a plane (given by the normal+d) intersects the AABB
 function PlaneIntersectAABB(const Normal: TAffineVector; D: Single; const Aabb: TAABB): Boolean;
 function PlaneIntersectAABB(const Normal: TAffineVector; D: Single; const Aabb: TAABB): Boolean;
 // Compute the intersection between a plane and the AABB
 // 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
   Original source code by Tomas Akenine-Möller
   Based on the paper "Fast 3D Triangle-Box Overlap Testing"
   Based on the paper "Fast 3D Triangle-Box Overlap Testing"
@@ -751,7 +751,7 @@ begin
     Max := X2;
     Max := X2;
 end;
 end;
 
 
-function PlaneAABBIntersection(const plane : THmgPlane;const AABB : TAABB) : TAffineVectorList;
+function PlaneAABBIntersection(const plane : THmgPlane;const AABB : TAABB) : TGLAffineVectorList;
 var
 var
   i, j, annexe : Integer;
   i, j, annexe : Integer;
   index : array[0..2] of Integer;
   index : array[0..2] of Integer;
@@ -771,7 +771,7 @@ begin
   box[0] := AABB.min;
   box[0] := AABB.min;
   box[1] := AABB.max;
   box[1] := AABB.max;
 
 
-  Result := TAffineVectorList.Create;
+  Result := TGLAffineVectorList.Create;
 
 
   // loop on vertices
   // loop on vertices
   for i := 0 to 7 do
   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
     this enhances perspective and quality, at the expense of computing
     power. *)
     power. *)
   TGLXYZGridLinesStyle = (glsLine, glsSegments);
   TGLXYZGridLinesStyle = (glsLine, glsSegments);
+
   // An XYZ Grid object. Renders an XYZ grid using lines
   // An XYZ Grid object. Renders an XYZ grid using lines
   TGLXYZGrid = class(TGLLineBase)
   TGLXYZGrid = class(TGLLineBase)
   private
   private
@@ -166,8 +167,7 @@ type
     property Parts: TGLXYZGridParts read FParts write SetParts default [gpX, gpY];
     property Parts: TGLXYZGridParts read FParts write SetParts default [gpX, gpY];
     property LinesStyle: TGLXYZGridLinesStyle read FLinesStyle write SetLinesStyle
     property LinesStyle: TGLXYZGridLinesStyle read FLinesStyle write SetLinesStyle
       default glsSegments;
       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;
     property LinesSmoothing: Boolean write SetLinesSmoothing stored False;
   end;
   end;
 
 
@@ -179,14 +179,12 @@ implementation
 // ------------------ TGLSamplingScale ------------------
 // ------------------ TGLSamplingScale ------------------
 // ------------------
 // ------------------
 
 
-
 constructor TGLSamplingScale.Create(AOwner: TPersistent);
 constructor TGLSamplingScale.Create(AOwner: TPersistent);
 begin
 begin
   inherited Create(AOwner);
   inherited Create(AOwner);
   FStep := 0.1;
   FStep := 0.1;
 end;
 end;
 
 
- 
 destructor TGLSamplingScale.Destroy;
 destructor TGLSamplingScale.Destroy;
 begin
 begin
   inherited Destroy;
   inherited Destroy;
@@ -214,7 +212,6 @@ begin
   NotifyChange(Self);
   NotifyChange(Self);
 end;
 end;
 
 
-
 procedure TGLSamplingScale.SetMax(const val: Single);
 procedure TGLSamplingScale.SetMax(const val: Single);
 begin
 begin
   FMax := val;
   FMax := val;
@@ -223,14 +220,12 @@ begin
   NotifyChange(Self);
   NotifyChange(Self);
 end;
 end;
 
 
-
 procedure TGLSamplingScale.SetOrigin(const val: Single);
 procedure TGLSamplingScale.SetOrigin(const val: Single);
 begin
 begin
   FOrigin := val;
   FOrigin := val;
   NotifyChange(Self);
   NotifyChange(Self);
 end;
 end;
 
 
-
 procedure TGLSamplingScale.SetStep(const val: Single);
 procedure TGLSamplingScale.SetStep(const val: Single);
 begin
 begin
   if val > 0 then
   if val > 0 then
@@ -240,7 +235,6 @@ begin
   NotifyChange(Self);
   NotifyChange(Self);
 end;
 end;
 
 
-
 function TGLSamplingScale.StepBase: Single;
 function TGLSamplingScale.StepBase: Single;
 begin
 begin
   if FOrigin <> FMin then
   if FOrigin <> FMin then
@@ -256,19 +250,16 @@ begin
     Result := FMin;
     Result := FMin;
 end;
 end;
 
 
-
 function TGLSamplingScale.MaxStepCount: Integer;
 function TGLSamplingScale.MaxStepCount: Integer;
 begin
 begin
   Result := Round(0.5 + (Max - Min) / Step);
   Result := Round(0.5 + (Max - Min) / Step);
 end;
 end;
 
 
-
 function TGLSamplingScale.IsValid: Boolean;
 function TGLSamplingScale.IsValid: Boolean;
 begin
 begin
   Result := (Max <> Min);
   Result := (Max <> Min);
 end;
 end;
 
 
-
 procedure TGLSamplingScale.SetBaseStepMaxToVars(var Base, Step, Max: Single;
 procedure TGLSamplingScale.SetBaseStepMaxToVars(var Base, Step, Max: Single;
   samplingEnabled: Boolean = True);
   samplingEnabled: Boolean = True);
 begin
 begin
@@ -297,7 +288,6 @@ begin
   FOptions := [hfoTwoSided];
   FOptions := [hfoTwoSided];
 end;
 end;
 
 
-
 destructor TGLHeightField.Destroy;
 destructor TGLHeightField.Destroy;
 begin
 begin
   FXSamplingScale.Free;
   FXSamplingScale.Free;
@@ -305,7 +295,6 @@ begin
   inherited Destroy;
   inherited Destroy;
 end;
 end;
 
 
-
 procedure TGLHeightField.Assign(Source: TPersistent);
 procedure TGLHeightField.Assign(Source: TPersistent);
 begin
 begin
   if Source is TGLHeightField then
   if Source is TGLHeightField then
@@ -319,7 +308,6 @@ begin
   inherited Assign(Source);
   inherited Assign(Source);
 end;
 end;
 
 
-
 procedure TGLHeightField.NotifyChange(Sender: TObject);
 procedure TGLHeightField.NotifyChange(Sender: TObject);
 begin
 begin
   if Sender is TGLSamplingScale then
   if Sender is TGLSamplingScale then
@@ -327,7 +315,6 @@ begin
   inherited NotifyChange(Sender);
   inherited NotifyChange(Sender);
 end;
 end;
 
 
-
 procedure TGLHeightField.BuildList(var rci: TGLRenderContextInfo);
 procedure TGLHeightField.BuildList(var rci: TGLRenderContextInfo);
 type
 type
   TRowData = packed record
   TRowData = packed record
@@ -336,9 +323,9 @@ type
     TexPoint: TTexPoint;
     TexPoint: TTexPoint;
     Normal: TAffineVector;
     Normal: TAffineVector;
   end;
   end;
-
   TRowDataArray = array [0 .. Maxint shr 6] of TRowData;
   TRowDataArray = array [0 .. Maxint shr 6] of TRowData;
   PRowData = ^TRowDataArray;
   PRowData = ^TRowDataArray;
+
 const
 const
   cHFCMtoEnum: array [hfcmEmission .. hfcmAmbientAndDiffuse] of Cardinal =
   cHFCMtoEnum: array [hfcmEmission .. hfcmAmbientAndDiffuse] of Cardinal =
     (GL_EMISSION, GL_AMBIENT, GL_DIFFUSE, GL_AMBIENT_AND_DIFFUSE);
     (GL_EMISSION, GL_AMBIENT, GL_DIFFUSE, GL_AMBIENT_AND_DIFFUSE);
@@ -504,19 +491,16 @@ begin
   end;
   end;
 end;
 end;
 
 
-
 procedure TGLHeightField.SetXSamplingScale(const val: TGLSamplingScale);
 procedure TGLHeightField.SetXSamplingScale(const val: TGLSamplingScale);
 begin
 begin
   FXSamplingScale.Assign(val);
   FXSamplingScale.Assign(val);
 end;
 end;
 
 
-
 procedure TGLHeightField.SetYSamplingScale(const val: TGLSamplingScale);
 procedure TGLHeightField.SetYSamplingScale(const val: TGLSamplingScale);
 begin
 begin
   FYSamplingScale.Assign(val);
   FYSamplingScale.Assign(val);
 end;
 end;
 
 
-
 procedure TGLHeightField.SetOptions(const val: TGLHeightFieldOptions);
 procedure TGLHeightField.SetOptions(const val: TGLHeightFieldOptions);
 begin
 begin
   if FOptions <> val then
   if FOptions <> val then
@@ -526,14 +510,12 @@ begin
   end;
   end;
 end;
 end;
 
 
-
 procedure TGLHeightField.SetOnGetHeight(const val: TGLHeightFieldGetHeightEvent);
 procedure TGLHeightField.SetOnGetHeight(const val: TGLHeightFieldGetHeightEvent);
 begin
 begin
   FOnGetHeight := val;
   FOnGetHeight := val;
   StructureChanged;
   StructureChanged;
 end;
 end;
 
 
-
 procedure TGLHeightField.SetOnGetHeight2(const val
 procedure TGLHeightField.SetOnGetHeight2(const val
   : TGLHeightFieldGetHeight2Event);
   : TGLHeightFieldGetHeight2Event);
 begin
 begin
@@ -541,7 +523,6 @@ begin
   StructureChanged;
   StructureChanged;
 end;
 end;
 
 
-
 procedure TGLHeightField.SetColorMode(const val: TGLHeightFieldColorMode);
 procedure TGLHeightField.SetColorMode(const val: TGLHeightFieldColorMode);
 begin
 begin
   if val <> FColorMode then
   if val <> FColorMode then
@@ -551,7 +532,6 @@ begin
   end;
   end;
 end;
 end;
 
 
-
 procedure TGLHeightField.DefaultHeightField(const x, y: Single; var z: Single;
 procedure TGLHeightField.DefaultHeightField(const x, y: Single; var z: Single;
   var color: TGLColorVector; var texPoint: TTexPoint);
   var color: TGLColorVector; var texPoint: TTexPoint);
 begin
 begin
@@ -560,7 +540,6 @@ begin
   color := clrGray80;
   color := clrGray80;
 end;
 end;
 
 
-
 procedure TGLHeightField.Height2Field(const x, y: Single; var z: Single;
 procedure TGLHeightField.Height2Field(const x, y: Single; var z: Single;
   var color: TGLColorVector; var texPoint: TTexPoint);
   var color: TGLColorVector; var texPoint: TTexPoint);
 begin
 begin
@@ -581,7 +560,6 @@ begin
   FLinesStyle := glsSegments;
   FLinesStyle := glsSegments;
 end;
 end;
 
 
-
 destructor TGLXYZGrid.Destroy;
 destructor TGLXYZGrid.Destroy;
 begin
 begin
   FXSamplingScale.Free;
   FXSamplingScale.Free;
@@ -590,7 +568,6 @@ begin
   inherited Destroy;
   inherited Destroy;
 end;
 end;
 
 
-
 procedure TGLXYZGrid.Assign(Source: TPersistent);
 procedure TGLXYZGrid.Assign(Source: TPersistent);
 begin
 begin
   if Source is TGLXYZGrid then
   if Source is TGLXYZGrid then
@@ -614,13 +591,11 @@ begin
   FYSamplingScale.Assign(val);
   FYSamplingScale.Assign(val);
 end;
 end;
 
 
-
 procedure TGLXYZGrid.SetZSamplingScale(const val: TGLSamplingScale);
 procedure TGLXYZGrid.SetZSamplingScale(const val: TGLSamplingScale);
 begin
 begin
   FZSamplingScale.Assign(val);
   FZSamplingScale.Assign(val);
 end;
 end;
 
 
-
 procedure TGLXYZGrid.SetParts(const val: TGLXYZGridParts);
 procedure TGLXYZGrid.SetParts(const val: TGLXYZGridParts);
 begin
 begin
   if FParts <> val then
   if FParts <> val then

+ 5 - 5
Source/GLS.Graphics.pas

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

+ 0 - 2
Source/GLS.HeightData.pas

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

+ 15 - 22
Source/GLS.HeightTileFileHDS.pas

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

+ 3 - 3
Source/GLS.Imposter.pas

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

+ 3 - 3
Source/GLS.Isolines.pas

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

+ 52 - 68
Source/GLS.Isosurface.pas

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

+ 4 - 4
Source/GLS.LinePFX.pas

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

+ 4 - 4
Source/GLS.Material.pas

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

+ 11 - 11
Source/GLS.MaterialEx.pas

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

+ 13 - 13
Source/GLS.MeshBSP.pas

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

+ 19 - 19
Source/GLS.MeshBuilder.pas

@@ -345,8 +345,8 @@ procedure OptimizeMesh(aMeshObject: TGLMeshObject;
 var
 var
   i: Integer;
   i: Integer;
   fg: TGLFaceGroup;
   fg: TGLFaceGroup;
-  coords, TexCoords, Normals: TAffineVectorList;
-  il: TIntegerList;
+  coords, TexCoords, Normals: TGLAffineVectorList;
+  il: TGLIntegerList;
   materialName: String;
   materialName: String;
 begin
 begin
   if (mooMergeObjects in options) then
   if (mooMergeObjects in options) then
@@ -370,8 +370,8 @@ begin
     begin
     begin
       if aMeshObject.FaceGroups.Count = 1 then
       if aMeshObject.FaceGroups.Count = 1 then
         materialName := aMeshObject.FaceGroups[0].materialName;
         materialName := aMeshObject.FaceGroups[0].materialName;
-      TexCoords := TAffineVectorList.Create;
-      Normals := TAffineVectorList.Create;
+      TexCoords := TGLAffineVectorList.Create;
+      Normals := TGLAffineVectorList.Create;
       coords := aMeshObject.ExtractTriangles(TexCoords, Normals);
       coords := aMeshObject.ExtractTriangles(TexCoords, Normals);
       try
       try
         il := BuildVectorCountOptimizedIndices(coords, Normals, TexCoords);
         il := BuildVectorCountOptimizedIndices(coords, Normals, TexCoords);
@@ -426,20 +426,20 @@ procedure FacesSmooth(aMeshObj: TGLMeshObject;
   InvertNormals: boolean = false);
   InvertNormals: boolean = false);
 Var
 Var
   i, J, k, L: Integer;
   i, J, k, L: Integer;
-  WeldedVertex: TAffineVectorList;
-  TmpIntegerList: TIntegerList;
+  WeldedVertex: TGLAffineVectorList;
+  TmpIntegerList: TGLIntegerList;
   IndexMap: TStringList;
   IndexMap: TStringList;
   n: TAffineVector;
   n: TAffineVector;
-  indicesMap: TIntegerList;
+  indicesMap: TGLIntegerList;
   Index: Integer;
   Index: Integer;
-  FaceList: TIntegerList;
-  NormalList: TAffineVectorList;
-  FaceNormalList: TAffineVectorList;
+  FaceList: TGLIntegerList;
+  NormalList: TGLAffineVectorList;
+  FaceNormalList: TGLAffineVectorList;
   FaceGroup: TGLFaceGroup;
   FaceGroup: TGLFaceGroup;
   fg, FG1: TFGVertexIndexList;
   fg, FG1: TFGVertexIndexList;
   Threshold: Single;
   Threshold: Single;
   Angle: Single;
   Angle: Single;
-  ReferenceMap: TIntegerList;
+  ReferenceMap: TGLIntegerList;
   ID1, ID2: Integer;
   ID1, ID2: Integer;
   Index1, Index2, Index3: Integer;
   Index1, Index2, Index3: Integer;
 
 
@@ -465,10 +465,10 @@ Var
 begin
 begin
   Threshold := aThreshold * Pi / 180.0;
   Threshold := aThreshold * Pi / 180.0;
   // build the vectices reference map
   // build the vectices reference map
-  ReferenceMap := TIntegerList.Create;
-  WeldedVertex := TAffineVectorList.Create;
+  ReferenceMap := TGLIntegerList.Create;
+  WeldedVertex := TGLAffineVectorList.Create;
   WeldedVertex.Assign(aMeshObj.Vertices);
   WeldedVertex.Assign(aMeshObj.Vertices);
-  indicesMap := TIntegerList.Create;
+  indicesMap := TGLIntegerList.Create;
   // first of all, weld the very closed vertices
   // first of all, weld the very closed vertices
   WeldVertices(WeldedVertex, indicesMap, aWeldDistance);
   WeldVertices(WeldedVertex, indicesMap, aWeldDistance);
   // then, rebuild the map list
   // then, rebuild the map list
@@ -476,7 +476,7 @@ begin
   for i := 0 to WeldedVertex.Count - 1 do
   for i := 0 to WeldedVertex.Count - 1 do
   begin
   begin
     ReferenceMap.Assign(indicesMap);
     ReferenceMap.Assign(indicesMap);
-    TmpIntegerList := TIntegerList.Create;
+    TmpIntegerList := TGLIntegerList.Create;
     Index := ReferenceMap.IndexOf(i);
     Index := ReferenceMap.IndexOf(i);
     while Index >= 0 do
     while Index >= 0 do
     begin
     begin
@@ -491,10 +491,10 @@ begin
   WeldedVertex.Free;
   WeldedVertex.Free;
   indicesMap.Free;
   indicesMap.Free;
   // creates a TexPoint list for save face infomation, where s=facegroup index, t=face index
   // 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
   for i := 0 to aMeshObj.FaceGroups.Count - 1 do
   begin
   begin
     FaceGroup := aMeshObj.FaceGroups[i];
     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);
   Res: TGLMeshObject; const MaterialName1, MaterialName2: string);
 
 
 var
 var
-  v1, t1, n1: TAffineVectorList;
-  v2, t2, n2: TAffineVectorList;
+  v1, t1, n1: TGLAffineVectorList;
+  v2, t2, n2: TGLAffineVectorList;
   BSP1, BSP2: TBSPMeshObject;
   BSP1, BSP2: TBSPMeshObject;
   FG1, FG2: TFGBSPNode;
   FG1, FG2: TFGBSPNode;
   i: Integer;
   i: Integer;
@@ -526,8 +526,8 @@ begin
   FG1 := TFGBSPNode.CreateOwned(BSP1.FaceGroups);
   FG1 := TFGBSPNode.CreateOwned(BSP1.FaceGroups);
   FG2 := TFGBSPNode.CreateOwned(BSP2.FaceGroups);
   FG2 := TFGBSPNode.CreateOwned(BSP2.FaceGroups);
 
 
-  t1 := TAffineVectorList.create;
-  n1 := TAffineVectorList.create;
+  t1 := TGLAffineVectorList.create;
+  n1 := TGLAffineVectorList.create;
   v1 := obj1.ExtractTriangles(t1, n1);
   v1 := obj1.ExtractTriangles(t1, n1);
 
 
   v1.TransformAsPoints(obj1.Owner.Owner.Matrix^);
   v1.TransformAsPoints(obj1.Owner.Owner.Matrix^);
@@ -538,8 +538,8 @@ begin
   BSP1.TexCoords := t1;
   BSP1.TexCoords := t1;
   FG1.VertexIndices.AddSerie(0, 1, BSP1.Vertices.Count);
   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 := obj2.ExtractTriangles(t2, n2);
   v2.TransformAsPoints(obj2.Owner.Owner.Matrix^);
   v2.TransformAsPoints(obj2.Owner.Owner.Matrix^);
 
 

+ 4 - 4
Source/GLS.MeshLines.pas

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

Diff do ficheiro suprimidas por serem muito extensas
+ 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. 
 (* Object with support for complex polygons. 
    When the tesselator finds an intersection of edges it wants us to give him some storage
    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
    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
    can happen implicitly while adding. The TGLVectorPool keeps all pointers valid until the
    destruction itself.
    destruction itself.
    Reactivated the TGLVectorPool object. The GLS.VectorLists are not suitable for this job.
    Reactivated the TGLVectorPool object. The GLS.VectorLists are not suitable for this job.
@@ -93,14 +93,14 @@ type
     procedure GetExtents(var min, max: TAffineVector);
     procedure GetExtents(var min, max: TAffineVector);
   end;
   end;
 
 
-  TGLPolygonList = class(TPersistentObjectList)
+  TGLPolygonList = class(TGLPersistentObjectList)
   private
   private
-    FAktList: TAffineVectorList;
-    function GetList(I: Integer): TAffineVectorList;
+    FAktList: TGLAffineVectorList;
+    function GetList(I: Integer): TGLAffineVectorList;
   public
   public
     procedure Add;
     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;
   end;
 
 
   (* Multipolygon is defined with multiple contours.
   (* Multipolygon is defined with multiple contours.
@@ -167,7 +167,7 @@ type
   end;
   end;
 
 
   (* Page oriented pointer array, with persistent pointer target memory.
   (* 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.
     a call to SetCapacity, which might be done implicitely during Add.
     The TGLVectorPool keeps memory in its original position during its
     The TGLVectorPool keeps memory in its original position during its
     whole lifetime. *)
     whole lifetime. *)
@@ -235,14 +235,14 @@ end;
 
 
 procedure TGLPolygonList.Add;
 procedure TGLPolygonList.Add;
 begin
 begin
-  FAktList := TAffineVectorList.Create;
+  FAktList := TGLAffineVectorList.Create;
   inherited Add(FAktList);
   inherited Add(FAktList);
 end;
 end;
 
 
 
 
-function TGLPolygonList.GetList(i: Integer): TAffineVectorList;
+function TGLPolygonList.GetList(i: Integer): TGLAffineVectorList;
 begin
 begin
-  Result := TAffineVectorList(Items[i]);
+  Result := TGLAffineVectorList(Items[i]);
 end;
 end;
 
 
 // ------------------
 // ------------------

+ 13 - 13
Source/GLS.Objects.pas

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

+ 17 - 17
Source/GLS.Octree.pas

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

+ 39 - 39
Source/GLS.ParametricSurfaces.pas

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

+ 22 - 22
Source/GLS.ParticleFX.pas

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

+ 113 - 114
Source/GLS.PersistentClasses.pas

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

+ 26 - 26
Source/GLS.ROAMPatch.pas

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

+ 16 - 16
Source/GLS.Ragdoll.pas

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

+ 39 - 34
Source/GLS.RandomHDS.pas

@@ -1,7 +1,6 @@
 //
 //
 // The graphics rendering engine GLScene http://glscene.org
 // The graphics rendering engine GLScene http://glscene.org
 //
 //
-
 unit GLS.RandomHDS;
 unit GLS.RandomHDS;
 
 
 (*
 (*
@@ -266,8 +265,8 @@ type
       and sea steps. *)
       and sea steps. *)
     procedure BuildLandscape;
     procedure BuildLandscape;
     (* - Compute the light effects
     (* - 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; overload;
     procedure BuildLightMap(const aLightDirection: TGLVector); overload;
     procedure BuildLightMap(const aLightDirection: TGLVector); overload;
     // Normals are needed for lighting and slope-based textures
     // Normals are needed for lighting and slope-based textures
@@ -298,7 +297,10 @@ type
       though. Some tweaking may be needed *)
       though. Some tweaking may be needed *)
     procedure DoErosionByLife;
     procedure DoErosionByLife;
     (* Create sharp valleys and canyons. If DepositRate>0, it will also fill the
     (* 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;
     procedure DoErosionByRain;
     // Create a beach and a cliff around the islands
     // Create a beach and a cliff around the islands
     procedure DoErosionBySea;
     procedure DoErosionBySea;
@@ -386,10 +388,11 @@ type
   TGLLandTile = TGLCustomRandomHDS;
   TGLLandTile = TGLCustomRandomHDS;
 
 
   TRelativeCoordinate = record
   TRelativeCoordinate = record
-    DX, DZ: integer 
+    DX, DZ: integer
   end;
   end;
   TOnCreateLandTile =  procedure(x, z, Seed: integer; var aLandscape: TGLLandTile) of object;
   TOnCreateLandTile =  procedure(x, z, Seed: integer; var aLandscape: TGLLandTile) of object;
   TIsDefaultTile =  function(X, Z: integer): boolean of object;
   TIsDefaultTile =  function(X, Z: integer): boolean of object;
+
   TGLTiledRndLandscape = class(TGLBaseRandomHDS)
   TGLTiledRndLandscape = class(TGLBaseRandomHDS)
   private 
   private 
     FLandTileComputing: boolean; // Is a landtile being computed?
     FLandTileComputing: boolean; // Is a landtile being computed?
@@ -500,12 +503,12 @@ type
       a unique seed for each landtile *)
       a unique seed for each landtile *)
     property ExtentX: integer read FExtentX write SetExtentX;
     property ExtentX: integer read FExtentX write SetExtentX;
     property ExtentZ: integer read FExtentZ write SetExtentZ;
     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;
     property GenerationRadius: integer read FGenerationRadius write SetGenerationRadius;
     // Number of landtile to keep in memory. Should not be modified.
     // Number of landtile to keep in memory. Should not be modified.
     property LandTileCapacity: integer read FLandTileCapacity write SetLandTileCapacity;
     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;
     property LandTileDensity: single read FLandTileDensity write SetLandTileDensity;
     // Base seed for the entire archipelago
     // Base seed for the entire archipelago
     property Seed: integer read FSeed write SetSeed;
     property Seed: integer read FSeed write SetSeed;
@@ -559,7 +562,7 @@ type
     // Ranges for the roughness parameter in the fractal algorithm 
     // Ranges for the roughness parameter in the fractal algorithm 
     property RoughnessMax: single read FRoughnessMax write SetRoughnessMax;
     property RoughnessMax: single read FRoughnessMax write SetRoughnessMax;
     property RoughnessMin: single read FRoughnessMin write SetRoughnessMin;
     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;
     property SeaDynamic: boolean read FSeaDynamic write SetSeaDynamic;
     (* Reference to a material in the TerrainRenderer's material library. This
     (* Reference to a material in the TerrainRenderer's material library. This
       material will be used to drape the water plane. *)
       material will be used to drape the water plane. *)
@@ -847,9 +850,9 @@ begin
   FTextureScale := Value;
   FTextureScale := Value;
 end;
 end;
 
 
-//
+// ----------------------------------------------
 // TGLCustomRandomHDS
 // TGLCustomRandomHDS
-//
+// ----------------------------------------------
 procedure TGLCustomRandomHDS.BoundaryClamp(var x, y: single);
 procedure TGLCustomRandomHDS.BoundaryClamp(var x, y: single);
 begin
 begin
   ClampValue(x, 0, FSize);
   ClampValue(x, 0, FSize);
@@ -930,8 +933,8 @@ begin
   if FLandCover then
   if FLandCover then
     BuildTexture;
     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
   if not FKeepNormals then
     FNormal := nil;
     FNormal := nil;
   FLightMap := nil;
   FLightMap := nil;
@@ -962,7 +965,7 @@ begin
   NormalizeVector(l);
   NormalizeVector(l);
   NegateVector(l);
   NegateVector(l);
 
 
-  { Compute lighting }
+  // Compute lighting
   for i := 0 to FSize do
   for i := 0 to FSize do
   begin
   begin
     FTaskProgress := Round(i / FSize * 100);
     FTaskProgress := Round(i / FSize * 100);
@@ -977,7 +980,7 @@ begin
     end; // for
     end; // for
   end; // for i
   end; // for i
 
 
-  { Shadows }
+  // Shadows
   if FShadows then
   if FShadows then
   begin
   begin
     FTask := 'Shadow casting';
     FTask := 'Shadow casting';
@@ -1013,7 +1016,7 @@ begin
     end; // for i
     end; // for i
   end; // if
   end; // if
 
 
-  { Smoothing }
+  // Smoothing
   if FLightSmoothing then
   if FLightSmoothing then
   begin
   begin
     FTask := 'Light-map smoothing';
     FTask := 'Light-map smoothing';
@@ -1254,9 +1257,10 @@ end; // *)
   fTask:='Texture creation';
   fTask:='Texture creation';
   fTaskProgress:=0;
   fTaskProgress:=0;
 
 
-  {Draw bitmap}
+  //Draw bitmap
   try
   try
-  with Bmp do begin
+  with Bmp do
+  begin
   PixelFormat:=pf24bit;
   PixelFormat:=pf24bit;
   Width:=fSize*TextureScale;
   Width:=fSize*TextureScale;
   Height:=fSize*TextureScale;
   Height:=fSize*TextureScale;
@@ -1264,7 +1268,8 @@ end; // *)
   for y:=0 to fSize*TextureScale-1 do begin
   for y:=0 to fSize*TextureScale-1 do begin
   fTaskProgress:=Round(y/(fSize*TextureScale)*100);
   fTaskProgress:=Round(y/(fSize*TextureScale)*100);
   Application.ProcessMessages;
   Application.ProcessMessages;
-  for x:=0 to fSize*TextureScale-1 do begin
+  for x:=0 to fSize*TextureScale-1 do
+  begin
   i:=x div TextureScale;
   i:=x div TextureScale;
   j:=y div TextureScale;
   j:=y div TextureScale;
   z:=Interpolate(x/TextureScale,y/TextureScale);
   z:=Interpolate(x/TextureScale,y/TextureScale);
@@ -1283,8 +1288,9 @@ end; // *)
   end;//with
   end;//with
   //Bmp.SaveToFile('test.bmp');
   //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.Assign(Bmp);
   Image.NotifyChange(Self);
   Image.NotifyChange(Self);
   Enabled:=true;
   Enabled:=true;
@@ -1400,7 +1406,7 @@ var
   x, y, i: integer;
   x, y, i: integer;
   z, z1: single;
   z, z1: single;
 begin
 begin
-  { Smoothing by a 3-by-3 mean filter }
+  // Smoothing by a 3-by-3 mean filter
   FTask := 'Erosion by life';
   FTask := 'Erosion by life';
   FTaskProgress := 0;
   FTaskProgress := 0;
   for y := 0 to FSize do
   for y := 0 to FSize do
@@ -1422,8 +1428,6 @@ begin
 end;
 end;
 
 
 procedure TGLCustomRandomHDS.DoErosionByRain;
 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
 const
   Ks = 0.001; // Soil solubility
   Ks = 0.001; // Soil solubility
 var
 var
@@ -1445,7 +1449,7 @@ begin
   MinZ := 0;
   MinZ := 0;
   Next := 0;
   Next := 0;
 
 
-  { Rain }
+  // Rain
   for y0 := 0 to FSize do
   for y0 := 0 to FSize do
   begin
   begin
     FTaskProgress := Round(y0 / (FSize) * 100);
     FTaskProgress := Round(y0 / (FSize) * 100);
@@ -1530,7 +1534,7 @@ end; // *)
   dz,mindz	:single;
   dz,mindz	:single;
   begin
   begin
   c:=1/VSF/sqrt(sqr(Scale.X)+sqr(Scale.Z));
   c:=1/VSF/sqrt(sqr(Scale.X)+sqr(Scale.Z));
-  {Water flow map computation}
+  // Water flow map computation
   SetLength(Flow,fSize+1,fSize+1);
   SetLength(Flow,fSize+1,fSize+1);
   for y:=0 to fSize do begin
   for y:=0 to fSize do begin
   for x:=0 to fSize do begin
   for x:=0 to fSize do begin
@@ -1568,7 +1572,7 @@ end; // *)
   end;//for
   end;//for
   From:=0;
   From:=0;
 
 
-  {Rain}
+  //Rain
   for y0:=0 to fSize do begin
   for y0:=0 to fSize do begin
   for x0:=0 to fSize do begin
   for x0:=0 to fSize do begin
   x:=x0;
   x:=x0;
@@ -1591,7 +1595,7 @@ end; // *)
   end;//for x0
   end;//for x0
   end;//for y0
   end;//for y0
 
 
-  {Apply erosion}
+  //Apply erosion
   for y:=0 to fSize do begin
   for y:=0 to fSize do begin
   for x:=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;
   //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);
   SetLength(Erosion,fSize+2,fSize+2);
   for y:=0 to fSize+1 do for x:=0 to fSize+1 do Erosion[x,y]:=0;
   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 y:=0 to fSize+1 do begin
   for x:=0 to fSize+1 do begin
   for x:=0 to fSize+1 do begin
   z:=fHeight[x,y];
   z:=fHeight[x,y];
@@ -1654,7 +1658,7 @@ end; // *)
   end;//for x
   end;//for x
   end;//for y
   end;//for y
 
 
-  {Apply erosion to each cell}
+  //Apply erosion to each cell
   for y:=0 to fSize do begin
   for y:=0 to fSize do begin
   for x:=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;
   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 i:=1 to 1 do begin
   //for y:=0 to fSize+1 do for x:=0 to fSize+1 do Erosion[x,y]:=0;
   //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 y:=5 to fSize-4 do begin
   for x:=5 to fSize-4 do begin
   for x:=5 to fSize-4 do begin
   z:=fHeight[x,y];
   z:=fHeight[x,y];
@@ -1704,7 +1708,7 @@ end; // *)
   end;//for x
   end;//for x
   end;//for y
   end;//for y
 
 
-  {Apply erosion to each cell}
+  //Apply erosion to each cell
   for y:=0 to fSize do begin
   for y:=0 to fSize do begin
   for x:=0 to fSize do begin
   for x:=0 to fSize do begin
   fHeight[x,y]:=fHeight[x,y]+Erosion[x,y]*100*Intensity;
   fHeight[x,y]:=fHeight[x,y]+Erosion[x,y]*100*Intensity;
@@ -1967,8 +1971,9 @@ begin
   FKeepNormals := Value;
   FKeepNormals := Value;
 end;
 end;
 
 
-{ TGLFractalHDS }
-
+// --------------------------------------
+// TGLFractalHDS
+// --------------------------------------
 procedure TGLFractalHDS.BuildHeightField(const aDepth, aSeed, aAmplitude: integer);
 procedure TGLFractalHDS.BuildHeightField(const aDepth, aSeed, aAmplitude: integer);
 begin
 begin
   fDepth := aDepth;
   fDepth := aDepth;

+ 2 - 2
Source/GLS.RenderContextInfo.pas

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

+ 16 - 16
Source/GLS.Scene.pas

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

+ 11 - 12
Source/GLS.Screen.pas

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

+ 2 - 2
Source/GLS.ShadowVolume.pas

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

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff