43 |
|
|
44 |
class Key { |
class Key { |
45 |
Object key; int parent; |
Object key; int parent; |
46 |
|
int interpolateTo; |
47 |
Key(Object k, int p) { key=k; parent=p; } |
Key(Object k, int p) { key=k; parent=p; } |
48 |
public int hashCode() { return key.hashCode() ^ parent; } |
public int hashCode() { return key.hashCode() ^ parent; } |
49 |
public boolean equals(Object o) { |
public boolean equals(Object o) { |
139 |
return o; |
return o; |
140 |
} |
} |
141 |
|
|
142 |
|
public void keymapSingleCoordsys(int mine, int other) { |
143 |
|
keyByCs[mine].interpolateTo = other; |
144 |
|
} |
145 |
|
|
146 |
public int[] interpList(VobMatcher other0, boolean towardsOther) { |
public int[] interpList(VobMatcher other0, boolean towardsOther) { |
147 |
DefaultVobMatcher other = (DefaultVobMatcher)other0; |
DefaultVobMatcher other = (DefaultVobMatcher)other0; |
148 |
int[] interpList = new int[maxcs+1]; |
int[] interpList = new int[maxcs+1]; |
152 |
interpList[i] = -1; |
interpList[i] = -1; |
153 |
else { |
else { |
154 |
Key k = keyByCs[i]; |
Key k = keyByCs[i]; |
155 |
|
if(!towardsOther && k.interpolateTo > 0) { |
156 |
|
int csTo = k.interpolateTo; |
157 |
|
Key kOther = other.keyByCs[csTo]; |
158 |
|
// Need to check; otherwise can get core dumps |
159 |
|
if(kOther == null) { |
160 |
|
pa("??!!! interp wrong"); |
161 |
|
} else { |
162 |
|
if(dbg) pa(i+" overridden into "+csTo); |
163 |
|
interpList[i] = csTo; |
164 |
|
} |
165 |
|
continue; |
166 |
|
} |
167 |
|
|
168 |
if(k.parent < 0 || k.parent >= i) |
if(k.parent < 0 || k.parent >= i) |
169 |
throw new Error("argh "+k.parent); |
throw new Error("argh "+k.parent); |