1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix RDRAMtoColorBuffer::copyFromRDRAM with FBInfo

This commit is contained in:
Sergey Lipskiy 2017-11-12 21:35:40 +07:00
parent 60c092ee23
commit 4d4a2d18a2
3 changed files with 10 additions and 3 deletions

View File

@ -177,8 +177,11 @@ void RDRAMtoColorBuffer::copyFromRDRAM(u32 _address, bool _bCFB)
if (m_pCurBuffer == nullptr) {
if (_bCFB || (config.frameBufferEmulation.copyFromRDRAM != 0 && !FBInfo::fbInfo.isSupported()))
m_pCurBuffer = frameBufferList().findBuffer(_address);
} else if (m_vecAddress.empty())
return;
} else {
if (m_vecAddress.empty())
return;
frameBufferList().setCurrent(m_pCurBuffer);
}
if (m_pCurBuffer == nullptr || m_pCurBuffer->m_size < G_IM_SIZ_16b)
return;

View File

@ -4,6 +4,7 @@
#include <vector>
#include <memory>
#include <Graphics/ObjectHandle.h>
#include <FrameBuffer.h>
namespace graphics {
class PixelWriteBuffer;
@ -32,13 +33,15 @@ private:
class Cleaner
{
public:
Cleaner(RDRAMtoColorBuffer * _p) : m_p(_p) {}
Cleaner(RDRAMtoColorBuffer * _p) : m_p(_p), m_pCureentBuffer(frameBufferList().getCurrent()) {}
~Cleaner()
{
m_p->reset();
frameBufferList().setCurrent(m_pCureentBuffer);
}
private:
RDRAMtoColorBuffer * m_p;
FrameBuffer * m_pCureentBuffer;
};
FrameBuffer * m_pCurBuffer;

View File

@ -92,6 +92,7 @@ public:
FrameBuffer * getBuffer(u32 _startAddress);
FrameBuffer * findTmpBuffer(u32 _address);
FrameBuffer * getCurrent() const {return m_pCurrent;}
void setCurrent(FrameBuffer * _pCurrent) { m_pCurrent = _pCurrent; }
void renderBuffer();
void setBufferChanged(f32 _maxY);
void clearBuffersChanged();