project_files/frontlib/hwconsts.h
changeset 7479 c8c552ee3acb
parent 7275 15f722e0b96f
child 7497 7e1d72fc03c7
equal deleted inserted replaced
7476:2fb781bbdd51 7479:c8c552ee3acb
    18  */
    18  */
    19 
    19 
    20 /**
    20 /**
    21  * This file contains important constants which might need to be changed to adapt to
    21  * This file contains important constants which might need to be changed to adapt to
    22  * changes in the engine or protocols.
    22  * changes in the engine or protocols.
       
    23  *
       
    24  * It also contains getter functions for some constants (in particular for constants
       
    25  * that are important for the layout of data structures), so that client code can
       
    26  * query the constants that the library was built with.
    23  */
    27  */
    24 
    28 
    25 #ifndef HWCONSTS_H_
    29 #ifndef HWCONSTS_H_
    26 #define HWCONSTS_H_
    30 #define HWCONSTS_H_
    27 
    31 
    47                               UINT32_C(0xff20bf00), /* green  */ \
    51                               UINT32_C(0xff20bf00), /* green  */ \
    48                               UINT32_C(0xfffe8b0e), /* orange */ \
    52                               UINT32_C(0xfffe8b0e), /* orange */ \
    49                               UINT32_C(0xff5f3605), /* brown  */ \
    53                               UINT32_C(0xff5f3605), /* brown  */ \
    50                               UINT32_C(0xffffff01), /* yellow */ \
    54                               UINT32_C(0xffffff01), /* yellow */ \
    51                               /* add new colors here */ \
    55                               /* add new colors here */ \
    52                               0 } /* Keep this 0 at the end or the length will be calculated wrong */
    56                               0 } /* Keep this 0 at the end */
    53 
    57 
    54 // TODO allow setting alternative color lists?
    58 extern const size_t flib_teamcolor_count;
    55 extern const size_t flib_teamcolor_defaults_len;
    59 extern const uint32_t flib_teamcolors[];
    56 extern const uint32_t flib_teamcolor_defaults[];
    60 
       
    61 /**
       
    62  * Returns the team color (ARGB) corresponding to the color index (0 if index out of bounds)
       
    63  */
       
    64 uint32_t flib_get_teamcolor(int colorIndex);
       
    65 
       
    66 /**
       
    67  * Returns the number of team colors (i.e. the length of the flib_teamcolors array)
       
    68  */
       
    69 int flib_get_teamcolor_count();
       
    70 
       
    71 /**
       
    72  * Returns the HEDGEHOGS_PER_TEAM constant
       
    73  */
       
    74 int flib_get_hedgehogs_per_team();
       
    75 
       
    76 /**
       
    77  * Returns the WEAPONS_COUNT constant
       
    78  */
       
    79 int flib_get_weapons_count();
    57 
    80 
    58 #endif
    81 #endif