1 /*
2  * Files.h
3  * Copyright (C) 2007 by Bryan Duff <duff0097@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  */
20 #ifndef _FILES_H_
21 #define _FILES_H_
22 
23 #include <stdio.h>
24 #include <stdlib.h>             // Header File For Standard functions
25 #include <stdio.h>              // Header File For Standard Input/Output
26 #include <string.h>
27 #include <ctype.h>
28 #include <cstdarg>
29 #include <cmath>
30 #include <iostream>
31 #include <fstream>
32 #include <GL/gl.h>
33 #include <GL/glu.h>
34 #include "MacInput.h"           // Header for Special Mac Input functions
35 
36 #define FILE_STRINGS              130
37 #define Pstr unsigned char *
38 #define Cstr char *
39 
40 #define FILE_ERROR_ALERT          138
41 #define OLD_SAVE_VERSION          139
42 #define UNREADABLE_SCORES_ALERT   140
43 
44 #define SAVE_WARNING_ID           132
45 #define PB_SAVE                     1
46 #define PB_CANCEL                   2
47 #define PB_DONT_SAVE                3
48 
49 #define FILE_ERROR_STRINGS        129
50 #define FILE_ERROR_PREFIX           1
51 #define FILE_ERROR_SUFFIX           2
52 
53 #define SAVE_WARNING_STRINGS      132
54 
55 #define FILE_STRINGS              130
56 #define SAVE_GAME_STRING            1
57 #define SAVE_SCORES_STRING          2
58 #define SCORES_NAME_STRING          3
59 #define SAVE_JOURNAL_STRING         4
60 #define JOURNAL_NAME_STRING         5
61 #define UNTITLED_STRING             6
62 #define SAVE_FORM_STRING            7
63 #define FORM_NAME_STRING            8
64 
65 #define REGISTRATION_FORM         136
66 
67 #define FILE_NAME_SIZE             32
68 #define ERROR_LENGTH               80
69 
70 /**> Files Opening <**/
71 class Files {
72 public:
73   char szSavedGameName[FILE_NAME_SIZE + 1];
74   short sSavedGameVolume;
75   int sFile;
76 
77   int OpenFile(Str255 Name);
Files()78     Files():sFile(-1) {
79   }
80   short OpenSavedGame(Str255 Name);
81   short OpenFileDialog();
82   void LoadNamedMap(Str255 Name);
83   void LoadGame(Str255 Name, int animnum);
84 
85   void LoadMap();
86   void StartSave();
87   void EndSave();
88   void StartLoad();
89   void EndLoad();
90 };
91 
92 #endif
93