some gnustep fixes, probably close to giving up on this ngl
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
fe72bc92bf
commit
0e2e3a1901
2 changed files with 8 additions and 2 deletions
|
|
@ -81,6 +81,8 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MilskoCocoaView : NSView {
|
@interface MilskoCocoaView : NSView {
|
||||||
|
@public
|
||||||
|
unsigned char* buf;
|
||||||
NSBitmapImageRep* rep;
|
NSBitmapImageRep* rep;
|
||||||
NSGraphicsContext* context;
|
NSGraphicsContext* context;
|
||||||
MwBool valid;
|
MwBool valid;
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,11 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
|
||||||
|
|
||||||
- (void)initRepAndContextWithWidth:(float)w Height:(float)h {
|
- (void)initRepAndContextWithWidth:(float)w Height:(float)h {
|
||||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
self->buf = malloc(w * h * 4);
|
||||||
|
memset(self->buf, 255, w * h * 4);
|
||||||
|
|
||||||
self->rep =
|
self->rep =
|
||||||
[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
|
[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&self->buf
|
||||||
pixelsWide:w
|
pixelsWide:w
|
||||||
pixelsHigh:h
|
pixelsHigh:h
|
||||||
bitsPerSample:8
|
bitsPerSample:8
|
||||||
|
|
@ -536,6 +539,7 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
|
||||||
colorSpaceName:NSDeviceRGBColorSpace
|
colorSpaceName:NSDeviceRGBColorSpace
|
||||||
bytesPerRow:(int)width * 4
|
bytesPerRow:(int)width * 4
|
||||||
bitsPerPixel:32];
|
bitsPerPixel:32];
|
||||||
|
assert(self->rep);
|
||||||
[self->image addRepresentation:self->rep];
|
[self->image addRepresentation:self->rep];
|
||||||
}
|
}
|
||||||
- (void)destroy {
|
- (void)destroy {
|
||||||
|
|
@ -975,7 +979,7 @@ static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||||
[NSGraphicsContext saveGraphicsState];
|
[NSGraphicsContext saveGraphicsState];
|
||||||
[NSGraphicsContext setCurrentContext:ctx];
|
[NSGraphicsContext setCurrentContext:ctx];
|
||||||
|
|
||||||
[[p image]
|
[p->image
|
||||||
drawInRect:localRectFlip(NSMakeRect(rect->x, rect->y, rect->width, rect->height), self->view)
|
drawInRect:localRectFlip(NSMakeRect(rect->x, rect->y, rect->width, rect->height), self->view)
|
||||||
fromRect:NSZeroRect
|
fromRect:NSZeroRect
|
||||||
operation:NSCompositeSourceOver
|
operation:NSCompositeSourceOver
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue