Another change that looks bigger than it is: changed out the global extern WResourceManager to a real singleton. This means that it's no longer being init'ed at static initialization time, and we can debug construction/destruction properly; it's also safer in a multithreaded context.

This commit is contained in:
wrenczes@gmail.com
2010-12-01 08:22:17 +00:00
parent aa6aa20ba5
commit 65e38b0694
53 changed files with 369 additions and 346 deletions

View File

@@ -39,7 +39,7 @@ GuiCombat::GuiCombat(GameObserver* go) :
{
if (NULL == ok_tex)
{
ok_tex = resources.RetrieveTexture("Ok.png", RETRIEVE_LOCK);
ok_tex = WResourceManager::Instance()->RetrieveTexture("Ok.png", RETRIEVE_LOCK);
}
}
@@ -47,7 +47,7 @@ GuiCombat::~GuiCombat()
{
if (ok_tex)
{
resources.Release(ok_tex);
WResourceManager::Instance()->Release(ok_tex);
ok_tex = NULL;
}
@@ -391,7 +391,7 @@ void GuiCombat::Render()
{
go->opponent()->mAvatar->SetHotSpot(18, 25);
enemy_avatar.Render(go->opponent()->mAvatar);
WFont * mFont = resources.GetWFont(Fonts::MAIN_FONT);
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
mFont->SetColor(ARGB(255, 255, 64, 0));
{
char buf[10];
@@ -402,14 +402,14 @@ void GuiCombat::Render()
}
if (ok_tex)
{
JQuad *ok_quad = resources.RetrieveTempQuad("Ok.png");
JQuad *ok_quad = WResourceManager::Instance()->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)
{
WFont * mFont = resources.GetWFont(Fonts::MAIN_FONT);
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
mFont->SetColor(ARGB(255, 64, 255, 64));
mFont->DrawString("First strike damage", 370, 2);
}