Skip to content

Commit

Permalink
#5567: Remove VfsImageArtProvider again, it's not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Apr 1, 2021
1 parent 12012a4 commit ae55e98
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 141 deletions.
49 changes: 0 additions & 49 deletions radiant/ui/materials/editor/MaterialEditor.cpp
Expand Up @@ -2,7 +2,6 @@

#include "i18n.h"
#include "ishaderexpression.h"
#include "VfsImageArtProvider.h"

#include <wx/panel.h>
#include <wx/splitter.h>
Expand Down Expand Up @@ -1445,54 +1444,6 @@ void MaterialEditor::updateBasicPageFromMaterial()
diffuseTabImage->SetMaterial(_material);
bumpTabImage->SetMaterial(_material);
specularTabImage->SetMaterial(_material);

#if 0
auto editorImg = _material->getEditorImageExpression();

if (editorImg)
{
auto image = VfsImageArtProvider::CreateImageFromVfsPath(editorImg->getExpressionString());

if (!image.IsOk())
{
image = wxutil::GetLocalBitmap("shadernotex.bmp").ConvertToImage();
}

image.Rescale(editorImgTabImage->GetSize().GetWidth(), editorImgTabImage->GetSize().GetHeight(), wxIMAGE_QUALITY_BICUBIC);

editorImgTabImage->SetBitmap(wxBitmap(image));
}

for (const auto& layer : _material->getAllLayers())
{
wxStaticBitmap* bitmap = nullptr;

switch (layer->getType())
{
case IShaderLayer::DIFFUSE: bitmap = diffuseTabImage; break;
case IShaderLayer::BUMP: bitmap = bumpTabImage; break;
case IShaderLayer::SPECULAR: bitmap = specularTabImage; break;
}

if (bitmap == nullptr)
{
continue;
}

auto mapExpression = layer->getMapExpression();

auto image = VfsImageArtProvider::CreateImageFromVfsPath(mapExpression->getExpressionString());

if (!image.IsOk())
{
image = wxutil::GetLocalBitmap("shadernotex.bmp").ConvertToImage();
}

image.Rescale(bitmap->GetSize().GetWidth(), bitmap->GetSize().GetHeight(), wxIMAGE_QUALITY_BICUBIC);

bitmap->SetBitmap(wxBitmap(image));
}
#endif
}

void MaterialEditor::updateControlsFromMaterial()
Expand Down
6 changes: 0 additions & 6 deletions radiant/ui/materials/editor/MaterialEditorModule.cpp
Expand Up @@ -6,17 +6,13 @@
#include "itextstream.h"
#include "imenumanager.h"
#include "module/StaticModule.h"
#include "VfsImageArtProvider.h"

namespace ui
{

class MaterialEditorModule :
public RegisterableModule
{
private:
std::unique_ptr<VfsImageArtProvider> _vfsArtProvider;

public:
// RegisterableModule
const std::string& getName() const override
Expand Down Expand Up @@ -49,8 +45,6 @@ class MaterialEditorModule :
_("Material Editor (experimental)..."), // caption
"icon_texture.png", // icon
"MaterialEditor"); // event name

_vfsArtProvider = std::make_unique<VfsImageArtProvider>();
}
};

Expand Down
82 changes: 0 additions & 82 deletions radiant/ui/materials/editor/VfsImageArtProvider.h

This file was deleted.

1 change: 0 additions & 1 deletion tools/msvc/DarkRadiant.vcxproj
Expand Up @@ -470,7 +470,6 @@
<ClInclude Include="..\..\radiant\ui\materials\editor\SpinCtrlBinding.h" />
<ClInclude Include="..\..\radiant\ui\materials\editor\TestModelSkin.h" />
<ClInclude Include="..\..\radiant\ui\materials\editor\TexturePreview.h" />
<ClInclude Include="..\..\radiant\ui\materials\editor\VfsImageArtProvider.h" />
<ClInclude Include="..\..\radiant\ui\materials\MaterialDefinitionView.h" />
<ClInclude Include="..\..\radiant\ui\materials\MaterialPopulator.h" />
<ClInclude Include="..\..\radiant\ui\materials\MaterialTreeView.h" />
Expand Down
3 changes: 0 additions & 3 deletions tools/msvc/DarkRadiant.vcxproj.filters
Expand Up @@ -1383,9 +1383,6 @@
<ClInclude Include="..\..\radiant\ui\materials\editor\TestModelSkin.h">
<Filter>src\ui\materials\editor</Filter>
</ClInclude>
<ClInclude Include="..\..\radiant\ui\materials\editor\VfsImageArtProvider.h">
<Filter>src\ui\materials\editor</Filter>
</ClInclude>
<ClInclude Include="..\..\radiant\ui\materials\editor\TexturePreview.h">
<Filter>src\ui\materials\editor</Filter>
</ClInclude>
Expand Down

0 comments on commit ae55e98

Please sign in to comment.