|
@@ -1156,49 +1156,49 @@ static const char* QZ_SetVideoWindowed(u
|
|
|
if (!isCustom) {
|
|
|
[ _cocoa_video_data.window setContentSize:contentRect.size ];
|
|
|
[ _cocoa_video_data.qdview setFrameSize:contentRect.size ];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
[ _cocoa_video_data.window center ];
|
|
|
|
|
|
/* Only recreate the view if it doesn't already exist */
|
|
|
if (_cocoa_video_data.qdview == nil) {
|
|
|
_cocoa_video_data.qdview = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ];
|
|
|
[ _cocoa_video_data.qdview setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
|
|
|
[ [ _cocoa_video_data.window contentView ] addSubview:_cocoa_video_data.qdview ];
|
|
|
[ _cocoa_video_data.qdview release ];
|
|
|
[ _cocoa_video_data.window makeKeyAndOrderFront:nil ];
|
|
|
}
|
|
|
|
|
|
LockPortBits([ _cocoa_video_data.qdview qdPort ]);
|
|
|
_cocoa_video_data.realpixels = GetPixBaseAddr(GetPortPixMap([ _cocoa_video_data.qdview qdPort ]));
|
|
|
_cocoa_video_data.pitch = GetPixRowBytes(GetPortPixMap([ _cocoa_video_data.qdview qdPort ]));
|
|
|
UnlockPortBits([ _cocoa_video_data.qdview qdPort ]);
|
|
|
|
|
|
/* _cocoa_video_data.realpixels now points to the window's pixels
|
|
|
* We want it to point to the *view's* pixels
|
|
|
*/
|
|
|
*/
|
|
|
{
|
|
|
int vOffset = [ _cocoa_video_data.window frame ].size.height - [ _cocoa_video_data.qdview frame ].size.height - [ _cocoa_video_data.qdview frame ].origin.y;
|
|
|
int hOffset = [ _cocoa_video_data.qdview frame ].origin.x;
|
|
|
|
|
|
_cocoa_video_data.realpixels = (uint8*)_cocoa_video_data.realpixels + (vOffset * _cocoa_video_data.pitch) + hOffset * (_cocoa_video_data.device_bpp / 8);
|
|
|
}
|
|
|
|
|
|
free(_cocoa_video_data.pixels);
|
|
|
_cocoa_video_data.pixels = (uint8*)malloc(width * height);
|
|
|
if (_cocoa_video_data.pixels == NULL) return "Failed to allocate 8-bit buffer";
|
|
|
|
|
|
_cocoa_video_data.fullscreen = false;
|
|
|
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
* Fullscreen mode *
|
|
|
******************************************************************************/
|
|
|
|
|
|
/* Gamma functions to try to hide the flash from a rez switch
|
|
|
* Fade the display from normal to black
|
|
|
* Save gamma tables for fade back to normal
|