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

C++ IS_FLAG_SET函数代码示例

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

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



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

示例1: SHADER_INIT_PARAMS

END_SHADER_PARAMS

SHADER_INIT_PARAMS()
{
    SET_FLAGS2( MATERIAL_VAR2_SUPPORTS_HW_SKINNING );

    if( !params[ENVMAPMASKSCALE]->IsDefined() )
        params[ENVMAPMASKSCALE]->SetFloatValue( 1.0f );

    if( !params[ENVMAPTINT]->IsDefined() )
        params[ENVMAPTINT]->SetVecValue( 1.0f, 1.0f, 1.0f );

    if( !params[SELFILLUMTINT]->IsDefined() )
        params[SELFILLUMTINT]->SetVecValue( 1.0f, 1.0f, 1.0f );

    if( !params[DETAILSCALE]->IsDefined() )
        params[DETAILSCALE]->SetFloatValue( 4.0f );

    // No envmap uses mode 0, it's one less pass
    // Also, if multipass = 0, then go to mode 0 also
    if ( ( !params[ENVMAP]->IsDefined() ) ||
            ( !IS_FLAG_SET(MATERIAL_VAR_MULTIPASS) ) )
    {
        CLEAR_FLAGS( MATERIAL_VAR_ENVMAPMODE );
    }

    // Vertex color requires mode 1
    if ( IS_FLAG_SET(MATERIAL_VAR_VERTEXCOLOR) )
    {
        SET_FLAGS( MATERIAL_VAR_ENVMAPMODE );
    }

    // No texture means no self-illum or env mask in base alpha
    if ( !params[BASETEXTURE]->IsDefined() )
    {
        CLEAR_FLAGS( MATERIAL_VAR_SELFILLUM );
        CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
    }

    // If in decal mode, no debug override...
    if ( IS_FLAG_SET(MATERIAL_VAR_DECAL) )
    {
        SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
    }

    SET_FLAGS2( MATERIAL_VAR2_LIGHTING_VERTEX_LIT );
    SET_FLAGS2( MATERIAL_VAR2_NEEDS_SOFTWARE_LIGHTING );

    // Get rid of the envmap if it's optional for this dx level.
    if( params[ENVMAPOPTIONAL]->IsDefined() && params[ENVMAPOPTIONAL]->GetIntValue() )
    {
        params[ENVMAP]->SetUndefined();
    }

    // If mat_specular 0, then get rid of envmap
    if( !g_pConfig->UseSpecular() && params[ENVMAP]->IsDefined() && params[BASETEXTURE]->IsDefined() )
    {
        params[ENVMAP]->SetUndefined();
    }
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:60,代码来源:vertexlitgeneric_dx6.cpp


示例2:

	inline const char *GetPixelShaderName( IMaterialVar** params, bool bBumpedEnvMap )
	{
		static char const* s_pPixelShaders[] = 
		{
			// Unmasked
			"LightmappedGeneric_EnvMapV2",
			"LightmappedGeneric_SelfIlluminatedEnvMapV2",

			"LightmappedGeneric_BaseAlphaMaskedEnvMapV2",
			"LightmappedGeneric_SelfIlluminatedEnvMapV2",

			// Env map mask
			"LightmappedGeneric_MaskedEnvMapV2",
			"LightmappedGeneric_SelfIlluminatedMaskedEnvMapV2",

			"LightmappedGeneric_MaskedEnvMapV2",
			"LightmappedGeneric_SelfIlluminatedMaskedEnvMapV2",
		};

		if (!params[BASETEXTURE]->IsTexture())
		{
			if (params[ENVMAP]->IsTexture() && !bBumpedEnvMap )
			{
				if (!params[ENVMAPMASK]->IsDefined() )
				{
					return "LightmappedGeneric_EnvmapNoTexture";
				}
				else
				{
					return "LightmappedGeneric_MaskedEnvmapNoTexture";
				}
			}
			else
			{
				return "LightmappedGeneric_NoTexture";
			}
		}
 		else
		{
			if (params[ENVMAP]->IsTexture() && !bBumpedEnvMap )
			{
				int pshIndex = 0;
				if (IS_FLAG_SET(MATERIAL_VAR_SELFILLUM))
					pshIndex |= 0x1;
				if (IS_FLAG_SET(MATERIAL_VAR_BASEALPHAENVMAPMASK))
					pshIndex |= 0x2;
				if (params[ENVMAPMASK]->IsTexture())
					pshIndex |= 0x4;
				return s_pPixelShaders[pshIndex];
			}
			else
			{
				if (IS_FLAG_SET(MATERIAL_VAR_SELFILLUM))
					return "LightmappedGeneric_SelfIlluminated";
				else
					return "LightmappedGeneric";
			}
		}
	}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:59,代码来源:lightmappedgeneric_dx8.cpp


示例3: mobilebackup_request_restore

/**
 * Request that a backup should be restored to the connected device.
 *
 * @param client The connected MobileBackup client to use.
 * @param backup_manifest The backup manifest, a plist_t of type PLIST_DICT
 *    containing the backup state to be restored.
 * @param flags Flags to send with the request. Currently this is a combination
 *    of the following mobilebackup_flags_t:
 *    MB_RESTORE_NOTIFY_SPRINGBOARD - let SpringBoard show a 'Restore' screen
 *    MB_RESTORE_PRESERVE_SETTINGS - do not overwrite any settings
 *    MB_RESTORE_PRESERVE_CAMERA_ROLL - preserve the photos of the camera roll
 * @param proto_version A string denoting the version of the backup protocol
 *    to use. Latest known version is "1.6". Ideally this value should be
 *    extracted from the given manifest plist.
 *
 * @return MOBILEBACKUP_E_SUCCESS on success, MOBILEBACKUP_E_INVALID_ARG if
 *    one of the parameters is invalid, MOBILEBACKUP_E_PLIST_ERROR if
 *    backup_manifest is not of type PLIST_DICT, MOBILEBACKUP_E_MUX_ERROR
 *    if a communication error occurs, or MOBILEBACKUP_E_REPLY_NOT_OK
 *    if the device did not accept the request.
 */
mobilebackup_error_t mobilebackup_request_restore(mobilebackup_client_t client, plist_t backup_manifest, mobilebackup_flags_t flags, const char *proto_version)
{
	if (!client || !client->parent || !backup_manifest || !proto_version)
		return MOBILEBACKUP_E_INVALID_ARG;

	if (backup_manifest && (plist_get_node_type(backup_manifest) != PLIST_DICT))
		return MOBILEBACKUP_E_PLIST_ERROR;

	mobilebackup_error_t err;

	/* construct request plist */
	plist_t dict = plist_new_dict();
	plist_dict_insert_item(dict, "BackupManifestKey", plist_copy(backup_manifest));
	plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string("kBackupMessageRestoreRequest"));
	plist_dict_insert_item(dict, "BackupProtocolVersion", plist_new_string(proto_version));
	/* add flags */
	plist_dict_insert_item(dict, "BackupNotifySpringBoard", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_NOTIFY_SPRINGBOARD)));
	plist_dict_insert_item(dict, "BackupPreserveSettings", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_SETTINGS)));
	plist_dict_insert_item(dict, "BackupPreserveCameraRoll", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_CAMERA_ROLL)));

	/* send request */
	err = mobilebackup_send_message(client, NULL, dict);
	plist_free(dict);
	dict = NULL;
	if (err != MOBILEBACKUP_E_SUCCESS) {
		debug_info("ERROR: Could not send restore request message (%d)!", err);
		goto leave;
	}

	/* now receive and hopefully get a BackupMessageRestoreReplyOK */
	err = mobilebackup_receive_message(client, "BackupMessageRestoreReplyOK", &dict);
	if (err != MOBILEBACKUP_E_SUCCESS) {
		debug_info("ERROR: Could not receive RestoreReplyOK message (%d)!", err);
		goto leave;
	}

	plist_t node = plist_dict_get_item(dict, "BackupProtocolVersion");
	if (node) {
		char *str = NULL;
		plist_get_string_val(node, &str);
		if (str) {
			if (strcmp(str, proto_version) != 0) {
				err = MOBILEBACKUP_E_BAD_VERSION;
			}
			free(str);
		}
	}

