1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "ags/engine/ac/character_extras.h"
24 #include "ags/shared/util/stream.h"
25 
26 namespace AGS3 {
27 
28 using AGS::Shared::Stream;
29 
ReadFromFile(Stream * in)30 void CharacterExtras::ReadFromFile(Stream *in) {
31 	in->ReadArrayOfInt16(invorder, MAX_INVORDER);
32 	invorder_count = in->ReadInt16();
33 	width = in->ReadInt16();
34 	height = in->ReadInt16();
35 	zoom = in->ReadInt16();
36 	xwas = in->ReadInt16();
37 	ywas = in->ReadInt16();
38 	tint_r = in->ReadInt16();
39 	tint_g = in->ReadInt16();
40 	tint_b = in->ReadInt16();
41 	tint_level = in->ReadInt16();
42 	tint_light = in->ReadInt16();
43 	process_idle_this_time = in->ReadInt8();
44 	slow_move_counter = in->ReadInt8();
45 	animwait = in->ReadInt16();
46 }
47 
WriteToFile(Stream * out)48 void CharacterExtras::WriteToFile(Stream *out) {
49 	out->WriteArrayOfInt16(invorder, MAX_INVORDER);
50 	out->WriteInt16(invorder_count);
51 	out->WriteInt16(width);
52 	out->WriteInt16(height);
53 	out->WriteInt16(zoom);
54 	out->WriteInt16(xwas);
55 	out->WriteInt16(ywas);
56 	out->WriteInt16(tint_r);
57 	out->WriteInt16(tint_g);
58 	out->WriteInt16(tint_b);
59 	out->WriteInt16(tint_level);
60 	out->WriteInt16(tint_light);
61 	out->WriteInt8(process_idle_this_time);
62 	out->WriteInt8(slow_move_counter);
63 	out->WriteInt16(animwait);
64 }
65 
66 } // namespace AGS3
67