home *** CD-ROM | disk | FTP | other *** search
- /* Cell Proj 1.0 */
-
- /********************************************************************
- Ported to Metrowerks CodeWarrior by Paul Celestin on 4 November 1994
- ********************************************************************/
-
- #include "Cell_Proto.h"
- #include "Cell_Definitions.h"
- #include "Cell_Variables.h"
-
- EventRecord gTheEvent;
- Boolean gWNEImplemented, gDone;
- MenuHandle gAppleMenu, gFileMenu, gAbilityMenu;
- WindowPtr gCellWindow;
- Rect gDragRect, gSizeRect;
- DialogPtr gCellInfoDialog;
- long gOverExp, gOverPop;
-
- int gCellStatus[ NUMBER_OF_CELLS ];
-
- main()
- {
- gDone = FALSE;
- ToolBoxInit();
- WindowInit();
- DialogInit();
- MenuBarInit();
- SetUpDragRect();
- DisplayCellWindow();
- PlaceRandomCells();
- MainLoop();
- }
-
- MainLoop()
- {
- while ( gDone == FALSE )
- {
- gWNEImplemented = ( NGetTrapAddress( WNE_TRAP_NUM, ToolTrap ) !=
- NGetTrapAddress( UMIMPL_TRAP_NUM, ToolTrap ) );
- if ( gWNEImplemented )
- WaitNextEvent( everyEvent, &gTheEvent, MIN_SLEEP, NIL_MOUSE_REGION );
-
- else
- {
- SystemTask();
- GetNextEvent( everyEvent, &gTheEvent );
- }
-
- DoPreCheck();
-
- if ( IsDialogEvent( &gTheEvent ) )
- {
- HandleDialog();
- }
-
- else
- HandleEvent();
- }
- }