mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
Removed the RF_PLACARD flag. Also, simplified sfPlaceActor and removed a non needed check
svn-id: r28901
This commit is contained in:
parent
5f1232a744
commit
c84ff65720
@ -390,7 +390,7 @@ int Events::handleOneShot(Event *event) {
|
||||
free(buf);
|
||||
free(resourceData);
|
||||
|
||||
// Draw the scene. It won't be drawn by Render::drawScene(), as the RF_PLACARD is set
|
||||
// Draw the scene. It won't be drawn by Render::drawScene(), as a placard is up
|
||||
_vm->_scene->draw();
|
||||
}
|
||||
break;
|
||||
@ -471,6 +471,9 @@ int Events::handleOneShot(Event *event) {
|
||||
case kEventSetFadeMode:
|
||||
_vm->_interface->setFadeMode(event->param);
|
||||
break;
|
||||
case kEventRestoreMode:
|
||||
_vm->_interface->restoreMode();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -92,6 +92,7 @@ enum EventOps {
|
||||
kEventSetStatus = 3,
|
||||
kEventClearStatus = 4,
|
||||
kEventSetFadeMode = 5,
|
||||
kEventRestoreMode = 6,
|
||||
// ACTOR events
|
||||
kEventMove = 1,
|
||||
// SCRIPT events
|
||||
|
@ -713,7 +713,7 @@ void Interface::setStatusText(const char *text, int statusColor) {
|
||||
assert(text != NULL);
|
||||
assert(strlen(text) < STATUS_TEXT_LEN);
|
||||
|
||||
if (_vm->_render->getFlags() & (RF_PLACARD | RF_MAP))
|
||||
if (_vm->_render->getFlags() & RF_MAP || _vm->_interface->getMode() == kPanelPlacard)
|
||||
return;
|
||||
|
||||
strncpy(_statusText, text, STATUS_TEXT_LEN);
|
||||
|
@ -85,11 +85,11 @@ void Render::drawScene() {
|
||||
// Get mouse coordinates
|
||||
mousePoint = _vm->mousePos();
|
||||
|
||||
if (!(_flags & (RF_DEMO_SUBST | RF_PLACARD | RF_MAP))) {
|
||||
// Display scene background
|
||||
_vm->_scene->draw();
|
||||
|
||||
if (!(_flags & (RF_DEMO_SUBST | RF_MAP) || _vm->_interface->getMode() == kPanelPlacard)) {
|
||||
if (_vm->_interface->getFadeMode() != kFadeOut) {
|
||||
// Display scene background
|
||||
_vm->_scene->draw();
|
||||
|
||||
if (_vm->_puzzle->isActive()) {
|
||||
_vm->_puzzle->movePiece(mousePoint);
|
||||
_vm->_actor->drawSpeech();
|
||||
|
@ -39,11 +39,10 @@ enum RENDER_FLAGS {
|
||||
RF_OBJECTMAP_TEST = (1 << 3),
|
||||
RF_RENDERPAUSE = (1 << 4),
|
||||
RF_GAMEPAUSE = (1 << 5),
|
||||
RF_PLACARD = (1 << 6),
|
||||
RF_ACTOR_PATH_TEST = (1 << 7),
|
||||
RF_MAP = (1 << 8),
|
||||
RF_DISABLE_ACTORS = (1 << 9),
|
||||
RF_DEMO_SUBST = (1 << 10)
|
||||
RF_ACTOR_PATH_TEST = (1 << 6),
|
||||
RF_MAP = (1 << 7),
|
||||
RF_DISABLE_ACTORS = (1 << 8),
|
||||
RF_DEMO_SUBST = (1 << 9)
|
||||
};
|
||||
|
||||
class Render {
|
||||
|
@ -739,15 +739,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
|
||||
|
||||
q_event = NULL;
|
||||
|
||||
//fix placard bug
|
||||
//i guess we should remove RF_PLACARD flag - and use _interface->getMode()
|
||||
event.type = kEvTOneshot;
|
||||
event.code = kGraphicsEvent;
|
||||
event.op = kEventClearFlag;
|
||||
event.param = RF_PLACARD;
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
if (loadSceneParams->transitionType == kTransitionFade) {
|
||||
|
||||
_vm->_interface->setFadeMode(kFadeOut);
|
||||
@ -1335,8 +1326,6 @@ void Scene::clearPlacard() {
|
||||
Event event;
|
||||
Event *q_event;
|
||||
|
||||
_vm->_interface->restoreMode();
|
||||
|
||||
_vm->_gfx->getCurrentPal(cur_pal);
|
||||
|
||||
event.type = kEvTImmediate;
|
||||
@ -1348,13 +1337,6 @@ void Scene::clearPlacard() {
|
||||
|
||||
q_event = _vm->_events->queue(&event);
|
||||
|
||||
event.type = kEvTOneshot;
|
||||
event.code = kGraphicsEvent;
|
||||
event.op = kEventClearFlag;
|
||||
event.param = RF_PLACARD;
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
event.type = kEvTOneshot;
|
||||
event.code = kTextEvent;
|
||||
event.op = kEventRemove;
|
||||
@ -1362,6 +1344,14 @@ void Scene::clearPlacard() {
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
event.type = kEvTImmediate;
|
||||
event.code = kInterfaceEvent;
|
||||
event.op = kEventRestoreMode;
|
||||
event.time = 0;
|
||||
event.duration = 0;
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
_vm->_scene->getBGPal(pal);
|
||||
|
||||
event.type = kEvTImmediate;
|
||||
@ -1425,13 +1415,6 @@ void Scene::showPsychicProfile(const char *text) {
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
event.type = kEvTOneshot;
|
||||
event.code = kGraphicsEvent;
|
||||
event.op = kEventSetFlag;
|
||||
event.param = RF_PLACARD;
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
// Set the background and palette for the psychic profile
|
||||
event.type = kEvTOneshot;
|
||||
event.code = kPsychicProfileBgEvent;
|
||||
@ -1484,6 +1467,7 @@ void Scene::showPsychicProfile(const char *text) {
|
||||
|
||||
void Scene::clearPsychicProfile() {
|
||||
if (_vm->_interface->getMode() == kPanelPlacard || _vm->getGameId() == GID_IHNM_DEMO) {
|
||||
_vm->_interface->restoreMode();
|
||||
_vm->_scene->clearPlacard();
|
||||
_vm->_scene->_textList.clear();
|
||||
_vm->_render->setFlag(RF_DISABLE_ACTORS);
|
||||
|
@ -1054,26 +1054,16 @@ void Script::sfPlaceActor(SCRIPTFUNC_PARAMS) {
|
||||
ActorData *actor = _vm->_actor->getActor(actorId);
|
||||
actor->_location.x = thread->pop();
|
||||
actor->_location.y = thread->pop();
|
||||
int actorDirection = thread->pop();
|
||||
actor->_facingDirection = actor->_actionDirection = thread->pop();
|
||||
int frameType = thread->pop();
|
||||
int frameOffset = thread->pop();
|
||||
ActorFrameRange *frameRange;
|
||||
|
||||
debug(1, "sfPlaceActor(id = 0x%x, x=%d, y=%d, dir=%d, frameType=%d, frameOffset=%d)", actorId, actor->_location.x,
|
||||
actor->_location.y, actorDirection, frameType, frameOffset);
|
||||
|
||||
actor->_facingDirection = actor->_actionDirection = actorDirection;
|
||||
|
||||
if (!actor->_frames)
|
||||
_vm->_actor->loadActorResources(actor); //? is not it already loaded ?
|
||||
actor->_location.y, actor->_facingDirection, frameType, frameOffset);
|
||||
|
||||
if (frameType >= 0) {
|
||||
frameRange = _vm->_actor->getActorFrameRange(actorId, frameType);
|
||||
|
||||
if (frameRange->frameCount <= frameOffset) {
|
||||
warning("Wrong frameOffset 0x%X", frameOffset);
|
||||
}
|
||||
|
||||
actor->_frameNumber = frameRange->frameIndex + frameOffset;
|
||||
actor->_currentAction = kActionFreeze;
|
||||
} else {
|
||||
@ -1207,13 +1197,6 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) {
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
event.type = kEvTOneshot;
|
||||
event.code = kGraphicsEvent;
|
||||
event.op = kEventSetFlag;
|
||||
event.param = RF_PLACARD;
|
||||
|
||||
q_event = _vm->_events->chain(q_event, &event);
|
||||
|
||||
event.type = kEvTOneshot;
|
||||
event.code = kGraphicsEvent;
|
||||
event.op = kEventFillRect;
|
||||
|
Loading…
Reference in New Issue
Block a user