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

C++ Texmap类代码示例

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

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



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


示例16: getBaseObjectAndID


//.........这里部分代码省略.........
                                            offcenterX_pos = pb->GetInt(pid);
                                        if (ATTREQ(paramName, "offcenterX_neg"))
                                            offcenterX_neg = pb->GetInt(pid);
                                        if (ATTREQ(paramName, "offcenterY_pos"))
                                            offcenterY_pos = pb->GetInt(pid);
                                        if (ATTREQ(paramName, "offcenterY_neg"))
                                            offcenterY_neg = pb->GetInt(pid);
                                    }
                                    free(paramName);
                                }
                                if(lensType==2){
                                    lens_type=AWD_LENS_ORTHO;
                                    awdCamera->set_lens_proj_height(projectionHeight);
                                }
                                else if (lensType==3){
                                    lens_type=AWD_LENS_ORTHOOFFCENTER;
                                    awdCamera->set_lens_offset(offcenterX_pos, offcenterX_neg, offcenterY_neg, offcenterY_pos );
                                }
                                awdCamera->set_lens_type(lens_type);
                            }
                        }
                        if(exportTextureProjector){
                            IParamBlock2*  pb = GetParamBlock2ByName((ReferenceMaker*)node_mod, "texture_projector_params");
                            if(pb!=NULL){
                                int numBlockparams=pb->NumParams();
                                int p=0;
                                for (p=0; p<numBlockparams; p++) {
                                    ParamID pid = pb->IndextoID(p);
                                    ParamDef def = pb->GetParamDef(pid);
                                    ParamType2 paramtype = pb->GetParameterType(pid);
                                    char * paramName=W2A(def.int_name);
                                    if (paramtype==TYPE_TEXMAP){
                                        if (ATTREQ(paramName,"projectionTexture") ){
                                            Texmap *projectionTexmap = pb->GetTexmap(pid);
                                            if (projectionTexmap != NULL && projectionTexmap->ClassID() == Class_ID(BMTEX_CLASS_ID, 0)) {
                                                projectionTexture=ExportBitmapTexture((BitmapTex *)projectionTexmap, NULL, UNDEFINEDTEXTYPE, FORTEXTUREPROJECTOR);
                                                if (projectionTexture!=NULL)
                                                    textureProjector->set_texture(projectionTexture);
                                                else{
                                                    textureProjector->make_invalide();
                                                    exportTextureProjector=false;
                                                }
                                            }
                                        }
                                    }
                                    if (paramtype==TYPE_FLOAT){
                                        if (ATTREQ(paramName, "aspect_ratio"))
                                            textureProjector->set_aspect_ratio(pb->GetFloat(pid));
                                    }
                                    free(paramName);
                                }
                            }
                            else{
                                textureProjector->make_invalide();
                                exportTextureProjector=false;
                            }
                        }
                    }
                    free(className_ptr);
                }
            }
        }
    }
    else{
    }
    if(exportCamera){
开发者ID:awaytools,项目名称:AwayExtensions-3dsmax,代码行数:67,代码来源:maxawdexporter_camera.cpp


示例17: ExportQuake3Model


//.........这里部分代码省略.........
		char  meshname[64];
		size_t meshnamelen = min(63, strlen(mesh_i->name));
		memset(meshname, 0, 64);
		strncpy(meshname, mesh_i->name, meshnamelen);
		meshname[meshnamelen] = 0;
		if (!strncmp("Box", meshname, 3)    || !strncmp("Sphere", meshname, 6)  || !strncmp("Cylinder", meshname, 8) ||
            !strncmp("Torus", meshname, 5)  || !strncmp("Cone", meshname, 4)    || !strncmp("GeoSphere", meshname, 9) ||
			!strncmp("Tube", meshname, 4)   || !strncmp("Pyramid", meshname, 7) || !strncmp("Plane", meshname, 5) ||
			!strncmp("Teapot", meshname, 6) || !strncmp("Object", meshname, 6))
		{
name_conflict:
			lazynamesfixed++;
			if (lazynamesfixed == 1)
				strcpy(meshname, "base");
			else
				sprintf(meshname, "base%i", lazynamesfixed);

			// check if it's not used by another mesh
			for (std::list<ExportNode>::iterator m_i = lMeshes.begin(); m_i != lMeshes.end(); m_i++)
				if (!strncmp(m_i->name, meshname, strlen(meshname)))
					goto name_conflict;
			// approve name
			ExportWarning("Lazy object name '%s' (mesh renamed to '%s').", node->GetName(), meshname);
		}

		// special mesh check
		bool shadow_or_collision = false;
		if (g_mesh_special)
			  if (!strncmp("collision", meshname, 9) || !strncmp("shadow", meshname, 6))
				shadow_or_collision = true;

		// get material
		const char *shadername = NULL;
		Texmap *tex = 0;
		Mtl *mtl = 0;
		if (!shadow_or_collision)
		{
			mtl = node->GetMtl();
			if (mtl)
			{
				// check for multi-material
				if (mtl->IsMultiMtl())
				{
					// check if it's truly multi material
					// we do support multi-material with only one texture (some importers set it)
					bool multi_material = false;
					MtlID matId = mesh.faces[0].getMatID();
					for (i = 1; i < mesh.getNumFaces(); i++)
						if (mesh.faces[i].getMatID() != matId)
							multi_material = true;

					if (multi_material)
						if (g_mesh_multimaterials == MULTIMATERIALS_NONE)
							ExportWarning("Object '%s' is multimaterial and using multiple materials on its faces, that case is not yet supported (truncating to first submaterial).", node->GetName());
					
					// switch to submaterial
					mtl = mtl->GetSubMtl(matId);
				}

				// get shader from material if supplied
				char *materialname = GetChar(mtl->GetName());
				if (g_mesh_materialasshader && (strstr(materialname, "/") != NULL || strstr(materialname, "\\") != NULL))
					shadername = GetChar(mtl->GetName());
				else
				{
					// get texture
开发者ID:paulvortex,项目名称:MaxDpMd3Exporter,代码行数:67,代码来源:ExportMD3.cpp


示例18: GetCOREInterface

void DxStdMtl2::LoadTextureData(IHLSLCodeGenerator * codeGen)
{
	Bitmap * bmap;
	BitmapInfo stBI;

	TimeValue t = GetCOREInterface()->GetTime();
	int nWidth,nHeight;

	int numberOfTextures = elementContainer.NumberofElementsByType(EffectElements::kEleTex);
	for(int i=0; i<numberOfTextures;i++)
	{
		bool bBump;
		TextureElement * texEle = static_cast<TextureElement*>(elementContainer.GetElementByType(i,EffectElements::kEleTex));

		TSTR mapType = texEle->GetMapName();
		Texmap *texmap = codeGen->GetShaderDefinedTexmap(map,mapType.data(),bBump);

		if(texmap)
		{
			BMM_Color_64 *p;
			nWidth = nHeight = DIMDEFAULT;
			BitmapDimensions(nWidth,nHeight,texmap);
			// load and create the D3D texture;
/*			if(texmap->ClassID() == Class_ID(BMTEX_CLASS_ID, 0))
			{
				BitmapTex *pBT;
				Bitmap *pTex;
				pBT = (BitmapTex *)texmap;
				pTex = pBT->GetBitmap(t);
				if (pTex)
				{
					nWidth = getClosestPowerOf2(pTex->Width());
					nHeight = getClosestPowerOf2(pTex->Height());
				}

			}
*/				
			stBI.SetType(BMM_TRUE_32);
			stBI.SetWidth(nWidth);
			stBI.SetHeight(nHeight);        
			bmap = TheManager->Create(&stBI);

			if (bmap)
			{
//				LPDIRECT3DTEXTURE9 pRenderTex = texEle->GetD3DTexture();

				texmap->RenderBitmap(t, bmap, MAPSCALE3D * 2.0f);
				p = new BMM_Color_64[nWidth*nHeight];

				for (int y = 0; y < nHeight; y++)
					bmap->GetLinearPixels(0, y, nWidth, p + y * nWidth);
			
				if(texEle->pTex)
				{
					D3DSURFACE_DESC stLD;
					texEle->pTex->GetLevelDesc(0, &stLD);
					if (stLD.Width != nWidth || stLD.Height != nHeight)
					{
						SAFE_RELEASE(texEle->pTex);
					}

				}
				if(!texEle->pTex)
					pd3dDevice->CreateTexture(nWidth,nHeight, 0,D3DUSAGE_AUTOGENMIPMAP,	D3DFMT_A8R8G8B8,D3DPOOL_MANAGED,&texEle->pTex, NULL);

				if(texEle->pTex)
				{
					PIXELFMT *pT;
					D3DLOCKED_RECT stLR;
					texEle->pTex->LockRect(0, &stLR, 0, 0);
					pT = (PIXELFMT *)stLR.pBits;

					for (int i = 0; i < nWidth * nHeight; i++)
					{
						pT[i].r = p[i].r >> 8;
						pT[i].g = p[i].g >> 8;
						pT[i].b = p[i].b >> 8;
						pT[i].a = p[i].a >> 8;
					}
					texEle->pTex->UnlockRect(0);
				
					if(bBump && texmap->ClassID() != GNORMAL_CLASS_ID)
					{
//						LPDIRECT3DTEXTURE9 normalTex = texEle->GetD3DBumpTexture();
						
						if(texEle->pBumpTex)
						{
							D3DSURFACE_DESC stLD;
							texEle->pBumpTex->GetLevelDesc(0, &stLD);
							if (stLD.Width != nWidth || stLD.Height != nHeight)
							{
								SAFE_RELEASE(texEle->pBumpTex);
							}
						}
						if(!texEle->pBumpTex)
							pd3dDevice->CreateTexture(nWidth,nHeight, 0,D3DUSAGE_AUTOGENMIPMAP,	D3DFMT_A8R8G8B8,D3DPOOL_MANAGED,&texEle->pBumpTex, NULL);

						D3DXComputeNormalMap(texEle->pBumpTex,texEle->pTex,NULL, NULL, D3DX_CHANNEL_RED,30.0f);

						if(texEle->GetParamHandle())
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:OgreGameProject,代码行数:101,代码来源:DxStdMtl2.cpp


示例19: ASSERT_MBOX


//.........这里部分代码省略.........
		// Get Face's sub-material from node's material, to get the bitmap name.
		// And no, there isn't a simpler way to get the bitmap name, you have to
		// dig down through all these levels.
		TCHAR szBitmapName[256] = "null.bmp";
		if (fHasMat)
		{
			MtlID mtlidFace = pface->getMatID();
			if (mtlidFace >= pmtlNode->NumSubMtls())
			{
				sprintf(st_szDBG, "ERROR--Bogus sub-material index %d in node %s; highest valid index is %d",
					mtlidFace, (char*)strNodeName, pmtlNode->NumSubMtls()-1);
				// ASSERT_AND_ABORT(FALSE, st_szDBG);
				mtlidFace = 0;
			}
			Mtl *pmtlFace = pmtlNode->GetSubMtl(mtlidFace);
			ASSERT_AND_ABORT(pmtlFace != NULL, "NULL Sub-material returned");
 
			if ((pmtlFace->ClassID() == Class_ID(MULTI_CLASS_ID, 0) && pmtlFace->IsMultiMtl()))
			{
				// it's a sub-sub material.  Gads.
				pmtlFace = pmtlFace->GetSubMtl(mtlidFace);			
				ASSERT_AND_ABORT(pmtlFace != NULL, "NULL Sub-material returned");
			}

			if (!(pmtlFace->ClassID() == Class_ID(DMTL_CLASS_ID, 0)))
			{

				sprintf(st_szDBG,
					"ERROR--Sub-material with index %d (used in node %s) isn't a 'default/standard' material [%x].",
					mtlidFace, (char*)strNodeName, pmtlFace->ClassID());
				ASSERT_AND_ABORT(FALSE, st_szDBG);
			}
			StdMat *pstdmtlFace = (StdMat*)pmtlFace;
			Texmap *ptexmap = pstdmtlFace->GetSubTexmap(ID_DI);
			// ASSERT_AND_ABORT(ptexmap != NULL, "NULL diffuse texture")
			if (ptexmap != NULL) 
			{
				if (!(ptexmap->ClassID() == Class_ID(BMTEX_CLASS_ID, 0)))
				{
					sprintf(st_szDBG,
						"ERROR--Sub-material with index %d (used in node %s) doesn't have a bitmap as its diffuse texture.",
						mtlidFace, (char*)strNodeName);
					ASSERT_AND_ABORT(FALSE, st_szDBG);
				}
				BitmapTex *pbmptex = (BitmapTex*)ptexmap;
				strcpy(szBitmapName, pbmptex->GetMapName());
				TSTR strPath, strFile;
				SplitPathFile(TSTR(szBitmapName), &strPath, &strFile);
				strcpy(szBitmapName,strFile);
			}
		}

		UVVert UVvertex0( 0, 0, 0 );
		UVVert UVvertex1( 1, 0, 0 );
		UVVert UVvertex2( 0, 1, 0 );
		
		// All faces must have textures assigned to them
		if (pface->flags & HAS_TVERTS)
		{
			// Get TVface's 3 indexes into the Mesh's TVertex array(s).
			DWORD iTVertex0 = ptvface->getTVert(0);
			DWORD iTVertex1 = ptvface->getTVert(1);
			DWORD iTVertex2 = ptvface->getTVert(2);
			ASSERT_AND_ABORT((int)iTVertex0 < pmesh->getNumTVerts(), "Bogus TVertex 0 index");
			ASSERT_AND_ABORT((int)iTVertex1 < pmesh->getNumTVerts(), "Bogus TVertex 1 index");
			ASSERT_AND_ABORT((int)iTVertex2 < pmesh->getNumTVerts(), "Bogus TVertex 2 index");
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:67,代码来源:smdlexp.cpp


示例20: assert


//.........这里部分代码省略.........
					{
						bBaked       = true;
						nMap         = ID_SI;
						pStandardMtl = pMaxBakedMtl;
					}
				}

				if(!bBaked)
				{
					if(pStandardMtl->GetMapState(ID_SI) == MAXMAPSTATE_ENABLED)
					{
						nMap = ID_SI;
					}
					else
					{
						nMap = ID_RL;
					}
				}
			}

			// Check validity

			if(pStandardMtl->GetMapState(nMap) != MAXMAPSTATE_ENABLED)
			{
				if(i == 0)
				{
					LOG.Write("\n        No diffuse. Skipping.");
					break;
				}

				continue;
			}

			Texmap* pMaxTexmap = pStandardMtl->GetSubTexmap(nMap);

			if(!pMaxTexmap)
			{
				if(i == 0)
				{
					LOG.Write("\n        No diffuse. Skipping.");
					break;
				}

				continue;
			}

			// Get texmaps

			std::vector<std::string> vecTextures, vecPaths;

			CShaderStandard::SLayerInfo  layerInfo;
			CShaderStandard::SBitmapInfo bitmapInfo;

			if(pMaxTexmap->ClassID() == Class_ID(BMTEX_CLASS_ID, 0))
			{
				BitmapTex* pMaxBitmapTex = (BitmapTex*)pMaxTexmap;
				Bitmap*    pMaxBitmap    = pMaxBitmapTex->GetBitmap(SECONDS_TO_TICKS(m_fStartTime));
				StdUVGen*  pMaxUVGen     = pMaxBitmapTex->GetUVGen();

				if(!pMaxBitmap)
				{
					if(i == 0)
					{
						LOG.Write("\n        Invalid diffuse. Skipping.");
						break;
					}
开发者ID:fernandojsg,项目名称:sgzsourcepack,代码行数:67,代码来源:BuildShaders.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Text类代码示例发布时间:2022-05-31
下一篇:
C++ TexTarget类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap