KYRA: (EOB/SegaCD) - make use of Common::ObjectPool
The priority render chain can go up to several thousand objects. So this might improve performance.
This commit is contained in:
parent
a523dcfeb2
commit
a52f581922
2 changed files with 19 additions and 3 deletions
|
@ -933,7 +933,11 @@ template<bool hflip> void SegaRenderer::renderLineFragment(uint8 *dst, uint8 *ma
|
|||
#undef mRenderLineFragment
|
||||
|
||||
void SegaRenderer::initPrioRenderTask(uint8 *dst, uint8 *mask, const uint8 *src, int start, int end, uint8 pal, bool hflip) {
|
||||
#if SEGA_USE_MEMPOOL
|
||||
_prioChainEnd = new (_prioRenderMemPool) PrioTileRenderObj(_prioChainEnd, dst, mask, src, start, end, pal, hflip);
|
||||
#else
|
||||
_prioChainEnd = new PrioTileRenderObj(_prioChainEnd, dst, mask, src, start, end, pal, hflip);
|
||||
#endif
|
||||
if (!_prioChainStart)
|
||||
_prioChainStart = _prioChainEnd;
|
||||
}
|
||||
|
@ -942,7 +946,11 @@ void SegaRenderer::clearPrioChain() {
|
|||
while (_prioChainEnd) {
|
||||
_prioChainEnd->_next = 0;
|
||||
PrioTileRenderObj *e = _prioChainEnd->_pred;
|
||||
#if SEGA_USE_MEMPOOL
|
||||
_prioRenderMemPool.deleteChunk(_prioChainEnd);
|
||||
#else
|
||||
delete _prioChainEnd;
|
||||
#endif
|
||||
_prioChainEnd = e;
|
||||
}
|
||||
_prioChainStart = 0;
|
||||
|
|
|
@ -25,11 +25,16 @@
|
|||
|
||||
#ifdef ENABLE_EOB
|
||||
|
||||
#define SEGA_PERFORMANCE true
|
||||
#define SEGA_USE_MEMPOOL true
|
||||
|
||||
#include "kyra/graphics/screen_eob.h"
|
||||
|
||||
namespace Kyra {
|
||||
#if SEGA_USE_MEMPOOL
|
||||
#include "common/memorypool.h"
|
||||
#endif
|
||||
|
||||
#define SEGA_PERFORMANCE true
|
||||
namespace Kyra {
|
||||
|
||||
class SegaRenderer {
|
||||
public:
|
||||
|
@ -141,6 +146,9 @@ private:
|
|||
PrioTileRenderObj *_next;
|
||||
};
|
||||
|
||||
#if SEGA_USE_MEMPOOL
|
||||
Common::ObjectPool<PrioTileRenderObj> _prioRenderMemPool;
|
||||
#endif
|
||||
PrioTileRenderObj *_prioChainStart, *_prioChainEnd;
|
||||
uint16 _screenW, _screenH, _blocksW, _blocksH;
|
||||
Screen_EoB *_screen;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue