Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDB: Add engine for Hyperspace Delivery Boy #1805

Open
wants to merge 1,209 commits into
base: master
from

Conversation

@nipunG314
Copy link
Contributor

commented Aug 13, 2019

This adds a new engine to run the Monkeystone game Hyperspace Delivery Boy as described here: https://wiki.scummvm.org/index.php?title=Summer_of_Code/GSoC_Ideas_2019#Hyperspace_Delivery_Boy

HDB was originally built for the PocketPC and later on ported to Windows and Linux. This engine was originally built using the source code of the Windows version, and support for the PocketPC version was added later. As such, it has been thoroughly tested with the Windows data files, but not so with the data files for the other platforms. However, it should work similarly for the Linux data files which have been tested to a brief extent.

The PocketPC data files however will most likely not work. The source code for the PocketPC version had a number of breaking changes, and as such, the PocketPC support for the engine is still in development. It might work, but one should expect crashes.

Most of the levels are known completable with the exception of a few at the end which hasn't been playtested.

Known Issues:

  1. The PPC version crashes when starting a new game from the actual in-game menu. You can try to load it through the command-line
@sev-

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

Nice work!

@sev-

This comment has been minimized.

Copy link
Collaborator

commented on engines/hdb/gfx.cpp in 6a3b293 Aug 16, 2019

And why did you remove this?

sev- and others added some commits Aug 16, 2019

HDB: Draw all stars/snow in PPC version.
Along the way, this caught a buffer overflow, so sanity checks
were also implemented
strcpy(e->entityName, str1);

if (str2)
strcpy(e->printedName, str2);

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

Perhaps you could use Common::String instead?

return *it;
}

if (g_hdb->_map->laserBeamExist(x, y))

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

laserBeamExists() or laserBeamsExist()

*y = h->y;
return;
}
}

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

Same with these, perhaps Common::String could be used instead?

{ ITEM_PACKAGE, "ITEM_PACKAGE", &package[0], aiPackageInit, aiPackageInit2 },

{ END_AI_TYPES, NULL, NULL, NULL, NULL }
};

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

The function names and the corresponding LUA strings match, so we could use a define with a stringifying operator (#), e.g:

#define ADD_ENTITY(x) foobar(#x, &x)
}

void aiDeadWorkerInit(AIEntity *e) {
}

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

Did this have any code originally? If not, it should be removed altogether (same with aiAccountantInit() below)

} else if (_dataHeader.id == MKTAG('M', 'S', 'D', 'C')) {
// we're fine
} else if (_dataHeader.id == MKTAG('M', 'S', 'D', 'U')) {
debug("UNCOMPRESSED MSD FILE");

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

Same question as above

if (!g_hdb->isPPC()) {
turnOffSnow();
if (_snowInfo.active)
turnOnSnow();

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

So the PPC version has no snow effect? And the command is never called by the game scripts in that version?

if (g_hdb->isPPC())
CursorMan.showMouse(true);
else
_mousePointer[anim]->drawMasked(g_hdb->_input->getMouseX() - 16, g_hdb->_input->getMouseY() - 16);

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

Perhaps we could change all versions to use CursorMan for the mouse cursor?

}
if (!_lua->init()) {
error("LuaScript::init: Couldn't load the GLOBAL.LUA code.");
}

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

It would be preferable to move all these init methods in their corresponding constructors

for (i = 0; i < _width * _height; i++)
out->writeByte(_mapExpBarrels[i]);
for (i = 0; i < _width * _height; i++)
out->writeByte(_mapLaserBeams[i]);

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 16, 2019

Member

These write consecutive bytes, so they could be changed to out->write(foo, _width * _height)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.