X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=course%2Fsemester2%2Fpprog%2Fassignment1%2Fsingle-thread%2Fnbody.h;fp=course%2Fsemester2%2Fpprog%2Fassignment1%2Fsingle-thread%2Fnbody.h;h=fc19d059f32179f243909a5262adc5ebf09b9605;hb=f012817dee17e24eee2e8951d138dab40b808ad3;hp=b8c9813578d105ac20b9071af49f581429e55f36;hpb=a6366978284ba7c3762518e684e16561797053a5;p=matches%2Fhonours.git diff --git a/course/semester2/pprog/assignment1/single-thread/nbody.h b/course/semester2/pprog/assignment1/single-thread/nbody.h index b8c98135..fc19d059 100644 --- a/course/semester2/pprog/assignment1/single-thread/nbody.h +++ b/course/semester2/pprog/assignment1/single-thread/nbody.h @@ -18,13 +18,14 @@ #define SINGLE_THREADED //These macros will be undefined by the multithreaded versions -#define Simulation_Run() //Sets up the simulation; in multithreaded versions, will spawn threads +#define Simulation_Run(argc, argv) (Graphics_Run(argc, argv)) //Sets up the simulation; in multithreaded versions, will spawn threads #define QuitProgram(error) (runstate = (error == true) ? QUIT : QUIT_ERROR) //Prepares to exit program, is thread safe in multithreaded versions #define M_PI 3.14159265358979323846264338327950288 /* pi */ #define G 6.67428E-11 #define DELTA_T 0.05 #define DIMENSIONS 3 +#define LINE_SIZE 1000 #define square(x) ((x)*(x)) @@ -95,6 +96,8 @@ void Universe_Cleanup(); //Cleanup universe and write bodies to file void DisplayStatistics(); // Print information about steps computed, total (real) runtime, and CPU cycles +bool ExitCondition(void); //Checks whether the program is supposed to exit automatically yet (ie: other than the user pressing "quit") + typedef enum {RUN, QUIT, QUIT_ERROR} RUNSTATE; extern RUNSTATE runstate; // Set runstate to QUIT or QUIT_ERROR and the simulation will stop on the next step.