Project

General

Profile

Bug #1990

Qt 4 incompatibility in ResourceSystem::initSprites()

Added by skyjake about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
Defect
Target version:
-
Start date:
2015-03-10
% Done:

100%

Tags:
Qt4

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

Revision 86aca9f0 (diff)
Added by danij about 9 years ago

Refactor|ResourceSystem: Cleaned up Sprite frame set construction

IssueID #1990

History

#1 Updated by skyjake about 9 years ago

  • Description updated (diff)

#2 Updated by skyjake about 9 years ago

  • Description updated (diff)

#3 Updated by danij about 9 years ago

  • Status changed from New to In Progress

#4 Updated by danij about 9 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

#5 Updated by skyjake about 9 years ago

  • Status changed from Resolved to Closed

#6 Updated by skyjake almost 9 years ago

  • Target version deleted (49)

Also available in: Atom PDF