Skip to content

Commit

Permalink
Apply smart mapping in matrices tab to do a skin splice equivalent, a…
Browse files Browse the repository at this point in the history
…nd iterate on track tab
  • Loading branch information
Retera committed Jun 12, 2022
1 parent 3a05d3f commit 4d5d164
Show file tree
Hide file tree
Showing 19 changed files with 1,508 additions and 820 deletions.
26 changes: 9 additions & 17 deletions craft3data/src/com/hiveworkshop/rms/editor/render3d/NGGLDP.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void glNormal3f(final float x, final float y, final float z) {
pushFloat(baseOffset + 4, tempVec4.x);
pushFloat(baseOffset + 5, tempVec4.y);
pushFloat(baseOffset + 6, tempVec4.z);
pushFloat(baseOffset + 7, 1);
pushFloat(baseOffset + 7, 0);
normalCount++;
}

Expand Down Expand Up @@ -391,11 +391,9 @@ public void glEnableIfNeeded(final int glEnum) {
if (glEnum == GL11.GL_TEXTURE_2D) {
textureUsed = 1;
GL13.glActiveTexture(GL13.GL_TEXTURE0);
}
else if (glEnum == GL11.GL_ALPHA_TEST) {
} else if (glEnum == GL11.GL_ALPHA_TEST) {
alphaTest = 1;
}
else if (glEnum == GL11.GL_LIGHTING) {
} else if (glEnum == GL11.GL_LIGHTING) {
lightingEnabled = 1;
}
}
Expand All @@ -409,11 +407,9 @@ public void glDisableIfNeeded(final int glEnum) {
if (glEnum == GL11.GL_TEXTURE_2D) {
textureUsed = 0;
GL13.glActiveTexture(0);
}
else if (glEnum == GL11.GL_ALPHA_TEST) {
} else if (glEnum == GL11.GL_ALPHA_TEST) {
alphaTest = 0;
}
else if (glEnum == GL11.GL_LIGHTING) {
} else if (glEnum == GL11.GL_LIGHTING) {
lightingEnabled = 0;
}
}
Expand Down Expand Up @@ -983,11 +979,9 @@ public void glEnableIfNeeded(final int glEnum) {
if (glEnum == GL11.GL_TEXTURE_2D) {
textureUsed = 1;
GL13.glActiveTexture(GL13.GL_TEXTURE0 + textureUnit);
}
else if ((glEnum == GL11.GL_ALPHA_TEST) && (textureUnit == 0)) {
} else if (glEnum == GL11.GL_ALPHA_TEST && textureUnit == 0) {
alphaTest = 1;
}
else if (glEnum == GL11.GL_LIGHTING) {
} else if (glEnum == GL11.GL_LIGHTING) {
lightingEnabled = 1;
}
}
Expand All @@ -1001,11 +995,9 @@ public void glDisableIfNeeded(final int glEnum) {
if (glEnum == GL11.GL_TEXTURE_2D) {
textureUsed = 0;
GL13.glActiveTexture(0);
}
else if ((glEnum == GL11.GL_ALPHA_TEST) && (textureUnit == 0)) {
} else if (glEnum == GL11.GL_ALPHA_TEST && textureUnit == 0) {
alphaTest = 0;
}
else if (glEnum == GL11.GL_LIGHTING) {
} else if (glEnum == GL11.GL_LIGHTING) {
lightingEnabled = 0;
}
}
Expand Down
233 changes: 146 additions & 87 deletions craft3data/src/com/hiveworkshop/wc3/gui/modeledit/ImportPanel.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,7 @@ protected void select(final Geoset item, final ModelViewManager modelViewManager

@Override
protected String getName(final Geoset item, final ModelViewManager modelViewManager) {
final String numberName = "Geoset " + (modelViewManager.getModel().getGeosetId(item) + 1);
if ((item.getLevelOfDetailName() != null) && (item.getLevelOfDetailName().length() > 0)) {
return numberName + ": " + item.getLevelOfDetailName();
}
return numberName;
return item.getUIName(modelViewManager.getModel());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public ModelPanel(final JComponent parent, final EditableModel input, final Prog
modelViewManagingTree.setFocusable(false);
modelComponentBrowserTree = new ModelComponentBrowserTree(modelView, undoManager, modelEditorManager,
modelStructureChangeListener);
tracksEditorPanel = new TracksEditorPanel(modelView, undoManager, modelEditorManager,
tracksEditorPanel = new TracksEditorPanel(modelView, undoManager, modelEditorManager, modeNotifier,
modelStructureChangeListener);

selectionItemTypeNotifier.addToolbarButtonListener(new ToolbarButtonListener<SelectionItemTypes>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ public void run() {
setModel(buildTreeModel(modelViewManager));
final TreePath newRootPath = new TreePath(getModel().getRoot());
final List<TreePath> pathsToExpand = new ArrayList<>();
while ((expandedDescendants != null) && expandedDescendants.hasMoreElements()) {
while (expandedDescendants != null && expandedDescendants.hasMoreElements()) {
final TreePath nextPathToExpand = expandedDescendants.nextElement();
TreePath newPathWithNewObjects = newRootPath;
JCheckBoxTreeNode currentNode = (JCheckBoxTreeNode) getModel().getRoot();
for (int i = 1; i < nextPathToExpand.getPathCount(); i++) {
final JCheckBoxTreeNode pathComponent = (JCheckBoxTreeNode) nextPathToExpand
.getPathComponent(i);
boolean foundMatchingChild = false;
for (int j = 0; (j < currentNode.getChildCount()) && !foundMatchingChild; j++) {
for (int j = 0; j < currentNode.getChildCount() && !foundMatchingChild; j++) {
final JCheckBoxTreeNode childAt = (JCheckBoxTreeNode) currentNode.getChildAt(j);
if (asElement(childAt.getUserObject())
.hasSameItem(asElement(pathComponent.getUserObject()))) {
Expand Down Expand Up @@ -163,7 +163,7 @@ private static DefaultTreeModel buildTreeModel(final ModelViewManager modelViewM
parentTreeNode.add(treeNode);
}
final List<JCheckBoxTreeNode> childrenNeedingLinkToCurrentNode = nodeToChildrenAwaitingLink.get(object);
if ((childrenNeedingLinkToCurrentNode != null)
if (childrenNeedingLinkToCurrentNode != null
&& !Collection.Util.isEmpty(childrenNeedingLinkToCurrentNode)) {
for (final JCheckBoxTreeNode child : childrenNeedingLinkToCurrentNode) {
treeNode.add(child);
Expand Down Expand Up @@ -268,7 +268,7 @@ public String toString() {
protected abstract String getName(T item, ModelViewManager modelViewManager);

public boolean hasSameItem(final CheckableDisplayElement<?> other) {
return (other.item == item) || ((item != null) && item.equals(other.item));
return other.item == item || item != null && item.equals(other.item);
}
}

Expand All @@ -288,10 +288,7 @@ protected void setChecked(final Geoset item, final ModelViewManager modelViewMan

@Override
protected String getName(final Geoset item, final ModelViewManager modelViewManager) {
if ((item.getLevelOfDetailName() != null) && (item.getLevelOfDetailName().length() > 0)) {
return item.getLevelOfDetailName();
}
return "Geoset " + (modelViewManager.getModel().getGeosetId(item) + 1);
return item.getUIName(modelViewManager.getModel());
}

@Override
Expand Down
Loading

0 comments on commit 4d5d164

Please sign in to comment.