Skip to content

Commit

Permalink
Merge pull request #135 from orange-vertex/cleanup_2
Browse files Browse the repository at this point in the history
Replace ShapeMap:m_objects with a std::map instead of pqmap
  • Loading branch information
pklampros authored Mar 7, 2018
2 parents 8d61338 + ce07e51 commit 96eb854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions salalib/shapemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2638,8 +2638,8 @@ bool ShapeMap::read( istream& stream, int version, bool drawinglayer )
for (int k = 0; k < count; k++) {
int key;
stream.read((char *) &key, sizeof(key));
int index = m_objects.add(key, SalaObject());
m_objects.value(index).read(stream,version);
m_objects.insert(std::make_pair(key, SalaObject()));
m_objects.end()->second.read(stream,version);
}
// read attribute data
m_attributes.read(stream,version);
Expand Down Expand Up @@ -2716,10 +2716,10 @@ bool ShapeMap::write( ofstream& stream, int version )
// write object data (currently unused)
count = m_objects.size();
stream.write((char *) &count, sizeof(count));
for (int k = 0; k < count; k++) {
int key = m_objects.key(k);
for (auto obj: m_objects) {
int key = obj.first;
stream.write((char *) &key, sizeof(key));
m_objects.value(k).write(stream);
obj.second.write(stream);
}
// write attribute data
m_attributes.write(stream,version);
Expand Down
2 changes: 1 addition & 1 deletion salalib/shapemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class ShapeMap : public PixelBase
mutable bool m_bsp_tree;
//
pqmap<int,SalaShape> m_shapes;
pqmap<int,SalaObject> m_objects; // THIS IS UNUSED! Meant for each object to have many shapes
std::map<int,SalaObject> m_objects; // THIS IS UNUSED! Meant for each object to have many shapes
//
prefvec<SalaEvent> m_undobuffer;
//
Expand Down

0 comments on commit 96eb854

Please sign in to comment.