This commit is contained in:
parent
21b9e1a645
commit
fe15566d2c
@ -22,7 +22,6 @@ ThumbnailRendererTask::~ThumbnailRendererTask()
|
||||
|
||||
bool ThumbnailRendererTask::doWork()
|
||||
{
|
||||
SaveRenderer::Ref().ResetModes();
|
||||
thumbnail = std::unique_ptr<VideoBuffer>(SaveRenderer::Ref().Render(Save.get(), Decorations, Fire));
|
||||
if (thumbnail)
|
||||
{
|
||||
|
@ -1784,8 +1784,7 @@ void GameView::NotifyPlaceSaveChanged(GameModel * sender)
|
||||
placeSaveOffset = ui::Point(0, 0);
|
||||
if(sender->GetPlaceSave())
|
||||
{
|
||||
SaveRenderer::Ref().CopyModes(sender->GetRenderer());
|
||||
placeSaveThumb = SaveRenderer::Ref().Render(sender->GetPlaceSave());
|
||||
placeSaveThumb = SaveRenderer::Ref().Render(sender->GetPlaceSave(), true, true, sender->GetRenderer());
|
||||
selectMode = PlaceSave;
|
||||
selectPoint2 = mousePosition;
|
||||
}
|
||||
|
@ -460,7 +460,6 @@ void PreviewView::NotifySaveChanged(PreviewModel * sender)
|
||||
|
||||
if(save->GetGameSave())
|
||||
{
|
||||
SaveRenderer::Ref().ResetModes();
|
||||
savePreview = SaveRenderer::Ref().Render(save->GetGameSave(), false, true);
|
||||
|
||||
if(savePreview && savePreview->Buffer && !(savePreview->Width == XRES/2 && savePreview->Height == YRES/2))
|
||||
|
@ -33,10 +33,18 @@ SaveRenderer::SaveRenderer(){
|
||||
#endif
|
||||
}
|
||||
|
||||
VideoBuffer * SaveRenderer::Render(GameSave * save, bool decorations, bool fire)
|
||||
VideoBuffer * SaveRenderer::Render(GameSave * save, bool decorations, bool fire, Renderer *renderModeSource)
|
||||
{
|
||||
std::lock_guard<std::mutex> gx(renderMutex);
|
||||
|
||||
ren->ResetModes();
|
||||
if (renderModeSource)
|
||||
{
|
||||
ren->SetRenderMode(renderModeSource->GetRenderMode());
|
||||
ren->SetDisplayMode(renderModeSource->GetDisplayMode());
|
||||
ren->SetColourMode(renderModeSource->GetColourMode());
|
||||
}
|
||||
|
||||
int width, height;
|
||||
VideoBuffer * tempThumb = NULL;
|
||||
width = save->blockWidth;
|
||||
@ -175,15 +183,3 @@ VideoBuffer * SaveRenderer::Render(unsigned char * saveData, int dataSize, bool
|
||||
SaveRenderer::~SaveRenderer()
|
||||
{
|
||||
}
|
||||
|
||||
void SaveRenderer::CopyModes(Renderer *source)
|
||||
{
|
||||
ren->SetRenderMode(source->GetRenderMode());
|
||||
ren->SetDisplayMode(source->GetDisplayMode());
|
||||
ren->SetColourMode(source->GetColourMode());
|
||||
}
|
||||
|
||||
void SaveRenderer::ResetModes()
|
||||
{
|
||||
ren->ResetModes();
|
||||
}
|
||||
|
@ -19,10 +19,8 @@ class SaveRenderer: public Singleton<SaveRenderer> {
|
||||
std::mutex renderMutex;
|
||||
public:
|
||||
SaveRenderer();
|
||||
VideoBuffer * Render(GameSave * save, bool decorations = true, bool fire = true);
|
||||
VideoBuffer * Render(GameSave * save, bool decorations = true, bool fire = true, Renderer *renderModeSource = nullptr);
|
||||
VideoBuffer * Render(unsigned char * saveData, int saveDataSize, bool decorations = true, bool fire = true);
|
||||
void CopyModes(Renderer *source);
|
||||
void ResetModes();
|
||||
virtual ~SaveRenderer();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user