mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
TSAGE: Fixed core engine display of background scene objects
This commit is contained in:
parent
15c1d2d6c1
commit
0e6e35b7c6
@ -159,7 +159,7 @@ public:
|
||||
TicketBook _ticketBook;
|
||||
CompartmentDoor _compartmentDoor;
|
||||
SceneObject _dashboard;
|
||||
AltSceneObject _car;
|
||||
BackgroundSceneObject _car;
|
||||
NamedHotspot _item1;
|
||||
Ignition _ignition;
|
||||
Item3 _item3;
|
||||
|
@ -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);
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
virtual void process(Event &event);
|
||||
};
|
||||
|
||||
class UIElement: public AltSceneObject {
|
||||
class UIElement: public BackgroundSceneObject {
|
||||
public:
|
||||
int _field88;
|
||||
bool _enabled;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
@ -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();
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user