leave:
	if (dict)
		plist_free(dict);
	return err;
}
开发者ID:Cunzhang,项目名称:libimobiledevice,代码行数:74,代码来源:mobilebackup.c


示例4: SHADER_INIT_PARAMS

	END_SHADER_PARAMS

	SHADER_INIT_PARAMS()
	{
		SET_FLAGS2( MATERIAL_VAR2_LIGHTING_LIGHTMAP );
		if( !params[ENVMAPMASKSCALE]->IsDefined() )
			params[ENVMAPMASKSCALE]->SetFloatValue( 1.0f );

		if( !params[DETAILSCALE]->IsDefined() )
			params[DETAILSCALE]->SetFloatValue( 1.0f );

		if( !params[ENVMAPTINT]->IsDefined() )
			params[ENVMAPTINT]->SetVecValue( 1.0f, 1.0f, 1.0f );

		// No texture means no self-illum or env mask in base alpha
		if ( !params[BASETEXTURE]->IsDefined() )
		{
			CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
		}

		// If in decal mode, no debug override...
		if (IS_FLAG_SET(MATERIAL_VAR_DECAL))
		{
			SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
		}
	}
开发者ID:DeadFuze,项目名称:swarm-sdk,代码行数:26,代码来源:lightmappedtwotexture.cpp


示例5: OnGetFileAttributes

