mirror of
https://github.com/Team-Neptune/DeepSea-Updater.git
synced 2024-11-23 12:29:52 +00:00
Make sure action textures get deleted.
This commit is contained in:
parent
c752b59eaf
commit
8bcf9d2f6b
@ -24,3 +24,10 @@ Action::Action(ActionButton actionButton, string actionText) {
|
||||
textWidth = 0;
|
||||
textHeight = 0;
|
||||
}
|
||||
|
||||
Action::~Action() {
|
||||
if (textTexture != NULL) {
|
||||
SDL_DestroyTexture(textTexture);
|
||||
textTexture = NULL;
|
||||
}
|
||||
}
|
@ -39,4 +39,5 @@ class Action {
|
||||
int textHeight;
|
||||
|
||||
Action(ActionButton actionButton, string actionText);
|
||||
~Action();
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ AppUpdateScene::AppUpdateScene() {
|
||||
|
||||
_footerView = new FooterView();
|
||||
_footerView->frame = { 0, 647, 1280, 73 };
|
||||
_footerView->actions.push_back(new Action(A_BUTTON, "Next"));
|
||||
|
||||
addSubView(_headerView);
|
||||
addSubView(_footerView);
|
||||
@ -39,7 +40,7 @@ AppUpdateScene::~AppUpdateScene() {
|
||||
|
||||
void AppUpdateScene::handleButton(u32 buttons) {
|
||||
if (buttons & KEY_A) {
|
||||
SceneDirector::currentScene = SCENE_ALL_DONE;
|
||||
SceneDirector::currentScene = SCENE_PACKAGE_SELECT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include "PackageSelectScene.hpp"
|
||||
#include "../SceneDirector.hpp"
|
||||
|
||||
PackageSelectScene::PackageSelectScene() {
|
||||
_headerView = new HeaderView();
|
||||
@ -37,7 +38,9 @@ PackageSelectScene::~PackageSelectScene() {
|
||||
}
|
||||
|
||||
void PackageSelectScene::handleButton(u32 buttons) {
|
||||
|
||||
if (buttons & KEY_A) {
|
||||
SceneDirector::currentScene = SCENE_ALL_DONE;
|
||||
}
|
||||
}
|
||||
|
||||
void PackageSelectScene::render(SDL_Rect rect, double dTime) {
|
||||
|
@ -49,7 +49,13 @@ FooterView::FooterView() : View() {
|
||||
}
|
||||
}
|
||||
|
||||
FooterView::~FooterView() {}
|
||||
FooterView::~FooterView() {
|
||||
for (list<Action *>::iterator it = actions.begin(); it != actions.end(); it++) {
|
||||
delete (*it);
|
||||
}
|
||||
|
||||
actions.clear();
|
||||
}
|
||||
|
||||
void FooterView::render(SDL_Rect rect) {
|
||||
// Divider.
|
||||
|
Loading…
Reference in New Issue
Block a user