[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.193,1.194 events.cpp,1.68,1.69 interface.cpp,1.143,1.144 isomap.cpp,1.61,1.62 saga.h,1.128,1.129 scene.cpp,1.150,1.151 scene.h,1.79,1.80 script.cpp,1.82,1.83 sfuncs.cpp,1.171,1.172 sprite.cpp,1.66,1.67
Eugene Sandulenko
sev at users.sourceforge.net
Sat Oct 8 08:21:38 CEST 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12105
Modified Files:
actor.cpp events.cpp interface.cpp isomap.cpp saga.h scene.cpp
scene.h script.cpp sfuncs.cpp sprite.cpp
Log Message:
_vm->getSceneHeight() --> _vm->_scene->getHeight() and make it return different
scene height for individual panel modes.
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- actor.cpp 7 Oct 2005 05:31:08 -0000 1.193
+++ actor.cpp 8 Oct 2005 15:20:11 -0000 1.194
@@ -22,27 +22,26 @@
*/
#include "saga/saga.h"
-#include "saga/gfx.h"
+#include "saga/actor.h"
#include "saga/animation.h"
#include "saga/console.h"
+#include "saga/events.h"
+#include "saga/gfx.h"
+#include "saga/interface.h"
+#include "saga/isomap.h"
+#include "saga/itedata.h"
+#include "saga/objectmap.h"
+#include "saga/resnames.h"
+#include "saga/rscfile.h"
#include "saga/script.h"
#include "saga/sndres.h"
#include "saga/sprite.h"
+#include "saga/stream.h"
#include "saga/font.h"
#include "saga/sound.h"
#include "saga/scene.h"
-#include "saga/isomap.h"
-#include "saga/actor.h"
-#include "saga/itedata.h"
-#include "saga/stream.h"
-#include "saga/interface.h"
-#include "saga/events.h"
-#include "saga/objectmap.h"
-#include "saga/rscfile.h"
-#include "saga/resnames.h"
-
#include "common/config-manager.h"
namespace Saga {
@@ -200,7 +199,7 @@
_protagState = 0;
_lastTickMsec = 0;
- _yCellCount = _vm->getSceneHeight();
+ _yCellCount = _vm->_scene->getHeight();
_xCellCount = _vm->getDisplayWidth();
_pathCell = (int8 *)malloc(_yCellCount * _xCellCount * sizeof(*_pathCell));
@@ -208,7 +207,7 @@
_pathRect.left = 0;
_pathRect.right = _vm->getDisplayWidth();
_pathRect.top = _vm->getDisplayInfo().pathStartY;
- _pathRect.bottom = _vm->getSceneHeight();
+ _pathRect.bottom = _vm->_scene->getHeight();
// Get actor resource file context
_actorContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
@@ -736,7 +735,7 @@
location.toScreenPointXY(point);
if ((point.x < 5) || (point.x >= _vm->getDisplayWidth() - 5) ||
- (point.y < 0) || (point.y > _vm->getSceneHeight())) {
+ (point.y < 0) || (point.y > _vm->_scene->getHeight())) {
return false;
}
@@ -1435,7 +1434,7 @@
_vm->_isoMap->tileCoordsToScreenPoint(commonObjectData->_location, commonObjectData->_screenPosition);
commonObjectData->_screenScale = 256;
} else {
- middle = _vm->getSceneHeight() - commonObjectData->_location.y / ACTOR_LMULT;
+ middle = _vm->_scene->getHeight() - commonObjectData->_location.y / ACTOR_LMULT;
_vm->_scene->getSlopes(beginSlope, endSlope);
@@ -1457,7 +1456,7 @@
result = commonObjectData->_screenPosition.x > -64 &&
commonObjectData->_screenPosition.x < _vm->getDisplayWidth() + 64 &&
commonObjectData->_screenPosition.y > -64 &&
- commonObjectData->_screenPosition.y < _vm->getSceneHeight() + 64;
+ commonObjectData->_screenPosition.y < _vm->_scene->getHeight() + 64;
return result;
}
@@ -1632,7 +1631,7 @@
calcScreenPosition(actor);
textPoint.x = clamp( 10, actor->_screenPosition.x - width / 2, _vm->getDisplayWidth() - 10 - width);
- textPoint.y = clamp( 10, actor->_screenPosition.y - 58, _vm->getSceneHeight() - 10 - height);
+ textPoint.y = clamp( 10, actor->_screenPosition.y - 58, _vm->_scene->getHeight() - 10 - height);
_vm->_font->textDraw((_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont), backBuffer, _activeSpeech.strings[0], textPoint,
_activeSpeech.speechColor[i], _activeSpeech.outlineColor[i], _activeSpeech.getFontFlags(i));
Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- events.cpp 5 Oct 2005 01:40:55 -0000 1.68
+++ events.cpp 8 Oct 2005 15:20:11 -0000 1.69
@@ -313,7 +313,7 @@
backGroundSurface->blit(bgInfo.bounds, bgInfo.buffer);
// If it is inset scene then draw black border
- if (bgInfo.bounds.width() < _vm->getDisplayWidth() || bgInfo.bounds.height() < _vm->getSceneHeight()) {
+ if (bgInfo.bounds.width() < _vm->getDisplayWidth() || bgInfo.bounds.height() < _vm->_scene->getHeight()) {
Common::Rect rect1(2, bgInfo.bounds.height() + 4);
Common::Rect rect2(bgInfo.bounds.width() + 4, 2);
Common::Rect rect3(2, bgInfo.bounds.height() + 4);
Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- interface.cpp 7 Oct 2005 15:36:28 -0000 1.143
+++ interface.cpp 8 Oct 2005 15:20:11 -0000 1.144
@@ -1330,8 +1330,8 @@
switch (_panelMode) {
case kPanelMain:
if (updateFlag & UPDATE_MOUSEMOVE) {
- bool lastWasPlayfield = _lastMousePoint.y < _vm->getSceneHeight();
- if (mousePoint.y < _vm->getSceneHeight()) {
+ bool lastWasPlayfield = _lastMousePoint.y < _vm->_scene->getHeight();
+ if (mousePoint.y < _vm->_scene->getHeight()) {
if (!lastWasPlayfield) {
handleMainUpdate(mousePoint);
}
@@ -1346,7 +1346,7 @@
} else {
if (updateFlag & UPDATE_MOUSECLICK) {
- if (mousePoint.y < _vm->getSceneHeight()) {
+ if (mousePoint.y < _vm->_scene->getHeight()) {
_vm->_script->playfieldClick(mousePoint, (updateFlag & UPDATE_LEFTBUTTONCLICK) != 0);
} else {
handleMainClick(mousePoint);
@@ -2280,7 +2280,7 @@
_mapPanelCrossHairState = !_mapPanelCrossHairState;
Point mapPosition = _vm->_isoMap->getMapPosition();
- Rect screen(_vm->getDisplayWidth(), _vm->getSceneHeight());
+ Rect screen(_vm->getDisplayWidth(), _vm->_scene->getHeight());
if (screen.contains(mapPosition)) {
_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _vm->_sprite->_mainSprites,
Index: isomap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/isomap.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- isomap.cpp 4 Sep 2005 17:40:16 -0000 1.61
+++ isomap.cpp 8 Oct 2005 15:20:11 -0000 1.62
@@ -296,7 +296,7 @@
playerPoint.y -= 28;
playerPoint.x += _viewScroll.x - _vm->getDisplayWidth()/2;
- playerPoint.y += _viewScroll.y - _vm->getSceneHeight()/2;
+ playerPoint.y += _viewScroll.y - _vm->_scene->getHeight()/2;
minScrollPos.x = playerPoint.x - SAGA_SCROLL_LIMIT_X1;
minScrollPos.y = playerPoint.y - SAGA_SCROLL_LIMIT_Y1;
@@ -417,8 +417,8 @@
if (_tileClip.top < 0) {
_tileClip.top = 0;
}
- if (_tileClip.bottom > _vm->getSceneHeight()) {
- _tileClip.bottom = _vm->getSceneHeight();
+ if (_tileClip.bottom > _vm->_scene->getHeight()) {
+ _tileClip.bottom = _vm->_scene->getHeight();
}
_vm->_sprite->drawClip(ds, clip, spritePointer, width, height, spriteBuffer);
@@ -457,7 +457,7 @@
metaTileY.y = (view1.y * 16 - fineScroll.y) - (u0 + v0) * 64;
workAreaWidth = _vm->getDisplayWidth() + 128;
- workAreaHeight = _vm->getSceneHeight() + 128 + 80;
+ workAreaHeight = _vm->_scene->getHeight() + 128 + 80;
for (u1 = u0, v1 = v0; metaTileY.y < workAreaHeight; u1--, v1-- ) {
metaTileX = metaTileY;
Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- saga.h 4 Oct 2005 23:38:19 -0000 1.128
+++ saga.h 8 Oct 2005 15:20:11 -0000 1.129
@@ -543,6 +543,8 @@
DetectedGameList GAME_ProbeGame(const FSList &fslist);
class SagaEngine : public Engine {
+ friend class Scene;
+
void errorString(const char *buf_input, char *buf_output);
protected:
@@ -655,9 +657,11 @@
//current game description
int _gameNumber;
GameDescription *_gameDescription;
- GameDisplayInfo _gameDisplayInfo;
Common::Rect _displayClip;
+protected:
+ GameDisplayInfo _gameDisplayInfo;
+
public:
int32 _frameCount;
@@ -690,7 +694,6 @@
const Common::Rect &getDisplayClip() const { return _displayClip;}
int getDisplayWidth() const { return _gameDisplayInfo.logicalWidth; }
int getDisplayHeight() const { return _gameDisplayInfo.logicalHeight;}
- int getSceneHeight() const { return _gameDisplayInfo.sceneHeight; }
const GameDisplayInfo & getDisplayInfo() { return _gameDisplayInfo; }
const char *getTextString(int textStringId);
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -d -r1.150 -r1.151
--- scene.cpp 6 Oct 2005 15:54:43 -0000 1.150
+++ scene.cpp 8 Oct 2005 15:20:11 -0000 1.151
@@ -455,8 +455,8 @@
_vm->_font->textDrawRect(kMediumFont, backBuffer, sceneSubstitutes[i].title,
Common::Rect(0, 7, _vm->getDisplayWidth(), 27), 1, 15, kFontOutline);
_vm->_font->textDrawRect(kMediumFont, backBuffer, sceneSubstitutes[i].message,
- Common::Rect(24, _vm->getSceneHeight() - 33, _vm->getDisplayWidth() - 11,
- _vm->getSceneHeight()), 1, 15, kFontOutline);
+ Common::Rect(24, getHeight() - 33, _vm->getDisplayWidth() - 11,
+ getHeight()), 1, 15, kFontOutline);
return;
}
}
@@ -479,8 +479,8 @@
}
void Scene::getSlopes(int &beginSlope, int &endSlope) {
- beginSlope = _vm->getSceneHeight() - _sceneDescription.beginSlope;
- endSlope = _vm->getSceneHeight() - _sceneDescription.endSlope;
+ beginSlope = getHeight() - _sceneDescription.beginSlope;
+ endSlope = getHeight() - _sceneDescription.endSlope;
}
void Scene::getBGInfo(BGInfo &bgInfo) {
@@ -493,8 +493,8 @@
bgInfo.bounds.left = (_vm->getDisplayWidth() - _bg.w) / 2;
}
- if (_bg.h < _vm->getSceneHeight()) {
- bgInfo.bounds.top = (_vm->getSceneHeight() - _bg.h) / 2;
+ if (_bg.h < getHeight()) {
+ bgInfo.bounds.top = (getHeight() - _bg.h) / 2;
}
bgInfo.bounds.setWidth(_bg.w);
@@ -696,12 +696,12 @@
_sceneClip.left = 0;
_sceneClip.top = 0;
_sceneClip.right = _vm->getDisplayWidth();
- _sceneClip.bottom = _vm->getSceneHeight();
+ _sceneClip.bottom = getHeight();
} else {
BGInfo backGroundInfo;
getBGInfo(backGroundInfo);
_sceneClip = backGroundInfo.bounds;
- if (!(_bg.w < _vm->getDisplayWidth() || _bg.h < _vm->getSceneHeight()))
+ if (!(_bg.w < _vm->getDisplayWidth() || _bg.h < getHeight()))
_outsetSceneNumber = _sceneNumber;
}
@@ -1043,7 +1043,7 @@
// At least in ITE the mask needs to be clipped.
_bgMask.w = MIN(_bgMask.w, _vm->getDisplayWidth());
- _bgMask.h = MIN(_bgMask.h, _vm->getSceneHeight());
+ _bgMask.h = MIN(_bgMask.h, getHeight());
debug(4, "BACKGROUND MASK width=%d height=%d length=%d", _bgMask.w, _bgMask.h, _bgMask.buf_len);
break;
@@ -1163,7 +1163,7 @@
} else {
backGroundSurface->getRect(rect);
if (_sceneClip.bottom < rect.bottom) {
- rect.bottom = _vm->getSceneHeight();
+ rect.bottom = getHeight();
}
backBuffer->blit(rect, (const byte *)backGroundSurface->pixels);
}
Index: scene.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.h,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- scene.h 4 Oct 2005 23:38:19 -0000 1.79
+++ scene.h 8 Oct 2005 15:20:11 -0000 1.80
@@ -29,6 +29,7 @@
#include "saga/font.h"
#include "saga/list.h"
#include "saga/actor.h"
+#include "saga/interface.h"
namespace Saga {
@@ -273,6 +274,14 @@
}
void drawTextList(Surface *ds);
+
+ int getHeight() const {
+ if (_vm->_interface->getMode() == kPanelChapterSelection)
+ return _vm->_gameDisplayInfo.logicalWidth;
+ else
+ return _vm->_gameDisplayInfo.sceneHeight;
+ }
+
private:
void loadScene(LoadSceneParams *loadSceneParams);
void loadSceneDescriptor(uint32 resourceId);
Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- script.cpp 16 Aug 2005 19:04:51 -0000 1.82
+++ script.cpp 8 Oct 2005 15:20:11 -0000 1.83
@@ -624,7 +624,7 @@
newRightButtonVerb = kVerbNone;
if (_vm->_actor->_protagonist->_currentAction != kActionWalkDir) {
- if (_vm->getSceneHeight() >= mousePoint.y) {
+ if (_vm->_scene->getHeight() >= mousePoint.y) {
newObjectId = _vm->_actor->hitTest(mousePoint, true);
if (newObjectId != ID_NOTHING) {
Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- sfuncs.cpp 7 Oct 2005 05:31:13 -0000 1.171
+++ sfuncs.cpp 8 Oct 2005 15:20:11 -0000 1.172
@@ -1289,7 +1289,7 @@
event.data = backBuffer;
event.param = 138;
event.param2 = 0;
- event.param3 = _vm->getSceneHeight();
+ event.param3 = _vm->_scene->getHeight();
event.param4 = 0;
event.param5 = _vm->getDisplayWidth();
@@ -1306,7 +1306,7 @@
textEntry.color = kITEColorBrightWhite;
textEntry.effectColor = kITEColorBlack;
textEntry.point.x = _vm->getDisplayWidth() / 2;
- textEntry.point.y = (_vm->getSceneHeight() - _vm->_font->getHeight(kMediumFont)) / 2;
+ textEntry.point.y = (_vm->_scene->getHeight() - _vm->_font->getHeight(kMediumFont)) / 2;
textEntry.fontId = kMediumFont;
textEntry.flags = (FontEffectFlags)(kFontOutline | kFontCentered);
textEntry.text = thread->_strings->getString(stringId);
Index: sprite.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- sprite.cpp 7 Oct 2005 10:44:48 -0000 1.66
+++ sprite.cpp 8 Oct 2005 15:20:11 -0000 1.67
@@ -118,6 +118,7 @@
spriteInfo->height = readS2.readUint16();
if (spriteInfo->width > 100) { // FIXME: HACK
+ warning("Width is too big: (%d x %d)", spriteInfo->width, spriteInfo->height);
spriteInfo->width = spriteInfo->height = 0;
}
spriteDataPointer = spritePointer + readS2.pos();
More information about the Scummvm-git-logs
mailing list