This is draw.c in view mode; [Download] [Up]
/* NeXT Drawing Stuff */ #import <appkit/appkit.h> #include "draw.h" extern BOOL drawColor; void cSetColor( int color, int ins ) { if( color == 0 ) PSsetrgbcolor( 0, 0, 0 ); if( color == 1 ) { if( drawColor == YES ) PSsetrgbcolor( 0.01*ins, 0, 0 ); else PSsetrgbcolor( 2.0/3.0, 2.0/3.0, 2.0/3.0 ); } if( color == 2 ) { if( drawColor == YES ) PSsetrgbcolor( 0, 0.01*ins, 0 ); else PSsetrgbcolor( 1, 1, 1 ); } if( color == 3 ) { if( drawColor == YES ) PSsetrgbcolor( 0.0, 0.0, 0.01*ins ); else PSsetrgbcolor( 1.0/3.0, 1.0/3.0, 1.0/3.0 ); } return; } void cSetSpor( int x, int y ) { NXRect aRect; aRect.origin.x = x * 4; /* 4 -> size of Spore */ aRect.origin.y = y * 4; aRect.size.height = 4; aRect.size.width = 4; NXRectFill( &aRect ); return; } void cSetLine( int x1, int y1, int x2, int y2 ) { NXRect theRect; theRect.size.height = y2 - y1; theRect.size.width = 1; theRect.origin.x = x1; theRect.origin.y = y1; NXRectFill( &theRect ); return; } void NextCls( int maxX, int maxY ) { NXRect theRect; cSetColor( 0, 100 ); theRect.origin.x = theRect.origin.y = 0; theRect.size.width = maxX + 2; theRect.size.height = maxY + 8; NXRectFill( &theRect ); return; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.