mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Draw the wide background with win movies
This commit is contained in:
parent
b321d915d3
commit
70f4f74e11
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "blupi.h"
|
#include "blupi.h"
|
||||||
#include "def.h"
|
#include "def.h"
|
||||||
|
#include "display.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
@ -129,13 +130,23 @@ CMovie::fileOpenMovie (const std::string & pFilename)
|
|||||||
m_audioDev = SDL_OpenAudioDevice (nullptr, 0, &wanted_spec, &audio_spec, 0);
|
m_audioDev = SDL_OpenAudioDevice (nullptr, 0, &wanted_spec, &audio_spec, 0);
|
||||||
SDL_PauseAudioDevice (m_audioDev, 0);
|
SDL_PauseAudioDevice (m_audioDev, 0);
|
||||||
|
|
||||||
|
if (g_bFullScreen && g_zoom == 1)
|
||||||
|
SDL_SetHint (SDL_HINT_RENDER_SCALE_QUALITY, "best");
|
||||||
m_videoTex = SDL_CreateTexture (
|
m_videoTex = SDL_CreateTexture (
|
||||||
g_renderer, info.video.output.format, SDL_TEXTUREACCESS_TARGET,
|
g_renderer, info.video.output.format, SDL_TEXTUREACCESS_TARGET,
|
||||||
info.video.output.width, info.video.output.height);
|
info.video.output.width, info.video.output.height);
|
||||||
|
if (g_bFullScreen && g_zoom == 1)
|
||||||
|
SDL_SetHint (SDL_HINT_RENDER_SCALE_QUALITY, "nearset");
|
||||||
|
|
||||||
if (m_videoTex == nullptr)
|
if (m_videoTex == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (Display::getDisplay ().isWide ())
|
||||||
|
{
|
||||||
|
if (path.rfind ("win005.mkv") != std::string::npos)
|
||||||
|
this->chBackWide = CHBACKWIN0;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -177,6 +188,9 @@ CMovie::CMovie (CPixmap * pixmap)
|
|||||||
|
|
||||||
memset (m_audiobuf, 0, sizeof (m_audiobuf));
|
memset (m_audiobuf, 0, sizeof (m_audiobuf));
|
||||||
|
|
||||||
|
this->chBackWide = CHNONE;
|
||||||
|
this->rw_ops = nullptr;
|
||||||
|
|
||||||
m_ret = 0;
|
m_ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,16 +298,29 @@ CMovie::Render ()
|
|||||||
SDL_PauseAudioDevice (m_audioDev, 0);
|
SDL_PauseAudioDevice (m_audioDev, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear screen with black
|
|
||||||
SDL_SetRenderDrawColor (g_renderer, 0, 0, 0, 255);
|
|
||||||
SDL_RenderClear (g_renderer);
|
|
||||||
|
|
||||||
if (this->starting)
|
if (this->starting)
|
||||||
{
|
{
|
||||||
SDL_SetRenderTarget (g_renderer, m_videoTex);
|
// Clear screen with black
|
||||||
SDL_SetRenderDrawColor (g_renderer, 0, 0, 0, 255);
|
SDL_SetRenderDrawColor (g_renderer, 0, 0, 0, 255);
|
||||||
SDL_RenderClear (g_renderer);
|
SDL_RenderClear (g_renderer);
|
||||||
SDL_SetRenderTarget (g_renderer, nullptr);
|
|
||||||
|
if (this->chBackWide == CHNONE)
|
||||||
|
{
|
||||||
|
SDL_SetRenderTarget (g_renderer, m_videoTex);
|
||||||
|
SDL_SetRenderDrawColor (g_renderer, 0, 0, 0, 255);
|
||||||
|
SDL_RenderClear (g_renderer);
|
||||||
|
SDL_SetRenderTarget (g_renderer, nullptr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SDL_Rect rect;
|
||||||
|
rect.x = 0;
|
||||||
|
rect.y = 0;
|
||||||
|
rect.w = LXIMAGE ();
|
||||||
|
rect.h = LYIMAGE ();
|
||||||
|
auto texture = this->pixmap->getTexture (chBackWide);
|
||||||
|
SDL_RenderCopy (g_renderer, texture, &rect, nullptr);
|
||||||
|
}
|
||||||
this->starting = false;
|
this->starting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ protected:
|
|||||||
Sint32 m_ret;
|
Sint32 m_ret;
|
||||||
SDL_AudioDeviceID m_audioDev;
|
SDL_AudioDeviceID m_audioDev;
|
||||||
SDL_RWops * rw_ops;
|
SDL_RWops * rw_ops;
|
||||||
|
int chBackWide;
|
||||||
|
|
||||||
char m_audiobuf[AUDIOBUFFER_SIZE];
|
char m_audiobuf[AUDIOBUFFER_SIZE];
|
||||||
bool m_bEnable;
|
bool m_bEnable;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user