Permalink
Browse files

Surface: remove redundant assert in CTor.

Surface: the pixel memory in the CTor was overriden by the changes of
#38. Now the CTor without pixel memory uses the Masks, the other sets
them to 0.
  • Loading branch information...
Dgame committed Apr 28, 2015
1 parent 1cc3ca1 commit f159b88b3cf491ac80e1731158a26098115b0e57
Showing with 1 addition and 5 deletions.
  1. +1 −5 source/Dgame/Graphic/Surface.d
  2. BIN source/Dgame/test/samples/images/XS.png
@@ -90,7 +90,7 @@ private:
assert(memory, "Memory is empty.");
assert(depth == 8 || depth == 16 || depth == 24 || depth == 32, "Invalid depth.");
return SDL_CreateRGBSurfaceFrom(memory, width, height, depth, (depth / 8) * width, RMask, GMask, BMask, AMask);
return SDL_CreateRGBSurfaceFrom(memory, width, height, depth, (depth / 8) * width, 0, 0, 0, 0);
}
public:
@@ -118,8 +118,6 @@ public:
*/
@nogc
this(uint width, uint height, ubyte depth = 32) nothrow {
assert(depth == 8 || depth == 16 || depth == 24 || depth == 32, "Invalid depth.");
_surface = Surface.create(width, height, depth);
assert(_surface, "Invalid SDL_Surface.");
@@ -131,8 +129,6 @@ public:
*/
@nogc
this(void* memory, uint width, uint height, ubyte depth = 32) nothrow {
assert(depth == 8 || depth == 16 || depth == 24 || depth == 32, "Invalid depth.");
_surface = Surface.create(memory, width, height, depth);
assert(_surface, "Invalid SDL_Surface.");
View
Binary file not shown.

0 comments on commit f159b88

Please sign in to comment.