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

C++ READ_BYTE函数代码示例

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

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



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

示例1: BEGIN_READ

int CHud::MsgFunc_Logo(const char *pszName,  int iSize, void *pbuf)
{
	BEGIN_READ( pbuf, iSize );

	// update Train data
	m_iLogo = READ_BYTE();

	return 1;
}
开发者ID:BackupTheBerlios,项目名称:battlegrounds-svn,代码行数:9,代码来源:hud.cpp


示例2: load_function

static int load_function(struct load_state *S, ktap_proto *f)
{
	f->linedefined = READ_INT(S);
 	f->lastlinedefined = READ_INT(S);
	f->numparams = READ_BYTE(S);
	f->is_vararg = READ_BYTE(S);
	f->maxstacksize = READ_BYTE(S);
	if (load_code(S, f))
		return -1;
	if (load_constants(S, f))
		return -1;
	if (load_upvalues(S, f))
		return -1;
	if (load_debuginfo(S, f))
		return -1;

	return 0;
}
开发者ID:bruce2008github,项目名称:ktap,代码行数:18,代码来源:loader.c


示例3: MsgFunc_SayText

int CHudSayText :: MsgFunc_SayText( const char *pszName, int iSize, void *pbuf )
{
	BEGIN_READ( pbuf, iSize );

	int client_index = READ_BYTE();		// the client who spoke the message
	SayTextPrint( READ_STRING(), iSize - 1,  client_index );
	
	return 1;
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:9,代码来源:saytext.cpp


示例4: BEGIN_READ

//Ben
void CHud::MsgFunc_Dead(const char *pszName, int iSize, void *pbuf)
{
	BEGIN_READ( pbuf, iSize);

	short client = READ_BYTE();
	short dead_state = READ_BYTE();

	if(dead_state == 2)
	{
		g_PlayerExtraInfo[client].dead = true;
	}
	else
	{
		g_PlayerExtraInfo[client].dead = false;
	}
	gViewPort->m_pScoreBoard->Update();
//	m_CommanderMenu.Die();
}
开发者ID:BackupTheBerlios,项目名称:battlegrounds-svn,代码行数:19,代码来源:hud_msg.cpp


示例5: load_upvalues

static int load_upvalues(struct load_state *S, ktap_proto *f)
{
	int i,n;

	n = READ_INT(S);
	f->upvalues = NEW_VECTOR(S, n * sizeof(ktap_upvaldesc));
	f->sizeupvalues = n;

	for (i = 0; i < n; i++)
		f->upvalues[i].name = NULL;

	for (i = 0; i < n; i++) {
		f->upvalues[i].instack = READ_BYTE(S);
		f->upvalues[i].idx = READ_BYTE(S);
	}

	return 0;
}
开发者ID:bruce2008github,项目名称:ktap,代码行数:18,代码来源:loader.c


示例6: VSIFOpenL

int PALSARJaxaDataset::Identify( GDALOpenInfo *poOpenInfo ) {
    if ( poOpenInfo->fp == NULL || poOpenInfo->nHeaderBytes < 360 )
        return 0;

    /* First, check that this is a PALSAR image indeed */
    if ( !EQUALN((char *)(poOpenInfo->pabyHeader + 60),"AL", 2) 
         || !EQUALN(CPLGetBasename((char *)(poOpenInfo->pszFilename)) + 4, 
                    "ALPSR", 5) )
    {
        return 0;
    }

    FILE *fpL = VSIFOpenL( poOpenInfo->pszFilename, "r" );
    if( fpL == NULL )
        return FALSE;

    /* Check that this is a volume directory file */
    int nRecordSeq = 0;
    int nRecordSubtype = 0;
    int nRecordType = 0;
    int nSecondSubtype = 0;
    int nThirdSubtype = 0;
    int nLengthRecord = 0;

    VSIFSeekL(fpL, 0, SEEK_SET);

    READ_WORD(fpL, nRecordSeq);
    READ_BYTE(fpL, nRecordSubtype);
    READ_BYTE(fpL, nRecordType);
    READ_BYTE(fpL, nSecondSubtype);
    READ_BYTE(fpL, nThirdSubtype);
    READ_WORD(fpL, nLengthRecord);

    VSIFCloseL( fpL );

    /* Check that we have the right record */
    if ( nRecordSeq == 1 && nRecordSubtype == 192 && nRecordType == 192 &&
         nSecondSubtype == 18 && nThirdSubtype == 18 && nLengthRecord == 360 )
    {
        return 1;
    }

    return 0;
}
开发者ID:Chaduke,项目名称:bah.mod,代码行数:44,代码来源:jaxapalsardataset.cpp


示例7: MsgFunc_InitHUD

void CHud :: MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf )
{
	g_iTeleNum = 0;
	g_bLoadedTeles = false;
	int i;

	//Clear all the teleporters
	for ( i = 0; i < MAX_TELES; i++ )
	{
		g_vecTeleMins[ i ].x = 0.0;
		g_vecTeleMins[ i ].y = 0.0;
		g_vecTeleMins[ i ].z = 0.0;

		g_vecTeleMaxs[ i ].x = 0.0;
		g_vecTeleMaxs[ i ].y = 0.0;
		g_vecTeleMaxs[ i ].z = 0.0;
	}

	/***** FOG CLEARING JIBBA JABBA *****/
	for ( i = 0; i < 3; i++ )
		 g_iFogColor[ i ] = 0.0;

	g_iStartDist = 0.0;
	g_iEndDist = 0.0;
	/***** FOG CLEARING JIBBA JABBA *****/

	// prepare all hud data
	HUDLIST *pList = m_pHudList;

	while (pList)
	{
		if ( pList->p )
			pList->p->InitHUDData();
		pList = pList->pNext;
	}

	BEGIN_READ( pbuf, iSize );
	g_iTeleNum = READ_BYTE();

	for ( i = 0; i < g_iTeleNum; i++ )
	{
		g_vecTeleMins[ i ].x = READ_COORD();
		g_vecTeleMins[ i ].y = READ_COORD();
		g_vecTeleMins[ i ].z = READ_COORD();
		g_vecTeleMaxs[ i ].x = READ_COORD();
		g_vecTeleMaxs[ i ].y = READ_COORD();
		g_vecTeleMaxs[ i ].z = READ_COORD();
	}

	for ( i = 0; i < 3; i++ )
		 g_iFogColor[ i ] = READ_SHORT(); // Should just get a byte.

	//If they both are 0, it means no fog for this level.
	g_iStartDist = READ_SHORT(); 
	g_iEndDist = READ_SHORT(); 
}
开发者ID:6779660,项目名称:halflife,代码行数:56,代码来源:hud_msg.cpp


