ScummVM API documentation
part_particle.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * This file is based on WME Lite.
24  * http://dead-code.org/redir.php?target=wmelite
25  * Copyright (c) 2011 Jan Nedoma
26  */
27 
28 #ifndef WINTERMUTE_PARTPARTICLE_H
29 #define WINTERMUTE_PARTPARTICLE_H
30 
31 
32 #include "engines/wintermute/base/base.h"
33 #include "engines/wintermute/math/rect32.h"
34 #include "engines/wintermute/math/vector2.h"
35 
36 namespace Wintermute {
37 
38 class PartEmitter;
39 class BaseSprite;
40 class BasePersistenceManager;
41 
42 class PartParticle : public BaseClass {
43 public:
44  enum TParticleState {
45  PARTICLE_NORMAL, PARTICLE_FADEIN, PARTICLE_FADEOUT
46  };
47 
48  PartParticle(BaseGame *inGame);
49  ~PartParticle() override;
50 
51  float _growthRate;
52  bool _exponentialGrowth;
53 
54  float _rotation;
55  float _angVelocity;
56 
57  int32 _alpha1;
58  int32 _alpha2;
59 
60  Rect32 _border;
61  Vector2 _pos;
62  float _posZ;
63  Vector2 _velocity;
64  float _scale;
65  BaseSprite *_sprite;
66  uint32 _creationTime;
67  int32 _lifeTime;
68  bool _isDead;
69  TParticleState _state;
70 
71  bool update(PartEmitter *emitter, uint32 currentTime, uint32 timerDelta);
72  bool display(PartEmitter *emitter);
73 
74  bool setSprite(const Common::String &filename);
75 
76  bool fadeIn(uint32 currentTime, int fadeTime);
77  bool fadeOut(uint32 currentTime, int fadeTime);
78 
79  bool persist(BasePersistenceManager *PersistMgr) override;
80 private:
81  uint32 _fadeStart;
82  int32 _fadeTime;
83  int32 _currentAlpha;
84  int32 _fadeStartAlpha;
85 };
86 
87 } // End of namespace Wintermute
88 
89 #endif
Definition: base_game.h:75
Definition: str.h:59
Definition: base_persistence_manager.h:55
Definition: part_particle.h:42
Definition: vector2.h:33
Definition: rect32.h:60
Definition: part_emitter.h:38
Definition: base.h:43
Definition: base_sprite.h:40
Definition: achievements_tables.h:27