void BadaAppForm::pushEvent(Common::EventType type, const Point ¤tPosition) { BadaSystem *system = (BadaSystem *)g_system; BadaGraphicsManager *graphics = system->getGraphics(); if (graphics) { // graphics could be NULL at startup or when // displaying the system error screen Common::Event e; e.type = type; e.mouse.x = currentPosition.x; e.mouse.y = currentPosition.y > MIN_TOUCH_Y ? currentPosition.y : 1; bool moved = graphics->moveMouse(e.mouse.x, e.mouse.y); _eventQueueLock->Acquire(); if (moved && type != Common::EVENT_MOUSEMOVE) { Common::Event moveEvent; moveEvent.type = Common::EVENT_MOUSEMOVE; moveEvent.mouse = e.mouse; _eventQueue.push(moveEvent); } _eventQueue.push(e); _eventQueueLock->Release(); } }
void BadaAppForm::pushEvent(Common::EventType type, const Point& currentPosition) { BadaSystem* system = (BadaSystem*) g_system; BadaGraphicsManager* graphics = system->getGraphics(); if (graphics) { Common::Event e; e.type = type; e.mouse.x = currentPosition.x; e.mouse.y = currentPosition.y; bool moved = graphics->moveMouse(e.mouse.x, e.mouse.y); _eventQueueLock->Acquire(); if (moved && type != Common::EVENT_MOUSEMOVE) { Common::Event moveEvent; moveEvent.type = Common::EVENT_MOUSEMOVE; moveEvent.mouse = e.mouse; _eventQueue.push(moveEvent); } _eventQueue.push(e); _eventQueueLock->Release(); } }
BadaScummVM::~BadaScummVM() { logEntered(); if (g_system) { BadaSystem *system = (BadaSystem *)g_system; system->destroyBackend(); delete system; g_system = 0; } }
void BadaEventManager::init() { DefaultEventManager::init(); // theme and vkbd should have now loaded - clear the splash screen BadaSystem *system = (BadaSystem *)g_system; BadaGraphicsManager *graphics = system->getGraphics(); if (graphics) { graphics->setReady(); graphics->updateScreen(); } }
result BadaAppForm::OnDraw(void) { logEntered(); if (g_system) { BadaSystem* system = (BadaSystem*) g_system; BadaGraphicsManager* graphics = system->getGraphics(); if (graphics && graphics->isReady()) { g_system->updateScreen(); } } return E_SUCCESS; }
// // display a fatal error notification // void systemError(const char *message) { AppLog("Fatal system error: %s", message); ArrayList *args = new ArrayList(); args->Construct(); args->Add(*(new String(message))); Application::GetInstance()->SendUserEvent(USER_MESSAGE_EXIT_ERR, args); if (g_system) { BadaSystem *system = (BadaSystem *)g_system; system->exitSystem(); } }
result BadaAppForm::Construct() { result r = Form::Construct(Controls::FORM_STYLE_NORMAL); if (IsFailed(r)) { return r; } BadaSystem* badaSystem = null; _gameThread = null; badaSystem = new BadaSystem(this); r = badaSystem != null ? E_SUCCESS : E_OUT_OF_MEMORY; if (!IsFailed(r)) { r = badaSystem->Construct(); } if (!IsFailed(r)) { _gameThread = new Thread(); r = _gameThread != null ? E_SUCCESS : E_OUT_OF_MEMORY; } if (!IsFailed(r)) { r = _gameThread->Construct(*this); } if (IsFailed(r)) { if (badaSystem != null) { delete badaSystem; } if (_gameThread != null) { delete _gameThread; _gameThread = null; } } else { g_system = badaSystem; } return r; }
int BadaEventManager::shouldQuit() const { BadaSystem *system = (BadaSystem *)g_system; return DefaultEventManager::shouldQuit() || system->isClosing(); }