private int GetTexFromNode(myTreeNode node, out TPFTexInfo tex)
{
tex = null;
// Heff: Cancellation check
if (cts.IsCancellationRequested)
return -1;
if (node.TexInd >= LoadedTexes.Count)
return 0;
if (node.TexInds.Count != 0)
tex = LoadedTexes[node.TexInds[0]].FileDuplicates[node.TexInds[1]];
else
tex = LoadedTexes[node.TexInd];
return node.TexInd;
}