ScummVM API documentation
protocol.h
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  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_PROTOCOL_H
28 #define ICB_PROTOCOL_H
29 
30 #include "engines/icb/common/px_common.h"
31 
32 namespace ICB {
33 
34 #pragma pack(push)
35 #pragma pack(1)
36 
37 // old sword 2 stuff required for console font printing
38 
39 #define NAME_LEN 34
40 
41 typedef struct {
42  uint32 compSize; // compressed size of frame - NB. compression type is now in Anim Header
43  uint16 width; // dimensions of frame
44  uint16 height;
45 } _frameHeader;
46 
47 typedef struct {
48  uint8 fileType; // byte to define file type (see below)
49  uint8 compType; // type of file compression used ie. on whole file (see below)
50  uint32 compSize; // length of compressed file (ie. length on disk)
51  uint32 decompSize; // length of decompressed file held in memory (NB. frames still held compressed)
52  uint8 name[NAME_LEN]; // name of object
54 
55 typedef struct {
56  int16 x; // sprite x-coord OR offset to add to mega's feet x-coord to calc sprite y-coord
57  int16 y; // sprite y-coord OR offset to add to mega's feet y-coord to calc sprite y-coord
58  uint32 frameOffset; // points to start of frame header (from start of file header)
59  uint8 frameType; // 0=print sprite normally with top-left corner at (x,y), otherwise see below...
60 } _cdtEntry;
61 
62 typedef struct {
63  uint8 runTimeComp; // type of runtime compression used for the frame data (see below)
64  uint16 noAnimFrames; // number of frames in the anim (ie. no. of CDT entries)
65  uint16 feetStartX; // start coords for mega to walk to, before running anim
66  uint16 feetStartY;
67  uint8 feetStartDir; // direction to start in before running anim
68  uint16 feetEndX; // end coords for mega to stand at after running anim (vital if anim starts from an off-screen position, or ends in a different place from the start)
69  uint16 feetEndY;
70  uint8 feetEndDir; // direction to start in after running anim
71  uint16 blend;
72 } _animHeader;
73 
74 #pragma pack(pop)
75 
76 _frameHeader *FetchFrameHeader(uint8 *animFile, uint16 frameNo); // (25sep96JEL)
77 
78 } // End of namespace ICB
79 
80 #endif
Definition: actor.h:32
Definition: protocol.h:41
Definition: protocol.h:62
Definition: protocol.h:55
Definition: protocol.h:47