[Scummvm-git-logs] scummvm master -> f77e238629b8567d6954f181e3a0d8b9a205ee5a
athrxx
athrxx at scummvm.org
Sun Sep 6 17:00:13 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b87773bcd9 KYRA: (EOB/SegaCD) - minor cleanup
f77e238629 KYRA: (EOB/SegaCD) - make use of Common::ObjectPool
Commit: b87773bcd9eaf40d9f1404bf89261e557a5b1ba4
https://github.com/scummvm/scummvm/commit/b87773bcd9eaf40d9f1404bf89261e557a5b1ba4
Author: athrxx (athrxx at scummvm.org)
Date: 2020-09-06T18:57:24+02:00
Commit Message:
KYRA: (EOB/SegaCD) - minor cleanup
Changed paths:
engines/kyra/sequence/seqplayer_eob_segacd.cpp
diff --git a/engines/kyra/sequence/seqplayer_eob_segacd.cpp b/engines/kyra/sequence/seqplayer_eob_segacd.cpp
index c78e8a6fc6..ff33876af2 100644
--- a/engines/kyra/sequence/seqplayer_eob_segacd.cpp
+++ b/engines/kyra/sequence/seqplayer_eob_segacd.cpp
@@ -542,7 +542,7 @@ void SegaSequencePlayer::s_orbZoomEffect(const uint8*) {
int step = 512;
for (int i = 0; i < 90; ++i) {
uint32 nextFrame = _vm->_system->getMillis() + 64;
- uint16 *dst = (uint16*)_scaleTraceVectors;
+ uint16 *dst = _scaleTraceVectors;
uint32 xtr = 0x58000 - step * 128;
uint32 ytr = 0x59000 - step * 88;
for (int ii = 0; ii < 176; ++ii) {
Commit: f77e238629b8567d6954f181e3a0d8b9a205ee5a
https://github.com/scummvm/scummvm/commit/f77e238629b8567d6954f181e3a0d8b9a205ee5a
Author: athrxx (athrxx at scummvm.org)
Date: 2020-09-06T18:57:24+02:00
Commit Message:
KYRA: (EOB/SegaCD) - make use of Common::ObjectPool
The priority render chain can go up to several thousand objects. So this might improve performance.
Changed paths:
engines/kyra/graphics/screen_eob_segacd.cpp
engines/kyra/graphics/screen_eob_segacd.h
diff --git a/engines/kyra/graphics/screen_eob_segacd.cpp b/engines/kyra/graphics/screen_eob_segacd.cpp
index 986aec8669..691df2b356 100644
--- a/engines/kyra/graphics/screen_eob_segacd.cpp
+++ b/engines/kyra/graphics/screen_eob_segacd.cpp
@@ -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;
@@ -1110,7 +1118,7 @@ void SegaCDFont::drawChar(uint16 c, byte *dst, int pitch, int xOffs, int yOffs)
dst++;
if ((x & 7) == 7)
dst += 28;
- }
+ }
dst = dst2 + 4;
if ((++yOffs & 7) == 0)
dst = dst + (pitch << 5) - 32;
diff --git a/engines/kyra/graphics/screen_eob_segacd.h b/engines/kyra/graphics/screen_eob_segacd.h
index 72b575fccb..e390af0b9f 100644
--- a/engines/kyra/graphics/screen_eob_segacd.h
+++ b/engines/kyra/graphics/screen_eob_segacd.h
@@ -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;
More information about the Scummvm-git-logs
mailing list