mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 07:53:12 +00:00
* Implemented LoadPalette, SetPalette and BlackPalette GPL commands.
* Used a more natural condition (whether the scheduled room number is different from the current room number) instead of the _roomChange hack. svn-id: r43391
This commit is contained in:
parent
fad77de234
commit
abf10049bb
@ -217,6 +217,7 @@ void Game::start() {
|
||||
void Game::init() {
|
||||
_shouldQuit = false;
|
||||
_shouldExitLoop = false;
|
||||
_scheduledPalette = 0;
|
||||
|
||||
_animUnderCursor = kOverlayImage;
|
||||
|
||||
@ -437,7 +438,7 @@ void Game::loop() {
|
||||
_vm->_system->delayMillis(20);
|
||||
|
||||
// HACK: Won't be needed once the game loop is implemented properly
|
||||
_shouldExitLoop = _shouldExitLoop || (_roomChange &&
|
||||
_shouldExitLoop = _shouldExitLoop || (_newRoom != _currentRoom._roomNum &&
|
||||
(_loopStatus == kStatusOrdinary || _loopStatus == kStatusGate));
|
||||
|
||||
} while (!shouldExitLoop());
|
||||
@ -1160,6 +1161,14 @@ int Game::getEscRoom() {
|
||||
return _currentRoom._escRoom;
|
||||
}
|
||||
|
||||
void Game::schedulePalette(int paletteID) {
|
||||
_scheduledPalette = paletteID;
|
||||
}
|
||||
|
||||
int Game::getScheduledPalette() {
|
||||
return _scheduledPalette;
|
||||
}
|
||||
|
||||
/**
|
||||
* The GPL command Mark sets the animation index (which specifies the order in which
|
||||
* animations were loaded in) which is then used by the Release command to delete
|
||||
|
@ -73,6 +73,10 @@ enum {
|
||||
kNoDialogue = -1, kDialogueLines = 4
|
||||
};
|
||||
|
||||
enum {
|
||||
kBlackPalette = -1
|
||||
};
|
||||
|
||||
enum SpeechConstants {
|
||||
kBaseSpeechDuration = 200,
|
||||
kSpeechTimeUnit = 400
|
||||
@ -293,6 +297,9 @@ public:
|
||||
void dialogueDone();
|
||||
void runDialogueProg(GPL2Program, int offset);
|
||||
|
||||
void schedulePalette(int paletteID);
|
||||
int getScheduledPalette();
|
||||
|
||||
bool _roomChange;
|
||||
|
||||
private:
|
||||
@ -341,6 +348,8 @@ public:
|
||||
int _animUnderCursor;
|
||||
|
||||
int _markedAnimationIndex; //!< Used by the Mark GPL command
|
||||
|
||||
int _scheduledPalette;
|
||||
};
|
||||
|
||||
} // End of namespace Draci
|
||||
|
@ -61,9 +61,9 @@ void Script::setupCommandList() {
|
||||
{ 10, 1, "WalkOn", 3, { 1, 1, 3 }, &Script::walkOn },
|
||||
{ 10, 2, "StayOn", 3, { 1, 1, 3 }, &Script::walkOn }, // HACK: not a proper implementation
|
||||
{ 10, 3, "WalkOnPlay", 3, { 1, 1, 3 }, &Script::walkOnPlay },
|
||||
{ 11, 1, "LoadPalette", 1, { 2 }, NULL },
|
||||
{ 12, 1, "SetPalette", 0, { 0 }, NULL },
|
||||
{ 12, 2, "BlackPalette", 0, { 0 }, NULL },
|
||||
{ 11, 1, "LoadPalette", 1, { 2 }, &Script::loadPalette },
|
||||
{ 12, 1, "SetPalette", 0, { 0 }, &Script::setPalette },
|
||||
{ 12, 2, "BlackPalette", 0, { 0 }, &Script::blackPalette },
|
||||
{ 13, 1, "FadePalette", 3, { 1, 1, 1 }, NULL },
|
||||
{ 13, 2, "FadePalettePlay", 3, { 1, 1, 1 }, NULL },
|
||||
{ 14, 1, "NewRoom", 2, { 3, 1 }, &Script::newRoom },
|
||||
@ -716,6 +716,28 @@ void Script::roomMap(Common::Queue<int> ¶ms) {
|
||||
_vm->_game->loadWalkingMap();
|
||||
}
|
||||
|
||||
void Script::loadPalette(Common::Queue<int> ¶ms) {
|
||||
int palette = params.pop() - 1;
|
||||
|
||||
_vm->_game->schedulePalette(palette);
|
||||
}
|
||||
|
||||
void Script::blackPalette(Common::Queue<int> ¶ms) {
|
||||
|
||||
_vm->_game->schedulePalette(kBlackPalette);
|
||||
}
|
||||
|
||||
void Script::setPalette(Common::Queue<int> ¶ms) {
|
||||
|
||||
if (_vm->_game->getScheduledPalette() == -1) {
|
||||
_vm->_screen->setPaletteEmpty();
|
||||
} else {
|
||||
BAFile *f;
|
||||
f = _vm->_paletteArchive->getFile(_vm->_game->getScheduledPalette());
|
||||
_vm->_screen->setPalette(f->_data, 0, kNumColours);
|
||||
}
|
||||
}
|
||||
|
||||
void Script::endCurrentProgram() {
|
||||
_endProgram = true;
|
||||
}
|
||||
|
@ -127,6 +127,9 @@ private:
|
||||
void resetDialogue(Common::Queue<int> ¶ms);
|
||||
void resetDialogueFrom(Common::Queue<int> ¶ms);
|
||||
void resetBlock(Common::Queue<int> ¶ms);
|
||||
void setPalette(Common::Queue<int> ¶ms);
|
||||
void blackPalette(Common::Queue<int> ¶ms);
|
||||
void loadPalette(Common::Queue<int> ¶ms);
|
||||
|
||||
int operAnd(int op1, int op2);
|
||||
int operOr(int op1, int op2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user