newgrf_spritegroup.h
changeset 4892 cafd96f10c1e
parent 4817 116374e1a5f1
equal deleted inserted replaced
4891:90fed43ba450 4892:cafd96f10c1e
    17 	// with small amount of cargo whilst loading is for stations with a lot
    17 	// with small amount of cargo whilst loading is for stations with a lot
    18 	// of da stuff.
    18 	// of da stuff.
    19 
    19 
    20 	byte num_loaded;       ///< Number of loaded groups
    20 	byte num_loaded;       ///< Number of loaded groups
    21 	byte num_loading;      ///< Number of loading groups
    21 	byte num_loading;      ///< Number of loading groups
    22 	SpriteGroup **loaded;  ///< List of loaded groups (can be SpriteIDs or Callback results)
    22 	const SpriteGroup **loaded;  ///< List of loaded groups (can be SpriteIDs or Callback results)
    23 	SpriteGroup **loading; ///< List of loading groups (can be SpriteIDs or Callback results)
    23 	const SpriteGroup **loading; ///< List of loading groups (can be SpriteIDs or Callback results)
    24 } RealSpriteGroup;
    24 } RealSpriteGroup;
    25 
    25 
    26 /* Shared by deterministic and random groups. */
    26 /* Shared by deterministic and random groups. */
    27 typedef enum VarSpriteGroupScopes {
    27 typedef enum VarSpriteGroupScopes {
    28 	VSG_SCOPE_SELF,
    28 	VSG_SCOPE_SELF,
    71 	uint32 divmod_val;
    71 	uint32 divmod_val;
    72 } DeterministicSpriteGroupAdjust;
    72 } DeterministicSpriteGroupAdjust;
    73 
    73 
    74 
    74 
    75 typedef struct DeterministicSpriteGroupRange {
    75 typedef struct DeterministicSpriteGroupRange {
    76 	SpriteGroup *group;
    76 	const SpriteGroup *group;
    77 	uint32 low;
    77 	uint32 low;
    78 	uint32 high;
    78 	uint32 high;
    79 } DeterministicSpriteGroupRange;
    79 } DeterministicSpriteGroupRange;
    80 
    80 
    81 
    81 
    86 	byte num_ranges;
    86 	byte num_ranges;
    87 	DeterministicSpriteGroupAdjust *adjusts;
    87 	DeterministicSpriteGroupAdjust *adjusts;
    88 	DeterministicSpriteGroupRange *ranges; // Dynamically allocated
    88 	DeterministicSpriteGroupRange *ranges; // Dynamically allocated
    89 
    89 
    90 	// Dynamically allocated, this is the sole owner
    90 	// Dynamically allocated, this is the sole owner
    91 	SpriteGroup *default_group;
    91 	const SpriteGroup *default_group;
    92 } DeterministicSpriteGroup;
    92 } DeterministicSpriteGroup;
    93 
    93 
    94 typedef enum RandomizedSpriteGroupCompareModes {
    94 typedef enum RandomizedSpriteGroupCompareModes {
    95 	RSG_CMP_ANY,
    95 	RSG_CMP_ANY,
    96 	RSG_CMP_ALL,
    96 	RSG_CMP_ALL,
   107 	// Look for this in the per-object randomized bitmask:
   107 	// Look for this in the per-object randomized bitmask:
   108 	byte lowest_randbit;
   108 	byte lowest_randbit;
   109 	byte num_groups; // must be power of 2
   109 	byte num_groups; // must be power of 2
   110 
   110 
   111 	// Take the group with appropriate index:
   111 	// Take the group with appropriate index:
   112 	SpriteGroup **groups;
   112 	const SpriteGroup **groups;
   113 } RandomizedSpriteGroup;
   113 } RandomizedSpriteGroup;
   114 
   114 
   115 
   115 
   116 /* This contains a callback result. A failed callback has a value of
   116 /* This contains a callback result. A failed callback has a value of
   117  * CALLBACK_FAILED */
   117  * CALLBACK_FAILED */