mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Compilation fixes - allow SDL1.
Please do not define class-specific constants that are static at same time.
This commit is contained in:
parent
2a082e6c21
commit
6ac00873b9
@ -1306,7 +1306,7 @@ void CFadeAnimation::draw(SDL_Surface * targetSurface, const SDL_Rect * sourceRe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetSurfaceAlphaMod(fadingSurface, fadingCounter * 255);
|
CSDL_Ext::setAlpha(fadingSurface, fadingCounter * 255);
|
||||||
SDL_BlitSurface(fadingSurface, sourceRect, targetSurface, destRect);
|
SDL_BlitSurface(fadingSurface, const_cast<SDL_Rect *>(sourceRect), targetSurface, destRect); //FIXME
|
||||||
SDL_SetSurfaceAlphaMod(fadingSurface, 255);
|
CSDL_Ext::setAlpha(fadingSurface, 255);
|
||||||
}
|
}
|
||||||
|
@ -221,6 +221,8 @@ public:
|
|||||||
size_t size(size_t group=0) const;
|
size_t size(size_t group=0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const float DEFAULT_DELTA = 0.05f;
|
||||||
|
|
||||||
class CFadeAnimation
|
class CFadeAnimation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -229,7 +231,6 @@ public:
|
|||||||
NONE, IN, OUT
|
NONE, IN, OUT
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
static constexpr float DEFAULT_DELTA = 0.05f;
|
|
||||||
float delta;
|
float delta;
|
||||||
SDL_Surface * fadingSurface;
|
SDL_Surface * fadingSurface;
|
||||||
bool fading;
|
bool fading;
|
||||||
|
@ -102,6 +102,15 @@ namespace CSDL_Ext
|
|||||||
dest.unused = source.unused;
|
dest.unused = source.unused;
|
||||||
#else
|
#else
|
||||||
dest.a = source.a;
|
dest.a = source.a;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void setAlpha(SDL_Surface * bg, int value)
|
||||||
|
{
|
||||||
|
#ifdef VCMI_SDL1
|
||||||
|
SDL_SetAlpha(bg, SDL_SRCALPHA, value);
|
||||||
|
#else
|
||||||
|
SDL_SetSurfaceAlphaMod(bg, value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ class CMapHandler
|
|||||||
class CMapBlitter
|
class CMapBlitter
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static constexpr int FRAMES_PER_MOVE_ANIM_GROUP = 8;
|
const int FRAMES_PER_MOVE_ANIM_GROUP = 8;
|
||||||
CMapHandler * parent; // ptr to enclosing map handler; generally for legacy reasons, probably could/should be refactored out of here
|
CMapHandler * parent; // ptr to enclosing map handler; generally for legacy reasons, probably could/should be refactored out of here
|
||||||
int tileSize; // size of a tile drawn on map [in pixels]
|
int tileSize; // size of a tile drawn on map [in pixels]
|
||||||
int halfTileSizeCeil; // half of the tile size, rounded up
|
int halfTileSizeCeil; // half of the tile size, rounded up
|
||||||
|
@ -151,11 +151,7 @@ void CPicture::convertToScreenBPP()
|
|||||||
|
|
||||||
void CPicture::setAlpha(int value)
|
void CPicture::setAlpha(int value)
|
||||||
{
|
{
|
||||||
#ifdef VCMI_SDL1
|
CSDL_Ext::setAlpha (bg, value);
|
||||||
SDL_SetAlpha(bg, SDL_SRCALPHA, value);
|
|
||||||
#else
|
|
||||||
SDL_SetSurfaceAlphaMod(bg,value);
|
|
||||||
#endif // 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPicture::scaleTo(Point size)
|
void CPicture::scaleTo(Point size)
|
||||||
|
Loading…
Reference in New Issue
Block a user