OpenTTD

effectvehicle_base.h
Go to the documentation of this file.
1 /* $Id: effectvehicle_base.h 23735 2012-01-03 20:26:05Z rubidium $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef EFFECTVEHICLE_BASE_H
13 #define EFFECTVEHICLE_BASE_H
14
15 #include "vehicle_base.h"
16 #include "transparency.h"
17
26 struct EffectVehicle FINAL : public SpecializedVehicle<EffectVehicle, VEH_EFFECT> {
27 uint16 animation_state;
28 byte animation_substate;
29
31 EffectVehicle() : SpecializedVehicleBase() {}
33 virtual ~EffectVehicle() {}
34
35 void UpdateDeltaXY(Direction direction);
36 bool Tick();
37 TransparencyOption GetTransparencyOption() const;
38 };
39
44 #define FOR_ALL_EFFECTVEHICLES(var) FOR_ALL_VEHICLES_OF_TYPE(EffectVehicle, var)
45
46 #endif /* EFFECTVEHICLE_BASE_H */
Vehicle::direction
DirectionByte direction
facing
Definition: vehicle_base.h:271
EffectVehicle::animation_substate
byte animation_substate
Sub state to time the change of the graphics/behaviour.
Definition: effectvehicle_base.h:28
EffectVehicle
A special vehicle is one of the following:
Definition: effectvehicle_base.h:26
EffectVehicle::~EffectVehicle
virtual ~EffectVehicle()
We want to &#39;destruct&#39; the right class.
Definition: effectvehicle_base.h:33
Direction
Direction
Defines the 8 directions on the map.
Definition: direction_type.h:26
EffectVehicle::EffectVehicle
EffectVehicle()
We don&#39;t want GCC to zero our struct! It already is zeroed and has an index!
Definition: effectvehicle_base.h:31
SpecializedVehicle
Class defining several overloaded accessors so we don&#39;t have to cast vehicle types that often...
Definition: vehicle_base.h:993
EffectVehicle::GetTransparencyOption
TransparencyOption GetTransparencyOption() const
Determines the transparency option affecting the effect.
Definition: effectvehicle.cpp:663
EffectVehicle::UpdateDeltaXY
void UpdateDeltaXY(Direction direction)
Updates the x and y offsets and the size of the sprite used for this vehicle.
Definition: effectvehicle.cpp:650
EffectVehicle::Tick
bool Tick()
Calls the tick handler of the vehicle.
Definition: effectvehicle.cpp:645
vehicle_base.h
Base class for all vehicles.
transparency.h
Functions related to transparency.
EffectVehicle::animation_state
uint16 animation_state
State primarily used to change the graphics/behaviour.
Definition: effectvehicle_base.h:27
TransparencyOption
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
Definition: transparency.h:24