mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Fix usage of fillRect.
* proper fix for slider drawing
This commit is contained in:
parent
e70e68a56b
commit
0edd10078f
@ -4194,7 +4194,7 @@ CPrologEpilogVideo::CPrologEpilogVideo( CCampaignScenario::SScenarioPrologEpilog
|
|||||||
|
|
||||||
void CPrologEpilogVideo::show( SDL_Surface * to )
|
void CPrologEpilogVideo::show( SDL_Surface * to )
|
||||||
{
|
{
|
||||||
CSDL_Ext::fillRect(to, &pos, 0); // fill screen with black
|
CSDL_Ext::fillRectBlack(to, &pos);
|
||||||
//BUG: some videos are 800x600 in size while some are 800x400
|
//BUG: some videos are 800x600 in size while some are 800x400
|
||||||
//VCMI should center them in the middle of the screen. Possible but needs modification
|
//VCMI should center them in the middle of the screen. Possible but needs modification
|
||||||
//of video player API which I'd like to avoid until we'll get rid of Windows-specific player
|
//of video player API which I'd like to avoid until we'll get rid of Windows-specific player
|
||||||
|
@ -850,22 +850,10 @@ void CSlider::setAmount( int to )
|
|||||||
|
|
||||||
void CSlider::showAll(SDL_Surface * to)
|
void CSlider::showAll(SDL_Surface * to)
|
||||||
{
|
{
|
||||||
CSDL_Ext::fillRect(to, &pos, 0);
|
CSDL_Ext::fillRectBlack(to, &pos);
|
||||||
CIntObject::showAll(to);
|
CIntObject::showAll(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSlider::show(SDL_Surface * to)
|
|
||||||
{
|
|
||||||
//todo: find better solution for background glitches.
|
|
||||||
#ifdef VCMI_SDL1
|
|
||||||
CIntObject::show(to);
|
|
||||||
#else
|
|
||||||
CSDL_Ext::fillRect(to, &pos, 0);
|
|
||||||
CIntObject::showAll(to);
|
|
||||||
#endif // VCMI_SDL1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CSlider::wheelScrolled(bool down, bool in)
|
void CSlider::wheelScrolled(bool down, bool in)
|
||||||
{
|
{
|
||||||
moveTo(value + 3 * (down ? +scrollStep : -scrollStep));
|
moveTo(value + 3 * (down ? +scrollStep : -scrollStep));
|
||||||
|
@ -218,7 +218,6 @@ public:
|
|||||||
void clickLeft(tribool down, bool previousState);
|
void clickLeft(tribool down, bool previousState);
|
||||||
void mouseMoved (const SDL_MouseMotionEvent & sEvent);
|
void mouseMoved (const SDL_MouseMotionEvent & sEvent);
|
||||||
void showAll(SDL_Surface * to);
|
void showAll(SDL_Surface * to);
|
||||||
void show(SDL_Surface * to) override;
|
|
||||||
|
|
||||||
CSlider(int x, int y, int totalw, std::function<void(int)> Moved, int Capacity, int Amount,
|
CSlider(int x, int y, int totalw, std::function<void(int)> Moved, int Capacity, int Amount,
|
||||||
int Value=0, bool Horizontal=true, int style = 0); //style 0 - brown, 1 - blue
|
int Value=0, bool Horizontal=true, int style = 0); //style 0 - brown, 1 - blue
|
||||||
|
@ -955,6 +955,12 @@ void CSDL_Ext::fillRect( SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color )
|
|||||||
SDL_FillRect(dst, &newRect, color);
|
SDL_FillRect(dst, &newRect, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSDL_Ext::fillRectBlack( SDL_Surface *dst, SDL_Rect *dstrect)
|
||||||
|
{
|
||||||
|
const Uint32 black = SDL_MapRGB(dst->format,0,0,0);
|
||||||
|
fillRect(dst,dstrect,black);
|
||||||
|
}
|
||||||
|
|
||||||
void CSDL_Ext::fillTexture(SDL_Surface *dst, SDL_Surface * src)
|
void CSDL_Ext::fillTexture(SDL_Surface *dst, SDL_Surface * src)
|
||||||
{
|
{
|
||||||
SDL_Rect srcRect;
|
SDL_Rect srcRect;
|
||||||
|
@ -208,6 +208,7 @@ namespace CSDL_Ext
|
|||||||
|
|
||||||
void blitSurface(SDL_Surface * src, SDL_Rect * srcRect, SDL_Surface * dst, SDL_Rect * dstRect);
|
void blitSurface(SDL_Surface * src, SDL_Rect * srcRect, SDL_Surface * dst, SDL_Rect * dstRect);
|
||||||
void fillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
|
void fillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
|
||||||
|
void fillRectBlack(SDL_Surface * dst, SDL_Rect * dstrect);
|
||||||
//fill dest image with source texture.
|
//fill dest image with source texture.
|
||||||
void fillTexture(SDL_Surface *dst, SDL_Surface * sourceTexture);
|
void fillTexture(SDL_Surface *dst, SDL_Surface * sourceTexture);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user