2002-07-16 21:03:14 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2005-01-01 16:09:25 +00:00
|
|
|
* Copyright (C) 2002-2005 The ScummVM project
|
2002-07-16 21:03:14 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OBJECT_H
|
|
|
|
#define OBJECT_H
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
namespace Scumm {
|
|
|
|
|
2003-09-11 10:32:15 +00:00
|
|
|
struct ObjectData {
|
|
|
|
uint32 OBIMoffset;
|
|
|
|
uint32 OBCDoffset;
|
|
|
|
int16 walk_x, walk_y;
|
|
|
|
uint16 obj_nr;
|
|
|
|
int16 x_pos;
|
|
|
|
int16 y_pos;
|
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
|
|
|
byte actordir;
|
|
|
|
byte parent;
|
|
|
|
byte parentstate;
|
|
|
|
byte state;
|
|
|
|
byte fl_object_index;
|
2004-10-08 23:06:19 +00:00
|
|
|
byte flags;
|
2003-09-11 10:32:15 +00:00
|
|
|
};
|
|
|
|
|
2002-07-16 21:03:14 +00:00
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma START_PACK_STRUCTS
|
2004-08-27 23:50:45 +00:00
|
|
|
#endif
|
2002-07-16 21:03:14 +00:00
|
|
|
|
|
|
|
struct RoomHeader {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint16 width, height;
|
|
|
|
uint16 numObjects;
|
2002-12-24 03:42:18 +00:00
|
|
|
} GCC_PACK old;
|
|
|
|
|
2002-07-16 21:03:14 +00:00
|
|
|
struct {
|
2002-12-24 03:42:18 +00:00
|
|
|
uint32 version;
|
2002-07-16 21:03:14 +00:00
|
|
|
uint16 width, height;
|
|
|
|
uint16 numObjects;
|
2002-12-24 03:42:18 +00:00
|
|
|
} GCC_PACK v7;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint32 version;
|
|
|
|
uint32 width, height;
|
|
|
|
uint32 numObjects;
|
2002-12-24 10:04:38 +00:00
|
|
|
uint32 numZBuffer;
|
2004-10-04 12:16:52 +00:00
|
|
|
uint32 transparency;
|
2002-12-24 03:42:18 +00:00
|
|
|
} GCC_PACK v8;
|
2002-07-16 21:03:14 +00:00
|
|
|
} GCC_PACK;
|
|
|
|
} GCC_PACK;
|
|
|
|
|
|
|
|
struct CodeHeader {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint16 obj_id;
|
|
|
|
byte x, y, w, h;
|
|
|
|
byte flags;
|
|
|
|
byte parent;
|
|
|
|
int16 walk_x;
|
|
|
|
int16 walk_y;
|
|
|
|
byte actordir;
|
|
|
|
} GCC_PACK v5;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint16 obj_id;
|
|
|
|
int16 x, y;
|
|
|
|
uint16 w, h;
|
|
|
|
byte flags, parent;
|
|
|
|
uint16 unk1;
|
|
|
|
uint16 unk2;
|
|
|
|
byte actordir;
|
|
|
|
} GCC_PACK v6;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint32 version;
|
|
|
|
uint16 obj_id;
|
|
|
|
byte parent;
|
|
|
|
byte parentstate;
|
|
|
|
} GCC_PACK v7;
|
2004-08-27 23:50:45 +00:00
|
|
|
|
2002-07-16 21:03:14 +00:00
|
|
|
} GCC_PACK;
|
|
|
|
} GCC_PACK;
|
|
|
|
|
|
|
|
struct ImageHeader { /* file format */
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint16 obj_id;
|
2004-09-02 10:18:34 +00:00
|
|
|
uint16 image_count;
|
2004-09-26 15:25:58 +00:00
|
|
|
uint16 unk[1];
|
2004-10-08 23:06:19 +00:00
|
|
|
byte flags;
|
2004-09-26 15:25:58 +00:00
|
|
|
byte unk1;
|
|
|
|
uint16 unk2[2];
|
2002-07-16 21:03:14 +00:00
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
2002-12-24 03:42:18 +00:00
|
|
|
uint16 hotspot_num;
|
2002-07-16 21:03:14 +00:00
|
|
|
struct {
|
|
|
|
int16 x, y;
|
|
|
|
} GCC_PACK hotspot[15];
|
|
|
|
} GCC_PACK old;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint32 version;
|
|
|
|
uint16 obj_id;
|
2004-09-02 10:18:34 +00:00
|
|
|
uint16 image_count;
|
2002-07-16 21:03:14 +00:00
|
|
|
int16 x_pos, y_pos;
|
|
|
|
uint16 width, height;
|
|
|
|
byte unk2[3];
|
|
|
|
byte actordir;
|
2002-12-24 03:42:18 +00:00
|
|
|
uint16 hotspot_num;
|
2002-07-16 21:03:14 +00:00
|
|
|
struct {
|
|
|
|
int16 x, y;
|
|
|
|
} GCC_PACK hotspot[15];
|
|
|
|
} GCC_PACK v7;
|
2002-12-24 03:42:18 +00:00
|
|
|
|
|
|
|
struct {
|
2004-08-27 23:50:45 +00:00
|
|
|
char name[32];
|
|
|
|
uint32 unk_1[2];
|
|
|
|
uint32 version; // 801 in COMI, 800 in the COMI demo
|
|
|
|
uint32 image_count;
|
|
|
|
uint32 x_pos;
|
|
|
|
uint32 y_pos;
|
|
|
|
uint32 width;
|
|
|
|
uint32 height;
|
|
|
|
uint32 actordir;
|
2004-10-08 23:06:19 +00:00
|
|
|
uint32 flags; // This field is missing in the COMI demo (version == 800) !
|
2002-12-24 03:42:18 +00:00
|
|
|
struct {
|
|
|
|
int32 x, y;
|
|
|
|
} GCC_PACK hotspot[15];
|
|
|
|
} GCC_PACK v8;
|
2002-07-16 21:03:14 +00:00
|
|
|
} GCC_PACK;
|
|
|
|
} GCC_PACK;
|
|
|
|
|
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma END_PACK_STRUCTS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct FindObjectInRoom {
|
2003-05-28 20:01:47 +00:00
|
|
|
const CodeHeader *cdhd;
|
|
|
|
const byte *obcd;
|
|
|
|
const ImageHeader *imhd;
|
|
|
|
const byte *obim;
|
|
|
|
const byte *roomptr;
|
2002-07-16 21:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum FindObjectWhat {
|
|
|
|
foCodeHeader = 1,
|
|
|
|
foImageHeader = 2,
|
|
|
|
foCheckAlreadyLoaded = 4
|
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
|
|
|
|
2002-07-16 21:03:14 +00:00
|
|
|
|
|
|
|
#endif
|