This is BoinkSpaceView.m in view mode; [Download] [Up]
#import "BoinkSpaceView.h"
#import "Thinker.h"
#import <appkit/Application.h>
#import <dpsclient/wraps.h>
@implementation BoinkSpaceView
- oneStep
{
// this is weird but efficient - focus is locked on this View, and
// spaceview goes ahead and draws on it. It's like subviews, only
// faster because all coordinate systems are kept the same...
[super oneStep];
avoid.origin = redrawTo;
[mySpaceView setVoidRect:&avoid];
[mySpaceView oneStep];
return self;
}
- initFrame:(NXRect *)frameRect
{
[super initFrame:frameRect];
mySpaceView = [[SpaceView alloc] initFrame:frameRect];
[self setAccel:-1.4];
[self newViewSize];
avoid.size.width = avoid.size.height = 100;
return self;
}
- sizeTo:(NXCoord)width :(NXCoord)height
{
[super sizeTo:width :height];
[mySpaceView sizeTo:width :height];
[self newViewSize];
return self;
}
- drawSelf:(const NXRect *)rects :(int)rectCount
{
if (!rects || !rectCount) return self;
PSsetgray(0);
//NXRectFill(rects);
return self;
}
- (float) getXspeed
{
return randBetween(4, 6.5);
}
- (const char *)windowTitle
{
return "BoinkSpace";
}
- newViewSize
{
[super newViewSize];
nvert = nhoriz = 0;
return self;
}
- didLockFocus
{
[mySpaceView didLockFocus];
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.