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


C++ Texmap类代码示例

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


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

示例1: reload_texture_cf

Value* reload_texture_cf (Value** arg_list, int count)
{
	// Make sure we have the correct number of arguments (1)
	check_arg_count(reload_texture, 1, count);
	char *message = "NelReloadTexture [BitmapTex]";
	//type_check (arg_list[0], TextureMap, message);

	// Get a good interface pointer
	Interface *ip = MAXScript_interface;

	theCNelExport.init (false, false, ip, true);

	// The 2 filenames
	Texmap *texmap = arg_list[0]->to_texmap ();

	// BitmapTex ?
	if (texmap->ClassID() == Class_ID (BMTEX_CLASS_ID, 0))
	{
		// Cast
		BitmapTex *bitmap = (BitmapTex*)texmap;

		// Reload
		bitmap->ReloadBitmapAndUpdate ();

		// Tell the bitmap has changed
		BroadcastNotification (NOTIFY_BITMAP_CHANGED, (void *)bitmap->GetMapName());
		
		return &true_value;
	}

	return &false_value;
}
开发者ID:mixxit,项目名称:solinia,代码行数:32,代码来源:nel_export_script.cpp

示例2: EvalColor

AColor mrTwoSidedShader::EvalColor(ShadeContext& sc) {

	// Provide a good default for this (for the material editor peview)... 
	// Use the front color for the top half of the screen the the back color 
	// for the bottom half.
	if(m_mainPB != NULL) {
		Point2 screenUV;
		Point2 screenDUV;
		sc.ScreenUV(screenUV, screenDUV);

		// Front map is used for top part of the image
		bool useFront = (screenUV.y > 0.5f);

		TimeValue t = sc.CurTime();
		BOOL mapOn = m_mainPB->GetInt(useFront ? kMainPID_FrontMapOn : kMainPID_BackMapOn, t);
		if(mapOn) {
			Texmap* map = m_mainPB->GetTexmap(useFront ? kMainPID_FrontMap : kMainPID_BackMap, t);
			if(map != NULL) {
				return map->EvalColor(sc);
			}
		}

		// Return the color only
		AColor col = m_mainPB->GetAColor(useFront ? kMainPID_FrontColor : kMainPID_BackColor, t);
		return col;
	}
	
	return AColor(0,0,0);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:29,代码来源:mrTwoSidedShader.cpp

示例3: getStdMatBitmapTex

BitmapTex* SceneExportUtil::getStdMatBitmapTex( StdMat* stdmat, int id )
{
	StdMat2* stdmat2 = 0;
	int channel = id;
	if ( stdmat->SupportsShaders() )
	{
		stdmat2 = static_cast<StdMat2*>( stdmat );
		channel = stdmat2->StdIDToChannel( id );
	}

	if ( stdmat->MapEnabled(channel) )
	{
		Texmap*	tex	= stdmat->GetSubTexmap(channel);
		if ( tex && tex->ClassID() == Class_ID(BMTEX_CLASS_ID,0) &&
			(!stdmat2 || 2 == stdmat2->GetMapState(channel)) )
		{
			BitmapTex* bmptex = static_cast<BitmapTex*>(tex);
			if ( bmptex->GetMapName() )
			{
				return bmptex;
			}
		}
	}
	return 0;
}
开发者ID:TheRyaz,项目名称:c_reading,代码行数:25,代码来源:SceneExportUtil.cpp

示例4: NumSubTexmaps

void mrTwoSidedShader::Update(TimeValue t, Interval& valid) {

	// Update the sub textures
	int count = NumSubTexmaps();
	for(int i = 0; i < count; ++i) {
		Texmap* subMap = GetSubTexmap(i);
		if(subMap != NULL)
			subMap->Update(t, valid);
	}
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:10,代码来源:mrTwoSidedShader.cpp

示例5: NumSubTexmaps

Interval HLSLShaderMaterial::Validity(TimeValue t)
{
	Interval valid = FOREVER;	
	int count = NumSubTexmaps();
	for(int i = 0; i < count; ++i) {
		Texmap* subMap = GetSubTexmap(i);
		if(subMap != NULL)
			valid &= subMap->Validity(t);
	}
	return valid;
}
开发者ID:ZuqiuMao,项目名称:HLSLMaterial,代码行数:11,代码来源:HLSLShaderMaterial.cpp

示例6: GNORMAL_CLASS_ID

Texmap* NifImporter::CreateNormalBump(LPCTSTR name, Texmap* nmap)
{
   static const Class_ID GNORMAL_CLASS_ID(0x243e22c6, 0x63f6a014);
   Texmap *texmap = (Texmap*)gi->CreateInstance(TEXMAP_CLASS_ID, GNORMAL_CLASS_ID);
   if(texmap != NULL)
   {
      TSTR tname = (name == NULL) ? FormatText("Norm %s", nmap->GetName().data()) : TSTR(name);
      texmap->SetName(tname);
      texmap->SetSubTexmap(0, nmap);
      return texmap;
   }
   return nmap;
}
开发者ID:CruxAnsata,项目名称:max_nif_plugin,代码行数:13,代码来源:ImportMtlAndTex.cpp

示例7: Class_ID

Texmap* NifImporter::CreateMask(LPCTSTR name, Texmap* map, Texmap* mask)
{
   Texmap *texmap = (Texmap*)gi->CreateInstance(TEXMAP_CLASS_ID, Class_ID(MASK_CLASS_ID, 0));
   if(texmap != NULL)
   {
      TSTR tname = (name == NULL) ? FormatText("Mask %s", map->GetName().data()) : TSTR(name);
      texmap->SetName(tname);
      texmap->SetSubTexmap(0, map);
      texmap->SetSubTexmap(0, mask);
      return texmap;
   }
   return map;
}
开发者ID:CruxAnsata,项目名称:max_nif_plugin,代码行数:13,代码来源:ImportMtlAndTex.cpp

示例8: ISetProbTexmap

void plDistribComponent_old::ISetProbTexmap(plDistributor& distrib)
{
    distrib.SetProbabilityBitmapTex(nil);

    Texmap* tex = fCompPB->GetTexmap(kProbTexmap);
    if( tex )
    {
        BitmapTex* bmt = GetIBitmapTextInterface(tex);
        if( bmt )
            distrib.SetProbabilityBitmapTex(bmt);
        else if( tex->ClassID() == LAYER_TEX_CLASS_ID )
            distrib.SetProbabilityLayerTex((plLayerTex*)tex);
    }
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:14,代码来源:plDistribComponent_old.cpp

示例9: assert

bool SGP_MaxInterface::GetStdMtlChannelBitmapFileName( StdMat* pStdMat, int nChannel, TCHAR szFileName[] )
{
	if( !pStdMat )
	{
		assert( false );
		return false;
	}
	Texmap *tx = pStdMat->GetSubTexmap(nChannel);
	if( !tx  )
		return false;
	if(tx->ClassID() != Class_ID(BMTEX_CLASS_ID,0))
		return false;
	BitmapTex *bmt = (BitmapTex*)tx;
	_tcscpy( szFileName, bmt->GetMapName() );
	return true;
}
开发者ID:phoenixzz,项目名称:SGPEngine,代码行数:16,代码来源:SGP_MAX9Interface.cpp

示例10: UpdateSubTexNames

void CompositeDlg::UpdateSubTexNames() 
	{
	for (int i=theTex->offset; i<theTex->subTex.Count(); i++) {
		if (i-theTex->offset>=NDLG) break;

		Texmap *m = theTex->subTex[i];
		TSTR nm;
		if (m) 	nm = m->GetFullName();
		else 	nm = GetString(IDS_DS_NONE);
		TSTR buf;
		buf.printf(_T("%s %d:"),GetString(IDS_RB_MAP2),i+1);
		iBut[i-theTex->offset]->SetText(nm.data());
		SetDlgItemText(hPanel, labelIDs[i-theTex->offset], buf);
//		SetCheckBox(hPanel, mapOnIDs[i-theTex->offset], theTex->mapOn[i]);
		int on;
		Interval iv;
		theTex->pblock->GetValue(comptex_ons,0,on,iv,i);
		SetCheckBox(hPanel, mapOnIDs[i-theTex->offset], on);
		}
	}
开发者ID:2asoft,项目名称:xray,代码行数:20,代码来源:composit.cpp

示例11: NumParamBlocks

Interval mrTwoSidedShader::Validity(TimeValue t) {

	// Get the validity of all the parameter blocks and sub-textures
	Interval valid = FOREVER;

	int count = NumParamBlocks();
	int i;
	for(i = 0; i < count; ++i) {
		IParamBlock2* pBlock = GetParamBlock(i);
		if(pBlock != NULL)
			pBlock->GetValidity(t, valid);
	}

	count = NumSubTexmaps();
	for(i = 0; i < count; ++i) {
		Texmap* subMap = GetSubTexmap(i);
		if(subMap != NULL)
			valid &= subMap->Validity(t);
	}

	return valid;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:22,代码来源:mrTwoSidedShader.cpp

示例12: DbgAssert

void mrShaderButtonHandler::Update() {

	DbgAssert(m_dialogHWnd != NULL);

	HWND ctrlHWnd = GetDlgItem(m_dialogHWnd, m_ctrlID);
	ICustButton* custButton = GetICustButton(ctrlHWnd);
	if(custButton != NULL) {

		MSTR text;
		Texmap* shader = GetShader();
		if(shader != NULL)
			text = shader->GetFullName();
		else
			text = GetNoneString();

		custButton->SetText(text.data());
		
		ReleaseICustButton(custButton);
	}
	else {
		DbgAssert(false);
	}
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:23,代码来源:mrShaderButtonHandler.cpp

示例13: GetSubmeshMapCount

int CMaxMesh::GetSubmeshMapCount(int submeshId)
{
    // check if the submesh id is valid
    if((submeshId < 0) || (submeshId >= (int)m_vectorStdMat.size()))
    {
        theExporter.SetLastError("Invalid handle.", __FILE__, __LINE__);
        return -1;
    }

    // get the material of the submesh
    StdMat *pStdMat;
    pStdMat = m_vectorStdMat[submeshId];

    // count all the mapping channels in this material
    int mapCount;
    mapCount = 0;

    int mapId;
    for(mapId = 0; mapId < pStdMat->NumSubTexmaps(); mapId++)
    {
        // get texture map
        Texmap *pTexMap;
        pTexMap = pStdMat->GetSubTexmap(mapId);

        // check if map is valid
        if((pTexMap != 0) && (pStdMat->MapEnabled(mapId)))
        {
            // check if we have a valid texture coordinate
            if((m_pIMesh->mapSupport(pTexMap->GetMapChannel())) || (m_pIMesh->numTVerts > 0))
            {
                mapCount++;
            }
        }
    }

    return mapCount;
}
开发者ID:imvu,项目名称:cal3d,代码行数:37,代码来源:MaxMesh.cpp

示例14: switch

bool sMaterial::ConvertMTL(Mtl *mtl)
{
	char filename[64];
	char file_ext[16];
	char filename_with_ext[128];

	m_EmissiveColor = mtl->GetSelfIllumColor();
	m_AmbientColor = mtl->GetAmbient();
	m_DiffuseColor = mtl->GetDiffuse();
	m_SpecularColor = mtl->GetSpecular();
	m_fShininess = mtl->GetShininess();

	m_iNumTextures = 0;

	m_BlendMode = "replace";

	if ( mtl->ClassID()==Class_ID(DMTL_CLASS_ID, 0) ) 
	{
		StdMat* std = (StdMat*)mtl;

		float fOpacity = std->GetOpacity(0);
		if ( fOpacity < 1.0f )
		{
			switch (std->GetTransparencyType()) 
			{
			case TRANSP_FILTER: 
				m_BlendMode = "blend";
				break;
			case TRANSP_SUBTRACTIVE: 
				m_BlendMode = "subtract";
				break;
			case TRANSP_ADDITIVE: 
				m_BlendMode = "add";
				break;
			default: 
				m_BlendMode = "replace";
				break;
			}	
		}

		m_bCullFace = !std->GetTwoSided();
	}

	for (int i=0; i<mtl->NumSubTexmaps(); i++) 
	{
		Texmap *tex = mtl->GetSubTexmap(i);
		if ( tex && tex->ClassID() == Class_ID(BMTEX_CLASS_ID, 0x00) ) 
		{
			bool valid_channel = false;
			int texture_type = -1;

			switch(i)
			{
			case 0: // ambientmap/lightmap
				texture_type = TEXTURE_LIGHTMAP;
				break;
			case 1: // diffusemap
				texture_type = TEXTURE_DIFFUSE;
				break;
			case 9: // environment
				texture_type = TEXTURE_ENVIRONMENT;
				break;
			default:
				// not supported by fixed pipeline 3D rendering
				break;
			}

			if ( texture_type >= 0 )
			{
				TSTR mapName = ((BitmapTex *)tex)->GetMapName();
				_splitpath(mapName, NULL, NULL, filename, file_ext);
				sprintf(filename_with_ext, "%s%s", filename, file_ext);
				m_Textures[texture_type] = filename_with_ext;
				m_MapChannel[texture_type] = tex->GetMapChannel()-1;
			}
		}
	}

	return true;
}
开发者ID:chenbk85,项目名称:3dlearn,代码行数:80,代码来源:gmodelexp.cpp

示例15: proc

int MapLoadEnum::proc(MtlBase *m, int subMtlNum)
{
	Texmap *tm = (Texmap *)m;
	tm->LoadMapFiles(t);
	return 1;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:6,代码来源:refenum.cpp


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