LOADDLG.H 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. ** Command & Conquer(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  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 3 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, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $Header: F:\projects\c&c\vcs\code\loaddlg.h_v 2.17 16 Oct 1995 16:48:02 JOE_BOSTIC $ */
  19. /***********************************************************************************************
  20. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : LOADDLG.H *
  26. * *
  27. * Programmer : Maria Legg, Joe Bostic, Bill Randolph *
  28. * *
  29. * Start Date : March 19, 1995 *
  30. * *
  31. * Last Update : March 19, 1995 *
  32. * *
  33. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  34. #ifndef LOADDLG_H
  35. #define LOADDLG_H
  36. class FileEntryClass {
  37. public:
  38. char Descr[40]; // save-game description
  39. unsigned Scenario; // scenario #
  40. HousesType House; // house
  41. int Num; // save file number (from the extension)
  42. unsigned long DateTime; // date/time stamp of file
  43. bool Valid; // Is the scenario valid?
  44. };
  45. class LoadOptionsClass
  46. {
  47. public:
  48. /*
  49. ** This defines the style of the dialog
  50. */
  51. typedef enum OperationModeEnum {
  52. NONE = 0,
  53. LOAD,
  54. SAVE,
  55. WWDELETE,
  56. } LoadStyleType;
  57. LoadOptionsClass (LoadStyleType style = LoadOptionsClass::NONE);
  58. ~LoadOptionsClass ();
  59. int Process (void);
  60. protected:
  61. /*
  62. ** Internal routines
  63. */
  64. void Clear_List (ListClass *list); // clears the list & game # array
  65. void Fill_List (ListClass *list); // fills the list & game # array
  66. int Num_From_Ext (char *fname); // translates filename to file #
  67. static int Compare(const void *p1, const void *p2); // for qsort()
  68. /*
  69. ** This is the requested style of the dialog
  70. */
  71. LoadStyleType Style;
  72. /*
  73. ** This is an array of pointers to FileEntryClass objects. These objects
  74. ** are allocated on the fly as files are found, and pointers to them are
  75. ** added to the vector list. Thus, all the objects must be free'd before
  76. ** the vector list is cleared. This list is used for sorting the files
  77. ** by date/time.
  78. */
  79. DynamicVectorClass<class FileEntryClass *> Files;
  80. };
  81. #endif