Skip to content

Commit

Permalink
NWN: Use PtrVector for the main menu fog parts
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent f035b03 commit 118153a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/engines/nwn/gui/main/newgamefog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,16 @@ NewGameFogs::NewGameFogs(size_t count) {
}

NewGameFogs::~NewGameFogs() {
for (std::vector<Graphics::Aurora::Model *>::iterator f = _fogs.begin(); f != _fogs.end(); ++f) {
(*f)->hide();
delete *f;
}
hide();
}

void NewGameFogs::show() {
for (std::vector<Graphics::Aurora::Model *>::iterator f = _fogs.begin(); f != _fogs.end(); ++f)
for (Common::PtrVector<Graphics::Aurora::Model>::iterator f = _fogs.begin(); f != _fogs.end(); ++f)
(*f)->show();
}

void NewGameFogs::hide() {
for (std::vector<Graphics::Aurora::Model *>::iterator f = _fogs.begin(); f != _fogs.end(); ++f)
for (Common::PtrVector<Graphics::Aurora::Model>::iterator f = _fogs.begin(); f != _fogs.end(); ++f)
(*f)->hide();
}

Expand Down
3 changes: 2 additions & 1 deletion src/engines/nwn/gui/main/newgamefog.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <vector>

#include "src/common/types.h"
#include "src/common/ptrvector.h"

#include "src/graphics/aurora/types.h"

Expand All @@ -44,7 +45,7 @@ class NewGameFogs {
void hide();

private:
std::vector<Graphics::Aurora::Model *> _fogs;
Common::PtrVector<Graphics::Aurora::Model> _fogs;
};

} // End of namespace NWN
Expand Down

0 comments on commit 118153a

Please sign in to comment.