STARK: Collect the render entries from the location and render them
This commit is contained in:
parent
328cbdc32b
commit
495e8e2611
13 changed files with 172 additions and 17 deletions
|
@ -28,7 +28,18 @@
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
||||||
|
RenderEntry::RenderEntry(Resource *owner, const Common::String &name) :
|
||||||
|
_visual(nullptr),
|
||||||
|
_name(name),
|
||||||
|
_owner(owner) {
|
||||||
|
}
|
||||||
|
|
||||||
void RenderEntry::update(uint32 delta) {
|
void RenderEntry::update(uint32 delta) {
|
||||||
|
if (!_visual) {
|
||||||
|
// warning("No visual for render entry '%s'", _name.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
VisualActor *actor = _visual->get<VisualActor>();
|
VisualActor *actor = _visual->get<VisualActor>();
|
||||||
if (actor) {
|
if (actor) {
|
||||||
actor->update(delta);
|
actor->update(delta);
|
||||||
|
@ -36,6 +47,11 @@ void RenderEntry::update(uint32 delta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderEntry::render(GfxDriver *gfx) {
|
void RenderEntry::render(GfxDriver *gfx) {
|
||||||
|
if (!_visual) {
|
||||||
|
// warning("No visual for render entry '%s'", _name.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
VisualImageXMG *imageXMG = _visual->get<VisualImageXMG>();
|
VisualImageXMG *imageXMG = _visual->get<VisualImageXMG>();
|
||||||
if (imageXMG) {
|
if (imageXMG) {
|
||||||
imageXMG->render(gfx, _position);
|
imageXMG->render(gfx, _position);
|
||||||
|
|
|
@ -23,15 +23,19 @@
|
||||||
#ifndef STARK_GFX_RENDER_ENTRY_H
|
#ifndef STARK_GFX_RENDER_ENTRY_H
|
||||||
#define STARK_GFX_RENDER_ENTRY_H
|
#define STARK_GFX_RENDER_ENTRY_H
|
||||||
|
|
||||||
|
#include "common/array.h"
|
||||||
#include "common/rect.h"
|
#include "common/rect.h"
|
||||||
|
#include "common/str.h"
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
||||||
class Visual;
|
|
||||||
class GfxDriver;
|
class GfxDriver;
|
||||||
|
class Resource;
|
||||||
|
class Visual;
|
||||||
|
|
||||||
class RenderEntry {
|
class RenderEntry {
|
||||||
public:
|
public:
|
||||||
|
RenderEntry(Resource *owner, const Common::String &name);
|
||||||
virtual ~RenderEntry() {};
|
virtual ~RenderEntry() {};
|
||||||
|
|
||||||
void update(uint32 delta); // TODO: Remove
|
void update(uint32 delta); // TODO: Remove
|
||||||
|
@ -41,10 +45,15 @@ public:
|
||||||
void setPosition(const Common::Point &position);
|
void setPosition(const Common::Point &position);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Common::String _name;
|
||||||
|
Resource *_owner;
|
||||||
|
|
||||||
Visual *_visual;
|
Visual *_visual;
|
||||||
Common::Point _position;
|
Common::Point _position;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef Common::Array<RenderEntry *> RenderEntryArray;
|
||||||
|
|
||||||
} // End of namespace Stark
|
} // End of namespace Stark
|
||||||
|
|
||||||
#endif // STARK_GFX_RENDER_ENTRY_H
|
#endif // STARK_GFX_RENDER_ENTRY_H
|
||||||
|
|
|
@ -110,6 +110,10 @@ void AnimHierarchy::selectItemAnim(ItemVisual *item) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Anim *AnimHierarchy::getCurrentAnim() {
|
||||||
|
return _currentAnim;
|
||||||
|
}
|
||||||
|
|
||||||
void AnimHierarchy::printData() {
|
void AnimHierarchy::printData() {
|
||||||
for (uint i = 0; i < _animationReferences.size(); i++) {
|
for (uint i = 0; i < _animationReferences.size(); i++) {
|
||||||
debug("anim %d: %s", i, _animationReferences[i].describe().c_str());
|
debug("anim %d: %s", i, _animationReferences[i].describe().c_str());
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
void unselectItemAnim(ItemVisual *item);
|
void unselectItemAnim(ItemVisual *item);
|
||||||
void selectItemAnim(ItemVisual *item);
|
void selectItemAnim(ItemVisual *item);
|
||||||
|
|
||||||
|
Anim *getCurrentAnim();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "engines/stark/resources/item.h"
|
||||||
|
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
|
|
||||||
#include "engines/stark/resources/item.h"
|
#include "engines/stark/gfx/renderentry.h"
|
||||||
|
#include "engines/stark/resources/anim.h"
|
||||||
#include "engines/stark/resources/animhierarchy.h"
|
#include "engines/stark/resources/animhierarchy.h"
|
||||||
#include "engines/stark/xrcreader.h"
|
#include "engines/stark/xrcreader.h"
|
||||||
|
|
||||||
|
@ -31,11 +34,11 @@ namespace Stark {
|
||||||
Resource *Item::construct(Resource *parent, byte subType, uint16 index, const Common::String &name) {
|
Resource *Item::construct(Resource *parent, byte subType, uint16 index, const Common::String &name) {
|
||||||
switch (subType) {
|
switch (subType) {
|
||||||
case kItemSub1:
|
case kItemSub1:
|
||||||
return new UnimplementedResource(parent, TYPE, subType, index, name);
|
return new Item(parent, subType, index, name); // TODO
|
||||||
case kItemSub2:
|
case kItemSub2:
|
||||||
return new UnimplementedResource(parent, TYPE, subType, index, name);
|
return new Item(parent, subType, index, name); // TODO
|
||||||
case kItemSub3:
|
case kItemSub3:
|
||||||
return new UnimplementedResource(parent, TYPE, subType, index, name);
|
return new Item(parent, subType, index, name); // TODO
|
||||||
case kItemSub5:
|
case kItemSub5:
|
||||||
case kItemSub6:
|
case kItemSub6:
|
||||||
return new ItemSub56(parent, subType, index, name);
|
return new ItemSub56(parent, subType, index, name);
|
||||||
|
@ -43,7 +46,7 @@ Resource *Item::construct(Resource *parent, byte subType, uint16 index, const Co
|
||||||
case kItemSub8:
|
case kItemSub8:
|
||||||
return new ItemSub78(parent, subType, index, name);
|
return new ItemSub78(parent, subType, index, name);
|
||||||
case kItemSub10:
|
case kItemSub10:
|
||||||
return new UnimplementedResource(parent, TYPE, subType, index, name);
|
return new Item(parent, subType, index, name); // TODO
|
||||||
default:
|
default:
|
||||||
error("Unknown item subtype %d", subType);
|
error("Unknown item subtype %d", subType);
|
||||||
}
|
}
|
||||||
|
@ -64,19 +67,26 @@ void Item::readData(XRCReadStream *stream) {
|
||||||
_field_38 = stream->readSint32LE();
|
_field_38 = stream->readSint32LE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RenderEntry *Item::getRenderEntry() {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void Item::printData() {
|
void Item::printData() {
|
||||||
debug("field_34: %d", _field_34);
|
debug("field_34: %d", _field_34);
|
||||||
debug("field_38: %d", _field_38);
|
debug("field_38: %d", _field_38);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemVisual::~ItemVisual() {
|
ItemVisual::~ItemVisual() {
|
||||||
|
delete _renderEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemVisual::ItemVisual(Resource *parent, byte subType, uint16 index, const Common::String &name) :
|
ItemVisual::ItemVisual(Resource *parent, byte subType, uint16 index, const Common::String &name) :
|
||||||
Item(parent, subType, index, name),
|
Item(parent, subType, index, name),
|
||||||
|
_renderEntry(nullptr),
|
||||||
_animHierarchy(nullptr),
|
_animHierarchy(nullptr),
|
||||||
_currentAnimIndex(-1),
|
_currentAnimIndex(-1),
|
||||||
_field_44(1) {
|
_field_44(1) {
|
||||||
|
_renderEntry = new RenderEntry(this, getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemVisual::readData(XRCReadStream *stream) {
|
void ItemVisual::readData(XRCReadStream *stream) {
|
||||||
|
@ -110,6 +120,20 @@ void ItemVisual::printData() {
|
||||||
debug("field_44: %d", _field_44);
|
debug("field_44: %d", _field_44);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Anim *ItemVisual::getAnim() {
|
||||||
|
return _animHierarchy->getCurrentAnim();
|
||||||
|
}
|
||||||
|
|
||||||
|
Visual *ItemVisual::getVisual() {
|
||||||
|
Anim *anim = getAnim();
|
||||||
|
|
||||||
|
if (!anim) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return anim->getVisual();
|
||||||
|
}
|
||||||
|
|
||||||
ItemSub5610::~ItemSub5610() {
|
ItemSub5610::~ItemSub5610() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +156,15 @@ void ItemSub56::readData(XRCReadStream *stream) {
|
||||||
_position = stream->readPoint();
|
_position = stream->readPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RenderEntry *ItemSub56::getRenderEntry() {
|
||||||
|
Visual *visual = getVisual();
|
||||||
|
|
||||||
|
_renderEntry->setVisual(visual);
|
||||||
|
_renderEntry->setPosition(_position);
|
||||||
|
|
||||||
|
return _renderEntry;
|
||||||
|
}
|
||||||
|
|
||||||
void ItemSub56::printData() {
|
void ItemSub56::printData() {
|
||||||
ItemSub5610::printData();
|
ItemSub5610::printData();
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,11 @@
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
||||||
class XRCReadStream;
|
class Anim;
|
||||||
class AnimHierarchy;
|
class AnimHierarchy;
|
||||||
|
class RenderEntry;
|
||||||
|
class Visual;
|
||||||
|
class XRCReadStream;
|
||||||
|
|
||||||
class Item : public Resource {
|
class Item : public Resource {
|
||||||
public:
|
public:
|
||||||
|
@ -55,8 +58,11 @@ public:
|
||||||
Item(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
Item(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
||||||
virtual ~Item();
|
virtual ~Item();
|
||||||
|
|
||||||
|
// Resource API
|
||||||
virtual void readData(XRCReadStream *stream) override;
|
virtual void readData(XRCReadStream *stream) override;
|
||||||
|
|
||||||
|
virtual RenderEntry *getRenderEntry();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
|
||||||
|
@ -69,14 +75,21 @@ public:
|
||||||
ItemVisual(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
ItemVisual(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
||||||
virtual ~ItemVisual();
|
virtual ~ItemVisual();
|
||||||
|
|
||||||
|
// Resource API
|
||||||
virtual void readData(XRCReadStream *stream) override;
|
virtual void readData(XRCReadStream *stream) override;
|
||||||
virtual void onAllLoaded() override;
|
virtual void onAllLoaded() override;
|
||||||
|
|
||||||
void setAnim(int32 index);
|
void setAnim(int32 index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Resource API
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
|
||||||
|
Anim *getAnim();
|
||||||
|
Visual *getVisual();
|
||||||
|
|
||||||
|
RenderEntry *_renderEntry;
|
||||||
|
|
||||||
AnimHierarchy *_animHierarchy;
|
AnimHierarchy *_animHierarchy;
|
||||||
int32 _currentAnimIndex;
|
int32 _currentAnimIndex;
|
||||||
uint32 _field_44;
|
uint32 _field_44;
|
||||||
|
@ -93,8 +106,12 @@ public:
|
||||||
ItemSub56(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
ItemSub56(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
||||||
virtual ~ItemSub56();
|
virtual ~ItemSub56();
|
||||||
|
|
||||||
|
// Resource API
|
||||||
virtual void readData(XRCReadStream *stream) override;
|
virtual void readData(XRCReadStream *stream) override;
|
||||||
|
|
||||||
|
// Item API
|
||||||
|
virtual RenderEntry *getRenderEntry() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "engines/stark/resources/layer.h"
|
#include "engines/stark/resources/layer.h"
|
||||||
|
|
||||||
|
#include "engines/stark/resources/item.h"
|
||||||
#include "engines/stark/xrcreader.h"
|
#include "engines/stark/xrcreader.h"
|
||||||
|
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
|
@ -78,6 +80,11 @@ void Layer2D::readData(XRCReadStream *stream) {
|
||||||
_field_50 = stream->readUint32LE();
|
_field_50 = stream->readUint32LE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RenderEntryArray Layer2D::listRenderEntries() {
|
||||||
|
// TODO
|
||||||
|
return RenderEntryArray();
|
||||||
|
}
|
||||||
|
|
||||||
void Layer2D::printData() {
|
void Layer2D::printData() {
|
||||||
Layer::printData();
|
Layer::printData();
|
||||||
}
|
}
|
||||||
|
@ -104,6 +111,33 @@ void Layer3D::readData(XRCReadStream *stream) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Layer3D::onAllLoaded() {
|
||||||
|
Layer::onAllLoaded();
|
||||||
|
|
||||||
|
_items = listChildren<Item>();
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderEntryArray Layer3D::listRenderEntries() {
|
||||||
|
RenderEntryArray renderEntries;
|
||||||
|
|
||||||
|
for (uint i = 0; i < _items.size(); i++) {
|
||||||
|
Item *item = _items[i];
|
||||||
|
|
||||||
|
if (item->getSubType() != Item::kItemSub8) {
|
||||||
|
RenderEntry *renderEntry = item->getRenderEntry();
|
||||||
|
|
||||||
|
if (!renderEntry) {
|
||||||
|
// warning("No render entry for item '%s'", item->getName().c_str());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
renderEntries.push_back(renderEntry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return renderEntries;
|
||||||
|
}
|
||||||
|
|
||||||
void Layer3D::printData() {
|
void Layer3D::printData() {
|
||||||
Layer::printData();
|
Layer::printData();
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,12 @@
|
||||||
#include "common/array.h"
|
#include "common/array.h"
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
|
|
||||||
|
#include "engines/stark/gfx/renderentry.h"
|
||||||
#include "engines/stark/resources/resource.h"
|
#include "engines/stark/resources/resource.h"
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
||||||
|
class Item;
|
||||||
class XRCReadStream;
|
class XRCReadStream;
|
||||||
|
|
||||||
class Layer : public Resource {
|
class Layer : public Resource {
|
||||||
|
@ -47,8 +49,11 @@ public:
|
||||||
Layer(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
Layer(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
||||||
virtual ~Layer();
|
virtual ~Layer();
|
||||||
|
|
||||||
|
// Resource API
|
||||||
virtual void readData(XRCReadStream *stream) override;
|
virtual void readData(XRCReadStream *stream) override;
|
||||||
|
|
||||||
|
virtual RenderEntryArray listRenderEntries() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
|
||||||
|
@ -61,7 +66,11 @@ public:
|
||||||
Layer2D(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
Layer2D(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
||||||
virtual ~Layer2D();
|
virtual ~Layer2D();
|
||||||
|
|
||||||
virtual void readData(XRCReadStream *stream) override;
|
// Resource API
|
||||||
|
void readData(XRCReadStream *stream) override;
|
||||||
|
|
||||||
|
// Layer API
|
||||||
|
RenderEntryArray listRenderEntries() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
@ -74,7 +83,12 @@ public:
|
||||||
Layer3D(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
Layer3D(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
||||||
virtual ~Layer3D();
|
virtual ~Layer3D();
|
||||||
|
|
||||||
virtual void readData(XRCReadStream *stream) override;
|
// Resource API
|
||||||
|
void readData(XRCReadStream *stream) override;
|
||||||
|
void onAllLoaded() override;
|
||||||
|
|
||||||
|
// Layer API
|
||||||
|
RenderEntryArray listRenderEntries() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
@ -83,6 +97,8 @@ protected:
|
||||||
uint32 _field_58;
|
uint32 _field_58;
|
||||||
float _nearClipPlane;
|
float _nearClipPlane;
|
||||||
float _farClipPlane;
|
float _farClipPlane;
|
||||||
|
|
||||||
|
Common::Array<Item *> _items;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Stark
|
} // End of namespace Stark
|
||||||
|
|
|
@ -41,6 +41,17 @@ void Location::onAllLoaded() {
|
||||||
_layers = listChildren<Layer>();
|
_layers = listChildren<Layer>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RenderEntryArray Location::listRenderEntries() {
|
||||||
|
RenderEntryArray renderEntries;
|
||||||
|
|
||||||
|
for (uint i = 0; i < _layers.size(); i++) {
|
||||||
|
Layer *layer = _layers[i];
|
||||||
|
renderEntries.push_back(layer->listRenderEntries());
|
||||||
|
}
|
||||||
|
|
||||||
|
return renderEntries;
|
||||||
|
}
|
||||||
|
|
||||||
void Location::printData() {
|
void Location::printData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,13 @@
|
||||||
|
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
|
|
||||||
|
#include "engines/stark/gfx/renderentry.h"
|
||||||
#include "engines/stark/resources/resource.h"
|
#include "engines/stark/resources/resource.h"
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
||||||
class XRCReadStream;
|
|
||||||
class Layer;
|
class Layer;
|
||||||
|
class XRCReadStream;
|
||||||
|
|
||||||
class Location : public Resource {
|
class Location : public Resource {
|
||||||
public:
|
public:
|
||||||
|
@ -39,8 +40,11 @@ public:
|
||||||
Location(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
Location(Resource *parent, byte subType, uint16 index, const Common::String &name);
|
||||||
virtual ~Location();
|
virtual ~Location();
|
||||||
|
|
||||||
|
// Resource API
|
||||||
void onAllLoaded() override;
|
void onAllLoaded() override;
|
||||||
|
|
||||||
|
RenderEntryArray listRenderEntries();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printData() override;
|
void printData() override;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ Scene::Scene(GfxDriver *gfx) : _gfx(gfx) {
|
||||||
actor->setAnim(&xarc, "oldapril_idle.ani");
|
actor->setAnim(&xarc, "oldapril_idle.ani");
|
||||||
actor->setTexture(&xarc, "oldapril.tm");
|
actor->setTexture(&xarc, "oldapril.tm");
|
||||||
|
|
||||||
RenderEntry *oldApril = new RenderEntry();
|
RenderEntry *oldApril = new RenderEntry(nullptr, "Old April");
|
||||||
oldApril->setVisual(actor);
|
oldApril->setVisual(actor);
|
||||||
|
|
||||||
_elements.push_back(oldApril);
|
_elements.push_back(oldApril);
|
||||||
|
@ -58,7 +58,11 @@ Scene::Scene(GfxDriver *gfx) : _gfx(gfx) {
|
||||||
Scene::~Scene() {
|
Scene::~Scene() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::render(uint32 delta) {
|
void Scene::render(RenderEntryArray renderEntries, uint32 delta) {
|
||||||
|
RenderEntryArray allElements;
|
||||||
|
allElements.push_back(renderEntries);
|
||||||
|
allElements.push_back(_elements);
|
||||||
|
|
||||||
// setup cam
|
// setup cam
|
||||||
|
|
||||||
// Draw bg
|
// Draw bg
|
||||||
|
@ -66,8 +70,8 @@ void Scene::render(uint32 delta) {
|
||||||
// Draw other things
|
// Draw other things
|
||||||
|
|
||||||
// Render all the scene elements
|
// Render all the scene elements
|
||||||
Common::Array<RenderEntry *>::iterator element = _elements.begin();
|
RenderEntryArray::iterator element = allElements.begin();
|
||||||
while (element != _elements.end()) {
|
while (element != allElements.end()) {
|
||||||
// Draw the current element
|
// Draw the current element
|
||||||
(*element)->update(delta);
|
(*element)->update(delta);
|
||||||
(*element)->render(_gfx);
|
(*element)->render(_gfx);
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#include "common/array.h"
|
#include "common/array.h"
|
||||||
|
|
||||||
|
#include "engines/stark/gfx/renderentry.h"
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
||||||
class GfxDriver;
|
class GfxDriver;
|
||||||
|
@ -43,11 +45,11 @@ public:
|
||||||
*
|
*
|
||||||
* @param delta Time offset (in ms) since last frame render
|
* @param delta Time offset (in ms) since last frame render
|
||||||
*/
|
*/
|
||||||
void render(uint32 delta);
|
void render(RenderEntryArray renderEntries, uint32 delta);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GfxDriver *_gfx;
|
GfxDriver *_gfx;
|
||||||
Common::Array<RenderEntry *> _elements;
|
RenderEntryArray _elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Stark
|
} // End of namespace Stark
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "engines/stark/stark.h"
|
#include "engines/stark/stark.h"
|
||||||
|
|
||||||
#include "engines/stark/archiveloader.h"
|
#include "engines/stark/archiveloader.h"
|
||||||
#include "engines/stark/console.h"
|
#include "engines/stark/console.h"
|
||||||
#include "engines/stark/debug.h"
|
#include "engines/stark/debug.h"
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
#include "engines/stark/scene.h"
|
#include "engines/stark/scene.h"
|
||||||
#include "engines/stark/stateprovider.h"
|
#include "engines/stark/stateprovider.h"
|
||||||
#include "engines/stark/gfx/driver.h"
|
#include "engines/stark/gfx/driver.h"
|
||||||
|
#include "engines/stark/gfx/renderentry.h"
|
||||||
|
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
#include "common/events.h"
|
#include "common/events.h"
|
||||||
|
@ -171,7 +173,8 @@ void StarkEngine::updateDisplayScene() {
|
||||||
_global->getCurrent()->getLocation()->onGameLoop(delta);
|
_global->getCurrent()->getLocation()->onGameLoop(delta);
|
||||||
|
|
||||||
// Render the current scene
|
// Render the current scene
|
||||||
_scene->render(delta);
|
RenderEntryArray renderEntries = _global->getCurrent()->getLocation()->listRenderEntries();
|
||||||
|
_scene->render(renderEntries, delta);
|
||||||
|
|
||||||
// Swap buffers
|
// Swap buffers
|
||||||
_gfx->flipBuffer();
|
_gfx->flipBuffer();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue