This is MazeView.h in view mode; [Download] [Up]
#import <appkit/appkit.h> #import "Thinker.h" #define ITERATIONS 20000/* max # of iterations before restarting */ #define PANELTIME 333 /* ms delay between *panel* animation frames */ #define MINCELLSIZE 2 /* Make sure cell size gets no smaller than... */ #define MAXDELAY 1000 /* no more than this many ms between frames */ #define RECTBUFSIZE 32 /* Number of squares of one color to draw at once */ #define MAXCOLS (1600/MINCELLSIZE+2) /* full screen of smallest cells (x) */ #define MAXROWS (1280/MINCELLSIZE+2) /* (y) */ typedef struct _mazecell { int next; int bdir; unsigned int eastwall : 1; unsigned int northwall : 1; unsigned int westwall : 1; unsigned int southwall : 1; } mazecell; @interface MazeView:View { mazecell *Grid; BStimeval lasttime; int icur; int dcur; int ncols, nrows; int countDown; int ifirst; int cellSize; int wallSize; int pathSize; int gapSize; int xoffset, yoffset; BOOL randomColor; NXColor wallColor; NXColor curWallColor; NXColor pathColor; NXColor curPathColor; int delay; NXRect wallRectList[RECTBUFSIZE]; int wallRectListSize; NXRect pathRectList[RECTBUFSIZE]; int pathRectListSize; NXRect eraseRectList[RECTBUFSIZE]; int eraseRectListSize; id panelSpeedSlider; id randomColorSwitch; id sharedInspectorPanel; id panelWallColorWell; id panelPathColorWell; id panelMazeView; id panelCreditsView; } - oneStep; - drawForward:(int)index; - drawBack:(int)index; - drawSelf:(const NXRect *)rects :(int)rectCount; - (const char *) windowTitle; - initFrame:(const NXRect *)frameRect; - free; - getMazeDefaults; - sizeTo:(NXCoord)width :(NXCoord)height; - initMaze; - computeMaze; - firstStep; - clearMaze; - addWallRectOrigin:(int) x :(int) y size:(int)w :(int) h; - flushWallRects; - addPathRectOrigin:(int) x :(int) y size:(int)w :(int) h; - flushPathRects; - addEraseRectOrigin:(int) x :(int) y size:(int)w :(int) h; - flushEraseRects; - flushDrawing; - updateViews:sender; - inspector:sender; - inspectorInstalled; - doSpeedSlider:sender; - doRandomColorSwitch:sender; - takeWallColorFrom:sender; - takePathColorFrom:sender; - showCredits:sender; - hideCredits:sender; - doShowCredits:sender; - doHideCredits:sender; @end @interface StaticMazeView:MazeView { } - initMaze; - drawSelf:(const NXRect *)rects :(int)rectCount; - setWallColor:(NXColor)wc pathColor:(NXColor)pc; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.