示例8: BEGIN_READ

// Message handler for ShowMenu message
// takes four values:
//		short: a bitfield of keys that are valid input
//		char : the duration, in seconds, the menu should stay up. -1 means is stays until something is chosen.
//		byte : a boolean, TRUE if there is more string yet to be received before displaying the menu, FALSE if it's the last string
//		string: menu string to display
// if this message is never received, then scores will simply be the combined totals of the players.
int CHudMenu::MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf )
{
	char *temp = NULL;

	BEGIN_READ( pbuf, iSize );

	m_bitsValidSlots = READ_SHORT();
	int DisplayTime = READ_CHAR();
	int NeedMore = READ_BYTE();

	if( DisplayTime > 0 )
		m_flShutoffTime = DisplayTime + gHUD.m_flTime;
	else
		m_flShutoffTime = -1;

	if( m_bitsValidSlots )
	{
		if( !m_fWaitingForMore ) // this is the start of a new menu
		{
			strncpy( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING );
		}
		else
		{
			// append to the current menu string
			strncat( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING - strlen( g_szPrelocalisedMenuString ) - 1 );
		}
		g_szPrelocalisedMenuString[MAX_MENU_STRING - 1] = 0;  // ensure null termination (strncat/strncpy does not)

		if( !NeedMore )
		{
			// we have the whole string, so we can localise it now
			strncpy( g_szMenuString, gHUD.m_TextMessage.BufferedLocaliseTextString( g_szPrelocalisedMenuString ), MAX_MENU_STRING );
			g_szMenuString[MAX_MENU_STRING - 1] = '\0';

			// Swap in characters
			if( KB_ConvertString( g_szMenuString, &temp ) )
			{
				strncpy( g_szMenuString, temp, MAX_MENU_STRING );
				g_szMenuString[MAX_MENU_STRING - 1] = '\0';
				free( temp );
			}
		}

		m_fMenuDisplayed = 1;
		m_iFlags |= HUD_ACTIVE;
	}
	else
	{
		m_fMenuDisplayed = 0; // no valid slots means that the menu should be turned off
		m_iFlags &= ~HUD_ACTIVE;
	}

	m_fWaitingForMore = NeedMore;

	return 1;
}
开发者ID:FWGS,项目名称:hlsdk-xash3d,代码行数:63,代码来源:menu.cpp


