ScummVM API documentation
preagi.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 AGI_PREAGI_PREAGI_H
23 #define AGI_PREAGI_PREAGI_H
24 
25 #include "agi/agi.h"
26 
27 namespace Audio {
28 class SoundHandle;
29 class PCSpeaker;
30 }
31 
32 namespace Agi {
33 
34 // default attributes
35 #define IDA_DEFAULT 0x0F
36 #define IDA_DEFAULT_REV 0xF0
37 
38 #define IDI_SND_OSCILLATOR_FREQUENCY 1193180
39 #define IDI_SND_TIMER_RESOLUTION 0.0182
40 
41 #define kColorDefault 0x1337
42 
43 #define IDI_MAX_ROW_PIC 20
44 
45 enum SelectionTypes {
46  kSelYesNo,
47  kSelNumber,
48  kSelSpace,
49  kSelAnyKey,
50  kSelBackspace
51 };
52 
53 class PreAgiEngine : public AgiBase {
54  int _gameId;
55 
56 protected:
57  void initialize() override;
58 
59  void pollTimer() {}
60  int getKeypress() override { return 0; }
61  bool isKeypress() override { return false; }
62  void clearKeyQueue() override {}
63 
64  PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc);
65  ~PreAgiEngine() override;
66  int getGameId() {
67  return _gameId;
68  }
69 
70  PictureMgr *_picture;
71 
72  void clearImageStack() override {}
73  void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
74  int16 p4, int16 p5, int16 p6, int16 p7) override {}
75  void replayImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
76  int16 p4, int16 p5, int16 p6, int16 p7) override {}
77  void releaseImageStack() override {}
78  int saveGame(const Common::String &fileName, const Common::String &saveName) { return -1; }
79  int loadGame(const Common::String &fileName, bool checkId = true) { return -1; }
80 
81  // Game
82  Common::String getTargetName() { return _targetName; }
83 
84  // Screen
85  void clearScreen(int attr, bool overrideDefault = true);
86  void clearGfxScreen(int attr);
87  void setDefaultTextColor(int attr) { _defaultColor = attr; }
88 
89  // Keyboard
90  int getSelection(SelectionTypes type);
91 
92  int rnd(int hi);
93 
94  // Text
95  void drawStr(int row, int col, int attr, const char *buffer);
96  void drawStrMiddle(int row, int attr, const char *buffer);
97  void clearTextArea();
98  void clearRow(int row);
99  void XOR80(char *buffer);
100  void printStr(const char *szMsg);
101  void printStrXOR(char *szMsg);
102 
103  // Saved Games
104  Common::SaveFileManager *getSaveFileMan() { return _saveFileMan; }
105 
106  void playNote(int16 frequency, int32 length);
107  void waitForTimer(int msec_delay);
108 
109 private:
110  int _defaultColor;
111 
112  Audio::PCSpeaker *_speakerStream;
113  Audio::SoundHandle *_speakerHandle;
114 };
115 
116 } // End of namespace Agi
117 
118 
119 #endif
Definition: str.h:59
Definition: agi.h:713
Definition: picture.h:66
Definition: mixer.h:49
Definition: preagi.h:53
Definition: savefile.h:142
Definition: system.h:161
Definition: detection.h:29
Definition: agi.h:63
Definition: pcspk.h:31
Definition: system.h:38