Browse Source
SDL_RWsize is documented as returning any negative value on error (even though in practice errors are always indicated by a value of -1) so allow for that instead of only checking for unknown size. There were also a few unnecessary arithmetic operations being done to calculate the size to read, straightforward to simplify. SDL_CreateRGBSurfaceWithFormat expects width and height to be positive values < 2^16. Could get away with using unsigned if the SDL API did but it doesn't so stick with signed types even when it doesn't really fit the use. bufferPitch is an oddity, ultimately it's only used to determine a pointer offset so making the param ptrdiff_t as it's more appropriate than size_t.pull/4467/head
1 changed files with 12 additions and 12 deletions
Loading…
Reference in new issue