home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 2.12 / 1997-01_Disc_2.12.iso / rexblade / vcrun.cpp < prev    next >
C/C++ Source or Header  |  1996-09-10  |  3KB  |  95 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // VCRUN.CPP                                                               //
  3. //                                                                         //
  4. // Rex Blade(tm) Virtual Computer                                          //
  5. // Copyright (c) 1996 Xtreme Games                                         //
  6. // All rights reserved.                                                    //
  7. /////////////////////////////////////////////////////////////////////////////
  8.  
  9. // INCLUDES /////////////////////////////////////////////////////////////////
  10. #include "gv.h"
  11. #include "vc.h"
  12.  
  13. // DEFINES //////////////////////////////////////////////////////////////////
  14.  
  15. // STRUCTURES ///////////////////////////////////////////////////////////////
  16.  
  17. // GLOBALS //////////////////////////////////////////////////////////////////
  18. rex_vc_context_obj info;
  19.  
  20. // PROTOTYPES ///////////////////////////////////////////////////////////////
  21.  
  22.  
  23. // SOUND & MIDI ROUTINES
  24. int PlaySndFile(char *filename, int volume, int rate)
  25. {
  26.   return(0);
  27. }
  28.  
  29. int PlaySnd(int sound_name, int volume, int rate)
  30. {
  31.   return(0);
  32. }
  33.  
  34. int PlayMid(int midi_name, int volume)
  35. {
  36.   return(0);
  37. }
  38.  
  39. int StopMid(int midi_id)
  40. {
  41.   return(0);
  42. }
  43.  
  44. // RPC
  45. int RPC(rex_rpc_obj_ptr request)
  46. {
  47.   int result;
  48.  
  49.   switch (request->command)
  50.   {
  51.     case REX_RPC_COMM_TELEPORT_ENTER: result = REX_RPC_RESULT_YES; break;
  52.     case REX_RPC_COMM_TELEPORT_LEVEL: result = REX_RPC_RESULT_YES; break;
  53.   }
  54.  
  55.   return result;
  56. }
  57.  
  58. // MAIN /////////////////////////////////////////////////////////////////////
  59. void main()
  60. {
  61.   // init double buffer
  62.   rex_vc_dblbuf = GV_PageNew();
  63.  
  64.   // init sound & midi interface
  65.   //Rex_VC_Play_Dig = &PlaySnd;
  66.   //Rex_VC_Play_Mid = &PlayMid;
  67.   //Rex_VC_Stop_Mid = &StopMid;
  68.  
  69.   // RPC
  70.   Rex_VC_RPC_Interface = RPC;
  71.  
  72.   // init vc context
  73.   strcpy((char *)&info.world_name, "");
  74.   strcpy((char *)&info.level_name, "");
  75.   strcpy((char *)&info.qa_file, "world1.qa");
  76.   strcpy((char *)&info.log_file, "world1.log");
  77.   strcpy((char *)&info.pass_file, "world1.pwd");
  78.   strcpy((char *)&info.program_file, "world1.prg");
  79.   strcpy((char *)&info.splash_file, "world1.spl");
  80.   strcpy((char *)&info.com_file_pcx, "world1.mon");
  81.  
  82.   // init graph mode
  83.   GV_ModeSet(0x013);
  84.  
  85.   // run virtual computer
  86.   Rex_VC_Run(&info);
  87.  
  88.   // free double buffer
  89.   GV_PageFree(rex_vc_dblbuf);
  90.  
  91.   // init text mode
  92.   GV_ModeSet(0x03);
  93. }
  94.  
  95.