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


C++ IsUsed函数代码示例

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


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

示例1: uint8_t

void DecodedMux::Decode(uint32_t dwMux0, uint32_t dwMux1)
{
    m_dwMux0 = dwMux0;
    m_dwMux1 = dwMux1;

    aRGB0  = uint8_t((dwMux0>>20)&0x0F);  // c1 c1        // a0
    bRGB0  = uint8_t((dwMux1>>28)&0x0F);  // c1 c2        // b0
    cRGB0  = uint8_t((dwMux0>>15)&0x1F);  // c1 c3        // c0
    dRGB0  = uint8_t((dwMux1>>15)&0x07);  // c1 c4        // d0
    
    aA0    = uint8_t((dwMux0>>12)&0x07);  // c1 a1        // Aa0
    bA0    = uint8_t((dwMux1>>12)&0x07);  // c1 a2        // Ab0
    cA0    = uint8_t((dwMux0>>9 )&0x07);  // c1 a3        // Ac0
    dA0    = uint8_t((dwMux1>>9 )&0x07);  // c1 a4        // Ad0
    
    aRGB1  = uint8_t((dwMux0>>5 )&0x0F);  // c2 c1        // a1
    bRGB1  = uint8_t((dwMux1>>24)&0x0F);  // c2 c2        // b1
    cRGB1  = uint8_t((dwMux0    )&0x1F);  // c2 c3        // c1
    dRGB1  = uint8_t((dwMux1>>6 )&0x07);  // c2 c4        // d1
    
    aA1    = uint8_t((dwMux1>>21)&0x07);  // c2 a1        // Aa1
    bA1    = uint8_t((dwMux1>>3 )&0x07);  // c2 a2        // Ab1
    cA1    = uint8_t((dwMux1>>18)&0x07);  // c2 a3        // Ac1
    dA1    = uint8_t((dwMux1    )&0x07);  // c2 a4        // Ad1

    //This function will translate the decode mux info further, so we can use
    //the decode data better.
    //Will translate A,B,C,D to unified presentation
    aRGB0  = sc_Mux16[aRGB0];
    bRGB0  = sc_Mux16[bRGB0];
    cRGB0  = sc_Mux32[cRGB0];
    dRGB0  = sc_Mux8[dRGB0];
    
    aA0    = sc_Mux8[aA0];
    bA0    = sc_Mux8[bA0];
    cA0    = sc_Mux8[cA0];
    dA0    = sc_Mux8[dA0];
    
    aRGB1  = sc_Mux16[aRGB1];
    bRGB1  = sc_Mux16[bRGB1];
    cRGB1  = sc_Mux32[cRGB1];
    dRGB1  = sc_Mux8[dRGB1];
    
    aA1    = sc_Mux8[aA1];
    bA1    = sc_Mux8[bA1];
    cA1    = sc_Mux8[cA1];
    dA1    = sc_Mux8[dA1];

    m_bShadeIsUsed[1] = IsUsedInAlphaChannel(MUX_SHADE, MUX_MASK);
    m_bShadeIsUsed[0] = IsUsedInColorChannel(MUX_SHADE, MUX_MASK);
    m_bTexel0IsUsed = IsUsed(MUX_TEXEL0, MUX_MASK);
    m_bTexel1IsUsed = IsUsed(MUX_TEXEL1, MUX_MASK);

    m_dwShadeColorChannelFlag = 0;
    m_dwShadeAlphaChannelFlag = 0;
    m_ColorTextureFlag[0] = 0;
    m_ColorTextureFlag[1] = 0;
}
开发者ID:RobLoach,项目名称:mupen64plus-libretro,代码行数:58,代码来源:DecodedMux.cpp

示例2: HowManyTextures

int DecodedMux::HowManyTextures()
{
    int n = 0;

    if (IsUsed(MUX_TEXEL0, MUX_MASK))
        n++;

    if (IsUsed(MUX_TEXEL1, MUX_MASK))
        n++;

    return n;
}
开发者ID:RobLoach,项目名称:mupen64plus-libretro,代码行数:12,代码来源:DecodedMux.cpp

示例3: CheckCombineInCycle1

