Bug #1990
Qt 4 incompatibility in ResourceSystem::initSprites()
Start date:
2015-03-10
% Done:
100%
Description
Build 1528 fails when compiling with Qt 4.7, because QMap::firstKey() is not availble.
This loop could be written in a way that doesn't modify newSprites:
int lastFrame = -1;
while(!newSprites.isEmpty())
{
int frame = newSprites.firstKey();
// Insert dummy sprites to fill any gaps in the frame set.
for(int i = lastFrame + 1; i < frame; ++i)
{
group.sprites << new Sprite;
}
group.sprites << newSprites.take(frame);
lastFrame = frame;
}
One could simply for()/foreach() over
newSprites, accessing the map iterator's key() and value().
Even if one would want to modify newSprites, there's QMutableMapIterator that doesn't require firstKey().
Associated revisions
History
#1
Updated by skyjake over 10 years ago
- Description updated (diff)
#2
Updated by skyjake over 10 years ago
- Description updated (diff)
#3
Updated by danij over 10 years ago
- Status changed from New to In Progress
#4
Updated by danij over 10 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
#5
Updated by skyjake over 10 years ago
- Status changed from Resolved to Closed
#6
Updated by skyjake over 10 years ago
- Target version deleted (
49)
Refactor|ResourceSystem: Cleaned up Sprite frame set construction
IssueID #1990