TSAGE: Fixed core engine display of background scene objects

This commit is contained in:
Paul Gilbert 2011-09-24 17:52:03 +10:00
parent 15c1d2d6c1
commit 0e6e35b7c6
8 changed files with 20 additions and 19 deletions

View File

@ -159,7 +159,7 @@ public:
TicketBook _ticketBook;
CompartmentDoor _compartmentDoor;
SceneObject _dashboard;
AltSceneObject _car;
BackgroundSceneObject _car;
NamedHotspot _item1;
Ignition _ignition;
Item3 _item3;

View File

@ -38,7 +38,7 @@ void StripProxy::process(Event &event) {
/*--------------------------------------------------------------------------*/
void UIElement::synchronize(Serializer &s) {
AltSceneObject::synchronize(s);
BackgroundSceneObject::synchronize(s);
s.syncAsSint16LE(_field88);
s.syncAsSint16LE(_enabled);
s.syncAsSint16LE(_frameNum);

View File

@ -39,7 +39,7 @@ public:
virtual void process(Event &event);
};
class UIElement: public AltSceneObject {
class UIElement: public BackgroundSceneObject {
public:
int _field88;
bool _enabled;

View File

@ -2528,17 +2528,18 @@ void SceneObject::setup(int visage, int stripFrameNum, int frameNum, int posX, i
/*--------------------------------------------------------------------------*/
void AltSceneObject::postInit(SceneObjectList *OwnerList) {
SceneObject::postInit(&_globals->_sceneManager._altSceneObjects);
void BackgroundSceneObject::postInit(SceneObjectList *OwnerList) {
SceneObject::postInit(&_globals->_sceneManager._bgSceneObjects);
}
void AltSceneObject::draw() {
void BackgroundSceneObject::draw() {
assert(_globals->_sceneManager._scene);
Rect destRect = _bounds;
destRect.translate(-_globals->_sceneManager._scene->_sceneBounds.left,
-_globals->_sceneManager._scene->_sceneBounds.top);
Region *priorityRegion = _globals->_sceneManager._scene->_priorities.find(_priority);
GfxSurface frame = getFrame();
_globals->_gfxManagerInstance.copyFrom(frame, destRect, priorityRegion);
_globals->_sceneManager._scene->_backSurface.copyFrom(frame, destRect, priorityRegion);
}
/*--------------------------------------------------------------------------*/

View File

@ -606,9 +606,9 @@ public:
void setup(int visage, int stripFrameNum, int frameNum, int posX, int posY, int priority);
};
class AltSceneObject: public SceneObject {
class BackgroundSceneObject: public SceneObject {
public:
virtual Common::String getClassName() { return "AltObjectExt"; }
virtual Common::String getClassName() { return "BackgroundSceneObject"; }
virtual void postInit(SceneObjectList *OwnerList = NULL);
virtual void draw();
};

View File

@ -37,7 +37,7 @@ Scene2::Scene2() : Scene() {
/*--------------------------------------------------------------------------*/
void Object9350::postInit(SceneObjectList *OwnerList) {
//SceneObject::postInit(&_globals->_sceneManager._altSceneObjects);
//SceneObject::postInit(&_globals->_sceneManager._bgSceneObjects);
SceneObject::postInit(OwnerList);
}

View File

@ -81,7 +81,7 @@ void SceneManager::sceneChange() {
}
// Clear the secondary scene object list
_altSceneObjects.clear();
_bgSceneObjects.clear();
// Clear the hotspot list
SynchronizedList<SceneItem *>::iterator ii = _globals->_sceneItems.begin();
@ -234,7 +234,7 @@ void SceneManager::listenerSynchronize(Serializer &s) {
// in order for the savegame loading to work correctly
_globals->_sceneManager._scene = new Scene();
_altSceneObjects.synchronize(s);
_bgSceneObjects.synchronize(s);
s.syncAsSint32LE(_sceneNumber);
s.syncAsUint16LE(_globals->_sceneManager._scene->_activeScreenNumber);
@ -442,16 +442,16 @@ void Scene::refreshBackground(int xAmount, int yAmount) {
}
if (changedFlag) {
drawAltObjects();
drawBackgroundObjects();
}
}
void Scene::drawAltObjects() {
void Scene::drawBackgroundObjects() {
Common::Array<SceneObject *> objList;
// Initial loop to set the priority for entries in the list
for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneManager._altSceneObjects.begin();
i != _globals->_sceneManager._altSceneObjects.end(); ++i) {
for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneManager._bgSceneObjects.begin();
i != _globals->_sceneManager._bgSceneObjects.end(); ++i) {
SceneObject *obj = *i;
objList.push_back(obj);
@ -463,7 +463,7 @@ void Scene::drawAltObjects() {
}
// Sort the list by priority
_globals->_sceneManager._altSceneObjects.sortList(objList);
_globals->_sceneManager._bgSceneObjects.sortList(objList);
// Drawing loop
for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) {

View File

@ -33,7 +33,7 @@ namespace TsAGE {
class Scene : public StripCallback {
private:
void drawAltObjects();
void drawBackgroundObjects();
public:
int _field12;
int _screenNumber;
@ -86,7 +86,7 @@ public:
Common::Point _sceneBgOffset;
int _sceneLoadCount;
Rect _scrollerRect;
SceneObjectList _altSceneObjects;
SceneObjectList _bgSceneObjects;
int _objectCount;
public:
SceneManager();