void DecodedMux::Simplify(void)
{
    CheckCombineInCycle1();

    if (gRDP.otherMode.text_lod)
        ConvertLODFracTo0();

    if (g_curRomInfo.bTexture1Hack)
    {
        ReplaceVal(MUX_TEXEL1, MUX_TEXEL0, 2, MUX_MASK);
        ReplaceVal(MUX_TEXEL1, MUX_TEXEL0, 3, MUX_MASK);
    }
    Reformat(true);

    UseShadeForConstant();
    Reformat(true);

    if (m_dwShadeColorChannelFlag == MUX_0)
    {
        MergeShadeWithConstants();
        Reformat(true);
    }

#ifdef ALLOW_USE_TEXTURE_FOR_CONSTANTS
    UseTextureForConstant();
    for (int i=0; i<2; i++)
    {
        if (m_ColorTextureFlag[i] != 0)
        {
            if (m_dwShadeColorChannelFlag == m_ColorTextureFlag[i])
            {
                ReplaceVal(MUX_SHADE, MUX_TEXEL0+i, N64Cycle0RGB, MUX_MASK);
                ReplaceVal(MUX_SHADE, MUX_TEXEL0+i, N64Cycle1RGB, MUX_MASK);
                m_dwShadeColorChannelFlag = 0;
            }
            if (m_dwShadeAlphaChannelFlag == m_ColorTextureFlag[i])
            {
                ReplaceVal(MUX_SHADE, MUX_TEXEL0+i, N64Cycle0Alpha, MUX_MASK);
                ReplaceVal(MUX_SHADE, MUX_TEXEL0+i, N64Cycle1Alpha, MUX_MASK);
                ReplaceVal(MUX_SHADE|MUX_ALPHAREPLICATE, (MUX_TEXEL0+i)|MUX_ALPHAREPLICATE, N64Cycle0RGB, MUX_MASK_WITH_ALPHA);
                ReplaceVal(MUX_SHADE|MUX_ALPHAREPLICATE, (MUX_TEXEL0+i)|MUX_ALPHAREPLICATE, N64Cycle1RGB, MUX_MASK_WITH_ALPHA);
                m_dwShadeAlphaChannelFlag = 0;
            }
        }
    }
    Reformat(true);
#endif

    m_bTexel0IsUsed = IsUsed(MUX_TEXEL0, MUX_MASK);
    m_bTexel1IsUsed = IsUsed(MUX_TEXEL1, MUX_MASK);
}
开发者ID:RobLoach,项目名称:mupen64plus-libretro,代码行数:51,代码来源:DecodedMux.cpp

示例4: HowManyConstFactors

void DecodedMux::UseTextureForConstant(void)
{
    int numofconst = HowManyConstFactors();
    int numOftex = HowManyTextures();

    if (numofconst > m_maxConstants && numOftex < m_maxTextures)
    {
        // We can use a texture for a constant
        for (int i=0; i<2 && numofconst > m_maxConstants ; i++)
        {
            if (IsUsed(MUX_TEXEL0+i, MUX_MASK))
            {
                continue;   // can not use this texture
            }

            if (IsUsed(MUX_PRIM, MUX_MASK))
            {
                ReplaceVal(MUX_PRIM, MUX_TEXEL0+i, -1, MUX_MASK);
                m_ColorTextureFlag[i] = MUX_PRIM;
                numofconst--;
                continue;
            }

            if (IsUsed(MUX_ENV, MUX_MASK))
            {
                ReplaceVal(MUX_ENV, MUX_TEXEL0+i, -1, MUX_MASK);
                m_ColorTextureFlag[i] = MUX_ENV;
                numofconst--;
                continue;
            }

            if (IsUsed(MUX_LODFRAC, MUX_MASK))
            {
                ReplaceVal(MUX_LODFRAC, MUX_TEXEL0+i, -1, MUX_MASK);
                m_ColorTextureFlag[i] = MUX_LODFRAC;
                numofconst--;
                continue;
            }

            if (IsUsed(MUX_PRIMLODFRAC, MUX_MASK))
            {
                ReplaceVal(MUX_PRIMLODFRAC, MUX_TEXEL0+i, -1, MUX_MASK);
                m_ColorTextureFlag[i] = MUX_PRIMLODFRAC;
                numofconst--;
                continue;
            }
        }
    }
}
开发者ID:RobLoach,项目名称:mupen64plus-libretro,代码行数:49,代码来源:DecodedMux.cpp

示例5: IsUsed

