mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 23:57:32 +00:00
Made changing of background more flexible, in that the engine can now configure its BackgroundInfo before passing it to Gfx.
svn-id: r33469
This commit is contained in:
parent
591973c827
commit
6ed4beb1bf
@ -831,15 +831,11 @@ void Gfx::freeItems() {
|
||||
_numItems = 0;
|
||||
}
|
||||
|
||||
|
||||
void Gfx::setBackground(uint type, const char* name, const char* mask, const char* path) {
|
||||
|
||||
void Gfx::setBackground(uint type, BackgroundInfo *info) {
|
||||
delete _backgroundInfo;
|
||||
_backgroundInfo = new BackgroundInfo;
|
||||
_backgroundInfo = info;
|
||||
|
||||
if (type == kBackgroundLocation) {
|
||||
_disk->loadScenery(*_backgroundInfo, name, mask, path);
|
||||
|
||||
// The PC version of BRA needs the entries 20-31 of the palette to be constant, but
|
||||
// the background resource files are screwed up. The right colors come from an unused
|
||||
// bitmap (pointer.bmp). Nothing is known about the Amiga version so far.
|
||||
@ -854,12 +850,10 @@ void Gfx::setBackground(uint type, const char* name, const char* mask, const cha
|
||||
setPalette(_backgroundInfo->palette);
|
||||
_palette.clone(_backgroundInfo->palette);
|
||||
} else {
|
||||
_disk->loadSlide(*_backgroundInfo, name);
|
||||
for (uint i = 0; i < 6; i++)
|
||||
_backgroundInfo->ranges[i]._flags = 0; // disable palette cycling for slides
|
||||
setPalette(_backgroundInfo->palette);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace Parallaction
|
||||
|
@ -512,7 +512,7 @@ public:
|
||||
|
||||
// background surface
|
||||
BackgroundInfo *_backgroundInfo;
|
||||
void setBackground(uint type, const char* name, const char* mask, const char* path);
|
||||
void setBackground(uint type, BackgroundInfo *info);
|
||||
void patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask = false);
|
||||
void grabBackground(const Common::Rect& r, Graphics::Surface &dst);
|
||||
void fillBackground(const Common::Rect& r, byte color);
|
||||
|
@ -72,9 +72,7 @@ public:
|
||||
|
||||
virtual void enter() {
|
||||
_vm->_gfx->clearScreen();
|
||||
_vm->_gfx->setBackground(kBackgroundSlide, _slideName.c_str(), 0, 0);
|
||||
_vm->_gfx->_backgroundInfo->x = (_vm->_screenWidth - _vm->_gfx->_backgroundInfo->width) >> 1;
|
||||
_vm->_gfx->_backgroundInfo->y = (_vm->_screenHeight - _vm->_gfx->_backgroundInfo->height) >> 1;
|
||||
_vm->showSlide(_slideName.c_str(), CENTER_LABEL_HORIZONTAL, CENTER_LABEL_VERTICAL);
|
||||
_vm->_input->setMouseState(MOUSE_DISABLED);
|
||||
|
||||
_startTime = g_system->getMillis();
|
||||
@ -215,11 +213,12 @@ public:
|
||||
|
||||
virtual void enter() {
|
||||
_vm->_gfx->clearScreen();
|
||||
_vm->_gfx->setBackground(kBackgroundSlide, "tbra", 0, 0);
|
||||
int x = 0, y = 0;
|
||||
if (_vm->getPlatform() == Common::kPlatformPC) {
|
||||
_vm->_gfx->_backgroundInfo->x = 20;
|
||||
_vm->_gfx->_backgroundInfo->y = 50;
|
||||
x = 20;
|
||||
y = 50;
|
||||
}
|
||||
_vm->showSlide("tbra", x, y);
|
||||
|
||||
// TODO: load progress from savefile
|
||||
int progress = 3;
|
||||
|
@ -289,7 +289,10 @@ void Parallaction::freeBackground() {
|
||||
|
||||
void Parallaction::setBackground(const char* name, const char* mask, const char* path) {
|
||||
|
||||
_gfx->setBackground(kBackgroundLocation, name, mask, path);
|
||||
BackgroundInfo *info = new BackgroundInfo;
|
||||
_disk->loadScenery(*info, name, mask, path);
|
||||
|
||||
_gfx->setBackground(kBackgroundLocation, info);
|
||||
_pathBuffer = &_gfx->_backgroundInfo->path;
|
||||
|
||||
return;
|
||||
|
@ -487,7 +487,7 @@ public:
|
||||
bool saveGame();
|
||||
|
||||
void switchBackground(const char* background, const char* mask);
|
||||
void showSlide(const char *name);
|
||||
void showSlide(const char *name, int x = 0, int y = 0);
|
||||
void setArrowCursor();
|
||||
|
||||
// TODO: this should be private!!!!!!!
|
||||
|
@ -253,8 +253,14 @@ void Parallaction_ns::switchBackground(const char* background, const char* mask)
|
||||
}
|
||||
|
||||
|
||||
void Parallaction_ns::showSlide(const char *name) {
|
||||
_gfx->setBackground(kBackgroundSlide, name, 0, 0);
|
||||
void Parallaction_ns::showSlide(const char *name, int x, int y) {
|
||||
BackgroundInfo *info = new BackgroundInfo;
|
||||
_disk->loadSlide(*info, name);
|
||||
|
||||
info->x = (x == CENTER_LABEL_HORIZONTAL) ? ((_vm->_screenWidth - info->width) >> 1) : x;
|
||||
info->y = (y == CENTER_LABEL_VERTICAL) ? ((_vm->_screenHeight - info->height) >> 1) : y;
|
||||
|
||||
_gfx->setBackground(kBackgroundSlide, info);
|
||||
}
|
||||
|
||||
void Parallaction_ns::runPendingZones() {
|
||||
|
@ -1178,8 +1178,7 @@ void LocationParser_br::parse(Script *script) {
|
||||
|
||||
LocationParser_ns::parse(script);
|
||||
|
||||
_vm->_gfx->setBackground(kBackgroundLocation, ctxt.bgName, ctxt.maskName, ctxt.pathName);
|
||||
_vm->_pathBuffer = &_vm->_gfx->_backgroundInfo->path;
|
||||
_vm->setBackground(ctxt.bgName, ctxt.maskName, ctxt.pathName);
|
||||
|
||||
if (ctxt.characterName) {
|
||||
_vm->changeCharacter(ctxt.characterName);
|
||||
|
Loading…
Reference in New Issue
Block a user