home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / WGT_TC21.ZIP / WGT19.C < prev    next >
C/C++ Source or Header  |  1992-07-17  |  1KB  |  62 lines

  1. #include <conio.h>
  2. #include <stdio.h>
  3. #include "c:\tc\wgt\wgt.h"
  4. #include "c:\tc\wgt\spr.h"
  5. /*   WORDUP Graphics Toolkit   Version 2.1
  6.      Demonstration program 19
  7.  
  8.   This program loads in some sprite created with the
  9.   WordUp Sprite Creator.
  10.  
  11. */
  12.  
  13. block screen1;        // one virtual screen
  14. block sprites[201];    // you MUST make this array of 201
  15.             // this holds all the sprites in an array
  16.             // of blocks.
  17.  
  18. int y,sp;
  19. color palette[256];
  20.  
  21. void main(void)
  22. {
  23. vga256();        // initializes system
  24. wloadsprites(&palette,"c:\\tc\\wgt\\space.spr",sprites);    // load the sprites
  25. //     the palette,  the file,  the array of sprites
  26.  
  27.  
  28. screen1=wnewblock(0,0,319,199);
  29. wsetscreen(screen1);        // sets to screen1
  30.  
  31. sp=1;                // sprites always start at 1 in the array
  32.  
  33. msetbounds(0,0,160,199);
  34.  
  35. do {
  36. mread();
  37. for (y=0; y<200; y++)
  38.   {
  39.   wsetcolor(y);
  40.   wline(0,y,319,y);        // clear the screen by drawing horz lines (fast)
  41.   }
  42.  
  43. wputblock(mx,my,sprites[sp],1);    // put the block using xray mode at mouse position
  44. wcopyscreen(0,0,160,199,screen1,0,0,NULL);  // copy the whole screen
  45. // notice how we never use wnormscreen at all!
  46. if (but==1)
  47.    {
  48.    sp++;
  49.    if (sp>4) sp=1;
  50.    noclick();
  51.    }
  52.  
  53.  
  54. } while (but !=2);        // right button exits
  55.  
  56. msetbounds(0,0,319,199);
  57.  
  58.  
  59. wfreeblock(screen1);    // remember to free that memory
  60. wfreesprites(sprites);  // frees all sprites
  61. textmode(C80);                // used to return to text mode
  62. }