Skip to content

Commit

Permalink
Revert "Resolve the binding hash to the shader resource binding name (#…
Browse files Browse the repository at this point in the history
…70)"

This reverts commit 9b0fc57.
  • Loading branch information
ShadelessFox committed Apr 14, 2024
1 parent 9b0fc57 commit 7c04db9
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 549 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

@ValueViewerRegistration({
@Selector(type = @Type(name = "MeshResourceBase")),
@Selector(type = @Type(name = "LodMeshResourcePart")),
@Selector(type = @Type(name = "MultiMeshResourcePart")),
@Selector(type = @Type(name = "ArtPartsDataResource"), game = {GameType.DS, GameType.DSDC}),
@Selector(type = @Type(name = "ArtPartsSubModelResource"), game = {GameType.DS, GameType.DSDC}),
@Selector(type = @Type(name = "ArtPartsSubModelWithChildrenResource"), game = {GameType.DS, GameType.DSDC}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ private static Node serialize(
serializeModelPartResource(task.split(1), node, object, file, project, context);
case "LodMeshResource" ->
serializeLodMeshResource(task.split(1), node, object, file, project, context);
case "LodMeshResourcePart", "MultiMeshResourcePart" ->
serializeMeshResourcePart(task.split(1), node, object, file, project, context);
case "MultiMeshResource" ->
serializeMultiMeshResource(task.split(1), node, object, file, project, context);
case "StaticMeshInstance" ->
Expand Down Expand Up @@ -419,17 +417,6 @@ private static void serializeLodMeshResource(
}
}

private static void serializeMeshResourcePart(
@NotNull ProgressMonitor monitor,
@NotNull Node root,
@NotNull RTTIObject object,
@NotNull RTTICoreFile file,
@NotNull Project project,
@NotNull Context context
) throws IOException {
root.add(serialize(monitor, object.ref("Mesh"), file, project, context));
}

private static void serializeModelPartResource(
@NotNull ProgressMonitor monitor,
@NotNull Node root,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
@Selector(type = @Type(name = "ImageMapEntry")),
@Selector(type = @Type(name = "ButtonIcon")),
@Selector(type = @Type(name = "MenuStreamingTexture")),
@Selector(type = @Type(name = "UITextureBindingOverride")),
@Selector(type = @Type(type = HwTexture.class))
})
public class TextureViewer implements ValueViewer {
Expand Down Expand Up @@ -131,7 +130,7 @@ public static TextureInfo getTextureInfo(@NotNull RTTIObject object, @NotNull Pr
case "TextureBindingWithHandle", "ShaderTextureBinding" -> {
return getTextureInfo(object.ref("TextureResource"), project, file, object.i32("PackedData"));
}
case "TextureSetEntry", "ImageMapEntry", "ButtonIcon", "MenuStreamingTexture", "UITextureBindingOverride" -> {
case "TextureSetEntry", "ImageMapEntry", "ButtonIcon", "MenuStreamingTexture" -> {
return getTextureInfo(object.ref("Texture"), project, file, 0);
}
case "TextureSet" -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.shade.decima.ui.data.registry.ValueHandlerRegistration;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Selector;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Type;
import com.shade.platform.ui.controls.CommonTextAttributes;
import com.shade.platform.ui.controls.TextAttributes;
import com.shade.util.NotNull;
import com.shade.util.Nullable;

Expand All @@ -19,7 +19,7 @@ public class GGUUIDValueHandler extends ObjectValueHandler {
@NotNull
@Override
public Decorator getDecorator(@NotNull RTTIType<?> type) {
return (value, component) -> component.append("{%s}".formatted(RTTIUtils.uuidToString((RTTIObject) value)), CommonTextAttributes.NUMBER_ATTRIBUTES);
return (value, component) -> component.append("{%s}".formatted(RTTIUtils.uuidToString((RTTIObject) value)), TextAttributes.REGULAR_ATTRIBUTES);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
import com.shade.decima.ui.data.registry.ValueHandlerRegistration;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Selector;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Type;
import com.shade.platform.ui.controls.CommonTextAttributes;
import com.shade.platform.ui.controls.TextAttributes;
import com.shade.util.NotNull;
import com.shade.util.Nullable;

import javax.swing.*;

@ValueHandlerRegistration(id = "imageMapEntry", name = "Image ID", value = {
@Selector(type = @Type(name = "ImageMapEntry"))
Expand All @@ -18,18 +15,6 @@ public class ImageMapEntryValueHandler extends ObjectValueHandler {
@NotNull
@Override
public Decorator getDecorator(@NotNull RTTIType<?> type) {
return (value, component) -> component.append("\"%s\"".formatted(getText(type, value)), CommonTextAttributes.STRING_TEXT_ATTRIBUTES);
}

@NotNull
@Override
public String getText(@NotNull RTTIType<?> type, @NotNull Object value) {
return ((RTTIObject) value).str("ID");
}

@Nullable
@Override
public Icon getIcon(@NotNull RTTIType<?> type) {
return UIManager.getIcon("Node.textureIcon");
return (value, component) -> component.append(((RTTIObject) value).str("ID"), TextAttributes.REGULAR_ATTRIBUTES);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@

@ValueHandlerRegistration(id = "model", name = "Model", value = {
@Selector(type = @Type(name = "ModelResource")),
@Selector(type = @Type(name = "MeshResourceBase"))
@Selector(type = @Type(name = "MeshResourceBase")),
})
public class ModelValueHandler extends ObjectValueHandler {
@NotNull
@Override
public Decorator getDecorator(@NotNull RTTIType<?> type) {
return (value, component) -> ObjectWithNameValueHandler.INSTANCE.getDecorator(type).decorate(value, component);
}

@Nullable
@Override
public Icon getIcon(@NotNull RTTIType<?> type) {
Expand Down
Loading

0 comments on commit 7c04db9

Please sign in to comment.