Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
@@ -32,7 +32,7 @@ struct TileAnimationFrameAnimationHelper {
|
||||
* @tparam GetCallback The callback function pointer.
|
||||
* @tparam Tframehelper The animation frame get/set helper.
|
||||
*/
|
||||
template <typename Tbase, typename Tspec, typename Tobj, typename Textra, uint16 (*GetCallback)(CallbackID callback, uint32 param1, uint32 param2, const Tspec *statspec, Tobj *st, TileIndex tile, Textra extra_data), typename Tframehelper>
|
||||
template <typename Tbase, typename Tspec, typename Tobj, typename Textra, uint16_t (*GetCallback)(CallbackID callback, uint32_t param1, uint32_t param2, const Tspec *statspec, Tobj *st, TileIndex tile, Textra extra_data), typename Tframehelper>
|
||||
struct AnimationBase {
|
||||
/**
|
||||
* Animate a single tile.
|
||||
@@ -47,9 +47,9 @@ struct AnimationBase {
|
||||
assert(spec != nullptr);
|
||||
|
||||
/* Acquire the animation speed from the NewGRF. */
|
||||
uint8 animation_speed = spec->animation.speed;
|
||||
uint8_t animation_speed = spec->animation.speed;
|
||||
if (HasBit(spec->callback_mask, Tbase::cbm_animation_speed)) {
|
||||
uint16 callback = GetCallback(Tbase::cb_animation_speed, 0, 0, spec, obj, tile, extra_data);
|
||||
uint16_t callback = GetCallback(Tbase::cb_animation_speed, 0, 0, spec, obj, tile, extra_data);
|
||||
if (callback != CALLBACK_FAILED) {
|
||||
if (callback >= 0x100 && spec->grf_prop.grffile->grf_version >= 8) ErrorUnknownCallbackResult(spec->grf_prop.grffile->grfid, Tbase::cb_animation_speed, callback);
|
||||
animation_speed = Clamp(callback & 0xFF, 0, 16);
|
||||
@@ -62,13 +62,13 @@ struct AnimationBase {
|
||||
* maximum, corresponding to around 33 minutes. */
|
||||
if (TimerGameTick::counter % (1ULL << animation_speed) != 0) return;
|
||||
|
||||
uint8 frame = Tframehelper::Get(obj, tile);
|
||||
uint8 num_frames = spec->animation.frames;
|
||||
uint8_t frame = Tframehelper::Get(obj, tile);
|
||||
uint8_t num_frames = spec->animation.frames;
|
||||
|
||||
bool frame_set_by_callback = false;
|
||||
|
||||
if (HasBit(spec->callback_mask, Tbase::cbm_animation_next_frame)) {
|
||||
uint16 callback = GetCallback(Tbase::cb_animation_next_frame, random_animation ? Random() : 0, 0, spec, obj, tile, extra_data);
|
||||
uint16_t callback = GetCallback(Tbase::cb_animation_next_frame, random_animation ? Random() : 0, 0, spec, obj, tile, extra_data);
|
||||
|
||||
if (callback != CALLBACK_FAILED) {
|
||||
frame_set_by_callback = true;
|
||||
@@ -121,9 +121,9 @@ struct AnimationBase {
|
||||
* @param trigger What triggered this update? To be passed as parameter to the NewGRF.
|
||||
* @param extra_data Custom extra data for callback processing.
|
||||
*/
|
||||
static void ChangeAnimationFrame(CallbackID cb, const Tspec *spec, Tobj *obj, TileIndex tile, uint32 random_bits, uint32 trigger, Textra extra_data = 0)
|
||||
static void ChangeAnimationFrame(CallbackID cb, const Tspec *spec, Tobj *obj, TileIndex tile, uint32_t random_bits, uint32_t trigger, Textra extra_data = 0)
|
||||
{
|
||||
uint16 callback = GetCallback(cb, random_bits, trigger, spec, obj, tile, extra_data);
|
||||
uint16_t callback = GetCallback(cb, random_bits, trigger, spec, obj, tile, extra_data);
|
||||
if (callback == CALLBACK_FAILED) return;
|
||||
|
||||
switch (callback & 0xFF) {
|
||||
|
Reference in New Issue
Block a user