mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 16:26:53 +00:00
SKY works with the new GMM implementation, also updated gui/newgui.cpp and prevented pushEvent from pushing more than one EVENT_QUIT into the artificialEventQueue
svn-id: r33041
This commit is contained in:
parent
e9c6b03fc7
commit
a6e1d6bd3d
@ -478,6 +478,12 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
||||
}
|
||||
|
||||
void DefaultEventManager::pushEvent(Common::Event event) {
|
||||
|
||||
// If already received an EVENT_QUIT, don't add another one
|
||||
if (event.type == Common::EVENT_QUIT) {
|
||||
if (!_shouldQuit)
|
||||
artificialEventQueue.push(event);
|
||||
} else
|
||||
artificialEventQueue.push(event);
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ void Control::doControlPanel(void) {
|
||||
_curButtonText = 0;
|
||||
uint16 clickRes = 0;
|
||||
|
||||
while (!quitPanel && !g_engine->_quit) {
|
||||
while (!quitPanel && !g_engine->quit()) {
|
||||
_text->drawToScreen(WITH_MASK);
|
||||
_system->updateScreen();
|
||||
_mouseClicked = false;
|
||||
@ -524,7 +524,7 @@ void Control::doControlPanel(void) {
|
||||
}
|
||||
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
|
||||
_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
|
||||
if (!g_engine->_quit)
|
||||
if (!g_engine->quit())
|
||||
_system->updateScreen();
|
||||
_skyScreen->forceRefresh();
|
||||
_skyScreen->setPaletteEndian((uint8 *)_skyCompact->fetchCpt(SkyEngine::_systemVars.currentPalette));
|
||||
@ -603,7 +603,7 @@ uint16 Control::handleClick(ConResource *pButton) {
|
||||
case QUIT_TO_DOS:
|
||||
animClick(pButton);
|
||||
if (getYesNo(quitDos))
|
||||
g_engine->_quit = true;
|
||||
g_engine->quitGame();
|
||||
return 0;
|
||||
default:
|
||||
error("Control::handleClick: unknown routine: %X",pButton->_onClick);
|
||||
@ -875,7 +875,7 @@ uint16 Control::saveRestorePanel(bool allowSave) {
|
||||
bool refreshNames = true;
|
||||
bool refreshAll = true;
|
||||
uint16 clickRes = 0;
|
||||
while (!quitPanel && !g_engine->_quit) {
|
||||
while (!quitPanel && !g_engine->quit()) {
|
||||
clickRes = 0;
|
||||
if (refreshNames || refreshAll) {
|
||||
if (refreshAll) {
|
||||
@ -1546,9 +1546,6 @@ void Control::delay(unsigned int amount) {
|
||||
case Common::EVENT_WHEELDOWN:
|
||||
_mouseWheel = 1;
|
||||
break;
|
||||
case Common::EVENT_QUIT:
|
||||
g_engine->_quit = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -2489,7 +2489,7 @@ bool Logic::fnFadeUp(uint32 a, uint32 b, uint32 c) {
|
||||
}
|
||||
|
||||
bool Logic::fnQuitToDos(uint32 a, uint32 b, uint32 c) {
|
||||
g_engine->_quit = true;
|
||||
g_engine->quitGame();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,6 @@ void Mouse::waitMouseNotPressed(int minDelay) {
|
||||
while (mousePressed || _system->getMillis() < now + minDelay) {
|
||||
|
||||
if (eventMan->shouldQuit()) {
|
||||
g_engine->_quit = true;
|
||||
minDelay = 0;
|
||||
mousePressed = false;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ int SkyEngine::go() {
|
||||
introSkipped = !_skyIntro->doIntro(_floppyIntro);
|
||||
}
|
||||
|
||||
if (!_quit) {
|
||||
if (!quit()) {
|
||||
_skyLogic->initScreen0();
|
||||
if (introSkipped)
|
||||
_skyControl->restartGame();
|
||||
@ -363,7 +363,7 @@ int SkyEngine::go() {
|
||||
_lastSaveTime = _system->getMillis();
|
||||
|
||||
uint32 delayCount = _system->getMillis();
|
||||
while (!_quit) {
|
||||
while (!quit()) {
|
||||
if (_debugger->isAttached())
|
||||
_debugger->onFrame();
|
||||
|
||||
@ -414,7 +414,7 @@ int SkyEngine::go() {
|
||||
_skyMusic->stopMusic();
|
||||
ConfMan.flushToDisk();
|
||||
delay(1500);
|
||||
return _rtl;
|
||||
return _eventMan->shouldRTL();
|
||||
}
|
||||
|
||||
int SkyEngine::init() {
|
||||
@ -610,9 +610,6 @@ void SkyEngine::delay(int32 amount) {
|
||||
_skyMouse->mouseMoved(event.mouse.x, event.mouse.y);
|
||||
_skyMouse->buttonPressed(1);
|
||||
break;
|
||||
case Common::EVENT_QUIT:
|
||||
_quit = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ void NewGui::runLoop() {
|
||||
Common::Event event;
|
||||
|
||||
while (eventMan->pollEvent(event)) {
|
||||
if (activeDialog != getTopDialog() && event.type != Common::EVENT_QUIT && event.type != Common::EVENT_SCREEN_CHANGED)
|
||||
if (activeDialog != getTopDialog() && event.type != Common::EVENT_SCREEN_CHANGED)
|
||||
continue;
|
||||
|
||||
Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y);
|
||||
|
Loading…
Reference in New Issue
Block a user