From e7cd458b6b22589f5b8961dc0f953c0ae638923f Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Thu, 1 Oct 2009 14:06:47 +0000 Subject: [PATCH] Erwan -fix issue 85 (simpleMenu limitation) - this requires to recompile JGE --- JGE/include/JGui.h | 3 ++- JGE/src/JGui.cpp | 52 ++++++++++++++++------------------------------ 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/JGE/include/JGui.h b/JGE/include/JGui.h index c383bed3a..0f4344302 100644 --- a/JGE/include/JGui.h +++ b/JGE/include/JGui.h @@ -86,7 +86,7 @@ class JGuiController //int mKeyHoldTime; public: - JGuiObject* mObjects[MAX_GUIOBJECT]; + vector mObjects; int mCount; JGuiController(int id, JGuiListener* listener); @@ -96,6 +96,7 @@ class JGuiController virtual void Update(float dt); void Add(JGuiObject* ctrl); + void RemoveAt(int i); void Remove(int id); void Remove(JGuiObject* ctrl); diff --git a/JGE/src/JGui.cpp b/JGE/src/JGui.cpp index 973c1492b..6e5aba35b 100644 --- a/JGE/src/JGui.cpp +++ b/JGE/src/JGui.cpp @@ -89,17 +89,12 @@ JGuiController::~JGuiController() if (mObjects[i]!=NULL) delete mObjects[i]; - // JGERelease(); } void JGuiController::Render() { - // if (mShadingBg != NULL) - // jge->Gfx_BlendRect(mShadingBg, mShadingColor); - // if (mBg != NULL) - // jge->Gfx_DrawImage(mBg, mBgX, mBgY); for (int i=0;iGetId()==id) - { - delete mObjects[i]; - for (int j=i;jGetId()==id) { + RemoveAt(i); + return; + } } } @@ -197,19 +190,10 @@ void JGuiController::Remove(JGuiObject* ctrl) { for (int i=0;i