equal
deleted
inserted
replaced
23 |
23 |
24 GENERATE_NEW_SEED = (uint)-1, //! Create a new random seed |
24 GENERATE_NEW_SEED = (uint)-1, //! Create a new random seed |
25 }; |
25 }; |
26 |
26 |
27 typedef void gw_done_proc(void); |
27 typedef void gw_done_proc(void); |
|
28 typedef void gw_abort_proc(void); |
28 |
29 |
29 typedef struct gw_info { |
30 typedef struct gw_info { |
30 bool active; //! Is generating world active |
31 bool active; //! Is generating world active |
31 bool abort; //! Whether to abort the thread ASAP |
32 bool abort; //! Whether to abort the thread ASAP |
32 bool wait_for_draw; //! Are we waiting on a draw event |
33 bool wait_for_draw; //! Are we waiting on a draw event |
35 int mode; //! What mode are we making a world in |
36 int mode; //! What mode are we making a world in |
36 byte lp; //! The local_player before generating |
37 byte lp; //! The local_player before generating |
37 uint size_x; //! X-size of the map |
38 uint size_x; //! X-size of the map |
38 uint size_y; //! Y-size of the map |
39 uint size_y; //! Y-size of the map |
39 gw_done_proc *proc; //! Proc that is called when done (can be NULL) |
40 gw_done_proc *proc; //! Proc that is called when done (can be NULL) |
|
41 gw_abort_proc *abortp; //! Proc that is called when aborting (can be NULL) |
40 OTTDThread *thread; //! The thread we are in (can be NULL) |
42 OTTDThread *thread; //! The thread we are in (can be NULL) |
41 } gw_info; |
43 } gw_info; |
42 |
44 |
43 #ifdef TEMPORARY_OTTDTHREAD_DEFINITION |
45 #ifdef TEMPORARY_OTTDTHREAD_DEFINITION |
44 #undef OTTDThread |
46 #undef OTTDThread |
72 /* genworld.c */ |
74 /* genworld.c */ |
73 void SetGeneratingWorldPaintStatus(bool status); |
75 void SetGeneratingWorldPaintStatus(bool status); |
74 bool IsGeneratingWorldReadyForPaint(void); |
76 bool IsGeneratingWorldReadyForPaint(void); |
75 bool IsGenerateWorldThreaded(void); |
77 bool IsGenerateWorldThreaded(void); |
76 void GenerateWorldSetCallback(gw_done_proc *proc); |
78 void GenerateWorldSetCallback(gw_done_proc *proc); |
|
79 void GenerateWorldSetAbortCallback(gw_abort_proc *proc); |
77 void WaitTillGeneratedWorld(void); |
80 void WaitTillGeneratedWorld(void); |
78 void GenerateWorld(int mode, uint size_x, uint size_y); |
81 void GenerateWorld(int mode, uint size_x, uint size_y); |
79 void AbortGeneratingWorld(void); |
82 void AbortGeneratingWorld(void); |
80 bool IsGeneratingWorldAborted(void); |
83 bool IsGeneratingWorldAborted(void); |
81 void HandleGeneratingWorldAbortion(void); |
84 void HandleGeneratingWorldAbortion(void); |