• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cl_enginefunc_t类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cl_enginefunc_t的典型用法代码示例。如果您正苦于以下问题:C++ cl_enginefunc_t类的具体用法?C++ cl_enginefunc_t怎么用?C++ cl_enginefunc_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了cl_enginefunc_t类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Arkshine,项目名称:NS,代码行数:33,代码来源:cdll_int.cpp


示例2: Initialize

int EXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion )
{
    gEngfuncs = *pEnginefuncs;

    //!!! mwh UNDONE We need to think about our versioning strategy. Do we want to try to be compatible
    // with previous versions, especially when we're only 'bonus' functionality? Should it be the engine
    // that decides if the DLL is compliant?

    if (iVersion != CLDLL_INTERFACE_VERSION)
        return 0;

    memcpy(&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t));

    EV_HookEvents();

    // Determine which filesystem to use.
#if defined ( _WIN32 )
    char *szFsModule = "filesystem_stdio.dll";
#elif defined(OSX)
    char *szFsModule = "filesystem_stdio.dylib";
#elif defined(LINUX)
    char *szFsModule = "filesystem_stdio.so";
#else
#error
#endif


    char szFSDir[MAX_PATH];
    szFSDir[0] = 0;
    if ( gEngfuncs.COM_ExpandFilename( szFsModule, szFSDir, sizeof( szFSDir ) ) == FALSE )
    {
        return false;
    }

    // Get filesystem interface.
    g_pFileSystemModule = Sys_LoadModule( szFSDir );
    assert( g_pFileSystemModule );
    if( !g_pFileSystemModule )
    {
        return false;
    }

    CreateInterfaceFn fileSystemFactory = Sys_GetFactory( g_pFileSystemModule );
    if( !fileSystemFactory )
    {
        return false;
    }

    g_pFileSystem = ( IFileSystem * )fileSystemFactory( FILESYSTEM_INTERFACE_VERSION, NULL );
    assert( g_pFileSystem );
    if( !g_pFileSystem )
    {
        return false;
    }

    return 1;
}
开发者ID:ChunHungLiu,项目名称:halflife,代码行数:57,代码来源:cdll_int.cpp


示例3: 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;
}
开发者ID:vermagav,项目名称:mechmod,代码行数:65,代码来源:inputw32.cpp


示例4: 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
}
开发者ID:suXinjke,项目名称:HalfPayne,代码行数:32,代码来源:inputw32.cpp


示例5: 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 );
}
开发者ID:Arkshine,项目名称:NS,代码行数:25,代码来源:in_camera.cpp


示例6: 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
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:33,代码来源:input.cpp


示例7: 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;
}
开发者ID:vermagav,项目名称:mechmod,代码行数:30,代码来源:inputw32.cpp


示例8: 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(&current_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();
		}
	}
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:36,代码来源:InputWin32.cpp


示例9: 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;
}
开发者ID:vermagav,项目名称:mechmod,代码行数:34,代码来源:inputw32.cpp


示例10: 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
}
开发者ID:nekonomicon,项目名称:hlsdk-xash3d,代码行数:9,代码来源:cdll_int.cpp


示例11:

/*
=================
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;
}
开发者ID:nekonomicon,项目名称:hlsdk-xash3d,代码行数:18,代码来源:cdll_int.cpp


示例12: 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 );
	}
}
开发者ID:vermagav,项目名称:mechmod,代码行数:16,代码来源:inputw32.cpp


示例13: 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 ) );
	}
}
开发者ID:Chuvi-w,项目名称:CSSDK,代码行数:31,代码来源:cdll_int.cpp


示例14: HUD_Init

void DLLEXPORT HUD_Init( void )
{
	InitInput();
	gHUD.Init();

	gEngfuncs.pfnHookUserMsg( "Bhopcap", __MsgFunc_Bhopcap );
}
开发者ID:nekonomicon,项目名称:hlsdk-xash3d,代码行数:7,代码来源:cdll_int.cpp


示例15: paintBackground

void TeamFortressViewport::paintBackground()
{
//	int wide, tall;
//	getParent()->getSize( wide, tall );
//	setSize( wide, tall );
	gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect());
}
开发者ID:nekonomicon,项目名称:hlsdk-xash3d,代码行数:7,代码来源:cdll_int.cpp


示例16: 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;
}
开发者ID:Arkshine,项目名称:NS,代码行数:28,代码来源:in_camera.cpp


示例17: KeyUp

/*
============
KeyUp
============
*/
void KeyUp (kbutton_t *b)
{
	int		k;
	char	*c;
	
	c = gEngfuncs.Cmd_Argv(1);
	if (c[0])
		k = atoi(c);
	else
	{ // typed manually at the console, assume for unsticking, so clear all
		b->down[0] = b->down[1] = 0;
		b->state = 4;	// impulse up
		return;
	}

	if (b->down[0] == k)
		b->down[0] = 0;
	else if (b->down[1] == k)
		b->down[1] = 0;
	else
		return;		// key up without coresponding down (menu pass through)
	if (b->down[0] || b->down[1])
	{
		//Con_Printf ("Keys down for button: '%c' '%c' '%c' (%d,%d,%d)!\n", b->down[0], b->down[1], c, b->down[0], b->down[1], c);
		return;		// some other key is still holding it down
	}

	if (!(b->state & 1))
		return;		// still up (this should not happen)

	b->state &= ~1;		// now up
	b->state |= 4; 		// impulse up
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:38,代码来源:input.cpp


示例18: CAM_ToThirdPerson

void CAM_ToThirdPerson(void)
{ 
	vec3_t viewangles;

	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 );
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:17,代码来源:in_camera.cpp


示例19: HUD_Frame

void CL_DLLEXPORT HUD_Frame( double time )
{
	gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect());

	ServersThink( time );

	GetClientVoiceMgr()->Frame(time);
}
开发者ID:Hammermaps-DEV,项目名称:SOHL-V1.0-Refresh,代码行数:8,代码来源:cdll_int.cpp


示例20: IN_ResetMouse

/*
===========
IN_ResetMouse

FIXME: Call through to engine?
===========
*/
void IN_ResetMouse(void)
{
// no work to do in SDL
#ifdef _WIN32
	if(!m_bRawInput && mouseactive && gEngfuncs.GetWindowCenterX && gEngfuncs.GetWindowCenterY)
	{
		SetCursorPos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY());
		ThreadInterlockedExchange(&old_mouse_pos.x, gEngfuncs.GetWindowCenterX());
		ThreadInterlockedExchange(&old_mouse_pos.y, gEngfuncs.GetWindowCenterY());
	}

	if(gpGlobals && gpGlobals->time - s_flRawInputUpdateTime > 1.0f)
	{
		s_flRawInputUpdateTime = gpGlobals->time;
		m_bRawInput            = CVAR_GET_FLOAT("m_rawinput") != 0;
	}
#endif
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:25,代码来源:InputWin32.cpp



注:本文中的cl_enginefunc_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cl_mem类代码示例发布时间:2022-05-31
下一篇:
C++ cl_command_queue类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap