The reason all fields are getting set to the same when you call createMinMapDataArray()
is because you check for certain conditions like
if(imageFormat==Format.DXT5|| imageFormat==Format.DXT3)
You then iterate through the array and initialize the indices with a new MinMap()
object that is the same for each index.
The concept of adding to arrays is not really the right way to think about an array. Arrays are used to store information usually of a predetermined size. To add an object to the ith index you would do:
MipMapData[] minMaps = createMipMapDataArray(// pass your parameters here)
minMaps[10] = new MinMap(// pass your parameters)
Of course this does not add the value to your array. It overrides/replaces the value of minMaps[10] with the new value.
To add an undetermined amount of MinMaps
to a list, consider using an ArrayList<MinMap>
ArrayList<MinMap> minMapList = new ArrayList<MinMap>();
minMapList.add(new MinMap(// pass your parameters here));