wolf_main.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. Copyright (C) 2004-2005 Michael Liebscher
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #include "../wolfiphone.h"
  16. level_locals_t levelstate;
  17. LRstruct LevelRatios;
  18. cvar_t *g_version; // Wolfenstein or Spear of Destiny
  19. cvar_t *episode;
  20. cvar_t *skill;
  21. char *spritelocation = WL6SPRITESDIRNAME;
  22. /*
  23. -----------------------------------------------------------------------------
  24. Function:
  25. Parameters:
  26. Returns:
  27. Notes:
  28. -----------------------------------------------------------------------------
  29. */
  30. PUBLIC void Game_Reset( void )
  31. {
  32. memset( &levelstate, 0, sizeof( levelstate ) );
  33. }
  34. extern void Map_f( void );
  35. /*
  36. -----------------------------------------------------------------------------
  37. Function:
  38. Parameters:
  39. Returns:
  40. Notes:
  41. -----------------------------------------------------------------------------
  42. */
  43. PUBLIC void Game_Init( void )
  44. {
  45. Com_Printf( "\n------ Game Init ------\n" );
  46. episode = Cvar_Get( "episode", "0", CVAR_ARCHIVE );
  47. skill = Cvar_Get( "skill", "1", CVAR_ARCHIVE );
  48. g_version = Cvar_Get( "g_version", "1", CVAR_ARCHIVE ); //we should make a #ifdef for "special version"
  49. //this version is to come with spear
  50. #ifndef LITE
  51. Cmd_AddCommand( "map", Map_f );
  52. #endif
  53. G_Build_Tables();
  54. Powerup_Reset();
  55. Sprite_Reset();
  56. Game_Reset();
  57. PL_Init();
  58. Com_Printf( "\n-----------------------\n" );
  59. }