summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-06-12 20:32:52 +0000
committerterkhen <terkhen@openttd.org>2011-06-12 20:32:52 +0000
commite127fca384892a22a393fe68c88d9291c5c1d18c (patch)
tree171a95ea61a2f3462caa4d124139dcdd59a3114d /src
parentd7ec492887674362c6a054b28faf26707932df64 (diff)
downloadopenttd-e127fca384892a22a393fe68c88d9291c5c1d18c.tar.xz
(svn r22557) -Codechange: Remove constness from AnimationBase callbacks.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_airporttiles.cpp2
-rw-r--r--src/newgrf_animation_base.h6
-rw-r--r--src/newgrf_house.cpp2
-rw-r--r--src/newgrf_industrytiles.cpp4
-rw-r--r--src/newgrf_object.cpp6
-rw-r--r--src/newgrf_object.h4
-rw-r--r--src/newgrf_station.cpp4
-rw-r--r--src/newgrf_station.h4
-rw-r--r--src/object_cmd.cpp2
-rw-r--r--src/station_cmd.cpp2
10 files changed, 18 insertions, 18 deletions
diff --git a/src/newgrf_airporttiles.cpp b/src/newgrf_airporttiles.cpp
index e00d23ab0..89498416b 100644
--- a/src/newgrf_airporttiles.cpp
+++ b/src/newgrf_airporttiles.cpp
@@ -246,7 +246,7 @@ static void AirportTileResolver(ResolverObject *res, const AirportTileSpec *ats,
res->grffile = ats->grf_prop.grffile;
}
-uint16 GetAirportTileCallback(CallbackID callback, uint32 param1, uint32 param2, const AirportTileSpec *ats, const Station *st, TileIndex tile)
+uint16 GetAirportTileCallback(CallbackID callback, uint32 param1, uint32 param2, const AirportTileSpec *ats, Station *st, TileIndex tile)
{
ResolverObject object;
const SpriteGroup *group;
diff --git a/src/newgrf_animation_base.h b/src/newgrf_animation_base.h
index a2c0cdafd..be0b93c6a 100644
--- a/src/newgrf_animation_base.h
+++ b/src/newgrf_animation_base.h
@@ -25,7 +25,7 @@
* @tparam Tobj Object related to the animated tile.
* @tparam GetCallback The callback function pointer.
*/
-template <typename Tbase, typename Tspec, typename Tobj, uint16 (*GetCallback)(CallbackID callback, uint32 param1, uint32 param2, const Tspec *statspec, const Tobj *st, TileIndex tile)>
+template <typename Tbase, typename Tspec, typename Tobj, uint16 (*GetCallback)(CallbackID callback, uint32 param1, uint32 param2, const Tspec *statspec, Tobj *st, TileIndex tile)>
struct AnimationBase {
/**
* Animate a single tile.
@@ -35,7 +35,7 @@ struct AnimationBase {
* @param tile Tile to animate changes for.
* @param random_animation Whether to pass random bits to the "next frame" callback.
*/
- static void AnimateTile(const Tspec *spec, const Tobj *obj, TileIndex tile, bool random_animation)
+ static void AnimateTile(const Tspec *spec, Tobj *obj, TileIndex tile, bool random_animation)
{
assert(spec != NULL);
@@ -110,7 +110,7 @@ struct AnimationBase {
* @param random_bits Random bits for this update. To be passed as parameter to the NewGRF.
* @param trigger What triggered this update? To be passed as parameter to the NewGRF.
*/
- static void ChangeAnimationFrame(CallbackID cb, const Tspec *spec, const Tobj *obj, TileIndex tile, uint32 random_bits, uint32 trigger)
+ static void ChangeAnimationFrame(CallbackID cb, const Tspec *spec, Tobj *obj, TileIndex tile, uint32 random_bits, uint32 trigger)
{
uint16 callback = GetCallback(cb, random_bits, trigger, spec, obj, tile);
if (callback == CALLBACK_FAILED) return;
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index 1f525bd8e..d267ff1f2 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -469,7 +469,7 @@ void DrawNewHouseTile(TileInfo *ti, HouseID house_id)
}
/* Simple wrapper for GetHouseCallback to keep the animation unified. */
-uint16 GetSimpleHouseCallback(CallbackID callback, uint32 param1, uint32 param2, const HouseSpec *spec, const Town *town, TileIndex tile)
+uint16 GetSimpleHouseCallback(CallbackID callback, uint32 param1, uint32 param2, const HouseSpec *spec, Town *town, TileIndex tile)
{
return GetHouseCallback(callback, param1, param2, spec - HouseSpec::Get(0), town, tile);
}
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 397fecad7..da72c41cf 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -297,9 +297,9 @@ CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind
}
/* Simple wrapper for GetHouseCallback to keep the animation unified. */
-uint16 GetSimpleIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, const IndustryTileSpec *spec, const Industry *ind, TileIndex tile)
+uint16 GetSimpleIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, const IndustryTileSpec *spec, Industry *ind, TileIndex tile)
{
- return GetIndustryTileCallback(callback, param1, param2, spec - GetIndustryTileSpec(0), const_cast<Industry *>(ind), tile);
+ return GetIndustryTileCallback(callback, param1, param2, spec - GetIndustryTileSpec(0), ind, tile);
}
/** Helper class for animation control. */
diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp
index 967017039..a541c77ce 100644
--- a/src/newgrf_object.cpp
+++ b/src/newgrf_object.cpp
@@ -504,7 +504,7 @@ void DrawNewObjectTileInGUI(int x, int y, const ObjectSpec *spec, uint8 view)
* @param tile The tile the callback is called for.
* @return The result of the callback.
*/
-uint16 StubGetObjectCallback(CallbackID callback, uint32 param1, uint32 param2, const ObjectSpec *spec, const Object *o, TileIndex tile)
+uint16 StubGetObjectCallback(CallbackID callback, uint32 param1, uint32 param2, const ObjectSpec *spec, Object *o, TileIndex tile)
{
return GetObjectCallback(callback, param1, param2, spec, o, tile);
}
@@ -537,7 +537,7 @@ void AnimateNewObjectTile(TileIndex tile)
* @param trigger The trigger that is triggered.
* @param spec The spec associated with the object.
*/
-void TriggerObjectTileAnimation(const Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
+void TriggerObjectTileAnimation(Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
{
if (!HasBit(spec->animation.triggers, trigger)) return;
@@ -550,7 +550,7 @@ void TriggerObjectTileAnimation(const Object *o, TileIndex tile, ObjectAnimation
* @param trigger The trigger that is triggered.
* @param spec The spec associated with the object.
*/
-void TriggerObjectAnimation(const Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
+void TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
{
if (!HasBit(spec->animation.triggers, trigger)) return;
diff --git a/src/newgrf_object.h b/src/newgrf_object.h
index 243d0f3a3..5997f8d5a 100644
--- a/src/newgrf_object.h
+++ b/src/newgrf_object.h
@@ -100,7 +100,7 @@ uint16 GetObjectCallback(CallbackID callback, uint32 param1, uint32 param2, cons
void DrawNewObjectTile(TileInfo *ti, const ObjectSpec *spec);
void DrawNewObjectTileInGUI(int x, int y, const ObjectSpec *spec, uint8 view);
void AnimateNewObjectTile(TileIndex tile);
-void TriggerObjectTileAnimation(const Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec);
-void TriggerObjectAnimation(const Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec);
+void TriggerObjectTileAnimation(Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec);
+void TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec);
#endif /* NEWGRF_OBJECT_H */
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 4ca54962a..00b4d5f97 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -623,7 +623,7 @@ SpriteID GetCustomStationFoundationRelocation(const StationSpec *statspec, const
}
-uint16 GetStationCallback(CallbackID callback, uint32 param1, uint32 param2, const StationSpec *statspec, const BaseStation *st, TileIndex tile)
+uint16 GetStationCallback(CallbackID callback, uint32 param1, uint32 param2, const StationSpec *statspec, BaseStation *st, TileIndex tile)
{
const SpriteGroup *group;
ResolverObject object;
@@ -866,7 +866,7 @@ void AnimateStationTile(TileIndex tile)
StationAnimationBase::AnimateTile(ss, BaseStation::GetByTile(tile), tile, HasBit(ss->flags, SSF_CB141_RANDOM_BITS));
}
-void TriggerStationAnimation(const BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type)
+void TriggerStationAnimation(BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type)
{
/* List of coverage areas for each animation trigger */
static const TriggerArea tas[] = {
diff --git a/src/newgrf_station.h b/src/newgrf_station.h
index e82747bf7..e1da520c9 100644
--- a/src/newgrf_station.h
+++ b/src/newgrf_station.h
@@ -113,7 +113,7 @@ uint32 GetPlatformInfo(Axis axis, byte tile, int platforms, int length, int x, i
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const BaseStation *st, TileIndex tile, uint32 var10 = 0);
SpriteID GetCustomStationFoundationRelocation(const StationSpec *statspec, const BaseStation *st, TileIndex tile, uint layout, uint edge_info);
-uint16 GetStationCallback(CallbackID callback, uint32 param1, uint32 param2, const StationSpec *statspec, const BaseStation *st, TileIndex tile);
+uint16 GetStationCallback(CallbackID callback, uint32 param1, uint32 param2, const StationSpec *statspec, BaseStation *st, TileIndex tile);
/* Allocate a StationSpec to a Station. This is called once per build operation. */
int AllocateSpecToStation(const StationSpec *statspec, BaseStation *st, bool exec);
@@ -125,7 +125,7 @@ void DeallocateSpecFromStation(BaseStation *st, byte specindex);
bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station);
void AnimateStationTile(TileIndex tile);
-void TriggerStationAnimation(const BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type = CT_INVALID);
+void TriggerStationAnimation(BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type = CT_INVALID);
void StationUpdateAnimTriggers(BaseStation *st);
#endif /* NEWGRF_STATION_H */
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 2f8dcda03..4425d1118 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -526,7 +526,7 @@ static void TileLoop_Object(TileIndex tile)
{
const ObjectSpec *spec = ObjectSpec::GetByTile(tile);
if (spec->flags & OBJECT_FLAG_ANIMATION) {
- const Object *o = Object::GetByTile(tile);
+ Object *o = Object::GetByTile(tile);
TriggerObjectTileAnimation(o, tile, OAT_TILELOOP, spec);
if (o->location.tile == tile) TriggerObjectAnimation(o, OAT_256_TICKS, spec);
}
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 696c0a8c2..8094b805d 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2505,7 +2505,7 @@ static void DrawTile_Station(TileInfo *ti)
const RailtypeInfo *rti = NULL;
uint32 relocation = 0;
uint32 ground_relocation = 0;
- const BaseStation *st = NULL;
+ BaseStation *st = NULL;
const StationSpec *statspec = NULL;
uint tile_layout = 0;