当前位置: 首页>>代码示例>>C++>>正文


C++ READ_BYTE函数代码示例

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


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


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