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:
@@ -21,7 +21,7 @@ SimpleMenuItem::SimpleMenuItem(SimpleMenu* _parent, int id, int fontId, string t
|
||||
|
||||
void SimpleMenuItem::RenderWithOffset(float yOffset)
|
||||
{
|
||||
WFont * mFont = resources.GetWFont(fontId);
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||
mFont->DrawString(mText.c_str(), mX, mY + yOffset, JGETEXT_CENTER);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void SimpleMenuItem::Relocate(float x, float y)
|
||||
|
||||
float SimpleMenuItem::GetWidth()
|
||||
{
|
||||
WFont * mFont = resources.GetWFont(fontId);
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||
mFont->SetScale(1.0);
|
||||
return mFont->GetStringWidth(mText.c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user