Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2011
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion )
  2. {
  3.     gEngfuncs = *pEnginefuncs;
  4.  
  5.     if (iVersion != CLDLL_INTERFACE_VERSION)
  6.         return 0;
  7.  
  8.     memcpy(&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t));
  9.  
  10.     BSPB.LoadBackgroundFile();
  11.  
  12.     EV_HookEvents();
  13.  
  14.     return 1;
  15. }
  16.  
  17. int BSPBackground::LoadBackgroundFile( void )
  18. {
  19.  
  20.     level_id = 1;
  21.  
  22.     ifstream infile("scripts/background%s.txt", level_id);
  23.  
  24.     if (!infile)
  25.     {
  26.         gEngfuncs.Con_Printf( "Cannot find background%s.txt . Game will load default background file.", level_id);
  27.     }
  28.     else
  29.     {
  30.         gEngfuncs.Con_Printf( "The file background%s.txt found ! Game will load specified background file.", level_id);
  31.  
  32.         vector<string> lines;
  33.         string line;
  34.  
  35.         while (getline(infile, line))
  36.         {
  37.             lines.push_back(line);
  38.         }
  39.  
  40.         infile.close();
  41.     }
  42.  
  43.  
  44.     return 1;
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement