ScummVM API documentation
cluster_manager_pc.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  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_CLUSTER_MANAGER_PC_H_INCLUDED
28 #define ICB_CLUSTER_MANAGER_PC_H_INCLUDED
29 
30 namespace ICB {
31 
32 // Global cluster controller declaration
33 class ClusterManager;
34 class MovieManager;
35 extern ClusterManager *g_theClusterManager;
36 extern MovieManager *g_while_u_wait_SequenceManager;
37 // Byte limit of filelists
38 #define MAX_BYTESIZE_OF_A_FILELIST (4 * 1024)
39 
40 enum MISSION_ID { MISSION1 = 0, MISSION2 = 1, MISSION3 = 2, MISSION4 = 3, MISSION5 = 4, MISSION7 = 5, MISSION8 = 6, MISSION9 = 7, MISSION10 = 8 };
41 
42 #define NUMBER_OF_PROGRESS_BITS 32
43 
44 typedef struct {
45  LRECT r;
46  int32 state;
47 } PROGRESS_BIT;
48 
49 enum TLANGUAGE { T_ENGLISH, T_FRENCH, T_ITALIAN, T_GERMAN, T_SPANISH, T_RUSSIAN, T_POLISH };
50 
52 private:
53  // Drive path of CD drives on installed system
54  char m_cdroot1[1024];
55  char m_cdroot2[1024];
56  bool8 m_multipleCDDrives;
57  int32 m_activeCDDrive;
58 
59  // Working mission directory name (hashed)
60  char m_missionDir[8];
61 
62  // You guessed it
63  uint32 m_bytesFreeOnInstalledDrive;
64 
65  // As cluster management is only necessary on minimum installs this
66  // acts as an on\off switch (state determined via VISE installer)
67  bool8 m_minimumInstall;
68 
69  // Filelist handling
70  char m_theList[MAX_BYTESIZE_OF_A_FILELIST];
71  uint32 m_filelistTotalBytes;
72  int32 m_filelistCursor;
73  int32 m_filelistSize;
74 
75  // These are to handle the chunk copying
77  Common::WriteStream *m_dst_fp;
78  uint32 m_currentFileSize;
79  uint32 m_chunkCounter;
80  uint32 m_bytesDone;
81  bool8 m_installDone;
82 
83  // Pointer to memory resident bink file
84  char *m_movieMemoryPointer;
85 
86  // Progress bar structures and counter
87  PROGRESS_BIT m_progressBits[NUMBER_OF_PROGRESS_BITS];
88  uint32 m_bitsDone;
89 
90  // Used to control decay on progress bar
91  uint32 m_frameCounter;
92 
93  TLANGUAGE m_currentLanguage;
94 
95 public:
97  ~ClusterManager();
98 
99  // Startup
100  void Initialise();
101 
102  // Useful methods for external modules
103  bool8 AreWeRunningAMinimumInstall() { return m_minimumInstall; }
104  char *GetCDRoot();
105  void CheckDiscInserted(MISSION_ID mission);
106  bool8 CheckDiscInsertedWithCancel(MISSION_ID mission);
107  void CheckAnyDiscInserted();
108 
109  // These handle the mission swapping
110  bool8 StartMissionInstall(MISSION_ID mission);
111  bool8 InstallMission();
112 
113  // Shutdown
114  void Shutdown();
115 
116  // Language enquirer (set in Initialise() function called at startup)
117  TLANGUAGE GetLanguage() { return m_currentLanguage; }
118 
119 private:
120  // Administration functions
121  void InterrogateDrives();
122  void CalculateFreeDiskSpace();
123  void MinimumInstallCheck();
124  bool8 IsMissionDataInstalled(MISSION_ID &m);
125  void CleanHardDisk();
126  int32 WhichCD(MISSION_ID mission);
127  bool8 CheckForCD(int32 number);
128  void MissingCD(int32 number);
129  bool8 MissingCDWithCancel(int32 number);
130 
131  // Filelist handling
132  void LoadFileList(MISSION_ID mission);
133  char *GetFileListEntry();
134 
135  // Visual update
136  bool8 DrawCoverFrame();
137 
138  // Progress bar management
139  void InitialiseProgressBits();
140  void UpdateProgressBits();
141  void DrawProgressBits();
142 };
143 
144 } // End of namespace ICB
145 
146 #endif
Definition: stream.h:77
Definition: actor.h:32
Definition: stream.h:745
Definition: cluster_manager_pc.h:44
Definition: px_types.h:32
Definition: cluster_manager_pc.h:51