282 |
bitpos += region->pDimensionDefinitions[j].bits; |
bitpos += region->pDimensionDefinitions[j].bits; |
283 |
} |
} |
284 |
int mask = |
int mask = |
285 |
~(((1 << region->pDimensionDefinitions[resize.dimension].bits) - 1) << bitpos); |
~(((1 << region->pDimensionDefinitions[resize.dimension].bits) - 1) << bitpos); |
286 |
int c = dimregno & mask; // mask away this dimension |
int c = dimregno & mask; // mask away this dimension |
287 |
|
|
288 |
gig::DimensionRegion *d = region->pDimensionRegions[c + resize.offset]; |
if (region->pDimensionRegions[c]->DimensionUpperLimits[resize.dimension] == 0) { |
289 |
if (d->DimensionUpperLimits[resize.dimension]) { |
// the velocity dimension didn't previously have |
290 |
d->DimensionUpperLimits[resize.dimension] = resize.pos - 1; |
// custom v3 splits, so we initialize all splits with |
291 |
} else { |
// default values |
292 |
d->VelocityUpperLimit = resize.pos - 1; |
int nbZones = region->pDimensionDefinitions[resize.dimension].zones; |
293 |
|
for (int j = 0 ; j < nbZones ; j++) { |
294 |
|
gig::DimensionRegion *d = region->pDimensionRegions[c + (j << bitpos)]; |
295 |
|
d->DimensionUpperLimits[resize.dimension] = int(128.0 * (j + 1) / nbZones - 1); |
296 |
|
} |
297 |
|
} |
298 |
|
if (region->pDimensionRegions[c]->VelocityUpperLimit == 0) { |
299 |
|
// the velocity dimension didn't previously have |
300 |
|
// custom v2 splits, so we initialize all splits with |
301 |
|
// default values |
302 |
|
int nbZones = region->pDimensionDefinitions[resize.dimension].zones; |
303 |
|
for (int j = 0 ; j < nbZones ; j++) { |
304 |
|
gig::DimensionRegion *d = region->pDimensionRegions[c + (j << bitpos)]; |
305 |
|
d->VelocityUpperLimit = int(128.0 * (j + 1) / nbZones - 1); |
306 |
|
} |
307 |
} |
} |
308 |
|
|
309 |
|
gig::DimensionRegion *d = region->pDimensionRegions[c + resize.offset]; |
310 |
|
// update both v2 and v3 values |
311 |
|
d->DimensionUpperLimits[resize.dimension] = resize.pos - 1; |
312 |
|
d->VelocityUpperLimit = resize.pos - 1; |
313 |
|
|
314 |
} else { |
} else { |
315 |
for (int i = 0 ; i < region->DimensionRegions ; ) { |
for (int i = 0 ; i < region->DimensionRegions ; ) { |
316 |
|
|
317 |
|
if (region->pDimensionRegions[i]->DimensionUpperLimits[resize.dimension] == 0) { |
318 |
|
// the dimension didn't previously have custom |
319 |
|
// limits, so we have to set default limits for |
320 |
|
// all the dimension regions |
321 |
|
int bitpos = 0; |
322 |
|
for (int j = 0 ; j < resize.dimension ; j++) { |
323 |
|
bitpos += region->pDimensionDefinitions[j].bits; |
324 |
|
} |
325 |
|
int nbZones = region->pDimensionDefinitions[resize.dimension].zones; |
326 |
|
|
327 |
|
for (int j = 0 ; j < nbZones ; j++) { |
328 |
|
gig::DimensionRegion *d = region->pDimensionRegions[i + (j << bitpos)]; |
329 |
|
d->DimensionUpperLimits[resize.dimension] = int(128.0 * (j + 1) / nbZones - 1); |
330 |
|
} |
331 |
|
} |
332 |
gig::DimensionRegion *d = region->pDimensionRegions[i + resize.offset]; |
gig::DimensionRegion *d = region->pDimensionRegions[i + resize.offset]; |
333 |
d->DimensionUpperLimits[resize.dimension] = resize.pos - 1; |
d->DimensionUpperLimits[resize.dimension] = resize.pos - 1; |
334 |
|
|
546 |
(customsplits) ? |
(customsplits) ? |
547 |
(d->DimensionUpperLimits[dim]) ? |
(d->DimensionUpperLimits[dim]) ? |
548 |
d->DimensionUpperLimits[dim] : d->VelocityUpperLimit |
d->DimensionUpperLimits[dim] : d->VelocityUpperLimit |
549 |
: (iZone+1) * (int)region->pDimensionDefinitions[dim].zone_size; |
: (iZone+1) * (int)region->pDimensionDefinitions[dim].zone_size - 1; |
550 |
int limit = upperLimit + 1; |
int limit = upperLimit + 1; |
551 |
int limitx = int((w - label_width - 1) * limit / 128.0 + 0.5) + label_width; |
int limitx = int((w - label_width - 1) * limit / 128.0 + 0.5) + label_width; |
552 |
if (x <= limitx - 2) break; |
if (x <= limitx - 2) break; |
568 |
(customsplits) ? |
(customsplits) ? |
569 |
(d->DimensionUpperLimits[dim]) ? |
(d->DimensionUpperLimits[dim]) ? |
570 |
d->DimensionUpperLimits[dim] : d->VelocityUpperLimit |
d->DimensionUpperLimits[dim] : d->VelocityUpperLimit |
571 |
: (iZone+1) * (int)region->pDimensionDefinitions[dim].zone_size; |
: (iZone+1) * (int)region->pDimensionDefinitions[dim].zone_size - 1; |
572 |
|
|
573 |
int limit = upperLimit + 1; |
int limit = upperLimit + 1; |
574 |
resize.max = limit; |
resize.max = limit; |