void DecodedMuxForOGL14V2::UseTextureForConstant(void)
{
    bool envused = IsUsed(MUX_ENV, MUX_MASK);
    bool lodused = IsUsed(MUX_LODFRAC, MUX_MASK);
    
    int numofconst = 0;
    if (envused) numofconst++;
    if (lodused) numofconst++;

    int numOftex = HowManyTextures();

    if (numofconst > 0 && numOftex < 2)
    {
        // We can use a texture for a constant
        for (int i=0; i<2 && numofconst > 0 ; i++)
        {
            if (IsUsed(MUX_TEXEL0+i, MUX_MASK))
            {
                continue;   // can not use this texture
            }

            if (envused)
            {
                ReplaceVal(MUX_ENV, MUX_TEXEL0+i, -1, MUX_MASK);
                m_ColorTextureFlag[i] = MUX_ENV;
                numofconst--;
                envused = false;
                continue;
            }

            if (IsUsed(MUX_LODFRAC, MUX_MASK))
            {
                ReplaceVal(MUX_LODFRAC, MUX_TEXEL0+i, -1, MUX_MASK);
                m_ColorTextureFlag[i] = MUX_LODFRAC;
                numofconst--;
                continue;
            }

            if (IsUsed(MUX_PRIMLODFRAC, MUX_MASK))
            {
                ReplaceVal(MUX_PRIMLODFRAC, MUX_TEXEL0+i, -1, MUX_MASK);
                m_ColorTextureFlag[i] = MUX_PRIMLODFRAC;
                numofconst--;
                continue;
            }
        }
    }
}
开发者ID:RobLoach,项目名称:mupen64plus-libretro,代码行数:48,代码来源:DecodedMux.cpp

示例6: Release

void PortSpace::Release(const Value_t port)
{
	if(port < min_ || port > max_ || IsUsed(port) == false)
		return;

	setPort(port, false);
}
开发者ID:FRC-3637-Daleks,项目名称:dalek-manager-lib,代码行数:7,代码来源:PortSpace.cpp

示例7:

int NFCRecord::FindVector3(const int nCol, const NFVector3& value, NFDataList& varResult)
{
	if (!ValidCol(nCol))
	{
		return -1;
	}

	if (TDATA_VECTOR3 != mVarRecordType->Type(nCol))
	{
		return -1;
	}

	{
		for (int i = 0; i < mnMaxRow; ++i)
		{
			if (!IsUsed(i))
			{
				continue;
			}

			if (GetVector3(i, nCol) == value)
			{
				varResult << (int64_t)i;
			}
		}

		return varResult.GetCount();
	}

	return -1;
}
开发者ID:tcomy,项目名称:NoahGameFrame,代码行数:31,代码来源:NFCRecord.cpp

示例8: FindFloat

int NFCRecord::FindFloat(const int nCol, const double value, NFDataList& varResult)
{
    if (!ValidCol(nCol))
    {
        return -1;
    }

    if (TDATA_FLOAT != mVarRecordType->Type(nCol))
    {
        return -1;
    }

    for (int i = 0; i < mnMaxRow; ++i)
    {
        if (!IsUsed(i))
        {
            continue;
        }

        if (GetFloat(i, nCol) == value)
        {
            varResult << i;
        }
    }

    return varResult.GetCount();
}
开发者ID:tcomy,项目名称:NoahGameFrame,代码行数:27,代码来源:NFCRecord.cpp

示例9: Use

void PortSpace::Use(const Value_t port)
{
	if(IsUsed(port))
		throw UnavailablePortError(port, *this);

	setPort(port, true);
}
开发者ID:FRC-3637-Daleks,项目名称:dalek-manager-lib,代码行数:7,代码来源:PortSpace.cpp

示例10: FindString

int NFCRecord::FindString(const int nCol, const std::string& value, NFDataList& varResult)
{
    if (!ValidCol(nCol))
    {
        return -1;
    }

    if (TDATA_STRING != mVarRecordType->Type(nCol))
    {
        return -1;
    }


    {
        for (int i = 0; i < mnMaxRow; ++i)
        {
            if (!IsUsed(i))
            {
                continue;
            }

            const std::string& strData = GetString(i, nCol);
            if (0 == strcmp(strData.c_str(), value.c_str()))
            {
                varResult << (int64_t)i;
            }
        }

        return varResult.GetCount();
    }

    return -1;
}
开发者ID:tcomy,项目名称:NoahGameFrame,代码行数:33,代码来源:NFCRecord.cpp

示例11: SwapRowInfo

