diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/shake.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/shake.h')
| -rw-r--r-- | mp/src/public/shake.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/mp/src/public/shake.h b/mp/src/public/shake.h new file mode 100644 index 00000000..37ae4144 --- /dev/null +++ b/mp/src/public/shake.h @@ -0,0 +1,63 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Network data for screen shake and screen fade.
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef SHAKE_H
+#define SHAKE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+//
+// Commands for the screen shake effect.
+//
+
+struct ScreenShake_t
+{
+ int command;
+ float amplitude;
+ float frequency;
+ float duration;
+};
+
+enum ShakeCommand_t
+{
+ SHAKE_START = 0, // Starts the screen shake for all players within the radius.
+ SHAKE_STOP, // Stops the screen shake for all players within the radius.
+ SHAKE_AMPLITUDE, // Modifies the amplitude of an active screen shake for all players within the radius.
+ SHAKE_FREQUENCY, // Modifies the frequency of an active screen shake for all players within the radius.
+ SHAKE_START_RUMBLEONLY, // Starts a shake effect that only rumbles the controller, no screen effect.
+ SHAKE_START_NORUMBLE, // Starts a shake that does NOT rumble the controller.
+};
+
+
+//
+// Screen shake message.
+//
+extern int gmsgShake;
+
+// Fade in/out
+extern int gmsgFade;
+
+#define FFADE_IN 0x0001 // Just here so we don't pass 0 into the function
+#define FFADE_OUT 0x0002 // Fade out (not in)
+#define FFADE_MODULATE 0x0004 // Modulate (don't blend)
+#define FFADE_STAYOUT 0x0008 // ignores the duration, stays faded out until new ScreenFade message received
+#define FFADE_PURGE 0x0010 // Purges all other fades, replacing them with this one
+
+#define SCREENFADE_FRACBITS 9 // which leaves 16-this for the integer part
+// This structure is sent over the net to describe a screen fade event
+struct ScreenFade_t
+{
+ unsigned short duration; // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration
+ unsigned short holdTime; // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration until reset (fade & hold)
+ short fadeFlags; // flags
+ byte r, g, b, a; // fade to color ( max alpha )
+};
+
+
+#endif // SHAKE_H
|