(svn r19936) -Codechange: If there is an enum, also use it.

pull/155/head
frosch 14 years ago
parent b470c084b2
commit 8ef0aed0ae

@ -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;

@ -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);

@ -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;

Loading…
Cancel
Save