mirror of https://github.com/OpenTTD/OpenTTD
(svn r23703) -Codechange: allow a compiler to inline a wrapper function, avoiding creation of a function stack, massively increasing its speed, for a function that is called often
parent
3b2ecfab01
commit
da460f6928
|
@ -66,7 +66,7 @@
|
||||||
static SmallVector<GRFFile *, 16> _grf_files;
|
static SmallVector<GRFFile *, 16> _grf_files;
|
||||||
|
|
||||||
/** Miscellaneous GRF features, set by Action 0x0D, parameter 0x9E */
|
/** Miscellaneous GRF features, set by Action 0x0D, parameter 0x9E */
|
||||||
static byte _misc_grf_features = 0;
|
byte _misc_grf_features = 0;
|
||||||
|
|
||||||
/** 32 * 8 = 256 flags. Apparently TTDPatch uses this many.. */
|
/** 32 * 8 = 256 flags. Apparently TTDPatch uses this many.. */
|
||||||
static uint32 _ttdpatch_flags[8];
|
static uint32 _ttdpatch_flags[8];
|
||||||
|
@ -9062,13 +9062,3 @@ void LoadNewGRF(uint load_index, uint file_index)
|
||||||
_tick_counter = tick_counter;
|
_tick_counter = tick_counter;
|
||||||
_display_opt = display_opt;
|
_display_opt = display_opt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check for grf miscelaneous bits
|
|
||||||
* @param bit The bit to check.
|
|
||||||
* @return Whether the bit is set.
|
|
||||||
*/
|
|
||||||
bool HasGrfMiscBit(GrfMiscBit bit)
|
|
||||||
{
|
|
||||||
return HasBit(_misc_grf_features, bit);
|
|
||||||
}
|
|
||||||
|
|
13
src/newgrf.h
13
src/newgrf.h
|
@ -15,6 +15,7 @@
|
||||||
#include "cargotype.h"
|
#include "cargotype.h"
|
||||||
#include "rail_type.h"
|
#include "rail_type.h"
|
||||||
#include "fileio_type.h"
|
#include "fileio_type.h"
|
||||||
|
#include "core/bitmath_func.hpp"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of different canal 'features'.
|
* List of different canal 'features'.
|
||||||
|
@ -162,6 +163,17 @@ struct GRFLoadedFeatures {
|
||||||
ShoreReplacement shore; ///< It which way shore sprites were replaced.
|
ShoreReplacement shore; ///< It which way shore sprites were replaced.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for grf miscelaneous bits
|
||||||
|
* @param bit The bit to check.
|
||||||
|
* @return Whether the bit is set.
|
||||||
|
*/
|
||||||
|
static inline bool HasGrfMiscBit(GrfMiscBit bit)
|
||||||
|
{
|
||||||
|
extern byte _misc_grf_features;
|
||||||
|
return HasBit(_misc_grf_features, bit);
|
||||||
|
}
|
||||||
|
|
||||||
/* Indicates which are the newgrf features currently loaded ingame */
|
/* Indicates which are the newgrf features currently loaded ingame */
|
||||||
extern GRFLoadedFeatures _loaded_newgrf_features;
|
extern GRFLoadedFeatures _loaded_newgrf_features;
|
||||||
|
|
||||||
|
@ -173,7 +185,6 @@ void ResetPersistentNewGRFData();
|
||||||
|
|
||||||
void CDECL grfmsg(int severity, const char *str, ...) WARN_FORMAT(2, 3);
|
void CDECL grfmsg(int severity, const char *str, ...) WARN_FORMAT(2, 3);
|
||||||
|
|
||||||
bool HasGrfMiscBit(GrfMiscBit bit);
|
|
||||||
bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile);
|
bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile);
|
||||||
|
|
||||||
StringID MapGRFStringID(uint32 grfid, StringID str);
|
StringID MapGRFStringID(uint32 grfid, StringID str);
|
||||||
|
|
Loading…
Reference in New Issue