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

C++ IsUsed函数代码示例

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

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



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


示例16: GetUsage

	string COGRBaseOption::GetUsage()const
	{

		string usage = "Usage: \n";
		if (IsUsed(BASE_OPTIONS))
		{
			usage +=
				"  [--help-general] [--formats]\n"
				"  [-of format] [-ot Byte/Int16/...] [-co \"NAME=VALUE\"]*\n"
				"  [-srcnodata value] [-dstnodata value] [-wo \"NAME=VALUE\"]*\n"
				"  [-q] [-multi] [-overwrite]\n";
		}

		if (IsUsed(OP_SEPARATE))
			usage += "  [-separate]\n";

		if (IsUsed(OP_EXTENTS))
		{
			usage +=
				"  [-te xmin ymin xmax ymax] -tap\n";

		}

		if (IsUsed(OP_SIZE))
		{
			usage +=
				"  [-ts xres yres] [-ts width height]\n";

		}

		if (IsUsed(OP_BANDS))
		{
			usage +=
				"  [-b band]\n";

		}

		//usage += "  srcfile*\n";


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


示例17: QueryRow

// 获得数据
bool NFCRecord::QueryRow(const int nRow, NFIDataList& varList)
{
    if (!ValidRow(nRow))
    {
        return false;
    }

    if (!IsUsed(nRow))
    {
        return false;
    }

    varList.Clear();
    for (int i = 0; i < GetCols(); ++i)
    {
        NF_SHARE_PTR<NFIDataList::TData> pVar = mtRecordVec.at(GetPos(nRow, i));
        if (pVar.get())
        {
            varList.Append(*pVar);
        }
        else
        {
            switch (GetColType(i))
            {
                case TDATA_INT:
                    varList.Add(NFINT64(0));
                    break;

                case TDATA_FLOAT:
                    varList.Add(0.0f);
                    break;

                case TDATA_STRING:
                    varList.Add(NULL_STR.c_str());
                    break;

                case TDATA_OBJECT:
                    varList.Add(NFGUID());
                    break;
                default:
                    return false;
                    break;
            }
        }
    }

    if (varList.GetCount() != GetCols())
    {
        return false;
    }

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


示例18: AddScriptSection

// interface
int asCModule::AddScriptSection(const char *name, const char *code, size_t codeLength, int lineOffset)
{
	if( IsUsed() )
		return asMODULE_IS_IN_USE;

	if( !builder )
		builder = asNEW(asCBuilder)(engine, this);

	builder->AddCode(name, code, (int)codeLength, lineOffset, (int)builder->scripts.GetLength(), engine->ep.copyScriptSections);

	return asSUCCESS;
}
开发者ID:svn2github,项目名称:AngelscriptMirror,代码行数:13,代码来源:as_module.cpp


示例19: CRect

CRect cdxCDynamicControlsManager::ControlData::GetCurrentPosition() const
{
	if(!IsUsed())
	{
		ASSERT(false);			// all sub-controls have been deleted
		return CRect(0,0,0,0);
	}

	WINDOWPLACEMENT	wpl;
	VERIFY( m_pCtrl->GetCWnd().GetWindowPlacement(&wpl) );
	return CRect(wpl.rcNormalPosition);
}
开发者ID:Rocket-Buddha,项目名称:GameCode4,代码行数:12,代码来源:cdxCDynamicControlsManager.cpp


示例20: GetNextDefault

const PortSpace::Value_t PortSpace::GetNextDefault()
{
	default_count_++;
	if(default_count_ > max_)
		return empty;  // out of values :(

	if(IsUsed(default_count_))
		return GetNextDefault();  // this isn't available, try again
	else
		return default_count_;

	//^ Recursion may be a bad idea here
}
开发者ID:FRC-3637-Daleks,项目名称:dalek-manager-lib,代码行数:13,代码来源:PortSpace.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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