- Replaced static parts by per-instance parts of of several classes when they were not threadsafe (AIMomirPlayer, SimpleMenu, Trash, AIAction, MTGCardInstance, ATutorialMessage, MTGRules). The direct consequence is that we could consumme more memory. So, tell me if you have problems with low memory devices (PSP), there are some threadsafe optimizations that could be implemented if needed.
- Reworked the testsuite to be able to work multithreaded. This is deactivated by default everywhere except in QT_CONFIG as one testcase still refuses to pass in multithreaded mode. On my 4 cores linux desktop, the 650 tests passes now in 4 seconds (1 fails). - Replaced usage of CardSelectorSingleton by a card selector per game observer. - Modified the resource manager to be optionnal and per game observer instance instead of being a singleton. Two reasons here : threading AND Open Gl access. I only updated the crashing parts called from the game observer, so most of the code is still using the single instance. Beware of copy-paste concerning resources ... - Cleaned up the game observer constructors - Fixed several problems in action logging code while testing proliferate decks - Cleaned up Threading implementation based on QThread
This commit is contained in:
@@ -27,8 +27,6 @@ JTexture* SimpleMenu::spadeRTex = NULL;
|
||||
JTexture* SimpleMenu::spadeLTex = NULL;
|
||||
JTexture* SimpleMenu::jewelTex = NULL;
|
||||
JTexture* SimpleMenu::sideTex = NULL;
|
||||
WFont* SimpleMenu::titleFont = NULL;
|
||||
hgeParticleSystem* SimpleMenu::stars = NULL;
|
||||
|
||||
SimpleMenu::SimpleMenu(int id, JGuiListener* listener, int fontId, float x, float y, const char * _title, int _maxItems, bool centerHorizontal, bool centerVertical)
|
||||
: JGuiController(id, listener), fontId(fontId), mCenterHorizontal(centerHorizontal), mCenterVertical(centerVertical)
|
||||
@@ -58,14 +56,14 @@ SimpleMenu::SimpleMenu(int id, JGuiListener* listener, int fontId, float x, floa
|
||||
jewel.reset(NEW JQuad(jewelTex, 1, 1, 3, 3));
|
||||
side = WResourceManager::Instance()->RetrieveQuad("menuside.png", 1, 1, 1, kPoleWidth, "menuside", RETRIEVE_MANAGE);
|
||||
|
||||
if (NULL == stars)
|
||||
stars = NEW hgeParticleSystem(WResourceManager::Instance()->RetrievePSI("stars.psi", WResourceManager::Instance()->GetQuad("stars").get()));
|
||||
stars = NEW hgeParticleSystem(WResourceManager::Instance()->RetrievePSI("stars.psi", WResourceManager::Instance()->GetQuad("stars").get()));
|
||||
|
||||
stars->FireAt(mX, mY);
|
||||
}
|
||||
|
||||
SimpleMenu::~SimpleMenu()
|
||||
{
|
||||
SAFE_DELETE(stars);
|
||||
}
|
||||
|
||||
void SimpleMenu::drawHorzPole(float x, float y, float width)
|
||||
@@ -247,6 +245,5 @@ void SimpleMenu::Close()
|
||||
void SimpleMenu::destroy()
|
||||
{
|
||||
SimpleMenu::jewel.reset();
|
||||
SAFE_DELETE(SimpleMenu::stars);
|
||||
SAFE_DELETE(SimpleMenu::jewelTex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user