Added the missing adjustToNewSize parameter of Sprite::SetImage in CSFML
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1346 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
273cba055c
commit
6c44a1d33a
@ -303,11 +303,12 @@ CSFML_API void sfSprite_TransformToGlobal(const sfSprite* sprite, float pointX,
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Change the image of a sprite
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \param image : New image
|
||||
/// \param adjustToNewSize : If true, the SubRect of the sprite will be adjusted to the size of the new image
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfSprite_SetImage(sfSprite* sprite, const sfImage* image);
|
||||
CSFML_API void sfSprite_SetImage(sfSprite* sprite, const sfImage* image, sfBool adjustToNewSize);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Set the sub-rectangle of a sprite inside the source image
|
||||
|
@ -304,11 +304,11 @@ void sfSprite_TransformToGlobal(const sfSprite* sprite, float pointX, float poin
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Change the image of a sprite
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetImage(sfSprite* sprite, const sfImage* image)
|
||||
void sfSprite_SetImage(sfSprite* sprite, const sfImage* image, sfBool adjustToNewSize)
|
||||
{
|
||||
if (image)
|
||||
{
|
||||
CSFML_CALL(sprite, SetImage(*image->This))
|
||||
CSFML_CALL(sprite, SetImage(*image->This, adjustToNewSize == sfTrue))
|
||||
sprite->Image = image;
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -177,7 +177,7 @@ namespace SFML
|
||||
public Image Image
|
||||
{
|
||||
get { return myImage; }
|
||||
set { myImage = value; sfSprite_SetImage(This, value != null ? value.This : IntPtr.Zero); }
|
||||
set { myImage = value; sfSprite_SetImage(This, value != null ? value.This : IntPtr.Zero, false); }
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -374,7 +374,7 @@ namespace SFML
|
||||
static extern float sfSprite_GetHeight(IntPtr This);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfSprite_SetImage(IntPtr This, IntPtr Image);
|
||||
static extern void sfSprite_SetImage(IntPtr This, IntPtr Image, bool AdjustToNewSize);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfSprite_SetSubRect(IntPtr This, IntRect Rect);
|
||||
|
Loading…
Reference in New Issue
Block a user