本文整理汇总了C++中Key_ClearStates函数的典型用法代码示例。如果您正苦于以下问题:C++ Key_ClearStates函数的具体用法?C++ Key_ClearStates怎么用?C++ Key_ClearStates使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Key_ClearStates函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CIN_PlayAllFrames
/*********
CIN_PlayAllFrames
arg - bink video filename
x - x origin for movie
y - y origin for movie
w - width of the movie
h - height of the movie
systemBits - bit rate for movie
keyBreakAllowed - if true, button press will end playback
Plays the target movie in full
*********/
bool CIN_PlayAllFrames( const char *arg, int x, int y, int w, int h, int systemBits, bool keyBreakAllowed )
{
bool retval;
Key_ClearStates();
// PC hack
qbInGameCinematicOnStandBy = qfalse;
#ifdef XBOX_DEMO
// When run from CDX, we can pause the timer during cutscenes:
extern void Demo_TimerPause( bool bPaused );
Demo_TimerPause( true );
#endif
int Handle = CIN_PlayCinematic(arg, x, y, w, h, systemBits, NULL);
if (Handle != -1)
{
while (CIN_RunCinematic(Handle) == FMV_PLAY && !(keyBreakAllowed && kg.anykeydown))
{
SCR_UpdateScreen ();
IN_Frame ();
Com_EventLoop ();
}
#ifdef _XBOX
// while (CIN_RunCinematic(Handle) == FMV_PLAY && !(keyBreakAllowed && !kg.anykeydown))
// {
// SCR_UpdateScreen ();
// IN_Frame ();
// Com_EventLoop ();
// }
#endif
CIN_StopCinematic(Handle);
}
#ifdef XBOX_DEMO
Demo_TimerPause( false );
#endif
retval =(keyBreakAllowed && kg.anykeydown);
Key_ClearStates();
// Soooper hack! Game ends up running for a couple frames after this cutscene. We don't want it to!
if( Q_stricmp(arg, "ja08") == 0 )
{
// Filth. Don't call Present until this gets cleared.
extern bool connectSwapOverride;
connectSwapOverride = true;
}
return retval;
}
示例2: Key_SetCatcher
/*
====================
Key_SetCatcher
====================
*/
void Key_SetCatcher( int catcher ) {
// If the catcher state is changing, clear all key states
if( catcher != keyCatchers )
Key_ClearStates( );
keyCatchers = catcher;
}
示例3: AppActivate
void AppActivate(BOOL fActive, BOOL minimize)
{
Minimized = minimize;
Key_ClearStates();
// we don't want to act like we're active if we're minimized
if (fActive && !Minimized)
ActiveApp = true;
else
ActiveApp = false;
// minimize/restore mouse-capture on demand
if (!ActiveApp)
{
IN_Activate (false);
CDAudio_Activate (false);
S_Activate (false);
if ( win_noalttab->value )
{
WIN_EnableAltTab();
}
}
else
{
IN_Activate (true);
CDAudio_Activate (true);
S_Activate (true);
if ( win_noalttab->value )
{
WIN_DisableAltTab();
}
}
}
示例4: VID_Shutdown
void VID_Shutdown(void)
{
if (context == NULL && window == NULL)
return;
VID_EnableJoystick(false);
VID_SetMouse(false, false, false);
VID_RestoreSystemGamma();
if (context != NULL)
{
qaglDestroyContext(context);
context = NULL;
}
if (vid_isfullscreen)
CGReleaseAllDisplays();
if (window != NULL)
{
DisposeWindow(window);
window = NULL;
}
vid_hidden = true;
vid_isfullscreen = false;
GL_CloseLibrary();
Key_ClearStates ();
}
示例5: Con_Close
/*
* Con_Close
*/
void Con_Close( void )
{
scr_con_current = 0;
Con_ClearTyping();
Con_ClearNotify();
Key_ClearStates();
}
示例6: Key_SetDest
void Key_SetDest (keydest_t dest)
{
key_dest = dest;
if ((key_gamekey = Key_IsGameKey()) != prev_gamekey)
{
prev_gamekey = key_gamekey;
Key_ClearStates();
}
}
示例7: M_ForceMenuOff
void M_ForceMenuOff (void)
{
cls.key_dest = key_game;
m_menudepth = 0;
m_active = NULL;
Key_ClearStates ();
if(cl_paused->integer)
Cvar_Set ("paused", "0");
}
示例8: UI_ForceMenuOff
/*
=================
UI_ForceMenuOff
=================
*/
void UI_ForceMenuOff (void)
{
// Knightmare- added Psychospaz's mouse support
UI_RefreshCursorLink();
m_drawfunc = 0;
m_keyfunc = 0;
cls.key_dest = key_game;
m_menudepth = 0;
Key_ClearStates ();
if (!cls.consoleActive && Cvar_VariableValue ("maxclients") == 1 && Com_ServerState()) // Knightmare added
Cvar_Set ("paused", "0");
}
示例9: ClearAllStates
void ClearAllStates (void) {
int i;
// send an up event for each key, to make sure the server clears them all
for (i = 0; i < sizeof(keydown) / sizeof(*keydown); i++) {
if (keydown[i])
Key_Event (i, false);
}
Key_ClearStates ();
IN_ClearStates ();
}
示例10: ClearAllStates
/*
================
ClearAllStates
================
*/
static void ClearAllStates (void)
{
int i;
// send an up event for each key, to make sure the server clears them all
for (i = 0; i < 256; i++)
{
Key_Event (i, false);
}
Key_ClearStates ();
IN_ClearStates ();
}
示例11: AppActivate
static void AppActivate( bool fActive, bool minimize ) {
Minimized = minimize;
common->DPrintf( "AppActivate: %i\n", fActive );
Key_ClearStates(); // FIXME!!!
// we don't want to act like we're active if we're minimized
ActiveApp = fActive && !Minimized;
// minimize/restore mouse-capture on demand
IN_Activate( ActiveApp );
CDAudio_Activate( ActiveApp );
SNDDMA_Activate();
}
示例12: ClearAllStates
/*
================
ClearAllStates
================
*/
void ClearAllStates (void)
{
extern void IN_ClearStates (void);
extern qbool keydown[256];
int i;
// send an up event for each key, to make sure the server clears them all
for (i=0 ; i<256 ; i++)
{
if (keydown[i])
Key_Event (i, false);
}
Key_ClearStates ();
IN_ClearStates ();
}
示例13: VID_Restart_f
static void VID_Restart_f(void)
{
extern void GFX_Init(void);
extern void ReloadPaletteAndColormap(void);
qbool old_con_suppress;
if (!host_initialized) { // sanity
Com_Printf("Can't do %s yet\n", Cmd_Argv(0));
return;
}
VID_Shutdown();
ReloadPaletteAndColormap();
// keys can get stuck because SDL2 doesn't send keyup event when the video system is down
Key_ClearStates();
VID_Init(host_basepal);
// force models to reload (just flush, no actual loading code here)
Cache_Flush();
// shut up warnings during GFX_Init();
old_con_suppress = con_suppress;
con_suppress = (developer.value ? false : true);
// reload 2D textures, particles textures, some other textures and gfx.wad
GFX_Init();
// reload skins
Skin_Skins_f();
con_suppress = old_con_suppress;
// we need done something like for map reloading, for example reload textures for brush models
R_NewMap(true);
// force all cached models to be loaded, so no short HDD lag then u walk over level and discover new model
Mod_TouchModels();
// window may be re-created, so caption need to be forced to update
CL_UpdateCaption(true);
}
示例14: M_ForceMenuOff
/**
* \brief Close the menu
*/
PUBLIC void M_ForceMenuOff( void )
{
m_drawfunc = 0;
m_keyfunc = 0;
if( r_world == NULL )
{
ClientStatic.key_dest = key_console;
}
else
{
ClientStatic.key_dest = key_game;
ClientStatic.menuState = IPM_GAME;
}
m_menudepth = 0;
Key_ClearStates();
Cvar_Set( "paused", "0" );
}
示例15: VID_Shutdown
void VID_Shutdown(void)
{
if (!vidx11_display)
return;
VID_EnableJoystick(false);
VID_SetMouse(false, false, false);
VID_RestoreSystemGamma();
// FIXME: glXDestroyContext here?
if (vid_isvidmodefullscreen)
XF86VidModeSwitchToMode(vidx11_display, vidx11_screen, &init_vidmode);
if(vidx11_gc)
XFreeGC(vidx11_display, vidx11_gc);
vidx11_gc = NULL;
DestroyXImages();
vidx11_shmevent = -1;
vid.softpixels = NULL;
if (vid.softdepthpixels)
free(vid.softdepthpixels);
vid.softdepthpixels = NULL;
if (win)
XDestroyWindow(vidx11_display, win);
XCloseDisplay(vidx11_display);
vid_hidden = true;
vid_isfullscreen = false;
vid_isnetwmfullscreen = false;
vid_isvidmodefullscreen = false;
vid_isoverrideredirect = false;
vidx11_display = NULL;
win = 0;
ctx = NULL;
GL_CloseLibrary();
Key_ClearStates ();
}