project_files/frontlib/hwconsts.h
changeset 7497 7e1d72fc03c7
parent 7479 c8c552ee3acb
child 7566 57d343ee382f
equal deleted inserted replaced
7494:e65adfc99f15 7497:7e1d72fc03c7
    29 #ifndef HWCONSTS_H_
    29 #ifndef HWCONSTS_H_
    30 #define HWCONSTS_H_
    30 #define HWCONSTS_H_
    31 
    31 
    32 #include <inttypes.h>
    32 #include <inttypes.h>
    33 #include <stddef.h>
    33 #include <stddef.h>
       
    34 #include <stdbool.h>
    34 
    35 
    35 #define HEDGEHOGS_PER_TEAM 8
    36 #define HEDGEHOGS_PER_TEAM 8
    36 #define NETGAME_DEFAULT_PORT 46631
    37 #define NETGAME_DEFAULT_PORT 46631
    37 #define PROTOCOL_VERSION 42
    38 #define PROTOCOL_VERSION 42
    38 #define MIN_SERVER_VERSION 1
    39 #define MIN_SERVER_VERSION 1
    76 /**
    77 /**
    77  * Returns the WEAPONS_COUNT constant
    78  * Returns the WEAPONS_COUNT constant
    78  */
    79  */
    79 int flib_get_weapons_count();
    80 int flib_get_weapons_count();
    80 
    81 
       
    82 /*
       
    83  * These structs define the meaning of values in the flib_scheme struct, i.e. their correspondence to
       
    84  * ini settings, engine commands and positions in the network protocol (the last is encoded in the
       
    85  * order of settings/mods).
       
    86  */
       
    87 typedef struct {
       
    88     const char *name;				// A name identifying this setting (used as key in the schemes file)
       
    89     const char *engineCommand;		// The command needed to send the setting to the engine. May be null if the setting is not sent to the engine (for the "health" setting)
       
    90     const bool maxMeansInfinity;	// If true, send a very high number to the engine if the setting is equal to its maximum
       
    91     const bool times1000;			// If true (for time-based settings), multiply the setting by 1000 before sending it to the engine.
       
    92     const int min;					// The smallest allowed value
       
    93     const int max;					// The highest allowed value
       
    94     const int def;					// The default value
       
    95 } flib_metascheme_setting;
       
    96 
       
    97 typedef struct {
       
    98     const char *name;				// A name identifying this mod (used as key in the schemes file)
       
    99     const int bitmaskIndex;			// Mods are sent to the engine in a single integer, this field describes which bit of that integer is used
       
   100     								// for this particular mod.
       
   101 } flib_metascheme_mod;
       
   102 
       
   103 typedef struct {
       
   104 	const int settingCount;
       
   105 	const int modCount;
       
   106 	const flib_metascheme_setting *settings;
       
   107 	const flib_metascheme_mod *mods;
       
   108 } flib_metascheme;
       
   109 
       
   110 extern const flib_metascheme flib_meta;
       
   111 
       
   112 const flib_metascheme *flib_get_metascheme();
       
   113 
    81 #endif
   114 #endif