ScummVM API documentation
common_defines.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 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (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, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef AGS_SHARED_AC_COMMON_DEFINES_H
23#define AGS_SHARED_AC_COMMON_DEFINES_H
24
25#include "ags/shared/core/platform.h"
26
27namespace AGS3 {
28
29// Some arbitrary return values, should be replaced with either
30// simple boolean, or HError
31#define EXIT_NORMAL 0
32#define EXIT_CRASH 92
33#define EXIT_ERROR 93
34
35// Legacy (UNSUPPORTED!) interaction script constants
36//
37// NUMCONDIT : whataction[0]: Char walks off left
38// [1]: Char walks off right
39// [2]: Char walks off bottom
40// [3]: Char walks off top
41// [4]: First enters screen
42// [5]: Every time enters screen
43// [6]: execute every loop
44// [5]...[19]: Char stands on lookat type
45// [20]...[35]: Look at type
46// [36]...[49]: Action on type
47// [50]...[65]: Use inv on type
48// [66]...[75]: Look at object
49// [76]...[85]: Action on object
50// [86]...[95]: Speak to object
51// [96]...[105]: Use inv on object
52// [106]...[124]: Misc conditions 1-20
53
54// game ver whataction[]=
55// v1.00 0 : Go to screen
56// 1 : Don't do anything
57// 2 : Can't walk
58// 3 : Man dies
59// 4 : Run animation
60// 5 : Display message
61// 6 : Remove an object (set object.on=0)
62// 7 : Remove object & add Val2 to inventory
63// 8 : Add Val1 to inventory (Val2=num times)
64// 9 : Run a script
65// v1.00 SR-1 10 : Run graphical script
66// v1.1 11 : Play sound effect SOUND%d.WAV
67// v1.12 12 : Play FLI/FLC animation FLIC%d.FLC or FLIC%d.FLI
68// 13 : Turn object on
69// v2.00 14 : Run conversation
70#if defined(OBSOLETE)
71#define NUM_MISC 20
72#define NUMOTCON 7 // number of conditions before standing on
73#define NUM_CONDIT (120 + NUMOTCON)
74#define MISC_COND (MAX_WALK_BEHINDS * 4 + NUMOTCON + MAX_ROOM_OBJECTS * 4)
75#define NUMRESPONSE 14
76#define NUMCOMMANDS 15
77#define GO_TO_SCREEN 0
78#define NO_ACTION 1
79#define NO_WALK 2
80#define MAN_DIES 3
81#define RUN_ANIMATE 4
82#define SHOW_MESSAGE 5
83#define OBJECT_OFF 6
84#define OBJECT_INV 7
85#define ADD_INV 8
86#define RUNSCRIPT 9
87#define GRAPHSCRIPT 10
88#define PLAY_SOUND 11
89#define PLAY_FLI 12
90#define OBJECT_ON 13
91#define RUN_DIALOG 14
92#endif
93
94// Script name length limit for some game objects
95#define LEGACY_MAX_SCRIPT_NAME_LEN 20
96// Number of state-saved rooms
97#define MAX_ROOMS 300
98// Some obsolete room data, likely pre-2.5
99#define MAX_LEGACY_ROOM_FLAGS 15
100// Old object name limit
101#define LEGACY_MAXOBJNAMELEN 30
102// Max number of sprites in older versions
103#define LEGACY_MAX_SPRITES_V25 6000
104#define LEGACY_MAX_SPRITES 30000
105
106// The game to screen coordinate conversion multiplier, was used in older high-res games
107#define HIRES_COORD_MULTIPLIER 2
108
109// Room object flags (currently limited by a byte)
110#define OBJF_NOINTERACT 0x01 // not clickable
111#define OBJF_NOWALKBEHINDS 0x02 // ignore walk-behinds
112#define OBJF_HASTINT 0x04 // the tint_* members are valid
113#define OBJF_USEREGIONTINTS 0x08 // obey region tints/light areas
114#define OBJF_USEROOMSCALING 0x10 // obey room scaling areas
115#define OBJF_SOLID 0x20 // blocks characters from moving
116#define OBJF_LEGACY_LOCKED 0x40 // object position is locked in the editor (OBSOLETE since 3.5.0)
117#define OBJF_HASLIGHT 0x80 // the tint_light is valid and treated as brightness
118#define OBJF_TINTLIGHTMASK (OBJF_HASTINT | OBJF_HASLIGHT | OBJF_USEREGIONTINTS)
119
120// Animation flow mode
121// NOTE: had to move to common_defines, because used by CharacterInfo
122// Animates once and stops at the *last* frame
123#define ANIM_ONCE 0
124// Animates infinitely until stopped by command
125#define ANIM_REPEAT 1
126// Animates once and stops, resetting to the very first frame
127#define ANIM_ONCERESET 2
128
129} // namespace AGS3
130
131#endif