home *** CD-ROM | disk | FTP | other *** search
/ HOT Scene Stuff / hotscenestuffzyklop1996.iso / demos / sunknown / main.cpp < prev    next >
C/C++ Source or Header  |  1994-04-07  |  2KB  |  130 lines

  1. // SUPERUNKNOWN
  2. //
  3. // By Five, And Then Some.
  4. //
  5. // See the file SUNKNOWN.NFO for information regarding this source code.
  6.  
  7. // INCLUDES /////////////////////////////////////////////////////////////////
  8.  
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <stdio.h>
  12. #include <new.h>
  13. #include <dos.h>
  14. #include <conio.h>
  15.  
  16. #include "seg.h"
  17. #include "midi.h"
  18. #include "template.h"
  19. #include "xgraf.h"
  20. #include "timer.h"
  21. #include "keyscan.h"
  22. #include "voxel.h"
  23. #include "vx.h"
  24. #include "zoom.h"
  25. #include "morph.h"
  26. #include "dune.h"
  27. #include "ifs.h"
  28. #include "surface.h"
  29. #include "flamscrl.h"
  30. #include "eye.h"
  31.  
  32. // EXTERNALS ////////////////////////////////////////////////////////////////
  33.  
  34. extern void newhandler(void);
  35. extern "C"
  36. {
  37.   void smidigo(void);
  38.   void smidistart(void);
  39.   void smidireset(void);
  40.   void um_init_timers(void);
  41.   void um_cleanup_timers(void);
  42. }
  43.  
  44. // GLOBALS //////////////////////////////////////////////////////////////////
  45.  
  46. // STRUCTS
  47.  
  48. timer_C timer;
  49. keyscan_C keyscan;
  50. vx_C vx;
  51.  
  52. // SCALARS
  53.  
  54. ulong musicstart;
  55. int relspeed;
  56. long ticks,
  57.      modelx,
  58.      modely,
  59.      modelv;
  60. byte callmidi,
  61.      loop,
  62.      guson,
  63.      *pressed;
  64. void interrupt newkbdhandler(...);
  65. void interrupt (*oldkbdhandler)(...);
  66.  
  67. // ARRAYS
  68.  
  69. byte rgb[768];
  70.  
  71. // FUNCTIONS ////////////////////////////////////////////////////////////////
  72.  
  73. // QUIT
  74.  
  75. void quit(int val=0)
  76. {
  77.     if (guson)
  78.         smidireset();
  79.   else
  80.     um_cleanup_timers();
  81.   exit(val);
  82. }
  83.  
  84. // MAIN
  85.  
  86. void main(int argc, char **argv)
  87. {
  88.     set_new_handler(newhandler);
  89.   int testspeed=usepara(argc,argv,guson);
  90.  
  91.   do
  92.   {
  93.       if (guson)
  94.           smidistart();
  95.     else
  96.       um_init_timers();
  97.  
  98.       findrelspeed();
  99.  
  100.     if (testspeed)
  101.       showspeed();
  102.  
  103.       musicstart=timer.readtimer();
  104.       callmidi=guson;
  105.  
  106.       morph();
  107.       modex(1);
  108.       eye();
  109.       flamscrl();
  110.       zoom();
  111.       voxel();
  112.       ifs();
  113.       dune();
  114.       modex(1);
  115.       surface();
  116.  
  117.     if (guson)
  118.           smidireset();
  119.     else
  120.       um_cleanup_timers();
  121.  
  122.     for (int black=0; black<256; black++)
  123.       setrgb(black,0,0,0);
  124.  
  125.   } while (loop);
  126.  
  127.   bye();
  128.   quit();
  129. }
  130.