/[svn]/libgig/trunk/src/gig.cpp
ViewVC logotype

Diff of /libgig/trunk/src/gig.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3708 by schoenebeck, Sat Dec 14 17:10:57 2019 UTC revision 3709 by schoenebeck, Fri Jan 10 11:21:59 2020 UTC
# Line 4023  namespace { Line 4023  namespace {
4023          // now tempRegion's dimensions and DimensionRegions basically reflect          // now tempRegion's dimensions and DimensionRegions basically reflect
4024          // 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
4025          // delete and recreate the dimension in question with the new amount          // delete and recreate the dimension in question with the new amount
4026          // zones and then copy back from tempRegion                // zones and then copy back from tempRegion. we're actually deleting and
4027          DeleteDimension(oldDef);          // recreating all dimensions here, to avoid altering the precise order
4028          AddDimension(&newDef);          // of the dimensions (which would not be an error per so, but it would
4029            // cause usability issues with instrument editors)
4030            {
4031                std::vector<dimension_def_t> oldDefs;
4032                for (int i = 0; i < Dimensions; ++i)
4033                    oldDefs.push_back(pDimensionDefinitions[i]); // copy, don't reference
4034                for (int i = Dimensions - 1; i >= 0; --i)
4035                    DeleteDimension(&pDimensionDefinitions[i]);
4036                for (int i = 0; i < oldDefs.size(); ++i) {
4037                    dimension_def_t& def = oldDefs[i];
4038                    AddDimension(
4039                        (def.dimension == newDef.dimension) ? &newDef : &def
4040                    );
4041                }
4042            }
4043          for (int iSrc = 0; iSrc < 256; ++iSrc) {          for (int iSrc = 0; iSrc < 256; ++iSrc) {
4044              DimensionRegion* srcDimRgn = tempRgn->pDimensionRegions[iSrc];              DimensionRegion* srcDimRgn = tempRgn->pDimensionRegions[iSrc];
4045              if (!srcDimRgn) continue;              if (!srcDimRgn) continue;

Legend:
Removed from v.3708  
changed lines
  Added in v.3709

  ViewVC Help
Powered by ViewVC