mirror of
https://git.sr.ht/~rabbits/macintosh_cookbook
synced 2024-05-29 06:41:28 +00:00
Minorcleanup
This commit is contained in:
parent
c4d46b9cee
commit
7f05b347e4
|
@ -58,17 +58,18 @@ interface
|
|||
scene: Scene3D;
|
||||
|
||||
procedure InitWindow;
|
||||
{scene}
|
||||
procedure SetScene3D (var scene: Scene3D);
|
||||
{scene}
|
||||
procedure SetVertice3D (var vertice: Point3D; x, y, z: Longint);
|
||||
procedure SetEdge3D (var edge: Edge3D; a, b: Point3DPtr);
|
||||
procedure SetFace3D (var face: Face3D; a, b, c: Point3DPtr);
|
||||
{ basics }
|
||||
procedure AddVertice3D (var shape: Shape3D; x, y, z: Fixed);
|
||||
procedure AddVertice3D (var shape: Shape3D; x, y, z: LongInt);
|
||||
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: Fixed);
|
||||
procedure MoveShape3D (shape: Shape3DPtr; x, y, z: LongInt);
|
||||
procedure ScaleShape3D (shape: Shape3DPtr; x, y, z: LongInt);
|
||||
procedure TurnXShape3D (shape: Shape3DPtr);
|
||||
procedure TurnYShape3D (shape: Shape3DPtr);
|
||||
|
@ -87,6 +88,48 @@ implementation
|
|||
Halt;
|
||||
end;
|
||||
|
||||
procedure SetVertice3D (var vertice: Point3D; x, y, z: Longint);
|
||||
begin
|
||||
SetPt3D(vertice, Long2Fix(x), Long2Fix(y), Long2Fix(z));
|
||||
end;
|
||||
|
||||
procedure SetEdge3D (var edge: Edge3D; a, b: Point3DPtr);
|
||||
begin
|
||||
edge.a := a;
|
||||
edge.b := b;
|
||||
end;
|
||||
|
||||
procedure SetFace3D (var face: Face3D; a, b, c: Point3DPtr);
|
||||
begin
|
||||
face.a := a;
|
||||
face.b := b;
|
||||
face.c := c;
|
||||
end;
|
||||
|
||||
procedure AddVertice3D (var shape: Shape3D; x, y, z: Fixed);
|
||||
begin
|
||||
if shape.verticesLength > LIMIT_VERTICES - 1 then
|
||||
SceneError('Vertices limit reached');
|
||||
shape.verticesLength := shape.verticesLength + 1;
|
||||
SetPt3D(shape.vertices[shape.verticesLength], Long2Fix(x), Long2Fix(y), Long2Fix(z));
|
||||
end;
|
||||
|
||||
procedure AddEdge3D (var shape: Shape3D; a, b: Integer);
|
||||
begin
|
||||
if shape.EdgesLength > LIMIT_EDGES - 1 then
|
||||
SceneError('Edges limit reached');
|
||||
shape.EdgesLength := shape.EdgesLength + 1;
|
||||
SetEdge3D(shape.edges[shape.EdgesLength], @shape.vertices[a], @shape.vertices[b]);
|
||||
end;
|
||||
|
||||
procedure AddFace3D (var shape: Shape3D; a, b, c: Integer);
|
||||
begin
|
||||
if shape.facesLength > LIMIT_FACES - 1 then
|
||||
SceneError('Edges limit reached');
|
||||
shape.facesLength := shape.facesLength + 1;
|
||||
SetFace3D(shape.faces[shape.facesLength], @shape.vertices[a], @shape.vertices[b], @shape.vertices[c]);
|
||||
end;
|
||||
|
||||
procedure AddShape3D (var scene: scene3D; shape: Shape3DPtr);
|
||||
begin
|
||||
scene.length := scene.length + 1;
|
||||
|
@ -137,48 +180,11 @@ implementation
|
|||
SetPt3D(shape^.vertices[i], shape^.vertices[i].y, shape^.vertices[i].x, shape^.vertices[i].z);
|
||||
end;
|
||||
|
||||
procedure SetEdge3D (var edge: Edge3D; a, b: Point3DPtr);
|
||||
begin
|
||||
edge.a := a;
|
||||
edge.b := b;
|
||||
end;
|
||||
|
||||
procedure SetFc3D (var face: Face3D; a, b, c: Point3DPtr);
|
||||
begin
|
||||
face.a := a;
|
||||
face.b := b;
|
||||
face.c := c;
|
||||
end;
|
||||
|
||||
procedure SetScene3D (var scene: Scene3D);
|
||||
begin
|
||||
scene.length := 0;
|
||||
end;
|
||||
|
||||
procedure AddVertice3D (var shape: Shape3D; x, y, z: Fixed);
|
||||
begin
|
||||
if shape.verticesLength > LIMIT_VERTICES - 1 then
|
||||
SceneError('Verticles limit reached');
|
||||
shape.verticesLength := shape.verticesLength + 1;
|
||||
SetPt3D(shape.vertices[shape.verticesLength], Long2Fix(x), Long2Fix(y), Long2Fix(z));
|
||||
end;
|
||||
|
||||
procedure AddEdge3D (var shape: Shape3D; a, b: Integer);
|
||||
begin
|
||||
if shape.EdgesLength > LIMIT_EDGES - 1 then
|
||||
SceneError('Edges limit reached');
|
||||
shape.EdgesLength := shape.EdgesLength + 1;
|
||||
SetEdge3D(shape.edges[shape.EdgesLength], @shape.vertices[a], @shape.vertices[b]);
|
||||
end;
|
||||
|
||||
procedure AddFace3D (var shape: Shape3D; a, b, c: Integer);
|
||||
begin
|
||||
if shape.facesLength > LIMIT_FACES - 1 then
|
||||
SceneError('Edges limit reached');
|
||||
shape.facesLength := shape.facesLength + 1;
|
||||
SetFc3D(shape.faces[shape.facesLength], @shape.vertices[a], @shape.vertices[b], @shape.vertices[c]);
|
||||
end;
|
||||
|
||||
procedure DrawEdge3D (edge: Edge3D);
|
||||
begin
|
||||
MoveTo3D(edge.a^.x, edge.a^.y, edge.a^.z);
|
||||
|
|
Loading…
Reference in New Issue
Block a user