virtual qtexture_t* getSpecular() const = 0;
// get shader name
virtual const char* getName() const = 0;
+virtual const char* getWadName() const = 0;
+virtual void setWadName( const char* name ) = 0;
virtual bool IsInUse() const = 0;
virtual void SetInUse( bool bInUse ) = 0;
// get the editor flags (QER_NOCARVE QER_TRANS)
{
std::size_t m_refcount;
CopiedString m_Name;
+CopiedString m_WadName;
public:
ShaderParameters m_params;
const char* m_filename;
// name is shader-name, otherwise texture-name ( if not a real shader )
CopiedString m_Name;
+CopiedString m_WadName;
qtexture_t* m_pTexture;
qtexture_t* m_notfound;
return m_Name.c_str();
}
+const char* getWadName() const {
+ return m_WadName.c_str();
+}
+
bool IsInUse() const {
return m_bInUse;
}
m_Name = name;
}
+void setWadName( const char* name ){
+ m_WadName = name;
+}
+
class MapLayer : public ShaderLayer
{
qtexture_t* m_texture;
}
}
else {
- if ( !shader_equal_prefix( shader_get_textureName( shader->getName() ), g_TextureBrowser_currentDirectory.c_str() ) ) {
+ if ( TextureBrowser_showWads() )
+ {
+ if ( g_TextureBrowser_currentDirectory != ""
+ && !string_equal( shader->getWadName(), g_TextureBrowser_currentDirectory.c_str() ) )
+ {
+ return false;
+ }
+ }
+ else if ( !shader_equal_prefix( shader_get_textureName( shader->getName() ), g_TextureBrowser_currentDirectory.c_str() ) ) {
return false;
}
}
void visit( const char* name ){
IShader* shader = QERApp_Shader_ForName( CopiedString( StringRange( name, path_get_filename_base_end( name ) ) ).c_str() );
shader->DecRef();
+ shader->setWadName( g_TextureBrowser_currentDirectory.c_str() );
}
};
void TextureBrowser_ShowDirectory( TextureBrowser& textureBrowser, const char* directory ){
if ( TextureBrowser_showWads() ) {
+ g_TextureBrowser_currentDirectory = directory;
+ TextureBrowser_heightChanged( textureBrowser );
+
Archive* archive = GlobalFileSystem().getArchive( directory );
if ( archive != nullptr )
{