mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Replace PS*instance.
It's a little flakey (doesn't always do the right thing), but it's a good start. I'd like to do much smaller rectangles, and get the timing right.
This commit is contained in:
parent
35c7916c28
commit
d894034ab1
2 changed files with 41 additions and 14 deletions
|
@ -21,6 +21,9 @@ void qprintf (char *fmt, ...); // prints text to cmd_out_i
|
||||||
BOOL dirty;
|
BOOL dirty;
|
||||||
char filename[1024]; // full path with .map extension
|
char filename[1024]; // full path with .map extension
|
||||||
|
|
||||||
|
NSBitmapImageRep *cache[3];
|
||||||
|
NSRect cache_rect[3];
|
||||||
|
|
||||||
// UI objects
|
// UI objects
|
||||||
id brushcount_i;
|
id brushcount_i;
|
||||||
id entitycount_i;
|
id entitycount_i;
|
||||||
|
|
|
@ -250,50 +250,74 @@ flushWindow
|
||||||
instance draw the brush after each flush
|
instance draw the brush after each flush
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
-flushWindow
|
- (void) flushWindow
|
||||||
{
|
{
|
||||||
|
NSRect rect;
|
||||||
|
int i;
|
||||||
|
NSView *cv;
|
||||||
|
|
||||||
[super flushWindow];
|
[super flushWindow];
|
||||||
|
|
||||||
if (!running)
|
if (!running)
|
||||||
return self; // don't lock focus before nib is
|
return; // don't lock focus before nib is
|
||||||
// finished loading
|
// finished loading
|
||||||
|
|
||||||
if (_disableFlushWindow)
|
if (_disableFlushWindow)
|
||||||
return self;
|
return;
|
||||||
|
|
||||||
|
cv = [self contentView];
|
||||||
|
[cv lockFocus];
|
||||||
|
for (i = 3; i >= 0; i--) {
|
||||||
|
if (cache[i]) {
|
||||||
|
if (clearinstance) {
|
||||||
|
rect = cache_rect[i];
|
||||||
|
[cache[i] drawAtPoint: rect.origin];
|
||||||
|
}
|
||||||
|
[cache[i] release];
|
||||||
|
cache[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rect = [cameraview_i frame];
|
||||||
|
//rect = [cv convertRect: rect fromView: cameraview_i];
|
||||||
|
cache_rect[0] = rect = NSIntegralRect (rect);
|
||||||
|
cache[0] = [[NSBitmapImageRep alloc] initWithFocusedViewRect: rect];
|
||||||
|
|
||||||
|
rect = [[xyview_i superview] frame];
|
||||||
|
rect = [cv convertRect: rect fromView: [[xyview_i superview] superview]];
|
||||||
|
cache_rect[1] = rect = NSIntegralRect (rect);
|
||||||
|
cache[1] = [[NSBitmapImageRep alloc] initWithFocusedViewRect: rect];
|
||||||
|
|
||||||
|
rect = [[zview_i superview] frame];
|
||||||
|
rect = [cv convertRect: rect fromView: [[zview_i superview] superview]];
|
||||||
|
cache_rect[2] = rect = NSIntegralRect (rect);
|
||||||
|
cache[2] = [[NSBitmapImageRep alloc] initWithFocusedViewRect: rect];
|
||||||
|
[[self contentView] unlockFocus];
|
||||||
|
|
||||||
[cameraview_i lockFocus];
|
[cameraview_i lockFocus];
|
||||||
if (clearinstance) {
|
|
||||||
// XXX PSnewinstance ();
|
|
||||||
clearinstance = NO;
|
|
||||||
}
|
|
||||||
// XXX PSsetinstance (1);
|
|
||||||
linestart (0, 0, 0);
|
linestart (0, 0, 0);
|
||||||
[map_i makeSelectedPerform:@selector (CameraDrawSelf)];
|
[map_i makeSelectedPerform:@selector (CameraDrawSelf)];
|
||||||
[clipper_i cameraDrawSelf];
|
[clipper_i cameraDrawSelf];
|
||||||
lineflush ();
|
lineflush ();
|
||||||
// XXX PSsetinstance (0);
|
|
||||||
[cameraview_i unlockFocus];
|
[cameraview_i unlockFocus];
|
||||||
|
|
||||||
[xyview_i lockFocus];
|
[xyview_i lockFocus];
|
||||||
// XXX PSsetinstance (1);
|
|
||||||
linestart (0, 0, 0);
|
linestart (0, 0, 0);
|
||||||
[map_i makeSelectedPerform:@selector (XYDrawSelf)];
|
[map_i makeSelectedPerform:@selector (XYDrawSelf)];
|
||||||
lineflush ();
|
lineflush ();
|
||||||
[cameraview_i XYDrawSelf];
|
[cameraview_i XYDrawSelf];
|
||||||
[zview_i XYDrawSelf];
|
[zview_i XYDrawSelf];
|
||||||
[clipper_i XYDrawSelf];
|
[clipper_i XYDrawSelf];
|
||||||
// XXX PSsetinstance (0);
|
|
||||||
[xyview_i unlockFocus];
|
[xyview_i unlockFocus];
|
||||||
|
|
||||||
[zview_i lockFocus];
|
[zview_i lockFocus];
|
||||||
// XXX PSsetinstance (1);
|
|
||||||
[map_i makeSelectedPerform:@selector (ZDrawSelf)];
|
[map_i makeSelectedPerform:@selector (ZDrawSelf)];
|
||||||
[cameraview_i ZDrawSelf];
|
[cameraview_i ZDrawSelf];
|
||||||
[clipper_i ZDrawSelf];
|
[clipper_i ZDrawSelf];
|
||||||
// XXX PSsetinstance (0);
|
|
||||||
[zview_i unlockFocus];
|
[zview_i unlockFocus];
|
||||||
|
|
||||||
return self;
|
clearinstance = NO;
|
||||||
|
|
||||||
|
[super flushWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue