mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 06:41:51 +00:00
Next batch of panel-related fixes. Still wrong.
NOTE: lines which start with `;' should contain calls to not yet implemented subsystems like Conversation subsystem svn-id: r16443
This commit is contained in:
parent
19f604b6ef
commit
26d5810b81
@ -81,10 +81,16 @@ int SagaEngine::processInput() {
|
||||
break;
|
||||
case 27: // Esc
|
||||
// Skip to next scene skip target
|
||||
if (!_interface->getMode() == kPanelNull) // FIXME: hack
|
||||
_actor->abortAllSpeeches();
|
||||
else
|
||||
_scene->skipScene();
|
||||
switch (_interface->getMode()) {
|
||||
case kPanelNull:
|
||||
if (_scene->isInDemo())
|
||||
_scene->skipScene();
|
||||
else
|
||||
_actor->abortAllSpeeches();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -238,7 +238,8 @@ Interface::Interface(SagaEngine *vm) : _vm(vm), _initialized(false) {
|
||||
_activeVerb = I_VERB_WALKTO;
|
||||
|
||||
_active = 0;
|
||||
_panelMode = _savedMode = kPanelNull;
|
||||
_panelMode = _savedMode = _lockedMode = kPanelNull;
|
||||
_inMainMode = false;
|
||||
*_statusText = 0;
|
||||
|
||||
_inventoryCount = 0;
|
||||
@ -274,6 +275,12 @@ int Interface::setMode(int mode) {
|
||||
// TODO: Is this where we should hide/show the mouse cursor?
|
||||
|
||||
_panelMode = mode;
|
||||
|
||||
if (_panelMode == kPanelConverse)
|
||||
_inMainMode = false;
|
||||
//else if (_panelMode == kPanelInventory)
|
||||
// _inMainMode = true;
|
||||
|
||||
draw();
|
||||
|
||||
return SUCCESS;
|
||||
@ -355,16 +362,19 @@ int Interface::draw() {
|
||||
lportrait.x = xbase + _iDesc.lportrait_x;
|
||||
lportrait.y = ybase + _iDesc.lportrait_y;
|
||||
|
||||
_vm->_sprite->draw(back_buf, _defPortraits, _leftPortrait, lportrait, 256);
|
||||
if (_panelMode == kPanelMain || _panelMode == kPanelConverse ||
|
||||
_lockedMode == kPanelMain || _lockedMode == kPanelConverse)
|
||||
_vm->_sprite->draw(back_buf, _defPortraits, _leftPortrait, lportrait, 256);
|
||||
|
||||
if (_panelMode == kPanelConverse && _iDesc.rportrait_x >= 0) {
|
||||
if (!_inMainMode && _iDesc.rportrait_x >= 0) {
|
||||
rportrait.x = xbase + _iDesc.rportrait_x;
|
||||
rportrait.y = ybase + _iDesc.rportrait_y;
|
||||
|
||||
_vm->_sprite->draw(back_buf, _scenePortraits, _rightPortrait, rportrait, 256);
|
||||
}
|
||||
|
||||
drawInventory();
|
||||
if (_inMainMode)
|
||||
drawInventory();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
@ -211,6 +211,9 @@ public:
|
||||
int getMode(void) { return _panelMode; }
|
||||
void rememberMode() { _savedMode = _panelMode; }
|
||||
void restoreMode() { _panelMode = _savedMode; }
|
||||
void lockMode() { _lockedMode = _panelMode; }
|
||||
void unlockMode() { _panelMode = _lockedMode; }
|
||||
bool isInMainMode() { return _inMainMode; }
|
||||
int setStatusText(const char *new_txt);
|
||||
int loadScenePortraits(int res);
|
||||
int setLeftPortrait(int portrait);
|
||||
@ -240,6 +243,8 @@ private:
|
||||
INTERFACE_DESC _iDesc;
|
||||
int _panelMode;
|
||||
int _savedMode;
|
||||
int _lockedMode;
|
||||
bool _inMainMode;
|
||||
INTERFACE_PANEL _cPanel;
|
||||
INTERFACE_PANEL _dPanel;
|
||||
char _statusText[STATUS_TEXT_LEN];
|
||||
|
@ -253,6 +253,9 @@ int RSC_LoadResource(RSCFILE_CONTEXT *rsc, uint32 res_num, byte **res_p, size_t
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(_vm->_features & GF_WYRMKEEP))
|
||||
substnum = -1;
|
||||
|
||||
if (substnum != -1) {
|
||||
File in;
|
||||
|
||||
|
@ -245,7 +245,11 @@ int SagaEngine::go() {
|
||||
if (msec > MAX_TIME_DELTA) {
|
||||
msec = MAX_TIME_DELTA;
|
||||
}
|
||||
_actor->direct(msec);
|
||||
if (_vm->_interface->getMode() == kPanelMain ||
|
||||
_vm->_interface->getMode() == kPanelConverse ||
|
||||
_vm->_interface->getMode() == kPanelNull)
|
||||
_actor->direct(msec);
|
||||
|
||||
_events->handleEvents(msec);
|
||||
_script->executeThreads(msec);
|
||||
}
|
||||
|
@ -1046,6 +1046,8 @@ int Scene::defaultScene(int param, SCENE_INFO *scene_info) {
|
||||
EVENT event;
|
||||
EVENT *q_event;
|
||||
|
||||
_inGame = true;
|
||||
|
||||
switch (param) {
|
||||
case SCENE_BEGIN:
|
||||
_vm->_sound->stopVoice();
|
||||
|
@ -234,6 +234,7 @@ class Scene {
|
||||
int draw(SURFACE *);
|
||||
int getMode();
|
||||
int getFlags() { return _desc.flags; }
|
||||
bool isInDemo() { return !_inGame; }
|
||||
|
||||
void getBGMaskInfo(int &width, int &height, byte *&buffer, size_t &bufferLength);
|
||||
int isBGMaskPresent() {
|
||||
|
@ -313,14 +313,14 @@ private:
|
||||
int SF_takeObject(SCRIPTFUNC_PARAMS);
|
||||
int SF_objectIsCarried(SCRIPTFUNC_PARAMS);
|
||||
int sfStatusBar(SCRIPTFUNC_PARAMS);
|
||||
int SF_commandMode(SCRIPTFUNC_PARAMS);
|
||||
int SF_mainMode(SCRIPTFUNC_PARAMS);
|
||||
int sfScriptWalkTo(SCRIPTFUNC_PARAMS);
|
||||
int SF_doAction(SCRIPTFUNC_PARAMS);
|
||||
int sfSetActorFacing(SCRIPTFUNC_PARAMS);
|
||||
int sfStartBgdAnim(SCRIPTFUNC_PARAMS);
|
||||
int sfStopBgdAnim(SCRIPTFUNC_PARAMS);
|
||||
int SF_freezeInterface(SCRIPTFUNC_PARAMS);
|
||||
int SF_dialogMode(SCRIPTFUNC_PARAMS);
|
||||
int sfLockUser(SCRIPTFUNC_PARAMS);
|
||||
int SF_preDialog(SCRIPTFUNC_PARAMS);
|
||||
int SF_killActorThreads(SCRIPTFUNC_PARAMS);
|
||||
int SF_faceTowards(SCRIPTFUNC_PARAMS);
|
||||
int sfSetFollower(SCRIPTFUNC_PARAMS);
|
||||
|
@ -52,14 +52,14 @@ void Script::setupScriptFuncList(void) {
|
||||
OPCODE(SF_takeObject),
|
||||
OPCODE(SF_objectIsCarried),
|
||||
OPCODE(sfStatusBar),
|
||||
OPCODE(SF_commandMode),
|
||||
OPCODE(SF_mainMode),
|
||||
OPCODE(sfScriptWalkTo),
|
||||
OPCODE(SF_doAction),
|
||||
OPCODE(sfSetActorFacing),
|
||||
OPCODE(sfStartBgdAnim),
|
||||
OPCODE(sfStopBgdAnim),
|
||||
OPCODE(SF_freezeInterface),
|
||||
OPCODE(SF_dialogMode),
|
||||
OPCODE(sfLockUser),
|
||||
OPCODE(SF_preDialog),
|
||||
OPCODE(SF_killActorThreads),
|
||||
OPCODE(SF_faceTowards),
|
||||
OPCODE(sfSetFollower),
|
||||
@ -192,8 +192,14 @@ int Script::sfStatusBar(SCRIPTFUNC_PARAMS) {
|
||||
}
|
||||
|
||||
// Script function #5 (0x05)
|
||||
int Script::SF_commandMode(SCRIPTFUNC_PARAMS) {
|
||||
return _vm->_interface->setMode(kPanelMain);
|
||||
int Script::SF_mainMode(SCRIPTFUNC_PARAMS) {
|
||||
; // center actor
|
||||
; // show verb
|
||||
_vm->_interface->activate();
|
||||
//_vm->_interface->setMode(kPanelInventory);
|
||||
; // set pointer verb
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// Script function #6 (0x06) blocking
|
||||
@ -278,7 +284,7 @@ int Script::sfStopBgdAnim(SCRIPTFUNC_PARAMS) {
|
||||
// continues to run. If the parameter is false, the user interface is
|
||||
// reenabled.
|
||||
// Param1: boolean
|
||||
int Script::SF_freezeInterface(SCRIPTFUNC_PARAMS) {
|
||||
int Script::sfLockUser(SCRIPTFUNC_PARAMS) {
|
||||
ScriptDataWord b_param;
|
||||
|
||||
b_param = thread->pop();
|
||||
@ -294,8 +300,16 @@ int Script::SF_freezeInterface(SCRIPTFUNC_PARAMS) {
|
||||
|
||||
// Script function #12 (0x0C)
|
||||
// Disables mouse input, etc.
|
||||
int Script::SF_dialogMode(SCRIPTFUNC_PARAMS) {
|
||||
return _vm->_interface->setMode(kPanelConverse);
|
||||
int Script::SF_preDialog(SCRIPTFUNC_PARAMS) {
|
||||
_vm->_interface->deactivate();
|
||||
; // clear converse text
|
||||
if (_vm->_interface->isInMainMode())
|
||||
_vm->_interface->setMode(kPanelConverse);
|
||||
else
|
||||
; // display zero text
|
||||
_vm->_interface->setMode(kPanelNull);
|
||||
|
||||
debug(1, "stub: SF_preDialog()");
|
||||
}
|
||||
|
||||
// Script function #13 (0x0D)
|
||||
@ -972,7 +986,6 @@ int Script::sfPlacardOff(SCRIPTFUNC_PARAMS) {
|
||||
PALENTRY *pal;
|
||||
|
||||
// Fade down
|
||||
_vm->_gfx->showCursor(false);
|
||||
_vm->_gfx->getCurrentPal(cur_pal);
|
||||
_vm->_gfx->palToBlackWait(back_buf, cur_pal, kNormalFadeDuration);
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "saga/gfx.h"
|
||||
#include "saga/actor.h"
|
||||
#include "saga/console.h"
|
||||
#include "saga/interface.h"
|
||||
|
||||
#include "saga/script.h"
|
||||
|
||||
@ -784,6 +785,10 @@ void Script::runThread(SCRIPT_THREAD *thread, int instr_limit) {
|
||||
break;
|
||||
// (DLGX): Run dialogue interface
|
||||
case 0x55:
|
||||
if (0) {
|
||||
_vm->_interface->activate();
|
||||
_vm->_interface->setMode(kPanelConverse);
|
||||
}
|
||||
warning("dialog_end opcode: stub");
|
||||
break;
|
||||
// (DLGO): Add a dialogue option to interface
|
||||
|
Loading…
x
Reference in New Issue
Block a user