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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef HOPKINS_COMPUTER_H
24 #define HOPKINS_COMPUTER_H
25 
26 #include "common/scummsys.h"
27 #include "common/str.h"
28 #include "common/rect.h"
29 
30 namespace Hopkins {
31 
32 class HopkinsEngine;
33 
34 enum ComputerEnum { COMPUTER_HOPKINS = 1, COMPUTER_SAMANTHA = 2, COMPUTER_PUBLIC = 3 };
35 
36 class ComputerManager {
37 private:
38 	HopkinsEngine *_vm;
39 
40 	struct MenuItem {
41 		int  _lineSize;
42 		char _line[90];
43 	};
44 
45 	struct ScoreItem {
46 		Common::String _name;
47 		Common::String _score;
48 	};
49 
50 	MenuItem _menuText[50];
51 	char _inputBuf[200];
52 	ScoreItem _score[6];
53 	int _textColor;
54 	Common::Point _textPosition;
55 	Common::Point _ballPosition;
56 	byte *_breakoutSpr;
57 	int16 *_breakoutLevel;
58 	int _breakoutBrickNbr;
59 	int _breakoutScore;
60 	int _breakoutLives;
61 	int _breakoutSpeed;
62 	bool _ballRightFl;
63 	bool _ballUpFl;
64 	int _breakoutLevelNbr;
65 	int _padPositionX;
66 	int _lowestHiScore;
67 	int _minBreakoutMoveSpeed;
68 	int _maxBreakoutMoveSpeed;
69 	int _lastBreakoutMoveSpeed;
70 
71 	void loadMenu();
72 	void restoreFBIRoom();
73 	void setVideoMode();
74 	void setTextMode();
75 	void clearScreen();
76 	void setTextColor(int col);
77 	void setTextPosition(int yp, int xp);
78 	void outText(const Common::String &msg);
79 	void outText2(const Common::String &msg);
80 	void readText(int idx);
81 	void loadHiscore();
82 	void newLevel();
83 	void setModeVGA256();
84 	void displayLives();
85 	void displayBricks();
86 	void displayGamesSubMenu();
87 	int displayHiscores();
88 	void displayHiscoreLine(const byte *objectData, int x, int y, int curChar);
89 	void displayMessage(int xp, int yp, int textIdx);
90 	void displayScore();
91 	void displayScoreChar(int charPos, int charDisp);
92 	void getScoreName();
93 	void playBreakout();
94 	int moveBall();
95 	void saveScore();
96 	void checkBallCollisions();
97 
98 public:
99 	ComputerManager(HopkinsEngine *vm);
100 
101 	void showComputer(ComputerEnum mode);
102 };
103 
104 } // End of namespace Hopkins
105 
106 #endif /* HOPKINS_COMPUTER_H */
107