Ejemplo n.º 1
0
bool ZEffectBase::Create(const char *szTextureName)
{
	m_pBaseTexture = RCreateBaseTexture(szTextureName);

	if(!m_pVB || !m_pIB) return false;
	return true;
}
Ejemplo n.º 2
0
bool MBitmapR2::Create(const char* szAliasName, LPDIRECT3DDEVICE9 pd3dDevice, const char* szFileName,bool bUseFileSystem,DWORD colorkey)
{
	MBitmap::Create(szAliasName);

	m_pTexture = RCreateBaseTexture(szFileName,RTextureType_Etc,false,bUseFileSystem,colorkey);

	if(!m_pTexture) return false;

	m_bUnloadedTemporarily = false;

	m_nWidth = m_pTexture->GetWidth();
	m_nHeight = m_pTexture->GetHeight();

//	m_Texture.Create(szFileName);

	/*
	if( FAILED(D3DXCreateTextureFromFileEx(pd3dDevice, szFileName, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 
				D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_FILTER_TRIANGLE|D3DX_FILTER_MIRROR, D3DX_FILTER_TRIANGLE|D3DX_FILTER_MIRROR, 
				0, &m_Info, NULL, &m_pTexture))) return false;
*/
	//if(FAILED(D3DXCreateSprite(pd3dDevice, &m_pSprite))) return false;

	m_pd3dDevice = pd3dDevice;

	return true;
}
Ejemplo n.º 3
0
bool MBitmapR2::Create(const char* szAliasName, LPDIRECT3DDEVICE9 pd3dDevice, const char* szFileName,bool bUseFileSystem)
{
	MBitmap::Create(szAliasName);

	m_pTexture = RCreateBaseTexture(szFileName,RTextureType_Etc,false,false);
	if(!m_pTexture) return false;

//	m_Texture.Create(szFileName);

	/*
	if( FAILED(D3DXCreateTextureFromFileEx(pd3dDevice, szFileName, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 
				D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_FILTER_TRIANGLE|D3DX_FILTER_MIRROR, D3DX_FILTER_TRIANGLE|D3DX_FILTER_MIRROR, 
				0, &m_Info, NULL, &m_pTexture))) return false;
*/
	//if(FAILED(D3DXCreateSprite(pd3dDevice, &m_pSprite))) return false;

	m_pd3dDevice = pd3dDevice;

	return true;
}
Ejemplo n.º 4
0
bool RLenzFlare::ReadXmlElement(::CCXmlElement* PNode,char* Path)
{
	int i,j;
	int index;
	char texture_file_name[256];
	char buffer[16];
	char NodeName[64];
	
	::CCXmlElement Node, Leaf;
	
	PNode->GetNodeName(NodeName);
	int nCnt = PNode->GetChildNodeCount();
	for( i = 0 ; i < nCnt; ++i )
	{
		Node = PNode->GetChildNode( i );
		Node.GetTagName( NodeName );
		if (NodeName[0] == '#')
		{
			continue;
		}
		if( !strcmp( NodeName, "TEXTURE" ) )
		{
			index = 0;
			int numTex = Node.GetChildNodeCount();
			for( j = 0 ; j < numTex; ++j )
			{
				Leaf = Node.GetChildNode(j);
				Leaf.GetTagName( NodeName );
				if (NodeName[0] == '#')
				{
					continue;
				}
				if(!Leaf.GetAttribute( texture_file_name, "FILE_NAME" ))
				{
					for( int k = 0 ; k < MAX_NUMBER_TEXTURE; ++k )
					{
						SAFE_DELETE( msTextures[k] );
					}
					return false;
				}
				//D3DXCreateTextureFromFile( RGetDevice(), texture_file_name, &msTextures[index++] );
				msTextures[index++] = RCreateBaseTexture( texture_file_name );
			}
		}
		else if( !strcmp( NodeName, "ELEMENTS" ) )
		{
			index = 0;
			int numElem = Node.GetChildNodeCount();
			for( j = 0 ; j < numElem; ++j )
			{
				Leaf = Node.GetChildNode(j);
				Leaf.GetTagName( NodeName );
				if (NodeName[0] == '#')
				{
					continue;
				}

				if(!Leaf.GetAttribute( buffer, "TYPE" ))
				{
					return false;
				}
				msElements[index].iType = atoi(buffer);

				if(!Leaf.GetAttribute( buffer, "WIDTH" ))
				{
					return false;
				}
				msElements[index].width = atof(buffer);

				if(!Leaf.GetAttribute( buffer, "HEIGHT" ))
				{
					return false;
				}
				msElements[index].height = atof(buffer);


				if(!Leaf.GetAttribute( buffer, "COLOR" ))
				{
					return false;
				}
				msElements[index].color = atol(buffer);

				if(!Leaf.GetAttribute( buffer, "WIDTH" ))
				{
					return false;
				}
				msElements[index].width = atoi(buffer);


				if(!Leaf.GetAttribute( buffer, "TEXTURE_INDEX" ))
				{
					return false;
				}
				msElements[index].iTextureIndex = atoi(buffer);
				++index;
			}
		}
	}
	
	return true;
}