moved code to separate function
[rocksndiamonds.git] / src / files.h
1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // files.h
10 // ============================================================================
11
12 #ifndef FILES_H
13 #define FILES_H
14
15 #include "main.h"
16
17
18 #define LEVEL_PACKED_START              100
19 #define PACKED_LEVELS(x)                (LEVEL_PACKED_START + x)
20
21 #define LEVEL_FILE_TYPE_RND_PACKED      PACKED_LEVELS(LEVEL_FILE_TYPE_RND)
22 #define LEVEL_FILE_TYPE_EM_PACKED       PACKED_LEVELS(LEVEL_FILE_TYPE_EM)
23
24 #define IS_SINGLE_LEVEL_FILE(x)         (x < LEVEL_PACKED_START)
25 #define IS_PACKED_LEVEL_FILE(x)         (x > LEVEL_PACKED_START)
26
27
28 void setElementChangePages(struct ElementInfo *, int);
29 void setElementChangeInfoToDefaults(struct ElementChangeInfo *);
30 void copyElementInfo(struct ElementInfo *, struct ElementInfo *);
31
32 boolean isLevelsetFilename_BD(char *);
33 char *getDefaultLevelFilename(int);
34 char *getLocalLevelTemplateFilename(void);
35 char *getGlobalLevelTemplateFilename(void);
36
37 int getMappedElement(int);
38
39 void LoadLevelFromFilename(struct LevelInfo *, char *);
40 void LoadLevel(int);
41 void LoadLevelTemplate(int);
42 void LoadLevelInfoOnly(int);
43 void LoadNetworkLevel(struct NetworkLevelInfo *);
44 void SaveLevel(int);
45 void SaveLevelTemplate(void);
46 void SaveNativeLevel(struct LevelInfo *);
47 void DumpLevel(struct LevelInfo *);
48 void DumpLevels(void);
49 boolean SaveLevelChecked(int);
50
51 void CopyNativeLevel_RND_to_Native(struct LevelInfo *);
52 void CopyNativeLevel_Native_to_RND(struct LevelInfo *);
53
54 void LoadTapeFromFilename(char *);
55 void LoadTape(int);
56 void LoadSolutionTape(int);
57 void LoadScoreTape(char *, int);
58 void LoadScoreCacheTape(char *, int);
59 void SaveTapeToFilename(char *);
60 void SaveTape(int);
61 void SaveScoreTape(int);
62 void DumpTape(struct TapeInfo *);
63 void DumpTapes(void);
64 boolean SaveTapeChecked(int);
65 boolean SaveTapeChecked_LevelSolved(int);
66
67 void LoadScore(int);
68 void SaveScore(int);
69
70 void LoadServerScore(int, boolean);
71 void SaveServerScore(int, boolean);
72 void SaveServerScoreFromFile(int, boolean, char *);
73
74 void LoadLocalAndServerScore(int, boolean);
75
76 void PrepareScoreTapesForUpload(char *);
77
78 void LoadUserNames(void);
79
80 void LoadSetupFromFilename(char *);
81 void LoadSetup_Default(void);
82 void SaveSetup_Default(void);
83
84 void LoadSetup_AutoSetup(void);
85 void SaveSetup_AutoSetup(void);
86
87 void LoadSetup_ServerSetup(void);
88 void SaveSetup_ServerSetup(void);
89
90 void LoadSetup_EditorCascade(void);
91 void SaveSetup_EditorCascade(void);
92
93 void LoadSetup(void);
94 void SaveSetup(void);
95
96 void SaveSetup_AddGameControllerMapping(char *);
97
98 void setHideSetupEntry(void *);
99 void removeHideSetupEntry(void *);
100 boolean hideSetupEntry(void *);
101
102 void LoadCustomElementDescriptions(void);
103 void InitMenuDesignSettings_FromHash(SetupFileHash *, boolean);
104 void InitMenuDesignSettings_Static(void);
105 void LoadMenuDesignSettings(void);
106 void LoadMenuDesignSettings_AfterGraphics(void);
107 void InitSoundSettings_FromHash(SetupFileHash *, boolean);
108 void InitSoundSettings_Static(void);
109 void LoadSoundSettings(void);
110 void LoadUserDefinedEditorElementList(int **, int *);
111 void LoadMusicInfo(void);
112 void LoadHelpAnimInfo(void);
113 void LoadHelpTextInfo(void);
114
115 void ConvertLevels(void);
116 void CreateLevelSketchImages(void);
117 void CreateCollectElementImages(void);
118 void CreateCustomElementImages(char *);
119
120 void FreeGlobalAnimEventInfo(void);
121 int GetGlobalAnimEventValue(int, int);
122 int GetGlobalAnimEventValueCount(int);
123
124 int get_parameter_value(char *, char *, int);
125
126 #endif  // FILES_H