Jeck - Replaced ok_quad with ok_tex, which won't expire until the duel is over.
This commit is contained in:
@@ -13,7 +13,7 @@ class GuiCombat : public GuiLayer
|
||||
GameObserver* go;
|
||||
DamagerDamaged* active;
|
||||
AttackerDamaged* activeAtk;
|
||||
static JQuad* ok_quad;
|
||||
static JTexture* ok_tex;
|
||||
Pos ok, enemy_avatar;
|
||||
vector<AttackerDamaged*> attackers;
|
||||
DamagerDamaged* current;
|
||||
|
||||
@@ -73,6 +73,7 @@ void GameStateDuel::Start()
|
||||
testSuite = NEW TestSuite(RESPATH"/test/_tests.txt",mParent->collection);
|
||||
#endif
|
||||
|
||||
resources.RetrieveTexture("OK.png",RETRIEVE_LOCK);
|
||||
|
||||
mGamePhase = DUEL_STATE_CHOOSE_DECK1;
|
||||
credits = NEW Credits();
|
||||
@@ -218,6 +219,7 @@ void GameStateDuel::End()
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
OutputDebugString("Ending GamestateDuel\n");
|
||||
#endif
|
||||
resources.Release(resources.RetrieveTexture("OK.png"));
|
||||
resources.SmallCache();
|
||||
SAFE_DELETE(deckmenu);
|
||||
JRenderer::GetInstance()->EnableVSync(false);
|
||||
|
||||
@@ -12,25 +12,21 @@ struct Left : public Exp { static inline bool test(DamagerDamaged* ref, DamagerD
|
||||
struct Right : public Exp { static inline bool test(DamagerDamaged* ref, DamagerDamaged* test)
|
||||
{ return ref->y == test->y && ref->x < test->x && test->show; } };
|
||||
|
||||
JQuad* GuiCombat::ok_quad = NULL;
|
||||
JTexture* GuiCombat::ok_tex = NULL;
|
||||
|
||||
GuiCombat::GuiCombat(GameObserver* go) : GuiLayer(), go(go), active(false), activeAtk(NULL),
|
||||
ok(SCREEN_WIDTH - MARGIN, 210, 1, 0, 255),
|
||||
enemy_avatar(SCREEN_WIDTH - MARGIN, TOP_LINE, 2, 0, 255),
|
||||
cursor_pos(NONE), step(DAMAGE)
|
||||
{
|
||||
if(NULL == ok_quad)
|
||||
if(NULL == ok_tex)
|
||||
{
|
||||
ok_quad = resources.RetrieveQuad("OK.png");
|
||||
if (ok_quad) ok_quad->SetHotSpot(28, 22);
|
||||
ok_tex = resources.RetrieveTexture("OK.png");
|
||||
}
|
||||
}
|
||||
|
||||
GuiCombat::~GuiCombat()
|
||||
{
|
||||
if(ok_quad)
|
||||
resources.Release(ok_quad);
|
||||
|
||||
for (inner_iterator it = attackers.begin(); it != attackers.end(); ++it)
|
||||
{
|
||||
for (vector<DefenserDamaged*>::iterator q = (*it)->blockers.begin(); q != (*it)->blockers.end(); ++q)
|
||||
@@ -277,7 +273,11 @@ void GuiCombat::Render()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok_quad) ok.Render(ok_quad);
|
||||
if (ok_tex) {
|
||||
JQuad *ok_quad = resources.RetrieveTempQuad("ok.png");
|
||||
ok_quad->SetHotSpot(28, 22);
|
||||
ok.Render(ok_quad);
|
||||
}
|
||||
renderer->DrawLine(0, SCREEN_HEIGHT / 2 + 10, SCREEN_WIDTH, SCREEN_HEIGHT / 2 + 10, ARGB(255, 255, 64, 0));
|
||||
if (FIRST_STRIKE == step)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user