ScummVM API documentation
nis.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 LASTEXPRESS_NIS_H
23 #define LASTEXPRESS_NIS_H
24 
25 #include "lastexpress/lastexpress.h"
26 
27 #include "lastexpress/data/archive.h"
28 #include "lastexpress/sound/slot.h"
29 
30 namespace LastExpress {
31 
32 class LastExpressEngine;
33 class Slot;
34 
35 struct HPF;
36 struct Event;
37 struct NisSprite;
38 struct NisEvents;
39 struct Extent;
40 
41 #define NIS_SOUND_CHUNK_SIZE 739
42 
43 class NISManager {
44 
45 public:
47  ~NISManager();
48 
49  void clearBounds();
50  void addBounds(Extent extent);
51  void convertNSPR16(byte *spriteData, NisSprite *outSprite);
52  void getStream(byte *data, int32 size);
53  void loadSnd(int32 size);
54  int loadChunk(int32 size);
55  bool initNIS(const char *filename, int32 flags);
56  void endNIS();
57  void abortNIS();
58  void nisMouse(Event *event);
59  void nisTimer(Event *event);
60  void drawSprite(NisSprite *sprite);
61  void waxSprite(NisSprite *sprite);
62  void waneSprite(NisSprite *sprite);
63  void showNISStatus(int32 status);
64  bool doNIS(const char *name, int32 flags);
65  void processNIS(NisEvents *event);
66  void drawBK(int type);
67  void getNISSlot();
68 
69  Slot *getChainedSound();
70  void setChainedSound(Slot *slot);
71  int32 getNISFlag();
72 
73 private:
74  LastExpressEngine *_engine = nullptr;
75 
76  int32 _flags = 0;
77 
78  Common::Rect _nisRect = Common::Rect(0, 0, 0, 0);
79 
80  int32 _eventsCount = 0;
81  NisEvents *_events = nullptr;
82  byte *_eventsByteStream = nullptr;
83 
84  int32 _numOfOverlays = 0;
85 
86  HPF *_archive = nullptr;
87  Slot *_currentNISSound = nullptr;
88  Slot *_chainedSoundSlot = nullptr;
89 
90  int32 _streamCurrentPosition = 0;
91  int32 _currentStreamPage = 0;
92  int32 _totalStreamPages = 0;
93  int32 _remainingStreamBytes = 0;
94  int32 _streamBufferSize = 0;
95  int32 _totalBackgroundPages = 0;
96  Extent _spriteExtent;
97 
98  PixMap *_backgroundSurface = nullptr;
99  int32 _nisStatus = 0;
100  bool _decompressToBackBuffer = true;
101  bool _firstNISBackgroundDraw = true;
102  bool _waxWaneToggleFlag = false;
103 
104  NisSprite *_background1 = nullptr;
105  NisSprite *_background2 = nullptr;
106  NisSprite *_waneSprite = nullptr;
107  NisSprite *_waxSprite = nullptr;
108 
109  byte *_background1ByteStream = nullptr;
110  byte *_background2ByteStream = nullptr;
111  byte *_waneSpriteByteStream = nullptr;
112  byte *_waxSpriteByteStream = nullptr;
113 
114  int32 _cumulativeEventSize = 0;
115  bool _backgroundFlag = false;
116  int32 _backgroundType = 0;
117  int32 _selectBackgroundType = 0;
118  int32 _background1Offset = 0;
119  int32 _waneSpriteOffset = 0;
120 
121  PixMap *_originalBackgroundSurface = nullptr;
122 
123 
124  void (LastExpressEngine::*_savedTimerEventHandle)(Event *) = nullptr;
125  void (LastExpressEngine::*_savedMouseEventHandle)(Event *) = nullptr;
126 };
127 
128 } // End of namespace LastExpress
129 
130 #endif // LASTEXPRESS_NIS_H
Definition: lastexpress.h:523
Definition: archive.h:48
Definition: rect.h:524
Definition: lastexpress.h:488
Definition: archive.h:29
Definition: nis.h:43
Definition: events.h:62
Definition: sprites.h:31
Definition: slot.h:66
Definition: lastexpress.h:505