Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Portions of this file are copyright Rebirth contributors and licensed as
  3.  * described in COPYING.txt.
  4.  * Portions of this file are copyright Parallax Software and licensed
  5.  * according to the Parallax license below.
  6.  * See COPYING.txt for license details.
  7.  
  8. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  9. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  10. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  11. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  12. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  13. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  14. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  15. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  16. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  17. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  18. */
  19.  
  20. /*
  21.  *
  22.  * Menu prototypes and variables
  23.  *
  24.  */
  25.  
  26. #ifndef _MENU_H
  27. #define _MENU_H
  28.  
  29. #include <array>
  30. #include <chrono>
  31. #include "dsx-ns.h"
  32. #include "strutil.h"
  33.  
  34. namespace dcx {
  35.  
  36. template <typename Rep, std::size_t MaximumValue = std::numeric_limits<Rep>::max()>
  37. using human_readable_mmss_time = std::array<char, number_to_text_length<MaximumValue / 60> + number_to_text_length<60> + sizeof("ms")>;
  38.  
  39. template <typename Rep, std::size_t S>
  40. void format_human_readable_time(std::array<char, S> &buf, const std::chrono::duration<Rep, std::chrono::seconds::period> duration);
  41.  
  42. template <typename Rep, std::size_t S>
  43. void parse_human_readable_time(std::chrono::duration<Rep, std::chrono::seconds::period> &duration, const std::array<char, S> &buf);
  44.  
  45. }
  46.  
  47. extern int hide_menus(void);
  48. extern void show_menus(void);
  49.  
  50. #ifdef dsx
  51. namespace dsx {
  52. // returns number of item chosen
  53. extern int DoMenu();
  54. }
  55. #endif
  56. extern void do_options_menu();
  57. extern int select_demo(void);
  58.  
  59. #if defined(DXX_BUILD_DESCENT_I)
  60. #define Menu_pcx_name (((SWIDTH>=640&&SHEIGHT>=480) && PHYSFSX_exists("menuh.pcx",1))?"menuh.pcx":"menu.pcx")
  61. #define STARS_BACKGROUND (((SWIDTH>=640&&SHEIGHT>=480) && PHYSFSX_exists("starsb.pcx",1))?"starsb.pcx":"stars.pcx")
  62. #elif defined(DXX_BUILD_DESCENT_II)
  63. #define MENU_PCX_MAC_SHARE ("menub.pcx")
  64. #define MENU_PCX_SHAREWARE ("menud.pcx")
  65. #define MENU_PCX_OEM (HIRESMODE?"menuob.pcx":"menuo.pcx")
  66. #define MENU_PCX_FULL (HIRESMODE?"menub.pcx":"menu.pcx")
  67.  
  68. // name of background bitmap
  69. #define Menu_pcx_name (PHYSFSX_exists(MENU_PCX_FULL,1)?MENU_PCX_FULL:(PHYSFSX_exists(MENU_PCX_OEM,1)?MENU_PCX_OEM:PHYSFSX_exists(MENU_PCX_SHAREWARE,1)?MENU_PCX_SHAREWARE:MENU_PCX_MAC_SHARE))
  70. #define STARS_BACKGROUND ((HIRESMODE && PHYSFSX_exists("starsb.pcx",1))?"starsb.pcx":PHYSFSX_exists("stars.pcx",1)?"stars.pcx":"starsb.pcx")
  71. #endif
  72.  
  73. #endif /* _MENU_H */
  74.