@@ -29,7 +29,7 @@ public abstract class PolygonWrapper {
2929 private TurboList turbolist ;
3030 public boolean mirror , flip ;
3131 public boolean selected ;
32- public Integer color ;
32+ public int [] color ;
3333 public String name ;
3434
3535 public PolygonWrapper (GroupCompound compound ){
@@ -154,21 +154,31 @@ protected void setupMRT(){
154154 turbo = newMRT ().setTextured (compound .texture != null );
155155 lines = newMRT ().setLines (true );
156156 sellines = newMRT ().setLines (Settings .selectedColor );
157- picker = newMRT ().setTextured (false ).setColor (genColor ());
157+ //
158+ picker = new ModelRendererTurbo (null , 0 , 0 , 16 , 16 ){
159+ @ Override
160+ public RGB getColor (int i ){
161+ return new RGB (genColor (this , i ));
162+ }
163+ };
164+ picker .copyTo (sellines .getVertices (), sellines .getFaces ());
165+ picker .setRotationPoint (sellines .rotationPointX , sellines .rotationPointY , sellines .rotationPointZ );
166+ picker .setRotationAngle (sellines .rotateAngleX , sellines .rotateAngleY , sellines .rotateAngleZ );
167+ picker .setTextured (false ).setLines (false );
158168 }
159169
160170 //private static int maxcol = 16777215;
161171 private static int lastint = 0 ;
162172
163- private RGB genColor (){
173+ private RGB genColor (ModelRendererTurbo turbo , int face ){
164174 if (color == null ){
165- color = lastint += 16 ;
166- if (color == 2048383 ){
167- color = lastint += 16 ;
175+ color = new int [turbo .getFaces ().length ];
176+ for (int i = 0 ; i < color .length ; i ++){
177+ color [i ] = lastint += 1 ;
178+ if (color [i ] == 2048383 ){ color [i ] = lastint += 1 ; }
168179 }
169180 }
170- //Print.console(color + " ");
171- RGB rgb = new RGB (); rgb .packed = color ; return rgb ;
181+ RGB rgb = new RGB (); rgb .packed = color [face ]; return rgb ;
172182 }
173183
174184 protected abstract ModelRendererTurbo newMRT ();
@@ -219,13 +229,14 @@ public ModelRendererTurbo getTurboObject(int i){
219229 if (i < 0 || i > 2 ) i = 0 ; return i == 0 ? turbo : i == 1 ? lines : sellines ;
220230 }
221231
222- public boolean burnToTexture (Texture tex ){
232+ public boolean burnToTexture (Texture tex , Integer face ){
223233 if (this .texpos == null || this .texpos .length == 0 ){
224234 Print .console ("Polygon '" + turbolist .id + ":" + this .name () + "' has no texture data, skipping." );
225235 return false ;
226236 }
227237 BufferedImage buff = tex .getImage (); int color = 0 ;
228238 for (int i = 0 ; i < texpos .length ; i ++){
239+ if (face != null && i != face ) continue ;
229240 float [][] ends = texpos [i ]; if (ends == null || ends .length == 0 ) continue ; color = new Color (something .getColor (i ).packed ).darker ().darker ().getRGB ();
230241 for (float x = ends [0 ][0 ]; x < ends [1 ][0 ]; x += 0.5f ){//double accuracy!
231242 for (float y = ends [0 ][1 ]; y < ends [1 ][1 ]; y += 0.5f ){//double accuracy!
0 commit comments