ScummVM API documentation
bbdou_credits.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 #ifndef ILLUSIONS_BBDOU_BBDOU_CREDITS_H
23 #define ILLUSIONS_BBDOU_BBDOU_CREDITS_H
24 
25 #include "illusions/specialcode.h"
26 #include "illusions/thread.h"
27 
28 namespace Illusions {
29 
30 class IllusionsEngine_BBDOU;
31 class BbdouSpecialCode;
32 class Control;
33 
34 struct CreditsItem {
35  bool isUsed;
36  uint32 objectId;
37 };
38 
39 const uint kCreditsItemsCount = 64;
40 
41 class BbdouCredits {
42 public:
44  ~BbdouCredits();
45  void start(uint32 endSignalPropertyId, float speedModifier);
46  void stop();
47  void drawNextLine();
48  void updateTexts(int yIncr);
49 protected:
51  uint32 _endSignalPropertyId;
52  uint32 _currFontId;
53  uint _currLineIndex;
54  bool _split;
55  CreditsItem _items[kCreditsItemsCount];
56  const char *getText(uint index);
57  void drawTextToControl(uint32 objectId, const char *text, uint alignment);
58  bool readNextLine(uint &leftIndex, uint &rightIndex);
59  void initCreditsItems();
60  void freeCreditsItems();
61  uint32 getNextFreeObjectId();
62  void removeText(uint32 objectId);
63  void resetObjectPos(uint32 objectId);
64  void createCreditsThread(float speedModifier);
65 };
66 
67 class CreditsThread : public Thread {
68 public:
69  CreditsThread(IllusionsEngine_BBDOU *vm, BbdouCredits *credits, uint32 threadId, float speedModifier);
70  int onUpdate() override;
71  void onNotify() override;
72  void onResume() override;
73  void onTerminated() override;
74 public:
75  BbdouCredits *_credits;
76  float _speedModifier;
77  float _lastFraction;
78  uint32 _lastUpdateTime;
79 };
80 
81 } // End of namespace Illusions
82 
83 #endif // ILLUSIONS_BBDOU_BBDOU_CREDITS_H
Definition: bbdou_credits.h:41
Definition: actor.h:34
Definition: bbdou_credits.h:67
Definition: thread.h:47
Definition: bbdou_credits.h:34
Definition: illusions_bbdou.h:60