summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-06-05 18:44:31 +0000
committerfrosch <frosch@openttd.org>2010-06-05 18:44:31 +0000
commit1d9a84a934f680094bddc18f730067d757d27444 (patch)
tree5e5ccb19f10ca224ba27b630e4daea0201a226a5 /src
parent02276183243e58999acffce2f4a2cf7c391abf4c (diff)
downloadopenttd-1d9a84a934f680094bddc18f730067d757d27444.tar.xz
(svn r19936) -Codechange: If there is an enum, also use it.
Diffstat (limited to 'src')
-rw-r--r--src/fios.cpp3
-rw-r--r--src/fios.h8
-rw-r--r--src/openttd.cpp2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index e58ddd9bd..398c7c7e3 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -32,6 +32,7 @@
SmallVector<FiosItem, 32> _fios_items;
static char *_fios_path;
SmallFiosItem _file_to_saveload;
+SortingBits _savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING;
/* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
extern bool FiosIsRoot(const char *path);
@@ -306,7 +307,7 @@ static void FiosGetFileList(SaveLoadDialogMode mode, fios_getlist_callback_proc
/* Sort the subdirs always by name, ascending, remember user-sorting order */
{
- byte order = _savegame_sort_order;
+ SortingBits order = _savegame_sort_order;
_savegame_sort_order = SORT_BY_NAME | SORT_ASCENDING;
QSortT(_fios_items.Begin(), _fios_items.Length(), CompareFiosItems);
_savegame_sort_order = order;
diff --git a/src/fios.h b/src/fios.h
index 42c50a9ba..c03ed9aab 100644
--- a/src/fios.h
+++ b/src/fios.h
@@ -14,6 +14,7 @@
#include "strings_type.h"
#include "core/smallvec_type.hpp"
+#include "core/enum_type.hpp"
enum FileSlots {
/**
@@ -86,12 +87,13 @@ enum SortingBits {
SORT_BY_DATE = 0,
SORT_BY_NAME = 2
};
+DECLARE_ENUM_AS_BIT_SET(SortingBits)
/* Variables to display file lists */
-extern SmallVector<FiosItem, 32> _fios_items; ///< defined in fios.cpp
+extern SmallVector<FiosItem, 32> _fios_items;
extern SmallFiosItem _file_to_saveload;
-extern SaveLoadDialogMode _saveload_mode; ///< defined in misc_gui.cpp
-extern byte _savegame_sort_order;
+extern SaveLoadDialogMode _saveload_mode;
+extern SortingBits _savegame_sort_order;
/* Launch save/load dialog */
void ShowSaveLoadDialog(SaveLoadDialogMode mode);
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 554e7dbf1..1aa9348b9 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -405,7 +405,6 @@ void MakeNewgameSettingsLive()
#endif /* ENABLE_AI */
}
-byte _savegame_sort_order;
#if defined(UNIX) && !defined(__MORPHOS__)
extern void DedicatedFork();
#endif
@@ -680,7 +679,6 @@ int ttd_main(int argc, char *argv[])
}
free(musicdriver);
- _savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING;
/* Initialize the zoom level of the screen to normal */
_screen.zoom = ZOOM_LVL_NORMAL;