aboutsummaryrefslogtreecommitdiff
path: root/saga/events_mod.h
blob: 2fd0cf9c4b46f884eef50b777b4b4a76391ae5ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2004 The ScummVM project
 *
 * The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
 *
 * 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$
 *
 */

// Event module public header

#ifndef SAGA_EVENTS_MOD_H
#define SAGA_EVENTS_MOD_H

namespace Saga {

enum R_EVENT_TYPES {
	R_ONESHOT_EVENT,
	R_CONTINUOUS_EVENT,
	R_INTERVAL_EVENT
};

enum R_EVENT_FLAGS {
	R_SIGNALED = 0x8000,
	R_NODESTROY = 0x4000
};

enum R_EVENT_CODES {
	R_BG_EVENT = 1,
	R_ANIM_EVENT,
	R_MUSIC_EVENT,
	R_VOICE_EVENT,
	R_SOUND_EVENT,
	R_SCENE_EVENT,
	R_TEXT_EVENT,
	R_PAL_EVENT,
	R_PALANIM_EVENT,
	R_TRANSITION_EVENT,
	R_INTERFACE_EVENT,
	R_CONSOLE_EVENT,
	R_ACTOR_EVENT
};

enum R_EVENT_OPS {
	// INSTANTANEOUS events
	// BG events
	EVENT_DISPLAY = 1,
	// ANIM events
	EVENT_FRAME = 1,
	// MUISC & SOUND events
	EVENT_PLAY = 1,
	EVENT_STOP = 2,
	// SCENE events
	EVENT_END = 2,
	// TEXT events
	EVENT_HIDE = 2,
	EVENT_REMOVE = 3,
	// PALANIM events
	EVENT_CYCLESTART = 1,
	EVENT_CYCLESTEP = 2,
	// INTERFACE events
	EVENT_ACTIVATE = 1,
	EVENT_DEACTIVATE,
	// ACTOR events
	EVENT_MOVE = 1,

	// CONTINUOUS events
	// PALETTE events
	EVENT_PALTOBLACK = 1,
	EVENT_BLACKTOPAL = 2,
	// TRANSITION events
	EVENT_DISSOLVE = 1
};

enum R_EVENT_PARAMS {
	NO_SET_PALETTE,
	SET_PALETTE
};

struct R_EVENT {
	unsigned int type;
	unsigned int code; // Event operation category & flags 
	int op;            // Event operation
	long param;        // Optional event parameter
	long param2;
	void *data;        // Optional event data
	long time;         // Elapsed time until event
	long duration;     // Duration of event
	long d_reserved;

	R_EVENT *chain;    // Event chain (For consecutive events)
	R_EVENT() { memset(this, 0, sizeof(*this)); }
};

int EVENT_Init();
int EVENT_Shutdown();
int EVENT_HandleEvents(long msec);
int EVENT_ClearList();
int EVENT_FreeList();
R_EVENT *EVENT_Queue(R_EVENT *event);
R_EVENT *EVENT_Chain(R_EVENT *eead_event, R_EVENT *add_event);

} // End of namespace Saga

#endif