static int OnGetFileAttributes(HWND hDlg)
{
    TFileTestData * pData = GetDialogData(hDlg);
    TFlagInfo * pFlags = FileAttributesValues;
    TCHAR szFileAttributes[512] = _T("");
    DWORD dwAttr;
    int nError = ERROR_SUCCESS;

    SaveDialog(hDlg);
    dwAttr = GetFileAttributes(pData->szFileName1);
    if(dwAttr != INVALID_FILE_ATTRIBUTES)
    {
        for(int i = 0; pFlags->dwValue != 0; i++, pFlags++)
        {
            if(IS_FLAG_SET(pFlags, dwAttr))
            {
                if(szFileAttributes[0] != 0)
                    StringCchCat(szFileAttributes, _countof(szFileAttributes), _T("\n"));
                StringCchCat(szFileAttributes, _countof(szFileAttributes), pFlags->szFlagText);
            }
        }

        if(szFileAttributes[0] == 0)
            StringCchCopy(szFileAttributes, _countof(szFileAttributes), _T("0"));
        MessageBoxRc(hDlg, IDS_FILE_ATTRIBUTES, (UINT_PTR)szFileAttributes);
    }
    else
        nError = GetLastError();

    SetResultInfo(hDlg, nError);
    return TRUE;
}
开发者ID:transformersprimeabcxyz,项目名称:FileTest,代码行数:32,代码来源:Page05FileOps.cpp


示例6: TextureIsTranslucent

