本文整理汇总了C++中cl_enginefunc_t类的典型用法代码示例。如果您正苦于以下问题:C++ cl_enginefunc_t类的具体用法?C++ cl_enginefunc_t怎么用?C++ cl_enginefunc_t使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cl_enginefunc_t类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
int CL_DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion )
{
gEngfuncs = *pEnginefuncs;
RecClInitialize(pEnginefuncs, iVersion);
if (iVersion != CLDLL_INTERFACE_VERSION)
return 0;
memcpy(&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t));
EV_HookEvents();
// get tracker interface, if any
char szDir[512];
if (!gEngfuncs.COM_ExpandFilename("Bin/TrackerUI.dll", szDir, sizeof(szDir)))
{
g_pTrackerUser = NULL;
g_hTrackerModule = NULL;
return 1;
}
g_hTrackerModule = Sys_LoadModule(szDir);
CreateInterfaceFn trackerFactory = Sys_GetFactory(g_hTrackerModule);
if (!trackerFactory)
{
g_pTrackerUser = NULL;
g_hTrackerModule = NULL;
return 1;
}
g_pTrackerUser = (ITrackerUser *)trackerFactory(TRACKERUSER_INTERFACE_VERSION, NULL);
return 1;
}
示例2: IN_StartupJoystick
/*
===============
IN_StartupJoystick
===============
*/
void IN_StartupJoystick (void)
{
int numdevs;
JOYCAPS jc;
MMRESULT mmr;
// assume no joystick
joy_avail = 0;
// abort startup if user requests no joystick
if ( gEngfuncs.CheckParm ("-nojoy", NULL ) )
return;
// verify joystick driver is present
if ((numdevs = joyGetNumDevs ()) == 0)
{
gEngfuncs.Con_DPrintf ("joystick not found -- driver not present\n\n");
return;
}
// cycle through the joystick ids for the first valid one
for (joy_id=0 ; joy_id<numdevs ; joy_id++)
{
memset (&ji, 0, sizeof(ji));
ji.dwSize = sizeof(ji);
ji.dwFlags = JOY_RETURNCENTERED;
if ((mmr = joyGetPosEx (joy_id, &ji)) == JOYERR_NOERROR)
break;
}
// abort startup if we didn't find a valid joystick
if (mmr != JOYERR_NOERROR)
{
gEngfuncs.Con_DPrintf ("joystick not found -- no valid joysticks (%x)\n\n", mmr);
return;
}
// get the capabilities of the selected joystick
// abort startup if command fails
memset (&jc, 0, sizeof(jc));
if ((mmr = joyGetDevCaps (joy_id, &jc, sizeof(jc))) != JOYERR_NOERROR)
{
gEngfuncs.Con_DPrintf ("joystick not found -- invalid joystick capabilities (%x)\n\n", mmr);
return;
}
// save the joystick's number of buttons and POV status
joy_numbuttons = jc.wNumButtons;
joy_haspov = jc.wCaps & JOYCAPS_HASPOV;
// old button and POV states default to no buttons pressed
joy_oldbuttonstate = joy_oldpovstate = 0;
// mark the joystick as available and advanced initialization not completed
// this is needed as cvars are not available during initialization
gEngfuncs.Con_Printf ("joystick found\n\n", mmr);
joy_avail = 1;
joy_advancedinit = 0;
}
示例3: IN_ResetMouse
/*
===========
IN_ResetMouse
FIXME: Call through to engine?
===========
*/
void IN_ResetMouse( void )
{
// no work to do in SDL
#ifdef _WIN32
// reset only if mouse is active and not in visible mode:
if(mouseactive && !iVisibleMouse)
{
if ( !m_bRawInput && gEngfuncs.GetWindowCenterX && gEngfuncs.GetWindowCenterY )
{
bool lockEntered = MouseThread_ActiveLock_Enter();
int centerX = gEngfuncs.GetWindowCenterX();
int centerY = gEngfuncs.GetWindowCenterY();
SetCursorPos ( centerX, centerY );
InterlockedExchange( &mouseThreadCenterX, centerX );
InterlockedExchange( &mouseThreadCenterY, centerY );
InterlockedExchange( &mouseThreadDeltaX, 0 );
InterlockedExchange( &mouseThreadDeltaY, 0 );
if(lockEntered) MouseThread_ActiveLock_Exit();
}
}
#endif
}
示例4: CAM_ToThirdPerson
void CAM_ToThirdPerson(void)
{
vec3_t viewangles;
#if !defined( DEBUG )
if ( gEngfuncs.GetMaxClients() > 1 )
{
// no thirdperson in multiplayer.
return;
}
#endif
gEngfuncs.GetViewAngles( (float *)viewangles );
if( !cam_thirdperson )
{
cam_thirdperson = 1;
cam_ofs[ YAW ] = viewangles[ YAW ];
cam_ofs[ PITCH ] = viewangles[ PITCH ];
cam_ofs[ 2 ] = CAM_MIN_DIST;
}
gEngfuncs.Cvar_SetValue( "cam_command", 0 );
}
示例5: KeyDown
/*
============
KeyDown
============
*/
void KeyDown (kbutton_t *b)
{
int k;
char *c;
c = gEngfuncs.Cmd_Argv(1);
if (c[0])
k = atoi(c);
else
k = -1; // typed manually at the console for continuous down
if (k == b->down[0] || k == b->down[1])
return; // repeating key
if (!b->down[0])
b->down[0] = k;
else if (!b->down[1])
b->down[1] = k;
else
{
gEngfuncs.Con_DPrintf ("Three keys down for a button '%c' '%c' '%c'!\n", b->down[0], b->down[1], c);
return;
}
if (b->state & 1)
return; // still down
b->state |= 1 + 2; // down + impulse down
}
示例6: IN_MouseEvent
/*
===========
IN_MouseEvent
===========
*/
void DLLEXPORT IN_MouseEvent (int mstate)
{
int i;
if ( iMouseInUse || g_iVisibleMouse )
return;
// perform button actions
for (i=0 ; i<mouse_buttons ; i++)
{
if ( (mstate & (1<<i)) &&
!(mouse_oldbuttonstate & (1<<i)) )
{
gEngfuncs.Key_Event (K_MOUSE1 + i, 1);
}
if ( !(mstate & (1<<i)) &&
(mouse_oldbuttonstate & (1<<i)) )
{
gEngfuncs.Key_Event (K_MOUSE1 + i, 0);
}
}
mouse_oldbuttonstate = mstate;
}
示例7: IN_Accumulate
/*
===========
IN_Accumulate
===========
*/
void CL_DLLEXPORT IN_Accumulate(void)
{
//only accumulate mouse if we are not moving the camera with the mouse
if(!iMouseInUse && !g_iVisibleMouse)
{
if(mouseactive)
{
#ifdef _WIN32
if(!m_bRawInput)
{
if(!m_bMouseThread)
{
GetCursorPos(¤t_pos);
mx_accum += current_pos.x - gEngfuncs.GetWindowCenterX();
my_accum += current_pos.y - gEngfuncs.GetWindowCenterY();
}
}
else
#endif
{
int deltaX, deltaY;
SDL_GetRelativeMouseState(&deltaX, &deltaY);
mx_accum += deltaX;
my_accum += deltaY;
}
// force the mouse to the center, so there's room to move
IN_ResetMouse();
}
}
}
示例8: IN_StartupMouse
/*
===========
IN_StartupMouse
===========
*/
void IN_StartupMouse (void)
{
if ( gEngfuncs.CheckParm ("-nomouse", NULL ) )
return;
mouseinitialized = 1;
mouseparmsvalid = SystemParametersInfo (SPI_GETMOUSE, 0, originalmouseparms, 0);
if (mouseparmsvalid)
{
if ( gEngfuncs.CheckParm ("-noforcemspd", NULL ) )
newmouseparms[2] = originalmouseparms[2];
if ( gEngfuncs.CheckParm ("-noforcemaccel", NULL ) )
{
newmouseparms[0] = originalmouseparms[0];
newmouseparms[1] = originalmouseparms[1];
}
if ( gEngfuncs.CheckParm ("-noforcemparms", NULL ) )
{
newmouseparms[0] = originalmouseparms[0];
newmouseparms[1] = originalmouseparms[1];
newmouseparms[2] = originalmouseparms[2];
}
}
mouse_buttons = MOUSE_BUTTON_COUNT;
}
示例9: HUD_Frame
void DLLEXPORT HUD_Frame( double time )
{
#ifdef USE_VGUI_FOR_GOLDSOURCE_SUPPORT
if (!gViewPort)
gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect());
#else
gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect());
#endif
}
示例10:
/*
=================
HUD_GetRect
VGui stub
=================
*/
int *HUD_GetRect( void )
{
static int extent[4];
extent[0] = gEngfuncs.GetWindowCenterX() - ScreenWidth / 2;
extent[1] = gEngfuncs.GetWindowCenterY() - ScreenHeight / 2;
extent[2] = gEngfuncs.GetWindowCenterX() + ScreenWidth / 2;
extent[3] = gEngfuncs.GetWindowCenterY() + ScreenHeight / 2;
return extent;
}
示例11: Force_CenterView_f
/*
===========
Force_CenterView_f
===========
*/
void Force_CenterView_f (void)
{
vec3_t viewangles;
if (!iMouseInUse)
{
gEngfuncs.GetViewAngles( (float *)viewangles );
viewangles[PITCH] = 0;
gEngfuncs.SetViewAngles( (float *)viewangles );
}
}
示例12: CL_LoadParticleMan
void CL_LoadParticleMan( void )
{
char szPDir[512];
if ( gEngfuncs.COM_ExpandFilename( PARTICLEMAN_DLLNAME, szPDir, sizeof( szPDir ) ) == FALSE )
{
g_pParticleMan = NULL;
g_hParticleManModule = NULL;
return;
}
g_hParticleManModule = Sys_LoadModule( szPDir );
CreateInterfaceFn particleManFactory = Sys_GetFactory( g_hParticleManModule );
if ( particleManFactory == NULL )
{
g_pParticleMan = NULL;
g_hParticleManModule = NULL;
return;
}
g_pParticleMan = (IParticleMan *)particleManFactory( PARTICLEMAN_INTERFACE, NULL);
if ( g_pParticleMan )
{
g_pParticleMan->SetUp( &gEngfuncs );
// Add custom particle classes here BEFORE calling anything else or you will die.
g_pParticleMan->AddCustomParticleClassSize ( sizeof ( CBaseParticle ) );
}
}
示例13: HUD_Init
void DLLEXPORT HUD_Init( void )
{
InitInput();
gHUD.Init();
gEngfuncs.pfnHookUserMsg( "Bhopcap", __MsgFunc_Bhopcap );
}
示例14: paintBackground
void TeamFortressViewport::paintBackground()
{
// int wide, tall;
// getParent()->getSize( wide, tall );
// setSize( wide, tall );
gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect());
}
示例15: CAM_ClearStates
void CAM_ClearStates( void )
{
vec3_t viewangles;
gEngfuncs.GetViewAngles( (float *)viewangles );
cam_pitchup.state = 0;
cam_pitchdown.state = 0;
cam_yawleft.state = 0;
cam_yawright.state = 0;
cam_in.state = 0;
cam_out.state = 0;
cam_thirdperson = 0;
cam_command->value = 0;
cam_mousemove=0;
cam_snapto->value = 0;
cam_distancemove = 0;
cam_ofs[ 0 ] = 0.0;
cam_ofs[ 1 ] = 0.0;
cam_ofs[ 2 ] = CAM_MIN_DIST;
cam_idealpitch->value = viewangles[ PITCH ];
cam_idealyaw->value = viewangles[ YAW ];
cam_idealdist->value = CAM_MIN_DIST;
}