[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.29,1.30 interface.cpp,1.28,1.29 interface.h,1.10,1.11 scene.cpp,1.46,1.47 script.cpp,1.24,1.25 script.h,1.20,1.21 sfuncs.cpp,1.27,1.28 sthread.cpp,1.30,1.31
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Wed Oct 20 23:54:07 CEST 2004
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3285
Modified Files:
actor.cpp interface.cpp interface.h scene.cpp script.cpp
script.h sfuncs.cpp sthread.cpp
Log Message:
A bunch of mostly panel-related fixes for the ITE intro. Apart from the
numerous animation glitches, it's looking almost like the real thing now.
It's no longer possible to walk away during the intro. This should provide
a great incentive to implement the "Escape" feature. ;-)
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- actor.cpp 8 Oct 2004 19:58:49 -0000 1.29
+++ actor.cpp 21 Oct 2004 06:49:11 -0000 1.30
@@ -928,7 +928,10 @@
endpoint.x = (int)new_a_x / R_ACTOR_LMULT;
endpoint.y = (int)new_a_y / R_ACTOR_LMULT;
if ((exitNum = _vm->_scene->_actionMap->hitTest(endpoint)) != -1) {
- _vm->_scene->changeScene(_vm->_scene->_actionMap->getExitScene(exitNum));
+ // WORKAROUND: Only change room if the actor is Rif
+ // himself. We need to fix this properly later.
+ if (actor->id == 0)
+ _vm->_scene->changeScene(_vm->_scene->_actionMap->getExitScene(exitNum));
}
*complete_p = 1;
return R_FAILURE;
Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- interface.cpp 8 Oct 2004 19:58:49 -0000 1.28
+++ interface.cpp 21 Oct 2004 06:49:11 -0000 1.29
@@ -67,7 +67,9 @@
COMMAND_DEFAULT_BUTTON,
ITE_LPORTRAIT_X,
- ITE_LPORTRAIT_Y
+ ITE_LPORTRAIT_Y,
+ ITE_RPORTRAIT_X,
+ ITE_RPORTRAIT_Y
};
static R_INTERFACE_BUTTON ITE_c_buttons[] = {
@@ -109,7 +111,9 @@
COMMAND_DEFAULT_BUTTON,
IHNM_LPORTRAIT_X,
- IHNM_LPORTRAIT_Y
+ IHNM_LPORTRAIT_Y,
+ IHNM_RPORTRAIT_X,
+ IHNM_RPORTRAIT_Y
};
static R_INTERFACE_BUTTON IHNM_c_buttons[] = {
@@ -207,7 +211,9 @@
_dPanel.y = 149;
_cPanel.set_button = COMMAND_DEFAULT_BUTTON;
- _activePortrait = 0;
+ _scenePortraits = 0;
+ _leftPortrait = 0;
+ _rightPortrait = 0;
_activeVerb = I_VERB_WALKTO;
@@ -235,6 +241,15 @@
return R_SUCCESS;
}
+int Interface::setMode(R_PANEL_MODES mode) {
+ // TODO: Is this where we should hide/show the mouse cursor?
+
+ _panelMode = mode;
+ draw();
+
+ return R_SUCCESS;
+}
+
int Interface::setStatusText(const char *new_txt) {
assert(new_txt != NULL);
@@ -243,6 +258,27 @@
return R_SUCCESS;
}
+int Interface::loadScenePortraits(int res) {
+ if (_scenePortraits)
+ _vm->_sprite->freeSprite(_scenePortraits);
+
+ return _vm->_sprite->loadList(res, &_scenePortraits);
+}
+
+int Interface::setLeftPortrait(int portrait) {
+ _leftPortrait = portrait;
+ draw();
+
+ return R_SUCCESS;
+}
+
+int Interface::setRightPortrait(int portrait) {
+ _rightPortrait = portrait;
+ draw();
+
+ return R_SUCCESS;
+}
+
int Interface::draw() {
R_GAME_DISPLAYINFO g_di;
R_SURFACE *back_buf;
@@ -251,6 +287,8 @@
int ybase;
int lportrait_x;
int lportrait_y;
+ int rportrait_x;
+ int rportrait_y;
Rect rect;
Point origin;
@@ -298,7 +336,14 @@
lportrait_x = xbase + _iDesc.lportrait_x;
lportrait_y = ybase + _iDesc.lportrait_y;
- _vm->_sprite->draw(back_buf, _defPortraits, _activePortrait, lportrait_x, lportrait_y);
+ _vm->_sprite->draw(back_buf, _defPortraits, _leftPortrait, lportrait_x, lportrait_y);
+
+ if (_panelMode == PANEL_DIALOGUE && _iDesc.rportrait_x >= 0) {
+ rportrait_x = xbase + _iDesc.rportrait_x;
+ rportrait_y = ybase + _iDesc.rportrait_y;
+
+ _vm->_sprite->draw(back_buf, _scenePortraits, _rightPortrait, rportrait_x, rportrait_y);
+ }
return R_SUCCESS;
}
@@ -322,23 +367,25 @@
// Get game display info
GAME_GetDisplayInfo(&g_di);
- // Update playfield space ( only if cursor is inside )
- if (imouse_y < g_di.scene_h) {
- // Mouse is in playfield space
+ if (_panelMode == PANEL_COMMAND) {
+ // Update playfield space ( only if cursor is inside )
+ if (imouse_y < g_di.scene_h) {
+ // Mouse is in playfield space
+ if (update_flag == UPDATE_MOUSEMOVE) {
+ handlePlayfieldUpdate(back_buf, imousePt);
+ } else if (update_flag == UPDATE_MOUSECLICK) {
+ handlePlayfieldClick(back_buf, imousePt);
+ }
+ }
+
+ // Update command space
if (update_flag == UPDATE_MOUSEMOVE) {
- handlePlayfieldUpdate(back_buf, imousePt);
+ handleCommandUpdate(back_buf, imousePt);
} else if (update_flag == UPDATE_MOUSECLICK) {
- handlePlayfieldClick(back_buf, imousePt);
+ handleCommandClick(back_buf, imousePt);
}
}
- // Update command space
- if (update_flag == UPDATE_MOUSEMOVE) {
- handleCommandUpdate(back_buf, imousePt);
- } else if (update_flag == UPDATE_MOUSECLICK) {
- handleCommandClick(back_buf, imousePt);
- }
-
drawStatusBar(back_buf);
return R_SUCCESS;
Index: interface.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- interface.h 8 Oct 2004 19:58:49 -0000 1.10
+++ interface.h 21 Oct 2004 06:49:11 -0000 1.11
@@ -56,6 +56,8 @@
#define ITE_LPORTRAIT_X 5
#define ITE_LPORTRAIT_Y 4
+#define ITE_RPORTRAIT_X 274
+#define ITE_RPORTRAIT_Y 4
// IHNMAIMS interface values
#define IHNM_STATUS_Y 304
@@ -71,6 +73,8 @@
#define IHNM_LPORTRAIT_X 5
#define IHNM_LPORTRAIT_Y 4
+#define IHNM_RPORTRAIT_X -1
+#define IHNM_RPORTRAIT_Y -1
enum R_PANEL_MODES {
PANEL_COMMAND,
@@ -127,6 +131,8 @@
int cmd_defaultbutton;
int lportrait_x;
int lportrait_y;
+ int rportrait_x;
+ int rportrait_y;
};
struct R_INTERFACE_MODULE {
@@ -158,7 +164,11 @@
int registerLang();
int activate();
int deactivate();
+ int setMode(R_PANEL_MODES mode);
int setStatusText(const char *new_txt);
+ int loadScenePortraits(int res);
+ int setLeftPortrait(int portrait);
+ int setRightPortrait(int portrait);
int draw();
int update(const Point& imousePt, int update_flag);
@@ -182,8 +192,10 @@
R_INTERFACE_PANEL _cPanel;
R_INTERFACE_PANEL _dPanel;
char _statusText[R_STATUS_TEXT_LEN];
- int _activePortrait;
+ int _leftPortrait;
+ int _rightPortrait;
R_SPRITELIST *_defPortraits;
+ R_SPRITELIST *_scenePortraits;
int _activeVerb;
R_SCRIPT_THREAD *_iThread;
};
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- scene.cpp 16 Oct 2004 07:46:52 -0000 1.46
+++ scene.cpp 21 Oct 2004 06:49:11 -0000 1.47
@@ -30,6 +30,7 @@
#include "saga/animation.h"
#include "saga/console.h"
#include "saga/cvar_mod.h"
+#include "saga/interface.h"
#include "saga/events.h"
#include "saga/actionmap.h"
#include "saga/isomap.h"
@@ -789,7 +790,7 @@
warning("Scene::ProcessSceneResources(): Loading scene entries is not implemented");
break;
case SAGA_FACES:
- warning("Scene::ProcessSceneResources(): Loading scene faces is not implemented");
+ _vm->_interface->loadScenePortraits(_resList[i].res_number);
break;
default:
warning("Scene::ProcessSceneResources(): Encountered unknown resource type: %d", _resList[i].res_type);
Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- script.cpp 9 Oct 2004 07:39:45 -0000 1.24
+++ script.cpp 21 Oct 2004 06:49:11 -0000 1.25
@@ -58,6 +58,7 @@
int i, j;
//initialize member variables
+ _dbg_thread = 0;
_scriptContext = 0;
_voiceLUTPresent = false;
_scriptLUTEntryLen = 0;
Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- script.h 20 Oct 2004 22:38:24 -0000 1.20
+++ script.h 21 Oct 2004 06:49:11 -0000 1.21
@@ -236,8 +236,8 @@
int SF_sleep(R_SCRIPTFUNC_PARAMS);
int SF_takeObject(R_SCRIPTFUNC_PARAMS);
int SF_objectIsCarried(R_SCRIPTFUNC_PARAMS);
- int SF_setCommandText(R_SCRIPTFUNC_PARAMS);
- int SF_mainMode(R_SCRIPTFUNC_PARAMS);
+ int SF_setStatusText(R_SCRIPTFUNC_PARAMS);
+ int SF_commandMode(R_SCRIPTFUNC_PARAMS);
int SF_actorWalkTo(R_SCRIPTFUNC_PARAMS);
int SF_setFacing(R_SCRIPTFUNC_PARAMS);
int SF_startBgdAnim(R_SCRIPTFUNC_PARAMS);
Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- sfuncs.cpp 20 Oct 2004 22:38:24 -0000 1.27
+++ sfuncs.cpp 21 Oct 2004 06:49:11 -0000 1.28
@@ -47,8 +47,8 @@
{1, 1, OPCODE(SF_sleep)},
{2, 1, OPCODE(SF_takeObject)},
{3, 1, OPCODE(SF_objectIsCarried)},
- {4, 1, OPCODE(SF_setCommandText)},
- {5, 0, OPCODE(SF_mainMode)},
+ {4, 1, OPCODE(SF_setStatusText)},
+ {5, 0, OPCODE(SF_commandMode)},
{6, 3, OPCODE(SF_actorWalkTo)},
{7, 4, OPCODE(SF_doAction)},
{8, 2, OPCODE(SF_setFacing)},
@@ -163,18 +163,15 @@
// Script function #4 (0x04) nonblocking
// Set the command display to the specified text string
// Param1: dialogue index of string
-int Script::SF_setCommandText(R_SCRIPTFUNC_PARAMS) {
- SDataWord_T s_idx_parm;
-
- s_idx_parm = thread->pop();
- // INCOMPLETE
+int Script::SF_setStatusText(R_SCRIPTFUNC_PARAMS) {
+ SDataWord_T param = thread->pop();
- return R_SUCCESS;
+ return _vm->_interface->setStatusText(currentScript()->diag->str[param]);
}
// Script function #5 (0x05)
-int Script::SF_mainMode(R_SCRIPTFUNC_PARAMS) {
- return R_SUCCESS;
+int Script::SF_commandMode(R_SCRIPTFUNC_PARAMS) {
+ return _vm->_interface->setMode(PANEL_COMMAND);
}
// Script function #6 (0x06) blocking
@@ -279,7 +276,7 @@
// Script function #12 (0x0C)
// Disables mouse input, etc.
int Script::SF_dialogMode(R_SCRIPTFUNC_PARAMS) {
- return R_SUCCESS;
+ return _vm->_interface->setMode(PANEL_DIALOGUE);
}
// Script function #14 (0x0E)
@@ -533,15 +530,17 @@
// Script function #39 (0x27)
// Sets the right-hand portrait
int Script::SF_setRightPortrait(R_SCRIPTFUNC_PARAMS) {
- thread->pop();
- return R_SUCCESS;
+ SDataWord_T param = thread->pop();
+
+ return _vm->_interface->setRightPortrait(param);
}
// Script function #40 (0x28)
// Sets the left-hand portrait
int Script::SF_setLeftPortrait(R_SCRIPTFUNC_PARAMS) {
- thread->pop();
- return R_SUCCESS;
+ SDataWord_T param = thread->pop();
+
+ return _vm->_interface->setLeftPortrait(param);
}
// Script function #41 (0x29) nonblocking
Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- sthread.cpp 19 Oct 2004 16:51:26 -0000 1.30
+++ sthread.cpp 21 Oct 2004 06:49:11 -0000 1.31
@@ -726,7 +726,7 @@
} else {
voice_rn = currentScript()->voice->voices[data];
}
- _vm->_actor->speak(a_index, currentScript()->diag-> str[data], voice_rn, &thread->sem);
+ _vm->_actor->speak(a_index, currentScript()->diag->str[data], voice_rn, &thread->sem);
}
}
break;
More information about the Scummvm-git-logs
mailing list