3890 |
// now tempRegion's dimensions and DimensionRegions basically reflect |
// now tempRegion's dimensions and DimensionRegions basically reflect |
3891 |
// what we wanted to get for this actual Region here, so we now just |
// what we wanted to get for this actual Region here, so we now just |
3892 |
// delete and recreate the dimension in question with the new amount |
// delete and recreate the dimension in question with the new amount |
3893 |
// zones and then copy back from tempRegion |
// zones and then copy back from tempRegion. we're actually deleting and |
3894 |
DeleteDimension(oldDef); |
// recreating all dimensions here, to avoid altering the precise order |
3895 |
AddDimension(&newDef); |
// of the dimensions (which would not be an error per se, but it would |
3896 |
|
// cause usability issues with instrument editors) |
3897 |
|
{ |
3898 |
|
std::vector<dimension_def_t> oldDefs; |
3899 |
|
for (int i = 0; i < Dimensions; ++i) |
3900 |
|
oldDefs.push_back(pDimensionDefinitions[i]); // copy, don't reference |
3901 |
|
for (int i = Dimensions - 1; i >= 0; --i) |
3902 |
|
DeleteDimension(&pDimensionDefinitions[i]); |
3903 |
|
for (int i = 0; i < oldDefs.size(); ++i) { |
3904 |
|
dimension_def_t& def = oldDefs[i]; |
3905 |
|
AddDimension( |
3906 |
|
(def.dimension == newDef.dimension) ? &newDef : &def |
3907 |
|
); |
3908 |
|
} |
3909 |
|
} |
3910 |
for (int iSrc = 0; iSrc < 256; ++iSrc) { |
for (int iSrc = 0; iSrc < 256; ++iSrc) { |
3911 |
DimensionRegion* srcDimRgn = tempRgn->pDimensionRegions[iSrc]; |
DimensionRegion* srcDimRgn = tempRgn->pDimensionRegions[iSrc]; |
3912 |
if (!srcDimRgn) continue; |
if (!srcDimRgn) continue; |
4046 |
// delete and recreate the dimension in question with the new amount |
// delete and recreate the dimension in question with the new amount |
4047 |
// zones and then copy back from tempRegion. we're actually deleting and |
// zones and then copy back from tempRegion. we're actually deleting and |
4048 |
// recreating all dimensions here, to avoid altering the precise order |
// recreating all dimensions here, to avoid altering the precise order |
4049 |
// of the dimensions (which would not be an error per so, but it would |
// of the dimensions (which would not be an error per se, but it would |
4050 |
// cause usability issues with instrument editors) |
// cause usability issues with instrument editors) |
4051 |
{ |
{ |
4052 |
std::vector<dimension_def_t> oldDefs; |
std::vector<dimension_def_t> oldDefs; |