Debian Codegraph @

src/transform/castletransform_serialize.inc

raw
1 {%MainUnit castletransform.pas}
2 {
3 Copyright 2018-2021 Michalis Kamburelis.
4
5 This file is part of "Castle Game Engine".
6
7 "Castle Game Engine" is free software; see the file COPYING.txt,
8 included in this distribution, for details about the copyright.
9
10 "Castle Game Engine" is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 ----------------------------------------------------------------------------
15 }
16
17 { Integration of TCastleTransform with CastleComponentSerialize. }
18
19 {$ifdef read_interface}
20
21 { Save / load TCastleTransform (or descendant) to a .castle-transform file.
22
23 An example:
24 @includeCode(../../examples/short_api_samples/transform_save_load/transform_save_load.dpr) }
25 procedure TransformSave(const T: TCastleTransform; const Url: String);
26 function TransformLoad(const Url: String; const Owner: TComponent): TCastleTransform;
27
28 {$endif read_interface}
29
30 {$ifdef read_implementation}
31
32 procedure TransformSave(const T: TCastleTransform; const Url: String);
33 begin
34 ComponentSave(T, Url);
35 end;
36
37 function TransformLoad(const Url: String; const Owner: TComponent): TCastleTransform;
38 begin
39 Result := ComponentLoad(Url, Owner) as TCastleTransform;
40 end;
41
42 {$endif read_implementation}