OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
VehicleSoundEntity.h
1/*
2===========================================================================
3Copyright (C) 2015 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22// VehicleSoundEntity.h : Sound helper for vehicles
23
24#pragma once
25
26#include "entity.h"
27
28class Vehicle;
29
30class VehicleSoundEntity : public Entity
31{
32private:
33 SafePtr<Vehicle> m_pVehicle;
34 bool m_bDoSoundStuff;
35 int m_iTraceSurfaceFlags;
36
37public:
38 CLASS_PROTOTYPE(VehicleSoundEntity);
39
40 VehicleSoundEntity();
41 VehicleSoundEntity(Vehicle *owner);
42
43 void Start(void);
44 void Stop(void);
45 void Think(void) override;
46 void Archive(Archiver& arc) override;
47
48private:
49 void EventPostSpawn(Event *ev);
50 void EventUpdateTraces(Event *ev);
51 void DoSoundStuff(void);
52};
53
54inline void VehicleSoundEntity::Archive(Archiver& arc)
55{
56 Entity::Archive(arc);
57
58 arc.ArchiveSafePointer(&m_pVehicle);
59 arc.ArchiveBool(&m_bDoSoundStuff);
60 arc.ArchiveInteger(&m_iTraceSurfaceFlags);
61}
Definition archive.h:86
Definition listener.h:246
Definition safeptr.h:160
Definition vehicle.h:130