TINSEL: Map BACKGROUND

And don't load a palette in Discworld Noir
This commit is contained in:
Einar Johan Trøan Sømåen 2021-02-16 23:05:28 +01:00
parent 70aa0e793d
commit 25c91b5213
No known key found for this signature in database
GPG Key ID: E78D26458077C9C5
2 changed files with 10 additions and 4 deletions

View File

@ -168,13 +168,14 @@ void Background::StartupBackground(CORO_PARAM, SCNHANDLE hFilm) {
CORO_BEGIN_CODE(_ctx);
const FILM *pfilm;
IMAGE *pim;
_hBackground = hFilm; // Save handle in case of Save_Scene()
pim = _vm->_cursor->GetImageFromFilm(hFilm, 0, NULL, NULL, &pfilm);
if (!TinselV3) {
IMAGE *pim = _vm->_cursor->GetImageFromFilm(hFilm, 0, NULL, NULL, &pfilm);
SetBackPal(FROM_32(pim->hImgPal));
SetBackPal(FROM_32(pim->hImgPal));
}
// Extract the film speed
_BGspeed = ONE_SECOND / FROM_32(pfilm->frate);

View File

@ -4216,6 +4216,11 @@ NoirMapping translateNoirLibCode(int libCode, int32 *pp) {
pp -= mapping.numArgs - 1;
debug(7, "%s(%08X)", mapping.name, pp[0]);
break;
case 18:
mapping = NoirMapping{"BACKGROUND", BACKGROUND, 1};
pp -= mapping.numArgs - 1;
debug(7, "%s(0x%08X)", mapping.name, pp[0]);
break;
case 28:
mapping = NoirMapping{"CDCHANGESCENE", CDCHANGESCENE, 1};
pp -= mapping.numArgs - 1;
@ -4462,7 +4467,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
return -14;
case BACKGROUND:
// Common to both DW1 & DW2
// Common to DW1 / DW2 / Noir
startBackground(coroParam, pp[0]);
return -1;