urho3d/Urho3D — pull request #481 by friesencr (2014-10-07 23:33:59+00:00)
Title: SpritePacker cli

WIP. DO NOT MERGE.

I currently am having issues with the AreaAllocator. It might not like it when area is allocated imidiately that is more than double its size.

I run this command:
```
./SpritePacker Data/Textures/Jack_face.jpg Data/Textures/UrhoIcon.png Data/Textures/LogoLarge.png Atlas.png
```

```
[Tue Oct 7 18:22:52 2014] INFO: Output file set to Atlas.png.
[Tue Oct 7 18:22:52 2014] INFO: Checking Data/Textures/Jack_face.jpg to see if file exists.
[Tue Oct 7 18:22:52 2014] INFO: Checking Data/Textures/UrhoIcon.png to see if file exists.
[Tue Oct 7 18:22:52 2014] INFO: Checking Data/Textures/LogoLarge.png to see if file exists.
[Tue Oct 7 18:22:52 2014] INFO: Jack_face - x: 32 y: 0
[Tue Oct 7 18:22:52 2014] INFO: UrhoIcon - x: 0 y: 0
[Tue Oct 7 18:22:52 2014] INFO: LogoLarge - x: -1319935225 y: 1677447434
```

The x and y are way out of bounds.

My code to allocate:

```
SharedPtr packerInfo(new PackerInfo(path, name, image.GetWidth(), image.GetHeight()));
if (areaAllocator.Allocate(packerInfo->width + padX, packerInfo->height + padY, x, y))
{
packerInfo->x = x;
packerInfo->y = y;
packerInfos.Push(packerInfo);
}
else
ErrorExit("Could not allocate " + path + ".");
```