aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/duckman/duckman_screenshakereffects.cpp
blob: 6ccb143bf0b9cd38b0c264b24d3387c43dd42472 (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
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#include "illusions/duckman/illusions_duckman.h"
#include "illusions/duckman/duckman_screenshakereffects.h"

#include "engines/util.h"

namespace Illusions {

static const ScreenShakerPoint kShakerPoints0[] = {
	{0, -2}, {0, -4}, {0, -3}, {0, -1}, {0, 1}
};

static const ScreenShakeEffect kShakerEffect0 = {
	ARRAYSIZE(kShakerPoints0), 5, kShakerPoints0
};

static const ScreenShakerPoint kShakerPoints1[] = {
	{-4, -5}, {4,  5}, {-3, -4}, {3, 4}, {-2, -3}, {2, 3}, {-1, -2},
	{ 1,  2}, {0, -1}
};

static const ScreenShakeEffect kShakerEffect1 = {
	ARRAYSIZE(kShakerPoints1), 2, kShakerPoints1
};

static const ScreenShakerPoint kShakerPoints2[] = {
	{0, -3}, {0,  3}, {0, -2}, {0, 2}, {0, -2}, {0, 2}, {0, -1},
	{0,  1}, {0, -1},
};

static const ScreenShakeEffect kShakerEffect2 = {
	ARRAYSIZE(kShakerPoints2), 2, kShakerPoints2
};

static const ScreenShakerPoint kShakerPoints3[] = {
	{0, 1}, {0, -1}, {0, -2}, {0, 0}, {(int16)32768, 0}
};

static const ScreenShakeEffect kShakerEffect3 = {
	ARRAYSIZE(kShakerPoints3), 2, kShakerPoints3
};

static const ScreenShakerPoint kShakerPoints4[] = {
	{0, 4}, {0, -1}, {0, 3}, {0, -2}, {0, 1}, {0, -1}, {0, 1}, {0, -1}
};

static const ScreenShakeEffect kShakerEffect4 = {
	ARRAYSIZE(kShakerPoints4), 5, kShakerPoints4
};

static const ScreenShakerPoint kShakerPoints5[] = {
	{0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0},
	{0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0},
	{0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0},
	{0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0}
};

static const ScreenShakeEffect kShakerEffect5 = {
	ARRAYSIZE(kShakerPoints5), 2, kShakerPoints5
};

static const ScreenShakeEffect *kShakerEffects[] = {
	&kShakerEffect0,
	&kShakerEffect1,
	&kShakerEffect2,
	&kShakerEffect3,
	&kShakerEffect4,
	&kShakerEffect5
};

const ScreenShakeEffect *getScreenShakeEffect(byte index) {
	return kShakerEffects[index];
}

} // End of namespace Illusions