您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ConsolePrint函数代码示例

51自学网 2021-06-01 20:13:26
  C++
这篇教程C++ ConsolePrint函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了ConsolePrint函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DeviceListPrintList

/* INFO: */int DeviceListPrintList() {	StructuresDynamicNode * localNode = { 0 };	unsigned int localDeviceNumber = { 0 };	CHECK_INITIALIZED(staticInitializedFlag);	++localDeviceNumber;	CHECK(ConsolePrint(DEVICE_LIST_PRINT_LIST_STRING));	CHECK(DeviceListMutexLock());	{		localNode = globalDeviceList;		while(localNode) {			CHECK(ConsolePrint(				DEVICE_LIST_PRINT_LIST_ENTRY_FORMATTER,				localDeviceNumber, localNode->device->				friendlyName, localNode->device->				uniqueDeviceName));			localNode = localNode->next;			++localDeviceNumber;		}	}	CHECK(DeviceListMutexUnlock());	CHECK(ConsolePrint(DEVICE_LIST_NEW_LINE_STRING));	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:32,


示例2: ConsolePrint

void CHudAmmo::UserCmd_Rebuy(){	char *afile = (char*)gEngfuncs.COM_LoadFile("rebuy.txt", 5, NULL);	char *pfile = afile;	char token[64];	char szCmd[1024];	int lastCh;	if( !pfile )	{		ConsolePrint( "Can't open rebuy.txt file./n" );		return;	}	// start with /"	strncpy(szCmd, "cl_setrebuy /"", sizeof(szCmd));	while((pfile = gEngfuncs.COM_ParseFile( pfile, token )))	{		strcat(szCmd, token);		// append space after token		strcat(szCmd, " ");	}	// replace last space with ", before terminator	lastCh = strlen(szCmd);	szCmd[lastCh - 1] = '/"';	ConsolePrint(szCmd);	gEngfuncs.pfnServerCmd(szCmd);	gEngfuncs.COM_FreeFile( afile );}
开发者ID:izogain,项目名称:cs16-client,代码行数:34,


示例3: CommandsCommonPrintHelpList

/* INFO: */static int CommandsCommonPrintHelpList(const bool inpLongHelpFlag) {	const char * localCommandString = { 0 };	const char * localShortHelpString = { 0 };	const char * localLongHelpString = { 0 };	unsigned int localIndex = { 0 };	CHECK(ConsolePrint(COMMANDS_INFO));	for(; localIndex < globalCommandsCommandArraySize; ++localIndex) {		localCommandString = globalCommandsCommandArray[localIndex].			commandString;		localShortHelpString = globalCommandsCommandArray[localIndex].			shortHelpString;		localLongHelpString = globalCommandsCommandArray[localIndex].			longHelpString;		CHECK(CommandsCommonPrintHelpEntry(inpLongHelpFlag,			localCommandString, localShortHelpString,			localLongHelpString));	}	CHECK(ConsolePrint(COMMANDS_NEW_LINE_STRING));	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:26,


示例4: SM_ConfigsExecuted_Global

void RootConsoleMenu::GotRootCmd(const CCommand &cmd){	unsigned int argnum = cmd.ArgC();	if (argnum >= 2)	{		const char *cmdname = cmd.Arg(1);		if (strcmp(cmdname, "internal") == 0)		{			if (argnum >= 3)			{				const char *arg = cmd.Arg(2);				if (strcmp(arg, "1") == 0)				{					SM_ConfigsExecuted_Global();				}				else if (strcmp(arg, "2") == 0)				{					if (argnum >= 4)					{						SM_ConfigsExecuted_Plugin(atoi(cmd.Arg(3)));					}				}			}			return;		}		CCommandArgs ocmd(cmd);		ConsoleEntry *entry;		if (m_Commands.retrieve(cmdname, &entry))		{			if (entry->version2)			{				entry->cmd->OnRootConsoleCommand2(cmdname, &ocmd);			}			else			{				entry->cmd->OnRootConsoleCommand(cmdname, cmd);			}			return;		}	}	ConsolePrint("SourceMod Menu:");	ConsolePrint("Usage: sm <command> [arguments]");	List<ConsoleEntry *>::iterator iter;	ConsoleEntry *pEntry;	for (iter=m_Menu.begin(); iter!=m_Menu.end(); iter++)	{		pEntry = (*iter);		DrawGenericOption(pEntry->command.c_str(), pEntry->description.c_str());	}}
开发者ID:pmrowla,项目名称:sourcemod-central,代码行数:55,


示例5: BEGIN_READ

// Message handler for text messages// displays a string, looking them up from the titles.txt file, which can be localised// parameters://   byte:   message direction  ( HUD_PRINTCONSOLE, HUD_PRINTNOTIFY, HUD_PRINTCENTER, HUD_PRINTTALK )//   string: message// optional parameters://   string: message parameter 1//   string: message parameter 2//   string: message parameter 3//   string: message parameter 4// any string that starts with the character '#' is a message name, and is used to look up the real message in titles.txt// the next (optional) one to four strings are parameters for that string (which can also be message names if they begin with '#')int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	int msg_dest = READ_BYTE();#define MSG_BUF_SIZE 128	static char szBuf[6][MSG_BUF_SIZE];	char *msg_text = LookupString( READ_STRING(), &msg_dest );	msg_text = safe_strcpy( szBuf[0], msg_text , MSG_BUF_SIZE);	// keep reading strings and using C format strings for subsituting the strings into the localised text string	char *sstr1 = LookupString( READ_STRING() );	sstr1 = safe_strcpy( szBuf[1], sstr1 , MSG_BUF_SIZE);	StripEndNewlineFromString( sstr1 );  // these strings are meant for subsitution into the main strings, so cull the automatic end newlines	char *sstr2 = LookupString( READ_STRING() );	sstr2 = safe_strcpy( szBuf[2], sstr2 , MSG_BUF_SIZE);	StripEndNewlineFromString( sstr2 );	char *sstr3 = LookupString( READ_STRING() );	sstr3 = safe_strcpy( szBuf[3], sstr3 , MSG_BUF_SIZE);	StripEndNewlineFromString( sstr3 );	char *sstr4 = LookupString( READ_STRING() );	sstr4 = safe_strcpy( szBuf[4], sstr4 , MSG_BUF_SIZE);	StripEndNewlineFromString( sstr4 );	char *psz = szBuf[5];	if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE )		return 1;	switch ( msg_dest )	{	case HUD_PRINTCENTER:		safe_sprintf( psz, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 );		CenterPrint( ConvertCRtoNL( psz ) );		break;	case HUD_PRINTNOTIFY:		psz[0] = 1;  // mark this message to go into the notify buffer		safe_sprintf( psz+1, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 );		ConsolePrint( ConvertCRtoNL( psz ) );		break;	case HUD_PRINTTALK:		safe_sprintf( psz, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 );		gHUD.m_SayText.SayTextPrint( ConvertCRtoNL( psz ), 128 );		break;	case HUD_PRINTCONSOLE:		safe_sprintf( psz, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 );		ConsolePrint( ConvertCRtoNL( psz ) );		break;	}	return 1;}
开发者ID:6779660,项目名称:halflife,代码行数:67,


示例6: Blitters_Init

void	Blitters_Init(){    ConsolePrint(Msg_Get(MSG_Blitters_Loading));    Blitters.list = NULL;    Blitters.current = NULL;    // Open and read file    t_tfile * tf;    if ((tf = tfile_read (Blitters.filename)) == NULL)        Quit_Msg("%s", meka_strerror());    ConsolePrint("/n");    // Parse each line    int line_cnt = 0;    for (t_list* lines = tf->data_lines; lines; lines = lines->next)    {        const char* line = (char*)lines->elem;        line_cnt += 1;		int i, j;        char s1 [256], s2 [256];        for (i = 0, j = 0; line [i] != 0 && line [i] != ';'; i ++)            if ((line [0] == '[') || (line [i] != ' ' && line [i] != '/t'))                s2 [j ++] = line [i];        s2 [j] = 0;        if (StrIsNull (s2))            continue;        strcpy(s1, s2);        StrLower(s1);        switch (Blitters_Parse_Line (s1, s2))        {        case MEKA_ERR_UNKNOWN:          tfile_free(tf); Quit_Msg(Msg_Get(MSG_Blitters_Error_Unrecognized), line_cnt);        case MEKA_ERR_MISSING:          tfile_free(tf); Quit_Msg(Msg_Get(MSG_Blitters_Error_Missing), line_cnt);        case MEKA_ERR_VALUE_INCORRECT:  tfile_free(tf); Quit_Msg(Msg_Get(MSG_Blitters_Error_Incorrect_Value), line_cnt);        }    }    // Free file data    tfile_free(tf);    // Requires at least 1 blitter    if (Blitters.count == 0)        Quit_Msg("%s", Msg_Get(MSG_Blitters_Error_Not_Enough));    // Current blitter    if (Blitters.blitter_configuration_name != NULL)        Blitters.current = Blitters_FindBlitterByName(Blitters.blitter_configuration_name);    if (Blitters.current == NULL)        Blitters.current = (t_blitter*)Blitters.list->elem; // first}
开发者ID:mnstrmnch,项目名称:meka,代码行数:53,


示例7: DB_Load

//-----------------------------------------------------------------------------// DB_Load (const char *filename)// Initialize and load given Meka DB file//-----------------------------------------------------------------------------void            DB_Load (const char *filename){    t_tfile *   tf;    t_list *    lines;    char *      line;    int         line_cnt;    ConsolePrint (Msg_Get (MSG_DB_Loading));    // Open and read file    tf = tfile_read (filename);    if (tf == NULL)    {        ConsolePrintf ("%s/n", meka_strerror());        return;    }    // Ok    ConsolePrint ("/n");    // Parse each line    line_cnt = 0;    for (lines = tf->data_lines; lines; lines = lines->next)    {        line_cnt += 1;        line = lines->elem;        // Strip comments        // FIXME        // Trim spaces?        // FIXME        // Skip empty lines        //if (line[0] == EOSTR)        //    continue;        if (DB_Load_Line (line) == 0)        {            tfile_free (tf);             Quit_Msg (Msg_Get (MSG_DB_SyntaxError), line_cnt);        }    }    // Free file data    tfile_free(tf);    // FIXME - Uncomment for counting progress of DB transition    //ConsolePrintf ("ENTRIES NEW = %d, OLD = %d/n", DB.entries_counter_format_new, DB.entries_counter_format_old);    //Quit();}
开发者ID:dafyddcrosby,项目名称:meka,代码行数:53,


示例8: CommandsCommonPrintHelpEntry

/* INFO: */static int CommandsCommonPrintHelpEntry(const bool inpLongHelpFlag,		const char * const inpCommandString,		const char * const inpShortHelpString,		const char * const inpLongHelpString) {	if(inpLongHelpFlag) {		CHECK(ConsolePrint(COMMANDS_LONG_HELP_FORMATTER,			inpCommandString, inpShortHelpString,			inpLongHelpString));	} else {		CHECK(ConsolePrint(COMMANDS_SHORT_HELP_FORMATTER,			inpCommandString, inpShortHelpString));	}	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:16,


示例9: DisplayPrintServiceHeader

/* INFO: */static int DisplayPrintServiceHeader(		const StructuresDynamicService * const inpService,		const unsigned int inpServiceNumber,		const char inpServiceTreeVertical) {	CHECK(ConsolePrint(		DISPLAY_PRINT_SERVICE_HEADER_FORMAT_STRING,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_HORIZONTAL_FULL,		DISPLAY_SERVICE_GROUP_STRING,		inpServiceNumber,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpServiceTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL));	CHECK(DisplayPrintServiceEntry(DISPLAY_SUBSCRIPTION_ID_STRING,		inpService->subscriptionId, inpServiceTreeVertical));	CHECK(DisplayPrintServiceEntry(DISPLAY_SERVICE_TYPE_STRING,		inpService->serviceType, inpServiceTreeVertical));	CHECK(DisplayPrintServiceEntry(DISPLAY_SERVICE_ID_STRING,		inpService->serviceId, inpServiceTreeVertical));	CHECK(DisplayPrintServiceEntry(DISPLAY_SCPDURL_STRING,		inpService->SCPDURL, inpServiceTreeVertical));	CHECK(DisplayPrintServiceEntry(DISPLAY_CONTROL_URL_STRING,		inpService->controlURL, inpServiceTreeVertical));	CHECK(DisplayPrintServiceEntry(DISPLAY_EVENT_SUB_URL_STRING,		inpService->eventSubURL, inpServiceTreeVertical));	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:32,


示例10: Sound_Init_Engine

// Initialize Sound Engine ----------------------------------------------------// FIXME: This is mostly legacy stuff :(static  int     Sound_Init_Engine (int buffer_mode){    // Stream Buffer Mode    //STREAM_BUFFER_MAXA = DEF_STREAM_BUFFER_MAXA;    MODEB_FRAME_SIZE   = DEF_MODEB_FRAME_SIZE;    MODEB_UPDATE_COUNT = DEF_MODEB_UPDATE_COUNT;    MODEB_ERROR_MAX    = DEF_STREAM_UPDATE_ERROR_MAX;    STREAM_BUFFER_MAXB = MODEB_FRAME_SIZE;    MODEB_MASK         = MODEB_FRAME_SIZE / MODEB_UPDATE_COUNT;    sound_stream_mode  = buffer_mode; /* SOUND_STREAM_WAIT in MEKA */    //stream_buffer_max  = (sound_stream_mode == SOUND_STREAM_NORMAL) ? STREAM_BUFFER_MAXA : STREAM_BUFFER_MAXB;#ifdef INSTALL_SOUND_TIMER    buffered_stream_max = stream_buffer_max = 3; // audio_buffer_max_size    MODEB_UPDATE_COUNT = 1;#else    stream_buffer_max = ((stream_buffer_max / 6) / MODEB_UPDATE_COUNT) * MODEB_UPDATE_COUNT;    // buffered_stream_max = stream_buffer_max;   // audio_buffer_max_size    buffered_stream_max = MODEB_UPDATE_COUNT * 2; // audio_buffer_max_size#endif    /**** timer work init ****/    sound_freerun_count = 0;    sound_slice = 0;    if (change_sample_rate)    { // Sample rate has changed, so all emulators must be restarted!        change_sample_rate = FALSE;        saStopSoundEmulators();    }    ConsolePrint (" - SEAL: Ok/n"); // FIXME: should be a message ?#ifdef INSTALL_SOUND_TIMER    saInitSoundTimer();#endif    if (SndMachine != NULL)    {        if (!SndMachine->first)        {            int i;            SndMachine->first = 1;           /* first flag clear */            streams_sh_start();              /* streaming system initialize & start */            pause_sound = 0;                 /* pause flag off */            vbover_err = vbunder_err = 0;    /* error initial */            for (i = 0; i < SndMachine->control_max; i++)            {                if (SndMachine->f_init[i])                {                    if (SndMachine->f_init[i] (SndMachine->userdata[i]) != MEKA_ERR_OK)                    {                        SndMachine = NULL;                        return (MEKA_ERR_FAIL);                    }                }            }        }    }    return (MEKA_ERR_OK);}
开发者ID:dafyddcrosby,项目名称:meka,代码行数:62,


示例11: DisplayPrintAllowedValueHeader

/* INFO: */static int DisplayPrintAllowedValueHeader(		const StructuresDynamicAllowedValue * const inpAllowedValue,		const unsigned int inpAllowedValueNumber,		const char inpServiceTreeVertical,		const char inpAllowedValueTreeVertical) {	CHECK(ConsolePrint(		DISPLAY_PRINT_ALLOWED_VALUE_HEADER_FORMAT_STRING,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpServiceTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpServiceTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_HORIZONTAL_FULL,		DISPLAY_ALLOWED_VALUE_GROUP_STRING,		inpAllowedValueNumber,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpServiceTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpAllowedValueTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL));	CHECK(DisplayPrintAllowedValueEntry(DISPLAY_ALLOWED_VALUE_STRING,		inpAllowedValue->allowedValue, inpServiceTreeVertical,		inpAllowedValueTreeVertical));	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:36,


示例12: CliAutocompletionApplySuggestion

/* INFO: */static int CliAutocompletionApplySuggestion(char * const inpCommandBuffer,		const unsigned int inpCommandBufferSize,		unsigned int * const inpCommandSize,		unsigned int * const inpCommandBufferOffset,		const char * const inpSuggestion,		const unsigned int inpSuggestionSize) {	char * localCompletionBuffer = { 0 };	unsigned int localCompletionBufferSize = { 0 };	const char * localSuggestionTail = { 0 };	unsigned int localSuggestionTailSize = { 0 };	unsigned int localSuggestionOffset = { 0 };	localCompletionBuffer = inpCommandBuffer + (* inpCommandSize);	if((* inpCommandSize) >= inpCommandBufferSize) {		return ERROR;	}	localCompletionBufferSize = inpCommandBufferSize - (* inpCommandSize);	if(! localCompletionBufferSize) {		return ERROR;	}	if((* inpCommandBufferOffset) > (* inpCommandSize)) {		return ERROR;	}	localSuggestionOffset = (* inpCommandSize) -		(* inpCommandBufferOffset);	localSuggestionTail = inpSuggestion + localSuggestionOffset;	localSuggestionTailSize = inpSuggestionSize - localSuggestionOffset;	if(! localSuggestionTailSize) {		(* inpCommandBufferOffset) = (* inpCommandSize);		return NO_ERROR;	}	if(localSuggestionTailSize >= localCompletionBufferSize) {		(* inpCommandBufferOffset) = (* inpCommandSize);		return NO_ERROR;	}	memcpy(localCompletionBuffer, localSuggestionTail,		localSuggestionTailSize);	localCompletionBuffer[localSuggestionTailSize] = 0;	(* inpCommandSize) += localSuggestionTailSize;		CHECK(ConsolePrint(UTILS_SIMPLE_PRINT_FORMATTER,		localCompletionBuffer));	(* inpCommandBufferOffset) = (* inpCommandSize);	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:61,


示例13: CliAutocompletionPrintPrimaryCommand

/* INFO: */static int CliAutocompletionPrintPrimaryCommand(		char * const inpCommandBuffer) {	CHECK(ConsolePrint(UTILS_SIMPLE_PRINT_FORMATTER,		inpCommandBuffer));	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:8,


示例14: DisplayPrintActionHeader

/* INFO: */static int DisplayPrintActionHeader(		const StructuresDynamicAction * const inpAction,		const unsigned int inpActionNumber,		const char inpServiceTreeVertical) {	CHECK(ConsolePrint(		DISPLAY_PRINT_ACTION_HEADER_FORMAT_STRING,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpServiceTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpServiceTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_HORIZONTAL_FULL,		DISPLAY_ACTION_GROUP_STRING,		inpActionNumber,		DISPLAY_TREE_HORIZONTAL_EMPTY,		inpServiceTreeVertical,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL,		DISPLAY_TREE_HORIZONTAL_EMPTY,		DISPLAY_TREE_VERTICAL_FULL));	CHECK(DisplayPrintActionEntry(DISPLAY_NAME_STRING, inpAction->name,		inpServiceTreeVertical));	return NO_ERROR;}
开发者ID:archipelagos,项目名称:sample,代码行数:28,


示例15: ConsolePrint

void Log::LogPrint(LogType type, const char* msg){  if (config.logConsole)    ConsolePrint(type, msg);  if (config.logSyslog)    SyslogPrint(type, msg);  if (config.logFile)    FilePrint(type, msg);}
开发者ID:garbear,项目名称:atscepg,代码行数:9,


示例16: EthSendIntf

// ------------------------------------------------------------------------------------------------void EthSendIntf(NetIntf *intf, const void *dstAddr, u16 etherType, NetBuf *pkt){    // Determine ethernet address by protocol of packet    const EthAddr *dstEthAddr = 0;    switch (etherType)    {    case ET_ARP:        dstEthAddr = (const EthAddr *)dstAddr;        break;    case ET_IPV4:        {            const Ipv4Addr *dstIpv4Addr = (const Ipv4Addr *)dstAddr;            if (Ipv4AddrEq(dstIpv4Addr, &g_broadcastIpv4Addr) ||                Ipv4AddrEq(dstIpv4Addr, &intf->broadcastAddr))            {                // IP Broadcast -> Ethernet Broacast                dstEthAddr = &g_broadcastEthAddr;            }            else            {                // Lookup Ethernet address in ARP cache                dstEthAddr = ArpLookupEthAddr(dstIpv4Addr);                if (!dstEthAddr)                {                    ArpRequest(intf, dstIpv4Addr, etherType, pkt);                    return;                }            }        }        break;    case ET_IPV6:        break;    }    // Skip packets without a destination    if (!dstEthAddr)    {        ConsolePrint("Dropped packet/n");        return;    }    // Fill in ethernet header    pkt->start -= sizeof(EthHeader);    EthHeader *hdr = (EthHeader *)pkt->start;    hdr->dst = *dstEthAddr;    hdr->src = intf->ethAddr;    hdr->etherType = NetSwap16(etherType);    // Transmit    EthPrint(pkt);    intf->devSend(pkt);}
开发者ID:FFalcon,项目名称:osdev,代码行数:58,


示例17: NetMsg_TextMsg

// Message handler for text messages// displays a string, looking them up from the titles.txt file, which can be localised// parameters://   byte:   message direction  ( HUD_PRINTCONSOLE, HUD_PRINTNOTIFY, HUD_PRINTCENTER, HUD_PRINTTALK )//   string: message// optional parameters://   string: message parameter 1//   string: message parameter 2//   string: message parameter 3//   string: message parameter 4// any string that starts with the character '#' is a message name, and is used to look up the real message in titles.txt// the next (optional) one to four strings are parameters for that string (which can also be message names if they begin with '#')int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf ){	int destination;	StringList message;	NetMsg_TextMsg( pbuf, iSize, destination, message ); 	if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE )		return 1;	while( message.size() < 5 )	{ message.push_back( string("") ); }	char psz[1024];	char* origin = psz;	if( destination == HUD_PRINTNOTIFY )	{ 		psz[0] = 1;		origin = psz + 1;	}	// Ensure that message[0] does not contain exessive %'s, max 4x%s, all other %'s removed.	size_t lastpos = 0; size_t pos; int count = 0;	while(true)	{		pos = message[0].find("%", lastpos);		if (pos == string::npos)			break;		if ((message[0].substr(pos + 1, 1) == "s") && (count < 4))			count++;		else			message[0].replace(pos, 1, " ");		lastpos = pos + 1;	}	sprintf( origin, message[0].c_str(), message[1].c_str(), message[2].c_str(), message[3].c_str(), message[4].c_str() );	ConvertCRtoNL(psz);	switch ( destination )	{	case HUD_PRINTNOTIFY:	case HUD_PRINTCONSOLE:		ConsolePrint(psz);		break;	case HUD_PRINTCENTER:		CenterPrint(psz);		break;	case HUD_PRINTTALK:		gHUD.m_SayText.SayTextPrint(psz, 1024);		break;	}	return 1;}
开发者ID:puzl,项目名称:NS3.2,代码行数:68,


示例18: out

void OutputTable::FilePrint(string file){	std::ofstream out(file);	//	Opens the file	std::streambuf *coutbuf = std::cout.rdbuf(); //	Saves the old buf	std::cout.rdbuf(out.rdbuf());	//	Redirects std::cout to file	ConsolePrint();	std::cout.rdbuf(coutbuf);	//	Resets to standard output again}
开发者ID:vozabal,项目名称:HighProgrammingPrinciples,代码行数:10,


示例19: ConsolePrintf

//-----------------------------------------------------------------------------// ConsolePrintf (const char *format, ...)// Print formatted message to console.//-----------------------------------------------------------------------------void            ConsolePrintf (const char *format, ...){    va_list       params;    va_start (params, format);    vsprintf (Msg_Buf, format, params);    va_end   (params);    ConsolePrint(Msg_Buf);}
开发者ID:mnstrmnch,项目名称:meka,代码行数:14,


示例20: ConsolePrint

 bool Tester::RunAllTests() {   ConsolePrint("Running all tests./n");   bool retVal = true;   for (unsigned i = 0; i < tests_.size(); ++i)   {     retVal = (RunTest(i) && retVal);   }   return retVal; }
开发者ID:Marktopus,项目名称:WickedSickSingle,代码行数:10,


示例21: Sound_Init_SoundCard

// Initialize Sound Card ------------------------------------------------------static  int     Sound_Init_SoundCard (void){  int            i;  AUDIOINFO      Audio_Infos;  ConsolePrintf (Msg_Get (MSG_Sound_Init_Soundcard), Sound.SampleRate);  ConsolePrint ("/n");  Audio_Infos.nDeviceId = Sound.SoundCard;  Audio_Infos.wFormat = AUDIO_FORMAT_16BITS | AUDIO_FORMAT_STEREO; // FIXME: Stereo ?  Audio_Infos.nSampleRate = audio_sample_rate = Sound.SampleRate;  if (AOpenAudio(&Audio_Infos) != AUDIO_ERROR_NONE)     {     Quit_Msg ("%s", Msg_Get (MSG_Sound_Init_Error_Audio));     return (MEKA_ERR_FAIL);     }  // FIXME: original sound engine was trying different sample rate on failure  // Unused  // Maybe it was intended to check out number of channels there ?  // AGetAudioCaps (Audio_Infos.nDeviceId, &Audio_Caps);  // Open voices  if (AOpenVoices(Sound.Voices_Max) != AUDIO_ERROR_NONE)     {     Quit_Msg ("%s", Msg_Get (MSG_Sound_Init_Error_Voices));     return (MEKA_ERR_FAIL);     }  ASetAudioMixerValue (AUDIO_MIXER_MASTER_VOLUME, 256);  // Allocate voices and waveforms  Sound.Voices = Memory_Alloc (sizeof (t_voice) * Sound.Voices_Max);  for (i = 0; i < Sound.Voices_Max; i++)     {     if (ACreateAudioVoice(&Sound.Voices[i].hVoice) != AUDIO_ERROR_NONE)        {        Quit_Msg (Msg_Get (MSG_Sound_Init_Error_Voice_N), i);        return (MEKA_ERR_FAIL);        }     ASetVoicePanning(Sound.Voices[i].hVoice, 128); // Center voice     Sound.Voices[i].lpWave  = NULL;     Sound.Voices[i].playing = FALSE;     }  // FIXME: is this needed ?  AUpdateAudio ();  // FIXME: is this needed ?  // Check frame sample rate  audio_sample_rate = nominal_sample_rate = Audio_Infos.nSampleRate;  return (MEKA_ERR_OK);}
开发者ID:dafyddcrosby,项目名称:meka,代码行数:56,


示例22: Appli_DsadcCyclic

void Appli_DsadcCyclic(void){	char str_adc[10];	int chn;#ifdef iLLD	// start conversions	IfxDsadc_Dsadc_startScan(&dsadc, 0x3f, 0x3f);	// results are now available in IFXDSADC(ds).CH[x].RESM.B.RESULT (x=0..5	// declared globally    // sint16 result[];	for(chn=0; chn<IFXDSADC_NUM_CHANNELS; ++chn)	{		if( dsadcChannelAvailable[chn] )		{			result[chn] = IfxDsadc_Dsadc_getMainResult(&dsadcChannel[chn]);#if 0			ConsolePrint("/tCH");			ShortToAscii(chn, str_adc);			ConsolePrint(str_adc);			ConsolePrint(" :");			ShortToAscii(result, str_adc);  //str_adc[10] = '/0';			ConsolePrint(str_adc);#endif		}	}#else	DSADC_GLOBRC.U = 0x010001;	delay();	//note that DSADC result is 2's complement	if ((DSADC_RESM0.B.RESULT & 0x8000) == 0x8000)	{		result[0] = (float) (~DSADC_RESM0.U + 1) * 11.375290337;		//display_ascii_printf(DISPLAYSTDOUT0, "DSADC0 = -%.4fV/n", result);	}	else	{		result[0] = (float) DSADC_RESM0.U * 11.375290337;		//display_ascii_printf(DISPLAYSTDOUT0, "DSADC0 = %.4fV/n", result);	}#endif}
开发者ID:xiyanpeng,项目名称:Aurix_Multicore,代码行数:42,


示例23: ConsolePrint

void CHudMenu::UserCmd_ShowVGUIMenu(){	if( gEngfuncs.Cmd_Argc() < 2 )	{		ConsolePrint("usage: showvguimenu <menuType>/n");		return;	}	int menuType = atoi(gEngfuncs.Cmd_Argv(1));	ShowVGUIMenu(menuType);}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:11,


示例24: ConsolePrint

  Model* Graphics::LoadModel(const std::string& modelName)  {    Model* newModel = nullptr;    int dotIndex = modelName.find_last_of('.');    std::string extension = modelName.substr(dotIndex, (modelName.size()) - dotIndex);    auto& modelLoader = loaders_.find(extension);    std::string friendlyName = modelName.substr(0, dotIndex);        if (modelLoader != loaders_.end())    {      newModel = ((*modelLoader).val)->Load("Content/Models/" + modelName);      if (newModel)      {        auto it = models_.find(friendlyName);        if(it == models_.end())        {          models_.insert(friendlyName, newModel);        }        else        {          auto sit = models_.find(friendlyName + extension);          if(sit == models_.end())          {            models_.insert(friendlyName + extension, newModel);          }          else          {            ConsolePrint("Two model files of same name and same type, cannot load model" + friendlyName + extension + "/n");          }        }      }    }    else    {      ConsolePrint("Can't load file extension " + extension + " as model./n");    }    newModel->Initialize();    return newModel;  }
开发者ID:Marktopus,项目名称:WickedSickSingle,代码行数:41,


示例25: ConsolePrint

void TreeStem::Build(TreeSegment* parentSeg, float offset, TreeGeneralParams generalParams, TreeLevelParams levelParams, 					 LevelContext& context){	static int dbNumStems[4];	dbNumStems[levelParams.level]++;	ConsolePrint(L"current numStems: (0-%d),(1-%d),(2-%d),(3-%d)/n", dbNumStems[0], dbNumStems[1], dbNumStems[2], dbNumStems[3]);	SAFE_DELETE(mFirstSeg);	mParentSeg = parentSeg;	mLevelParams = levelParams;	float parentLength = 0;	float stemOffset = 0;	if(parentSeg)	{		mPos = Vector3(0, offset, 0);		// offset: 当stem是parentSeg的一个枝条时, stem在parentSeg上长出的位置		parentLength = mParentSeg->mStem->GetLength();		stemOffset = mParentSeg->mSegIndex * mParentSeg->mStem->GetSegLength() + offset;	}	else	{		_Assert(mLevelParams.level == 0);	// 只有trunk不存在parentSeg		mPos = Vector3::Zero;	}	mLength = calcStemLength(generalParams, parentLength, stemOffset);	mBaseRadius = calcStemBaseRadius(generalParams, parentLength, stemOffset);	float baseLength = 0;	if(mLevelParams.level == 0)	{		baseLength = generalParams.baseSize * mLength;	}	calcStemBranchInterval(parentLength, stemOffset, baseLength, &mNumBranches, &mBranchInterval);	float parentBaseLength = 0;	if(mLevelParams.level == 1)	{		parentBaseLength = generalParams.baseSize * parentLength;	}	float downAngle = 0;	float rotateAngle = 0;	calcBranchAngle(parentLength, stemOffset, parentBaseLength, context.rotateAngle, &downAngle, &rotateAngle);	context.rotateAngle = rotateAngle;	mOrient = Quaternion(0, DEGREE_TO_RAD(rotateAngle), DEGREE_TO_RAD(downAngle));	buildSegment(generalParams, NULL, 0, 0, 0, 0, LevelContext());}
开发者ID:SinYocto,项目名称:Zee,代码行数:53,


示例26: ConsolePrintStrStack

extern void ConsolePrintStrStack(void){	const char *str;	int i = 0;		while ((str = ConsolePopStrStack()) != NULL)	{		ConsoleSetColor(WHITE, BLACK);		ConsoleSetCursor(i++, 0);		ConsolePrint(str);	}}
开发者ID:uranosan,项目名称:noplan-part58,代码行数:12,


示例27: ConsoleFillRect

/*-----------------------------------------------------------------------------  Console: Extern Functions  ---------------------------------------------------------------------------*/extern void ConsoleFillRect( int top, int left, int bottom, int right, int fgColor, int bgColor, const char* str){	ConsoleSetColor( fgColor, bgColor );	for (int i=top; i<bottom; ++i)	{		ConsoleSetCursor( i, 0 );		for (int j=left; j<right; ++j)		{			ConsolePrint(str);		}	}}
开发者ID:uranosan,项目名称:noplan-part58,代码行数:15,



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


C++ ConstPtr函数代码示例
C++ Console函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。