Skip to content

Commit

Permalink
HOPKINS: Bugfixes to the display of the starting menu
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 17, 2012
1 parent df41095 commit 044f9b8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
10 changes: 8 additions & 2 deletions engines/hopkins/hopkins.cpp
Expand Up @@ -38,6 +38,8 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe
_gameDescription(gameDesc), _randomSource("Hopkins"), _animationManager() {
g_vm = this;
_animationManager.setParent(this);
_menuManager.setParent(this);
_objectsManager.setParent(this);
_soundManager.setParent(this);
}

Expand Down Expand Up @@ -104,7 +106,8 @@ Common::Error HopkinsEngine::run() {
if (!GLOBALS.SORTIE) {
GLOBALS.SORTIE = _menuManager.MENU();
if (GLOBALS.SORTIE == -1) {
PUBQUIT();
if (!g_system->getEventManager()->shouldQuit())
PUBQUIT();
_globals.PERSO = _globals.dos_free2(_globals.PERSO);
REST_SYSTEM();
}
Expand All @@ -118,6 +121,9 @@ Common::Error HopkinsEngine::run() {
for (;;) {
for (;;) {
for (;;) {
if (g_system->getEventManager()->shouldQuit())
return Common::kNoError;

if (GLOBALS.SORTIE == 300)
goto LABEL_13;
if (GLOBALS.SORTIE == 18)
Expand Down Expand Up @@ -868,7 +874,7 @@ void HopkinsEngine::PUBQUIT() {

if (_eventsManager.BMOUSE() == 1)
mouseClicked = true;
} while (!mouseClicked && g_system->getEventManager()->shouldQuit());
} while (!mouseClicked && !g_system->getEventManager()->shouldQuit());

if ((unsigned int)(xp - 167) <= 302 && (unsigned int)(yp - 47) <= 387) {
warning("Try to Connect...");
Expand Down
16 changes: 13 additions & 3 deletions engines/hopkins/menu.cpp
Expand Up @@ -21,6 +21,7 @@
*/

#include "common/scummsys.h"
#include "common/events.h"
#include "hopkins/menu.h"
#include "hopkins/files.h"
#include "hopkins/hopkins.h"
Expand All @@ -36,8 +37,7 @@ void MenuManager::setParent(HopkinsEngine *vm) {
}

int MenuManager::MENU() {
signed int v0;
byte *v1;
byte *v1 = NULL;
signed int v2;
int v3;
int v4;
Expand All @@ -50,7 +50,7 @@ int MenuManager::MENU() {
signed int v12;

v6 = 0;
for (;;) {
while (!g_system->getEventManager()->shouldQuit()) {
_vm->_globals.FORET = 0;
_vm->_eventsManager.CASSE = 0;
_vm->_globals.DESACTIVE_INVENT = 1;
Expand Down Expand Up @@ -96,6 +96,9 @@ int MenuManager::MENU() {
v12 = 0;

do {
if (g_system->getEventManager()->shouldQuit())
return -1;

v2 = 0;
v3 = _vm->_eventsManager.XMOUSE();
v4 = _vm->_eventsManager.YMOUSE();
Expand Down Expand Up @@ -210,6 +213,13 @@ int MenuManager::MENU() {
_vm->INTRORUN();
continue;
}

if ( v2 == 5 ) {
AFFICHE_SPEED(v1, 230, 386, 14);
_vm->_eventsManager.VBL();
_vm->_eventsManager.delay(200);
v6 = -1;
}
break;
}

Expand Down
4 changes: 4 additions & 0 deletions engines/hopkins/objects.cpp
Expand Up @@ -31,6 +31,10 @@

namespace Hopkins {

void ObjectsManager::setParent(HopkinsEngine *vm) {
_vm = vm;
}

byte *ObjectsManager::CHANGE_OBJET(int objIndex) {
byte *result = ObjectsManager::CAPTURE_OBJET(objIndex, 1);
GLOBALS.Bufferobjet = result;
Expand Down
6 changes: 6 additions & 0 deletions engines/hopkins/objects.h
Expand Up @@ -29,8 +29,14 @@

namespace Hopkins {

class HopkinsEngine;

class ObjectsManager {
private:
HopkinsEngine *_vm;
public:
void setParent(HopkinsEngine *vm);

byte *CHANGE_OBJET(int objIndex);
byte *CAPTURE_OBJET(int objIndex, int mode);

Expand Down

0 comments on commit 044f9b8

Please sign in to comment.