Adventure Game Studio

AGS Development => Engine Development => Topic started by: abstauber on Thu 14/11/2013 09:20:38

Title: AGS 3.3. beta 10 DynamicSprite.CreateFromFile broken?
Post by: abstauber on Thu 14/11/2013 09:20:38
Am I doing it wrong or is this function broken?

Code (AGS) Select
 
  String fs = "myimage.bmp";
  if (File.Exists(fs)) {
    DynamicSprite* sprite = DynamicSprite.CreateFromFile(fs);
    DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
    surface.DrawImage(100, 80, sprite.Graphic);
    surface.Release();
    sprite.Delete();
  }

This works fine in AGS 3.2.1, but in AGS 3.3 the dynamic sprite stays null and DrawImage fails.
Title: Re: AGS 3.3. beta 10 DynamicSprite.CreateFromFile broken?
Post by: Crimson Wizard on Thu 14/11/2013 09:52:50
Bitmap loading function returns error even if succeeded, so DynamicSprite is never initialized :-[.
Fixed now, will update beta soon.
Title: Re: AGS 3.3. beta 10 DynamicSprite.CreateFromFile broken?
Post by: abstauber on Thu 14/11/2013 09:58:06
Great, thanks!
Btw. just in case bmp and pcx are treated differently - please fix it for pcx is well :)