diff options
author | johndoe123 | 2015-11-18 13:03:45 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | a30a31868b44d3218e59c6eca42bf1d924b996e8 (patch) | |
tree | b258104ca4918bcc6d7c5b28e6ea99583bd38de6 /engines/illusions/duckman/duckman_screenshakereffects.cpp | |
parent | 88ea89118473e149de077f2c620dc5424e1ed1a2 (diff) | |
download | scummvm-rg350-a30a31868b44d3218e59c6eca42bf1d924b996e8.tar.gz scummvm-rg350-a30a31868b44d3218e59c6eca42bf1d924b996e8.tar.bz2 scummvm-rg350-a30a31868b44d3218e59c6eca42bf1d924b996e8.zip |
ILLUSIONS: Move screen shaker effects into separate file
Diffstat (limited to 'engines/illusions/duckman/duckman_screenshakereffects.cpp')
-rw-r--r-- | engines/illusions/duckman/duckman_screenshakereffects.cpp | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/engines/illusions/duckman/duckman_screenshakereffects.cpp b/engines/illusions/duckman/duckman_screenshakereffects.cpp new file mode 100644 index 0000000000..44f3ebc0ee --- /dev/null +++ b/engines/illusions/duckman/duckman_screenshakereffects.cpp @@ -0,0 +1,102 @@ +/* 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_specialcode.h" +#include "illusions/duckman/duckman_inventory.h" +#include "illusions/duckman/propertytimers.h" +#include "illusions/duckman/scriptopcodes_duckman.h" +#include "illusions/actor.h" +#include "illusions/resources/scriptresource.h" +#include "illusions/specialcode.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 |