Fixing bugs introduced into X11 shaping implementation by merge.
This commit is contained in:
parent
b6eeb0d250
commit
5f2c8902e0
1 changed files with 7 additions and 7 deletions
|
@ -20,7 +20,7 @@
|
||||||
eligottlieb@gmail.com
|
eligottlieb@gmail.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include "SDL_assert.h"
|
||||||
#include "SDL_x11video.h"
|
#include "SDL_x11video.h"
|
||||||
#include "SDL_x11shape.h"
|
#include "SDL_x11shape.h"
|
||||||
#include "SDL_x11window.h"
|
#include "SDL_x11window.h"
|
||||||
|
@ -41,13 +41,13 @@ X11_CreateShaper(SDL_Window* window) {
|
||||||
result->mode.mode = ShapeModeDefault;
|
result->mode.mode = ShapeModeDefault;
|
||||||
result->mode.parameters.binarizationCutoff = 1;
|
result->mode.parameters.binarizationCutoff = 1;
|
||||||
result->usershownflag = 0;
|
result->usershownflag = 0;
|
||||||
SDL_ShapeData* data = malloc(sizeof(SDL_ShapeData));
|
SDL_ShapeData* data = SDL_malloc(sizeof(SDL_ShapeData));
|
||||||
result->driverdata = data;
|
result->driverdata = data;
|
||||||
data->bitmapsize = 0;
|
data->bitmapsize = 0;
|
||||||
data->bitmap = NULL;
|
data->bitmap = NULL;
|
||||||
window->shaper = result;
|
window->shaper = result;
|
||||||
int resized_properly = X11_ResizeWindowShape(window);
|
int resized_properly = X11_ResizeWindowShape(window);
|
||||||
assert(resized_properly == 0);
|
SDL_assert(resized_properly == 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ X11_CreateShaper(SDL_Window* window) {
|
||||||
int
|
int
|
||||||
X11_ResizeWindowShape(SDL_Window* window) {
|
X11_ResizeWindowShape(SDL_Window* window) {
|
||||||
SDL_ShapeData* data = window->shaper->driverdata;
|
SDL_ShapeData* data = window->shaper->driverdata;
|
||||||
assert(data != NULL);
|
SDL_assert(data != NULL);
|
||||||
|
|
||||||
unsigned int bitmapsize = window->w / 8;
|
unsigned int bitmapsize = window->w / 8;
|
||||||
if(window->w % 8 > 0)
|
if(window->w % 8 > 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue