本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例15: proc
int MapLoadEnum::proc(MtlBase *m, int subMtlNum)
{
Texmap *tm = (Texmap *)m;
tm->LoadMapFiles(t);
return 1;
}