mirror of https://github.com/inolen/redream.git
don't render invalid last context on first frame
This commit is contained in:
parent
3504d313e0
commit
fcbb3cb043
|
@ -275,7 +275,7 @@ TileAccelerator::TileAccelerator(Dreamcast *dc)
|
||||||
: dc_(dc),
|
: dc_(dc),
|
||||||
texcache_(dc_),
|
texcache_(dc_),
|
||||||
tile_renderer_(texcache_),
|
tile_renderer_(texcache_),
|
||||||
last_context_(&scratch_context_) {}
|
last_context_(nullptr) {}
|
||||||
|
|
||||||
TileAccelerator::~TileAccelerator() {
|
TileAccelerator::~TileAccelerator() {
|
||||||
while (contexts_.size()) {
|
while (contexts_.size()) {
|
||||||
|
@ -359,6 +359,10 @@ void TileAccelerator::WriteContext(uint32_t addr, uint32_t value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileAccelerator::SaveLastContext(uint32_t addr) {
|
void TileAccelerator::SaveLastContext(uint32_t addr) {
|
||||||
|
if (!last_context_) {
|
||||||
|
last_context_ = &scratch_context_;
|
||||||
|
}
|
||||||
|
|
||||||
// swap context with last context to be delayed rendered
|
// swap context with last context to be delayed rendered
|
||||||
auto it = FindContext(addr);
|
auto it = FindContext(addr);
|
||||||
TileContext *tmp = last_context_;
|
TileContext *tmp = last_context_;
|
||||||
|
@ -376,6 +380,10 @@ void TileAccelerator::SaveLastContext(uint32_t addr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileAccelerator::RenderLastContext() {
|
void TileAccelerator::RenderLastContext() {
|
||||||
|
if (!last_context_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tile_renderer_.RenderContext(last_context_, dc_->rb());
|
tile_renderer_.RenderContext(last_context_, dc_->rb());
|
||||||
|
|
||||||
// add render to trace
|
// add render to trace
|
||||||
|
|
Loading…
Reference in New Issue