| 4265 | } |
| 4266 | |
| 4267 | void TextureViewer::texture_itemActivated(RDTreeWidgetItem *item, int column) |
| 4268 | { |
| 4269 | QVariant tag = item->tag(); |
| 4270 | if(!tag.canConvert<ResourceId>()) |
| 4271 | return; |
| 4272 | |
| 4273 | TextureDescription *tex = m_Ctx.GetTexture(tag.value<ResourceId>()); |
| 4274 | if(!tex) |
| 4275 | return; |
| 4276 | |
| 4277 | if(tex->type == TextureType::Buffer) |
| 4278 | { |
| 4279 | IBufferViewer *viewer = m_Ctx.ViewTextureAsBuffer( |
| 4280 | tex->resourceId, Subresource(), BufferFormatter::GetTextureFormatString(*tex)); |
| 4281 | |
| 4282 | m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this); |
| 4283 | } |
| 4284 | else |
| 4285 | { |
| 4286 | CompType typeCast = CompType::Typeless; |
| 4287 | if(m_TextureSettings.contains(tex->resourceId)) |
| 4288 | typeCast = m_TextureSettings[tex->resourceId].typeCast; |
| 4289 | ViewTexture(tex->resourceId, typeCast, true); |
| 4290 | } |
| 4291 | } |
| 4292 | |
| 4293 | bool TextureViewer::canCompileCustomShader(ShaderEncoding encoding) |
| 4294 | { |
nothing calls this directly
no test coverage detected