summaryrefslogtreecommitdiff
path: root/public/shake.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/shake.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/shake.h')
-rw-r--r--public/shake.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/public/shake.h b/public/shake.h
new file mode 100644
index 0000000..8283d8d
--- /dev/null
+++ b/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