|
|
/* $Id$ */
|
|
|
|
|
|
/** @file genworld.h */
|
|
|
|
|
|
#ifndef GENWORLD_H
|
|
|
#define GENWORLD_H
|
|
|
|
|
@@ -18,28 +20,28 @@
|
|
|
* Otherwise you will get inconsistent behaviour.
|
|
|
*/
|
|
|
enum {
|
|
|
LG_ORIGINAL = 0, //! The original landscape generator
|
|
|
LG_TERRAGENESIS = 1, //! TerraGenesis Perlin landscape generator
|
|
|
LG_ORIGINAL = 0, ///< The original landscape generator
|
|
|
LG_TERRAGENESIS = 1, ///< TerraGenesis Perlin landscape generator
|
|
|
|
|
|
GENERATE_NEW_SEED = (uint)-1, //! Create a new random seed
|
|
|
GENERATE_NEW_SEED = (uint)-1, ///< Create a new random seed
|
|
|
};
|
|
|
|
|
|
typedef void gw_done_proc(void);
|
|
|
typedef void gw_abort_proc(void);
|
|
|
|
|
|
typedef struct gw_info {
|
|
|
bool active; //! Is generating world active
|
|
|
bool abort; //! Whether to abort the thread ASAP
|
|
|
bool wait_for_draw; //! Are we waiting on a draw event
|
|
|
bool quit_thread; //! Do we want to quit the active thread
|
|
|
bool threaded; //! Whether we run _GenerateWorld threaded
|
|
|
int mode; //! What mode are we making a world in
|
|
|
PlayerID lp; //! The local_player before generating
|
|
|
uint size_x; //! X-size of the map
|
|
|
uint size_y; //! Y-size of the map
|
|
|
gw_done_proc *proc; //! Proc that is called when done (can be NULL)
|
|
|
gw_abort_proc *abortp; //! Proc that is called when aborting (can be NULL)
|
|
|
OTTDThread *thread; //! The thread we are in (can be NULL)
|
|
|
bool active; ///< Is generating world active
|
|
|
bool abort; ///< Whether to abort the thread ASAP
|
|
|
bool wait_for_draw; ///< Are we waiting on a draw event
|
|
|
bool quit_thread; ///< Do we want to quit the active thread
|
|
|
bool threaded; ///< Whether we run _GenerateWorld threaded
|
|
|
int mode; ///< What mode are we making a world in
|
|
|
PlayerID lp; ///< The local_player before generating
|
|
|
uint size_x; ///< X-size of the map
|
|
|
uint size_y; ///< Y-size of the map
|
|
|
gw_done_proc *proc; ///< Proc that is called when done (can be NULL)
|
|
|
gw_abort_proc *abortp; ///< Proc that is called when aborting (can be NULL)
|
|
|
OTTDThread *thread; ///< The thread we are in (can be NULL)
|
|
|
} gw_info;
|
|
|
|
|
|
#ifdef TEMPORARY_OTTDTHREAD_DEFINITION
|
|
@@ -48,16 +50,16 @@ typedef struct gw_info {
|
|
|
#endif
|
|
|
|
|
|
typedef enum gwp_classes {
|
|
|
GWP_MAP_INIT, /* Initialize/allocate the map, start economy */
|
|
|
GWP_LANDSCAPE, /* Create the landscape */
|
|
|
GWP_ROUGH_ROCKY, /* Make rough and rocky areas */
|
|
|
GWP_TOWN, /* Generate towns */
|
|
|
GWP_INDUSTRY, /* Generate industries */
|
|
|
GWP_UNMOVABLE, /* Generate unmovables (radio tower, light houses) */
|
|
|
GWP_TREE, /* Generate trees */
|
|
|
GWP_GAME_INIT, /* Initialize the game */
|
|
|
GWP_RUNTILELOOP, /* Runs the tile loop 1280 times to make snow etc */
|
|
|
GWP_GAME_START, /* Really prepare to start the game */
|
|
|
GWP_MAP_INIT, ///< Initialize/allocate the map, start economy
|
|
|
GWP_LANDSCAPE, ///< Create the landscape
|
|
|
GWP_ROUGH_ROCKY, ///< Make rough and rocky areas
|
|
|
GWP_TOWN, ///< Generate towns
|
|
|
GWP_INDUSTRY, ///< Generate industries
|
|
|
GWP_UNMOVABLE, ///< Generate unmovables (radio tower, light houses)
|
|
|
GWP_TREE, ///< Generate trees
|
|
|
GWP_GAME_INIT, ///< Initialize the game
|
|
|
GWP_RUNTILELOOP, ///< Runs the tile loop 1280 times to make snow etc
|
|
|
GWP_GAME_START, ///< Really prepare to start the game
|
|
|
GWP_CLASS_COUNT
|
|
|
} gwp_class;
|
|
|
|
|
@@ -71,7 +73,7 @@ static inline bool IsGeneratingWorld(voi
|
|
|
return _gw.active;
|
|
|
}
|
|
|
|
|
|
/* genworld.c */
|
|
|
/* genworld.cpp */
|
|
|
void SetGeneratingWorldPaintStatus(bool status);
|
|
|
bool IsGeneratingWorldReadyForPaint(void);
|
|
|
bool IsGenerateWorldThreaded(void);
|
|
@@ -83,7 +85,7 @@ void AbortGeneratingWorld(void);
|
|
|
bool IsGeneratingWorldAborted(void);
|
|
|
void HandleGeneratingWorldAbortion(void);
|
|
|
|
|
|
/* genworld_gui.c */
|
|
|
/* genworld_gui.cpp */
|
|
|
void SetGeneratingWorldProgress(gwp_class cls, uint total);
|
|
|
void IncreaseGeneratingWorldProgress(gwp_class cls);
|
|
|
void PrepareGenerateWorldProgress(void);
|