improved handling and displaying dropped level set zip files into window
[rocksndiamonds.git] / src / libgame / setup.h
index 278269ab354acced5172a2b88cd9d0686aa9b02c..a60585993513299d880294c761173fd9bc3fc496 100644 (file)
@@ -16,7 +16,7 @@
 #include "hash.h"
 
 
-/* values for setup file handling */
+// values for setup file handling
 #define TYPE_BOOLEAN                   (1 << 0)
 #define TYPE_SWITCH                    (1 << 1)
 #define TYPE_SWITCH3                   (1 << 2)
 #define TYPE_ELEMENT                   (1 << 11)
 #define TYPE_GRAPHIC                   (1 << 12)
 
-/* additional values for setup screen */
+// additional values for setup screen
 #define TYPE_ENTER_SCREEN              (1 << 13)
 #define TYPE_LEAVE_SCREEN              (1 << 14)
 #define TYPE_ENTER_MENU                        (1 << 15)
 #define TYPE_LEAVE_MENU                        (1 << 16)
 #define TYPE_ENTER_LIST                        (1 << 17)
 #define TYPE_LEAVE_LIST                        (1 << 18)
-#define TYPE_EMPTY                     (1 << 19)
-#define TYPE_SKIPPABLE                 (1 << 20)
-#define TYPE_KEYTEXT                   (1 << 21)
+#define TYPE_TEXT_INPUT                        (1 << 19)
+#define TYPE_EMPTY                     (1 << 20)
+#define TYPE_SKIPPABLE                 (1 << 21)
+#define TYPE_KEYTEXT                   (1 << 22)
 
-#define TYPE_GHOSTED                   (1 << 22)
-#define TYPE_QUERY                     (1 << 23)
+#define TYPE_GHOSTED                   (1 << 23)
+#define TYPE_QUERY                     (1 << 24)
 
-/* additional values for internal purposes */
-#define TYPE_BITFIELD                  (1 << 24)
-#define TYPE_CONTENT                   (1 << 25)
-#define TYPE_ELEMENT_LIST              (1 << 26)
-#define TYPE_CONTENT_LIST              (1 << 27)
+// additional values for internal purposes
+#define TYPE_BITFIELD                  (1 << 25)
+#define TYPE_CONTENT                   (1 << 26)
+#define TYPE_ELEMENT_LIST              (1 << 27)
+#define TYPE_CONTENT_LIST              (1 << 28)
 
-/* derived values for setup file handling */
+// derived values for setup file handling
 #define TYPE_BOOLEAN_STYLE             (TYPE_BOOLEAN | \
                                         TYPE_SWITCH  | \
                                         TYPE_YES_NO  | \
                                         TYPE_ECS_AGA )
 
-/* derived values for setup screen */
+// derived values for setup screen
 #define TYPE_VALUE                     (TYPE_BOOLEAN_STYLE     | \
                                         TYPE_SWITCH3           | \
                                         TYPE_YES_NO_AUTO       | \
@@ -92,7 +93,7 @@ struct TokenInfo
   char *text;
 };
 
-/* some definitions for list and hash handling */
+// some definitions for list and hash handling
 typedef struct SetupFileList SetupFileList;
 typedef struct hashtable     SetupFileHash;
 
@@ -111,7 +112,7 @@ typedef struct hashtable     SetupFileHash;
   }                                                            \
 
 
-/* sort priorities of level series (also used as level series classes) */
+// sort priorities of level series (also used as level series classes)
 #define LEVELCLASS_TUTORIAL_START      10
 #define LEVELCLASS_TUTORIAL_END                99
 #define LEVELCLASS_CLASSICS_START      100
@@ -188,7 +189,7 @@ typedef struct hashtable     SetupFileHash;
                         IS_LEVELCLASS_SB(n) ? LEVELCLASS_SB :             \
                         LEVELCLASS_UNDEFINED)
 
-/* sort priorities of artwork */
+// sort priorities of artwork
 #define ARTWORKCLASS_CLASSICS_START    100
 #define ARTWORKCLASS_CLASSICS_END      199
 #define ARTWORKCLASS_CONTRIB_START     200
@@ -225,6 +226,9 @@ typedef struct hashtable     SetupFileHash;
                         ARTWORKCLASS_UNDEFINED)
 
 
+char *getUserGraphicsDir(void);
+char *getUserSoundsDir(void);
+char *getUserMusicDir(void);
 char *setLevelArtworkDir(TreeInfo *);
 char *getProgramMainDataPath(char *, char *);
 char *getProgramConfigFilename(char *);
@@ -276,6 +280,7 @@ char *getCommonDataDir(void);
 char *getPersonalDataDir(void);
 char *getUserGameDataDir(void);
 char *getSetupDir(void);
+char *getLevelDirFromTreeInfo(TreeInfo *);
 char *getUserLevelDir(char *);
 char *getNetworkLevelDir(char *);
 char *getCurrentLevelDir(void);
@@ -313,6 +318,9 @@ char *getSetupLine(struct TokenInfo *, char *, int);
 
 unsigned int get_hash_from_key(void *);
 
+int GetZipFileTreeType(char *);
+char *ExtractZipFileIntoDirectory(char *, char *, int);
+
 boolean AdjustGraphicsForEMC(void);
 
 void LoadLevelInfo(void);
@@ -323,6 +331,7 @@ char *getArtworkIdentifierForUserLevelSet(int);
 TreeInfo *getArtworkTreeInfoForUserLevelSet(int);
 boolean checkIfCustomArtworkExistsForCurrentLevelSet(void);
 void AddUserLevelSetToLevelInfo(char *);
+void AddTreeSetToTreeInfo(TreeInfo *, char *, char *, int);
 boolean UpdateUserLevelSet(char *, char *, char *, int);
 boolean CreateUserLevelSet(char *, char *, char *, int, boolean);
 
@@ -339,4 +348,4 @@ void LevelStats_setSolved(int, int);
 void LevelStats_incPlayed(int);
 void LevelStats_incSolved(int);
 
-#endif /* MISC_H */
+#endif // MISC_H