bool NFCRecord::SwapRowInfo(const int nOriginRow, const int nTargetRow)
{
    if (!IsUsed(nOriginRow))
    {
        return false;
    }

    if (ValidRow(nOriginRow)
        && ValidRow(nTargetRow))
    {
        for (int i = 0; i < GetCols(); ++i)
        {
            NF_SHARE_PTR<NFData> pOrigin = mtRecordVec.at(GetPos(nOriginRow, i));
            mtRecordVec[GetPos(nOriginRow, i)] = mtRecordVec.at(GetPos(nTargetRow, i));
            mtRecordVec[GetPos(nTargetRow, i)] = pOrigin;
        }

        int nOriginUse = mVecUsedState[nOriginRow];
        mVecUsedState[nOriginRow] = mVecUsedState[nTargetRow];
        mVecUsedState[nTargetRow] = nOriginUse;

        RECORD_EVENT_DATA xEventData;
        xEventData.nOpType = RECORD_EVENT_DATA::Swap;
        xEventData.nRow = nOriginRow;
        xEventData.nCol = nTargetRow;
        xEventData.strRecordName = mstrRecordName;

        NFData xData;
        OnEventHandler(mSelf, xEventData, xData, xData);

        return true;
    }

    return false;
}
开发者ID:tcomy,项目名称:NoahGameFrame,代码行数:35,代码来源:NFCRecord.cpp

示例12: FindObject

int NFCRecord::FindObject(const int nCol, const NFGUID& value, NFIDataList& varResult)
{
    if (!ValidCol(nCol))
    {
        return -1;
    }

    if (TDATA_OBJECT != mVarRecordType->Type(nCol))
    {
        return -1;
    }

    {
        for (int64_t i = 0; i < mnMaxRow; ++i)
        {
            if (!IsUsed(i))
            {
                continue;
            }

            if (GetObject(i, nCol) == value)
            {
                varResult << i;
            }
        }

        return varResult.GetCount();
    }

    return -1;
}
开发者ID:B1sounours,项目名称:NoahGameFrame,代码行数:31,代码来源:NFCRecord.cpp

示例13: if

	ERMsg COGRBaseOption::ProcessOption(int& i, int argc, char* argv[])
	{
		ERMsg msg;
		string error;


		if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "--utility_version"))
		{
			m_bVersion = true;
		}
		else if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "-co") && i < argc - 1)
		{
			m_createOptions.push_back(argv[++i]);
		}
		else if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "-of") && i < argc - 1)
		{
			m_format = argv[++i];
		}
		else if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "-wo") && i < argc - 1)//working option
		{
			//UNIFIED_SRC_NODATA
			m_workOptions.push_back(argv[++i]);
		}
		else if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "-multi"))
		{
			m_bMulti = true;
		}
		else if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "-f") && i < argc - 1)
		{
			m_format = argv[i + 1];
		}
		else if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "-overwrite"))
		{
			m_bOverwrite = true;
		}
		else if (IsUsed(BASE_OPTIONS) && IsEqual(argv[i], "-q"))
		{
			m_bQuiet = true;
		}
		else if (IsEqual(argv[i], "-?") || IsEqual(argv[i], "-help"))
		{
			m_bNeedHelp = true;
		}
		else if (argv[i][0] == '-')
		{
			error = string("ERROR: Invalid option: ") + argv[i] + ", use - ? for more help.\n";
			msg.ajoute(error);
			//return false;
		}
		else
		{
			m_filesPath.push_back(argv[i]);
		}

		return msg;
	}
开发者ID:RNCan,项目名称:WeatherBasedSimulationFramework,代码行数:56,代码来源:OGRBasic.cpp

示例14: GetUsedSlots

	inline Slot GetUsedSlots() const noexcept
	{
		Slot n = 0;

		for (Slot s = 0; s < Slots; ++s)
			if (IsUsed(s)) ++n;

		return n;
	}
开发者ID:epicbrownie,项目名称:Epic,代码行数:9,代码来源:InputAction.hpp

示例15:

const PortSpace::Value_t PortSpace::GetAvailable() const
{
	for(Value_t port = min_; port <= max_; port++)
	{
		if(!IsUsed(port))
			return port;
	}

	return empty;
}
开发者ID:FRC-3637-Daleks,项目名称:dalek-manager-lib,代码行数:10,代码来源:PortSpace.cpp


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