mirror of
https://git.sr.ht/~rabbits/macintosh_cookbook
synced 2025-01-13 13:33:08 +00:00
Added shape budget
This commit is contained in:
parent
d8a070b5d7
commit
de90f4e649
@ -5,6 +5,7 @@ interface
|
||||
FixMath, Graf3D;
|
||||
|
||||
const
|
||||
LIMIT_SHAPES = 30;
|
||||
LIMIT_VERTICES = 32;
|
||||
LIMIT_EDGES = 40;
|
||||
LIMIT_FACES = 8;
|
||||
@ -37,7 +38,7 @@ interface
|
||||
|
||||
Scene3D = record
|
||||
length: Integer;
|
||||
shapes: array[1..30] of Shape3DPtr;
|
||||
shapes: array[1..LIMIT_SHAPES] of Shape3DPtr;
|
||||
end;
|
||||
|
||||
Scene3DPtr = ^Scene3D;
|
||||
@ -59,6 +60,7 @@ interface
|
||||
|
||||
procedure InitWindow;
|
||||
procedure SetScene3D (var scene: Scene3D);
|
||||
procedure AddShape3D (var scene: scene3D; shape: Shape3DPtr);
|
||||
{scene}
|
||||
procedure SetVertice3D (var vertice: Point3D; x, y, z: Longint);
|
||||
procedure SetEdge3D (var edge: Edge3D; a, b: Point3DPtr);
|
||||
@ -68,7 +70,6 @@ interface
|
||||
procedure AddEdge3D (var shape: Shape3D; a, b: Integer);
|
||||
procedure AddFace3D (var shape: Shape3D; a, b, c: Integer);
|
||||
{ transforms }
|
||||
procedure AddShape3D (var scene: scene3D; shape: Shape3DPtr);
|
||||
procedure MoveShape3D (shape: Shape3DPtr; x, y, z: LongInt);
|
||||
procedure ScaleShape3D (shape: Shape3DPtr; x, y, z: LongInt);
|
||||
procedure TurnXShape3D (shape: Shape3DPtr);
|
||||
@ -132,6 +133,8 @@ implementation
|
||||
|
||||
procedure AddShape3D (var scene: scene3D; shape: Shape3DPtr);
|
||||
begin
|
||||
if scene.length > LIMIT_SHAPES - 1 then
|
||||
SceneError('Shapes limit reached');
|
||||
scene.length := scene.length + 1;
|
||||
scene.shapes[scene.length] := shape;
|
||||
end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user