//-----------------------------------------------------------------------------
// Does the texture store translucency in its alpha channel?
//-----------------------------------------------------------------------------
bool CBaseShader::TextureIsTranslucent( int textureVar, bool isBaseTexture )
{
	if (textureVar < 0)
		return false;

	IMaterialVar** params = s_ppParams;
	if (params[textureVar]->GetType() == MATERIAL_VAR_TYPE_TEXTURE)
	{
		if (!isBaseTexture)
		{
			return params[textureVar]->GetTextureValue()->IsTranslucent();
		}
		else
		{
			// Override translucency settings if this flag is set.
			if (IS_FLAG_SET(MATERIAL_VAR_OPAQUETEXTURE))
				return false;

			if ( (CurrentMaterialVarFlags() & (MATERIAL_VAR_SELFILLUM | MATERIAL_VAR_BASEALPHAENVMAPMASK)) == 0)
			{
				if ((CurrentMaterialVarFlags() & MATERIAL_VAR_TRANSLUCENT) ||
					(CurrentMaterialVarFlags() & MATERIAL_VAR_ALPHATEST))
				{
					return params[textureVar]->GetTextureValue()->IsTranslucent();
				}
			}
		}
	}

	return false;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:34,代码来源:BaseShader.cpp


示例7: InitParamsPhong_DX9

//-----------------------------------------------------------------------------
// Initialize shader parameters
//-----------------------------------------------------------------------------
void InitParamsPhong_DX9( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, VertexLitGeneric_DX9_Vars_t &info )
{	
	// FLASHLIGHTFIXME: Do ShaderAPI::BindFlashlightTexture
	Assert( info.m_nFlashlightTexture >= 0 );

	params[FLASHLIGHTTEXTURE]->SetStringValue( GetFlashlightTextureFilename() );

	// Write over $basetexture with $info.m_nBumpmap if we are going to be using diffuse normal mapping.
	if( info.m_nAlbedo != -1 && g_pConfig->UseBumpmapping() && info.m_nBumpmap != -1 && params[info.m_nBumpmap]->IsDefined() && params[info.m_nAlbedo]->IsDefined() &&
		params[info.m_nBaseTexture]->IsDefined() )
	{
		params[info.m_nBaseTexture]->SetStringValue( params[info.m_nAlbedo]->GetStringValue() );
	}

	// This shader can be used with hw skinning
	SET_FLAGS2( MATERIAL_VAR2_SUPPORTS_HW_SKINNING );
	SET_FLAGS2( MATERIAL_VAR2_LIGHTING_VERTEX_LIT );

	// No texture means no env mask in base alpha
	if ( !params[info.m_nBaseTexture]->IsDefined() )
	{
		CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
	}

	// If in decal mode, no debug override...
	if (IS_FLAG_SET(MATERIAL_VAR_DECAL))
	{
		SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
	}

	// We always specify we're using user data, therefore we always need tangent spaces
	SET_FLAGS2( MATERIAL_VAR2_NEEDS_TANGENT_SPACES );
	bool bBump = (info.m_nBumpmap != -1) && g_pConfig->UseBumpmapping() && params[info.m_nBumpmap]->IsDefined();
	bool bEnvMap = (info.m_nEnvmap != -1) && params[info.m_nEnvmap]->IsDefined();
	bool bDiffuseWarp = (info.m_nDiffuseWarpTexture != -1) && params[info.m_nDiffuseWarpTexture]->IsDefined();
	bool bPhong = (info.m_nPhong != -1) && params[info.m_nPhong]->IsDefined();
	if( !bBump && !bEnvMap && !bDiffuseWarp && !bPhong )
	{
		CLEAR_FLAGS( MATERIAL_VAR_NORMALMAPALPHAENVMAPMASK );
	}

	if ( ( info.m_nSelfIllumFresnelMinMaxExp != -1 ) && ( !params[info.m_nSelfIllumFresnelMinMaxExp]->IsDefined() ) )
	{
		params[info.m_nSelfIllumFresnelMinMaxExp]->SetVecValue( 0.0f, 1.0f, 1.0f );
	}

	InitFloatParam( info.m_nEnvmapFresnel, params, 0.0f );
	InitFloatParam( info.m_nAmbientOcclusion, params, 0.0f );
	InitFloatParam( info.m_nDisplacementWrinkleMap, params, 0.0f );

	InitIntParam( info.m_nSelfIllumFresnel, params, 0 );
	InitIntParam( info.m_nBaseMapAlphaPhongMask, params, 0 );
	InitIntParam( info.m_nBaseMapLuminancePhongMask, params, 0 );
	InitIntParam( info.m_nShaderSrgbRead360, params, 0 );
	InitIntParam( info.m_nAllowDiffuseModulation, params, 1 );

	InitIntParam( info.m_nPhongDisableHalfLambert, params, 0 );

	SET_PARAM_STRING_IF_NOT_DEFINED( info.m_nFoW, "_rt_fog_of_war" );
}
开发者ID:detoxhby,项目名称:lambdawars,代码行数:63,代码来源:phong_dx9_helper.cpp


示例8: SHADER_INIT_PARAMS

	END_SHADER_PARAMS

	SHADER_INIT_PARAMS()
	{
		if( !params[ENVMAPTINT]->IsDefined() )
			params[ENVMAPTINT]->SetVecValue( 1.0f, 1.0f, 1.0f );
		if( !params[ENVMAPMASKSCALE]->IsDefined() )
			params[ENVMAPMASKSCALE]->SetFloatValue( 1.0f );
		if( !params[DETAILSCALE]->IsDefined() )
			params[DETAILSCALE]->SetFloatValue( 4.0f );

		// No texture means no env mask in base alpha
		if ( !params[BASETEXTURE]->IsDefined() )
		{
			CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
		}

		// If in decal mode, no debug override...
		if (IS_FLAG_SET(MATERIAL_VAR_DECAL))
		{
			SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
		}

		// Get rid of the envmap if it's optional for this dx level.
		if( params[ENVMAPOPTIONAL]->IsDefined() && params[ENVMAPOPTIONAL]->GetIntValue() )
		{
			params[ENVMAP]->SetUndefined();
		}

		// If mat_specular 0, then get rid of envmap
		if( !g_pConfig->UseSpecular() && params[ENVMAP]->IsDefined() && params[BASETEXTURE]->IsDefined() )
		{
			params[ENVMAP]->SetUndefined();
		}
	}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:35,代码来源:unlitgeneric_dx6.cpp


示例9: m_status

CNdasDevice::CNdasDevice(
	DWORD dwSlotNo, 
	CONST NDAS_DEVICE_ID& deviceId,
	DWORD dwFlags) :
	m_status(NDAS_DEVICE_STATUS_DISABLED),
	m_lastError(NDAS_DEVICE_ERROR_NONE),
	m_dwSlotNo(dwSlotNo),
	m_deviceId(deviceId),
	m_grantedAccess(0x00000000L),
	m_dwLastHeartbeatTick(0),
	m_dwCommFailureCount(0),
	m_fAutoRegistered(IS_FLAG_SET(dwFlags,NDAS_DEVICE_REG_FLAG_AUTO_REGISTERED)),
	m_fVolatile(IS_FLAG_SET(dwFlags,NDAS_DEVICE_REG_FLAG_VOLATILE)),
	m_fHidden(IS_FLAG_SET(dwFlags,NDAS_DEVICE_REG_FLAG_HIDDEN))
{
	m_szDeviceName[0] = TEXT('\0');

	::ZeroMemory(
		&m_hwInfo, 
		sizeof(HARDWARE_INFO));

	::ZeroMemory(
		m_pUnitDevices, 
		sizeof(CNdasUnitDevice*) * MAX_NDAS_UNITDEVICE_COUNT);

	HRESULT hr = ::StringCchPrintf(
		m_szCfgContainer, 
		30, 
		TEXT("Devices\\%04d"), 
		dwSlotNo);

	_ASSERT(SUCCEEDED(hr));

	//
	// After we allocate m_szCfgContainer, we can use SetConfigValue
	//
	if (m_fAutoRegistered)
	{
		(VOID) SetConfigValue(_T("AutoRegistered"), m_fAutoRegistered);
	}
	else
	{
		(VOID) DeleteConfigValue(_T("AutoRegistered"));		
	}

	DBGPRT_TRACE(_FT("ctor: %s\n"), ToString());
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:47,代码来源:ndasdev.cpp


示例10: GetDrawFlagsPass1

	int GetDrawFlagsPass1(IMaterialVar** params )
	{
		int flags = SHADER_DRAW_POSITION;
		if (IS_FLAG_SET(MATERIAL_VAR_VERTEXCOLOR))
			flags |= SHADER_DRAW_COLOR;
		flags |= SHADER_DRAW_TEXCOORD0;
		return flags;
	}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:8,代码来源:cable_dx6.cpp


示例11: GetDrawFlagsPass1

	int GetDrawFlagsPass1(IMaterialVar** params, bool doDetail)
	{
		int flags = SHADER_DRAW_POSITION;
		if (IS_FLAG_SET(MATERIAL_VAR_VERTEXCOLOR))
			flags |= SHADER_DRAW_COLOR;
		if (params[BASETEXTURE]->IsTexture())
			flags |= SHADER_DRAW_TEXCOORD0;
		if (doDetail)
			flags |= SHADER_DRAW_TEXCOORD1;
		return flags;
	}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:11,代码来源:unlitgeneric_dx6.cpp


示例12: RemoveAllInheritedAces

HRESULT RemoveAllInheritedAces(PACL *ppAcl)
{
    BOOL bResult = FALSE;
    DWORD errorCode = S_OK;
    HRESULT hr = S_OK;
    ACL_SIZE_INFORMATION aclInformation;
    DWORD totalCount;
    DWORD aceIndex = 0;
    LPVOID ace = nullptr;
    BYTE aceFlags = 0;

    if ( !ARGUMENT_PRESENT(*ppAcl) )
    {
        return E_INVALIDARG;
    }

    bResult = GetAclInformation(
        *ppAcl,
        &aclInformation,
        sizeof(aclInformation),
        AclSizeInformation
        );
    FailGracefullyGLE(bResult, L"GetAclInformation");
    
    totalCount = aclInformation.AceCount;
    while ( aceIndex < totalCount ) 
    {
        bResult = GetAce(
            *ppAcl,
            aceIndex,
            &ace
            );
        FailGracefullyGLE(bResult, L"GetAce");
                        
        aceFlags = ((PACE_HEADER)ace)->AceFlags; 

        if (IS_FLAG_SET(aceFlags,INHERITED_ACE)) 
        {
            bResult = DeleteAce(
                *ppAcl,
                aceIndex);
            FailGracefullyGLE(bResult, L"DeleteAce");

            totalCount--;
        }
        else
        {
            aceIndex++;
        }
    }

exit_gracefully:
    return hr;
}
开发者ID:9578577,项目名称:Windows-classic-samples,代码行数:54,代码来源:utility.cpp


示例13: IsTranslucent

bool IsTranslucent( IMaterialVar **params ) const
{
    if ( params[CLOAKPASSENABLED]->GetIntValue() ) // If material supports cloaking
    {
        if ( ( params[CLOAKFACTOR]->GetFloatValue() > 0.0f ) && ( params[CLOAKFACTOR]->GetFloatValue() < 1.0f ) ) // Per-frame check
            return true;
        // else, not cloaking this frame, so check flag in case the base material still needs it
    }

    // Check flag if not drawing cloak pass
    return IS_FLAG_SET( MATERIAL_VAR_TRANSLUCENT );
}
开发者ID:P1x3lF3v3r,项目名称:Estranged-Act-1,代码行数:12,代码来源:vertexlitgeneric_dx9.cpp


示例14: SHADER_INIT_PARAMS

	BEGIN_SHADER_PARAMS
	END_SHADER_PARAMS

	// Set up anything that is necessary to make decisions in SHADER_FALLBACK.
	SHADER_INIT_PARAMS()
	{
		// No texture means no self-illum or env mask in base alpha
		CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
		
		// If in decal mode, no debug override...
		if (IS_FLAG_SET(MATERIAL_VAR_DECAL))
		{
			SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
		}

		SET_FLAGS2( MATERIAL_VAR2_LIGHTING_LIGHTMAP );
	}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:17,代码来源:overlay_fit.cpp


示例15: CreateDialogLayout_PreArranged

// Arranging the dialog layout for pre-arranged dialogs
static void CreateDialogLayout_PreArranged(TFlagDialogData * pData)
{
    TFlagInfo * pFlags;
    HWND hWndChild;
    UINT nChecked;

    // Parse all flags and setup every child item
    for(pFlags = pData->pFlags; pFlags->nIDCtrl != 0; pFlags++)
    {
        // Retrieve the child window belonging to this flag
        hWndChild = GetDlgItem(pData->hDlg, pFlags->nIDCtrl);
        assert(hWndChild != NULL);

        // Set the pointer to flag info structure to the child's window data
        SetWindowLongPtr(hWndChild, GWLP_USERDATA, (LONG_PTR)pFlags);

        // If the flag is set, we need to check that item
        nChecked = IS_FLAG_SET(pFlags, pData->dwFlags);
        Button_SetCheck(hWndChild, nChecked);
    }
}
开发者ID:VlaBst6,项目名称:FileTest,代码行数:22,代码来源:DlgFlags.cpp


示例16: ComputePhongShaderInfo

static void ComputePhongShaderInfo( CBaseVSShader *pShader, IMaterialVar** params,
	VertexLitGeneric_DX9_Vars_t &info, bool bHasFlashlightOnly, PhongShaderInfo_t *pInfo )
{
	pInfo->m_bHasBaseTexture = (info.m_nBaseTexture != -1) && params[info.m_nBaseTexture]->IsTexture();
	pInfo->m_bHasBaseTextureWrinkle = pInfo->m_bHasBaseTexture && 
									 (info.m_nWrinkle != -1) && params[info.m_nWrinkle]->IsTexture() &&
									 (info.m_nStretch != -1) && params[info.m_nStretch]->IsTexture();
	pInfo->m_bHasBumpWrinkle = (info.m_nBumpmap != -1) && params[info.m_nBumpmap]->IsTexture() && 
							   (info.m_nNormalWrinkle != -1) && params[info.m_nNormalWrinkle]->IsTexture() &&
							   (info.m_nNormalStretch != -1) && params[info.m_nNormalStretch]->IsTexture();
	pInfo->m_bHasEnvmap = !bHasFlashlightOnly && params[info.m_nEnvmap]->IsTexture();
	pInfo->m_bHasSelfIllum = IS_FLAG_SET( MATERIAL_VAR_SELFILLUM ) != 0;
	pInfo->m_bHasSelfIllumFresnel = ( pInfo->m_bHasSelfIllum ) && ( info.m_nSelfIllumFresnel != -1 ) && ( params[info.m_nSelfIllumFresnel]->GetIntValue() != 0 );
	pInfo->m_bHasPhong = (info.m_nPhong != -1) && ( params[info.m_nPhong]->GetIntValue() != 0 );
	pInfo->m_bHasPhongWarp = (info.m_nPhongWarpTexture != -1) && params[info.m_nPhongWarpTexture]->IsTexture();
	pInfo->m_bHasDiffuseWarp = (info.m_nDiffuseWarpTexture != -1) && params[info.m_nDiffuseWarpTexture]->IsTexture();
	pInfo->m_bHasDetailTexture = ( info.m_nDetail != -1 ) && params[info.m_nDetail]->IsTexture();

	// Rimlight must be set to non-zero to trigger rim light combo (also requires Phong)
	pInfo->m_bHasRimLight = r_rimlight.GetBool() && pInfo->m_bHasPhong && (info.m_nRimLight != -1) && ( params[info.m_nRimLight]->GetIntValue() != 0 );
}
开发者ID:detoxhby,项目名称:lambdawars,代码行数:21,代码来源:phong_dx9_helper.cpp


示例17: TextureIsTranslucent

//-----------------------------------------------------------------------------
// Does the texture store translucency in its alpha channel?
//-----------------------------------------------------------------------------
bool CBaseShader::TextureIsTranslucent( int textureVar, bool isBaseTexture )
{
	if (textureVar < 0)
		return false;

	IMaterialVar** params = s_ppParams;
	if (params[textureVar]->GetType() == MATERIAL_VAR_TYPE_TEXTURE)
	{
		if (!isBaseTexture)
		{
			return params[textureVar]->GetTextureValue()->IsTranslucent();
		}
		else
		{
			// Override translucency settings if this flag is set.
			if (IS_FLAG_SET(MATERIAL_VAR_OPAQUETEXTURE))
				return false;

			bool bHasSelfIllum				= ( ( CurrentMaterialVarFlags() & MATERIAL_VAR_SELFILLUM ) != 0 );
			bool bHasSelfIllumMask			= ( ( CurrentMaterialVarFlags2() & MATERIAL_VAR2_SELFILLUMMASK ) != 0 );
			bool bHasBaseAlphaEnvmapMask	= ( ( CurrentMaterialVarFlags() & MATERIAL_VAR_BASEALPHAENVMAPMASK ) != 0 );
			bool bUsingBaseTextureAlphaForSelfIllum = bHasSelfIllum && !bHasSelfIllumMask;
			// Check if we are using base texture alpha for something other than translucency.
			if ( !bUsingBaseTextureAlphaForSelfIllum && !bHasBaseAlphaEnvmapMask )
			{
				// We aren't using base alpha for anything other than trancluceny.

				// check if the material is marked as translucent or alpha test.
				if ((CurrentMaterialVarFlags() & MATERIAL_VAR_TRANSLUCENT) ||
					(CurrentMaterialVarFlags() & MATERIAL_VAR_ALPHATEST))
				{
					// Make sure the texture has an alpha channel.
					return params[textureVar]->GetTextureValue()->IsTranslucent();
				}
			}
		}
	}

	return false;
}
开发者ID:BenLubar,项目名称:riflemod,代码行数:43,代码来源:BaseShader.cpp


示例18: SHADER_INIT_PARAMS

	END_SHADER_PARAMS

	SHADER_INIT_PARAMS()
	{
		if( !params[DETAILSCALE]->IsDefined() )
			params[DETAILSCALE]->SetFloatValue( 1.0f );

		if( !params[ENVMAPTINT]->IsDefined() )
			params[ENVMAPTINT]->SetVecValue( 1.0f, 1.0f, 1.0f );

		if( !params[ENVMAPCONTRAST]->IsDefined() )
			params[ENVMAPCONTRAST]->SetFloatValue( 0.0f );
		
		if( !params[ENVMAPSATURATION]->IsDefined() )
			params[ENVMAPSATURATION]->SetFloatValue( 1.0f );
		
		if( !params[UNLITFACTOR]->IsDefined() )
			params[UNLITFACTOR]->SetFloatValue( 0.3f );

		if( !params[FRESNELREFLECTION]->IsDefined() )
			params[FRESNELREFLECTION]->SetFloatValue( 1.0f );

		if( !params[ENVMAPMASKFRAME]->IsDefined() )
			params[ENVMAPMASKFRAME]->SetIntValue( 0 );
		
		if( !params[ENVMAPFRAME]->IsDefined() )
			params[ENVMAPFRAME]->SetIntValue( 0 );

		// No texture means no self-illum or env mask in base alpha
		if ( !params[BASETEXTURE]->IsDefined() )
		{
			CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
		}

		// If in decal mode, no debug override...
		if (IS_FLAG_SET(MATERIAL_VAR_DECAL))
		{
			SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
		}
	}
开发者ID:SCell555,项目名称:hl2-asw-port,代码行数:40,代码来源:shatteredglass.cpp


示例19: SHADER_INIT_PARAMS

	// Set up anything that is necessary to make decisions in SHADER_FALLBACK.
	SHADER_INIT_PARAMS()
	{
		// FLASHLIGHTFIXME
		params[FLASHLIGHTTEXTURE]->SetStringValue( "effects/flashlight001" );

		// Write over $basetexture with $albedo if we are going to be using diffuse normal mapping.
		if( ShouldUseBumpmapping( params ) && params[ALBEDO]->IsDefined() &&
			params[BASETEXTURE]->IsDefined() && 
			!( params[NODIFFUSEBUMPLIGHTING]->IsDefined() && params[NODIFFUSEBUMPLIGHTING]->GetIntValue() ) )
		{
			params[BASETEXTURE]->SetStringValue( params[ALBEDO]->GetStringValue() );
		}

		if( IsUsingGraphics() && params[ENVMAP]->IsDefined() && !CanUseEditorMaterials() )
		{
			if( stricmp( params[ENVMAP]->GetStringValue(), "env_cubemap" ) == 0 )
			{
				Warning( "env_cubemap used on world geometry without rebuilding map. . ignoring: %s\n", pMaterialName );
				params[ENVMAP]->SetUndefined();
			}
		}
		
		if( !params[ENVMAPMASKSCALE]->IsDefined() )
		{
			params[ENVMAPMASKSCALE]->SetFloatValue( 1.0f );
		}

		if( !params[ENVMAPTINT]->IsDefined() )
		{
			params[ENVMAPTINT]->SetVecValue( 1.0f, 1.0f, 1.0f );
		}

		if( !params[SELFILLUMTINT]->IsDefined() )
		{
			params[SELFILLUMTINT]->SetVecValue( 1.0f, 1.0f, 1.0f );
		}

		if( !params[DETAILSCALE]->IsDefined() )
		{
			params[DETAILSCALE]->SetFloatValue( 4.0f );
		}

		if( !params[DETAILBLENDFACTOR]->IsDefined() )
		{
			params[DETAILBLENDFACTOR]->SetFloatValue( 1.0f );
		}

		if( !params[FRESNELREFLECTION]->IsDefined() )
		{
			params[FRESNELREFLECTION]->SetFloatValue( 1.0f );
		}

		if( !params[ENVMAPMASKFRAME]->IsDefined() )
		{
			params[ENVMAPMASKFRAME]->SetIntValue( 0 );
		}
		
		if( !params[ENVMAPFRAME]->IsDefined() )
		{
			params[ENVMAPFRAME]->SetIntValue( 0 );
		}

		if( !params[BUMPFRAME]->IsDefined() )
		{
			params[BUMPFRAME]->SetIntValue( 0 );
		}

		if( !params[ENVMAPCONTRAST]->IsDefined() )
		{
			params[ENVMAPCONTRAST]->SetFloatValue( 0.0f );
		}
		
		if( !params[ENVMAPSATURATION]->IsDefined() )
		{
			params[ENVMAPSATURATION]->SetFloatValue( 1.0f );
		}

		if( !params[ALPHATESTREFERENCE]->IsDefined() )
		{
			params[ALPHATESTREFERENCE]->SetFloatValue( 0.0f );
		}

		// No texture means no self-illum or env mask in base alpha
		if ( !params[BASETEXTURE]->IsDefined() )
		{
			CLEAR_FLAGS( MATERIAL_VAR_SELFILLUM );
			CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
		}

		// If in decal mode, no debug override...
		if (IS_FLAG_SET(MATERIAL_VAR_DECAL))
		{
			SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
		}

		SET_FLAGS2( MATERIAL_VAR2_LIGHTING_LIGHTMAP );
		if( ShouldUseBumpmapping( params ) && (params[NODIFFUSEBUMPLIGHTING]->GetIntValue() == 0) )
		{
			SET_FLAGS2( MATERIAL_VAR2_LIGHTING_BUMPED_LIGHTMAP );
//.........这里部分代码省略.........
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:101,代码来源:lightmappedgeneric_dx8.cpp


示例20: InitParamsLightmappedGeneric_DX9

void InitParamsLightmappedGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, LightmappedGeneric_DX9_Vars_t &info )
{
	if ( g_pHardwareConfig->SupportsBorderColor() )
	{
		params[FLASHLIGHTTEXTURE]->SetStringValue( "effects/flashlight_border" );
	}
	else
	{
		params[FLASHLIGHTTEXTURE]->SetStringValue( "effects/flashlight001" );
	}

	// Write over $basetexture with $albedo if we are going to be using diffuse normal mapping.
	if( g_pConfig->UseBumpmapping() && params[info.m_nBumpmap]->IsDefined() && params[info.m_nAlbedo]->IsDefined() &&
		params[info.m_nBaseTexture]->IsDefined() && 
		!( params[info.m_nNoDiffuseBumpLighting]->IsDefined() && params[info.m_nNoDiffuseBumpLighting]->GetIntValue() ) )
	{
		params[info.m_nBaseTexture]->SetStringValue( params[info.m_nAlbedo]->GetStringValue() );
	}

	if( pShader->IsUsingGraphics() && params[info.m_nEnvmap]->IsDefined() && !pShader->CanUseEditorMaterials() )
	{
		if( stricmp( params[info.m_nEnvmap]->GetStringValue(), "env_cubemap" ) == 0 )
		{
			Warning( "env_cubemap used on world geometry without rebuilding map. . ignoring: %s\n", pMaterialName );
			params[info.m_nEnvmap]->SetUndefined();
		}
	}
	
	if ( (mat_disable_lightwarp.GetBool() ) &&
		 (info.m_nLightWarpTexture != -1) )
	{
		params[info.m_nLightWarpTexture]->SetUndefined();
	}
	if ( (mat_disable_fancy_blending.GetBool() ) &&
		 (info.m_nBlendModulateTexture != -1) )
	{
		params[info.m_nBlendModulateTexture]->SetUndefined();
	}

	if( !params[info.m_nEnvmapTint]->IsDefined() )
		params[info.m_nEnvmapTint]->SetVecValue( 1.0f, 1.0f, 1.0f );

	if( !params[info.m_nNoDiffuseBumpLighting]->IsDefined() )
		params[info.m_nNoDiffuseBumpLighting]->SetIntValue( 0 );

	if( !params[info.m_nSelfIllumTint]->IsDefined() )
		params[info.m_nSelfIllumTint]->SetVecValue( 1.0f, 1.0f, 1.0f );

	if( !params[info.m_nDetailScale]->IsDefined() )
		params[info.m_nDetailScale]->SetFloatValue( 4.0f );

	if ( !params[info.m_nDetailTint]->IsDefined() )
		params[info.m_nDetailTint]->SetVecValue( 1.0f, 1.0f, 1.0f, 1.0f );

	InitFloatParam( info.m_nDetailTextureBlendFactor, params, 1.0 );
	InitIntParam( info.m_nDetailTextureCombineMode, params, 0 );

	if( !params[info.m_nFresnelReflection]->IsDefined() )
		params[info.m_nFresnelReflection]->SetFloatValue( 1.0f );

	if( !params[info.m_nEnvmapMaskFrame]->IsDefined() )
		params[info.m_nEnvmapMaskFrame]->SetIntValue( 0 );
	
	if( !params[info.m_nEnvmapFrame]->IsDefined() )
		params[info.m_nEnvmapFrame]->SetIntValue( 0 );

	if( !params[info.m_nBumpFrame]->IsDefined() )
		params[info.m_nBumpFrame]->SetIntValue( 0 );

	if( !params[info.m_nDetailFrame]->IsDefined() )
		params[info.m_nDetailFrame]->SetIntValue( 0 );

	if( !params[info.m_nEnvmapContrast]->IsDefined() )
		params[info.m_nEnvmapContrast]->SetFloatValue( 0.0f );
	
	if( !params[info.m_nEnvmapSaturation]->IsDefined() )
		params[info.m_nEnvmapSaturation]->SetFloatValue( 1.0f );
	
	InitFloatParam( info.m_nAlphaTestReference, params, 0.0f );

	// No texture means no self-illum or env mask in base alpha
	if ( !params[info.m_nBaseTexture]->IsDefined() )
	{
		CLEAR_FLAGS( MATERIAL_VAR_SELFILLUM );
		CLEAR_FLAGS( MATERIAL_VAR_BASEALPHAENVMAPMASK );
	}

	if( params[info.m_nBumpmap]->IsDefined() )
	{
		params[info.m_nEnvmapMask]->SetUndefined();
	}
	
	// If in decal mode, no debug override...
	if (IS_FLAG_SET(MATERIAL_VAR_DECAL))
	{
		SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
	}

	SET_FLAGS2( MATERIAL_VAR2_LIGHTING_LIGHTMAP );
	if( g_pConfig->UseBumpmapping() && params[info.m_nBumpmap]->IsDefined() && (params[info.m_nNoDiffuseBumpLighting]->GetIntValue() == 0) )
//.........这里部分代码省略.........
开发者ID:bonjorno7,项目名称:GAME,代码行数:101,代码来源:lightmappedgeneric_dx9_helper.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ IS_FLASH_ADDRESS函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_EXTI_LINE函数代码示例发布时间: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