示例9: READ_BYTE

int CHudCloak::MsgFunc_Cloak(const char *pszName,  int iSize, void *pbuf )
{
	Cloak = READ_BYTE();

	if (Cloak)
		m_iFlags |= HUD_ACTIVE;
	else
		m_iFlags &= ~HUD_ACTIVE;
return 1;
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:10,代码来源:hud_cloak_icon.cpp


示例10: BEGIN_READ

int CHudAmmo::MsgFunc_WeapPickup(const char *pszName, int iSize, void *pbuf)
{
	BEGIN_READ(pbuf, iSize);
	int iIndex = READ_BYTE();

	// Add the weapon to the history
	gHR.AddToHistory(HISTSLOT_WEAP, iIndex);

	return 1;
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:10,代码来源:ammo.cpp


示例11: parse_header

// parse_header: populates a kssl_header structure from a byte stream. Returns
// KSSL_ERROR_NONE if successful.
kssl_error_code parse_header(BYTE *bytes,            // Stream of bytes
                             // containing a
                             // kssl_header
                             kssl_header *header) {  // Returns the populated
    // header (must be
    // allocated by caller)
    int offset = 0;

    if (bytes == NULL || header == NULL) {
        return KSSL_ERROR_INTERNAL;
    }

    header->version_maj = READ_BYTE(bytes, offset);
    header->version_min = READ_BYTE(bytes, offset);
    header->length = READ_WORD(bytes, offset);
    header->id = READ_DWORD(bytes, offset);

    return KSSL_ERROR_NONE;
}
开发者ID:b1v1r,项目名称:keyless,代码行数:21,代码来源:kssl_helpers.c


示例12: MsgFunc_WarHUD

int CHudRedeemer :: MsgFunc_WarHUD( const char *pszName, int iSize, void *pbuf )
{
	BEGIN_READ( pszName, iSize, pbuf );
	m_iHudMode = READ_BYTE();
	m_iOldHudMode = -1;	// force to update
	ClearPermanentFades ();
	END_READ();

	return 1;
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:10,代码来源:hud_warhead.cpp


示例13: READ_DWORD

bool HelpTable::SetTableData(void* pvTable, WCHAR* pwszSheetName, std::wstring* pstrDataName, BSTR bstrData)
{
    if (0 == wcscmp(pwszSheetName, L"Table_Data_KOR"))
    {
        sHELP_TBLDAT* pHelp = (sHELP_TBLDAT*)pvTable;

        if (0 == wcscmp(pstrDataName->c_str(), L"Help_Tblidx"))
        {
            pHelp->tblidx = READ_DWORD(bstrData);
        }
        else if (0 == wcscmp(pstrDataName->c_str(), L"Category"))
        {
            pHelp->byCategory = READ_BYTE(bstrData, pstrDataName->c_str());
        }
        else if (0 == wcscmp(pstrDataName->c_str(), L"Help_Title"))
        {
            pHelp->dwHelpTitle = READ_DWORD(bstrData);
        }
        else if (0 == wcscmp(pstrDataName->c_str(), L"Popo_Hint"))
        {
            pHelp->dwPopoHint = READ_DWORD(bstrData);
        }
        else if (0 == wcscmp(pstrDataName->c_str(), L"Help_HTML_Name"))
        {
            READ_STRINGW(bstrData, pHelp->wszHelpHTMLName, _countof(pHelp->wszHelpHTMLName));
        }
        else if (0 == wcscmp(pstrDataName->c_str(), L"Condition_Check"))
        {
            pHelp->byConditionCheck = READ_BYTE(bstrData, pstrDataName->c_str());
        }
        else
        {
            Table::CallErrorCallbackFunction(L"[File] : %s\n[Error] : Unknown field name found!(Field Name = %s)", m_wszXmlFileName, pstrDataName->c_str());
            return false;
        }
    }
    else
    {
        return false;
    }

    return true;
}
开发者ID:ChowZenki,项目名称:dboserver,代码行数:43,代码来源:HelpTable.cpp


示例14: MsgFunc_RoomType

int CHud :: MsgFunc_RoomType( const char *pszName, int iSize, void *pbuf )
{
	BEGIN_READ( pszName, iSize, pbuf );

	CVAR_SET_FLOAT( "room_type", (float)READ_BYTE( ));

	END_READ();

	return 1;
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:10,代码来源:hud_msg.cpp


示例15: MsgFunc_GameMode

int CHud :: MsgFunc_GameMode( const char *pszName, int iSize, void *pbuf )
{
	BEGIN_READ( pszName, iSize, pbuf );

	m_Teamplay = READ_BYTE();

	END_READ();
	
	return 1;
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:10,代码来源:hud_msg.cpp


示例16: MsgFunc_Concuss

int CHud :: MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf )
{
	BEGIN_READ( pbuf, iSize );
	m_iConcussionEffect = READ_BYTE();
	if (m_iConcussionEffect)
		this->m_StatusIcons.EnableIcon("dmg_concuss",255,160,0);
	else
		this->m_StatusIcons.DisableIcon("dmg_concuss");
	return 1;
}
开发者ID:vermagav,项目名称:mechmod,代码行数:10,代码来源:hud_msg.cpp


示例17: BEGIN_READ

int CHudMenu::MsgFunc_VGUIMenu( const char *pszName, int iSize, void *pbuf )
{
	BEGIN_READ(pbuf, iSize);

	int menuType = READ_BYTE();
	m_bitsValidSlots = READ_SHORT(); // is ignored

	ShowVGUIMenu(menuType);
	return 1;
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:10,代码来源:menu.cpp


示例18: MsgFunc_Firemode

int CHudFiremode:: MsgFunc_Firemode(const char *pszName,  int iSize, void *pbuf )
{
	m_iType = READ_BYTE();

	if (m_iType)
	m_iFlags |= HUD_ACTIVE;
	else
	m_iFlags &= ~HUD_ACTIVE;
	return 1;
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:10,代码来源:hud_firemode.cpp


示例19: 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,代码来源:text_message.cpp


示例20: BEGIN_READ

int CHudRadio::MsgFunc_SendAudio(const char *pszName, int iSize, void *pbuf)
{
	BEGIN_READ( pbuf, iSize );

	m_bFirst = READ_BYTE( );
	strcpy( m_sentence, READ_STRING( ));
	m_sThird = READ_SHORT( );
	m_enableRadio = true;

	return 1;
}
开发者ID:RomkaZVO,项目名称:cs16-client,代码行数:11,代码来源:radio.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ READ_DATA函数代码示例发布时间:2022-05-30
下一篇:
C++ READ_BT_16函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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