Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixing bugs introduced into X11 shaping implementation by merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eli Gottlieb committed Aug 10, 2010
1 parent 27bf3ec commit 4a1d19c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/video/x11/SDL_x11shape.c
Expand Up @@ -20,7 +20,7 @@
eligottlieb@gmail.com
*/

#include <assert.h>
#include "SDL_assert.h"
#include "SDL_x11video.h"
#include "SDL_x11shape.h"
#include "SDL_x11window.h"
Expand All @@ -30,7 +30,7 @@ X11_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned
return SDL_CreateWindow(title,x,y,w,h,flags);
}

SDL_WindowShaper*
SDL_WindowShaper*
X11_CreateShaper(SDL_Window* window) {
SDL_WindowShaper* result = NULL;

Expand All @@ -41,23 +41,23 @@ X11_CreateShaper(SDL_Window* window) {
result->mode.mode = ShapeModeDefault;
result->mode.parameters.binarizationCutoff = 1;
result->usershownflag = 0;
SDL_ShapeData* data = malloc(sizeof(SDL_ShapeData));
SDL_ShapeData* data = SDL_malloc(sizeof(SDL_ShapeData));
result->driverdata = data;
data->bitmapsize = 0;
data->bitmap = NULL;
window->shaper = result;
int resized_properly = X11_ResizeWindowShape(window);
assert(resized_properly == 0);
SDL_assert(resized_properly == 0);
}
#endif

return result;
}

int
int
X11_ResizeWindowShape(SDL_Window* window) {
SDL_ShapeData* data = window->shaper->driverdata;
assert(data != NULL);
SDL_assert(data != NULL);

unsigned int bitmapsize = window->w / 8;
if(window->w % 8 > 0)
Expand All @@ -80,7 +80,7 @@ X11_ResizeWindowShape(SDL_Window* window) {
return 0;
}

int
int
X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode) {
if(shaper == NULL || shape == NULL || shaper->driverdata == NULL)
return -1;
Expand Down

0 comments on commit 4a1d19c

Please sign in to comment.