| 1 |
#include "LDPixelRenderer.hh" |
| 2 |
|
| 3 |
#include "Display.hh" |
| 4 |
#include "LDRasterizer.hh" |
| 5 |
#include "PostProcessor.hh" |
| 6 |
#include "VideoSourceSetting.hh" |
| 7 |
#include "VideoSystem.hh" |
| 8 |
|
| 9 |
#include "Event.hh" |
| 10 |
#include "EventDistributor.hh" |
| 11 |
#include "LaserdiscPlayer.hh" |
| 12 |
#include "MSXMotherBoard.hh" |
| 13 |
#include "Reactor.hh" |
| 14 |
|
| 15 |
namespace openmsx { |
| 16 |
|
| 17 |
LDPixelRenderer::LDPixelRenderer(LaserdiscPlayer& ld, Display& display) |
| 18 |
: motherboard(ld.getMotherBoard()) |
| 19 |
, eventDistributor(motherboard.getReactor().getEventDistributor()) |
| 20 |
, rasterizer(display.getVideoSystem().createLDRasterizer(ld)) |
| 21 |
{ |
| 22 |
} |
| 23 |
|
| 24 |
LDPixelRenderer::~LDPixelRenderer() = default; |
| 25 |
|
| 26 |
void LDPixelRenderer::frameStart(EmuTime time) |
| 27 |
{ |
| 28 |
rasterizer->frameStart(time); |
| 29 |
} |
| 30 |
|
| 31 |
bool LDPixelRenderer::isActive() const |
| 32 |
{ |
| 33 |
return motherboard.isActive(); |
| 34 |
} |
| 35 |
|
| 36 |
void LDPixelRenderer::frameEnd() |
| 37 |
{ |
| 38 |
eventDistributor.distributeEvent(FinishFrameEvent( |
| 39 |
rasterizer->getPostProcessor()->getVideoSource(), |
| 40 |
motherboard.getVideoSource().getSource(), |
| 41 |
!isActive())); |
| 42 |
} |
| 43 |
|
| 44 |
void LDPixelRenderer::drawBlank(int r, int g, int b) |
| 45 |
{ |
| 46 |
rasterizer->drawBlank(r, g, b); |
| 47 |
} |
| 48 |
|
| 49 |
RawFrame* LDPixelRenderer::getRawFrame() |
| 50 |
{ |
| 51 |
return rasterizer->getRawFrame(); |
| 52 |
} |
| 53 |
|
| 54 |
} |