home *** CD-ROM | disk | FTP | other *** search
/ WarCraft 2000 - Nuclear Epidemic / W2000.nrg / SOURCE.War2000 / Fastdraw.h < prev    next >
C/C++ Source or Header  |  1998-07-29  |  2KB  |  76 lines

  1. /*               Fast raster graphics routine
  2.  *  
  3.  *  This module presents several useful procedures for fast output,
  4.  * using RLC graphics format (see the discription below). Before the
  5.  * wor you must call SetRlcWindow to set properly the screen 
  6.  * capabilities.After this you mast call SetScreenPtr to set the
  7.  * output distanation. Uou can use LoadRLC to load the set of RLC
  8.  * pictures into the RLCTable structure. Then you can draw the 
  9.  * picture on the screen wit the procedure ShowRLCItem 
  10.  */
  11. extern int WindX; 
  12. extern int WindY;
  13. extern int WindLx;
  14. extern int WindLy;
  15. extern int WindX1;
  16. extern int WindY1; 
  17. extern int ScrWidth;
  18. extern int ScrHeight;
  19. extern int BytesPerPixel;
  20. extern void* ScreenPtr;
  21. extern void* RealScreenPtr;
  22.  
  23. struct RLCHeader
  24. {
  25. short    SizeX;
  26. short    SizeY;
  27. };
  28. typedef RLCHeader* lpRLCHeader;
  29. struct xRLCTable
  30. {
  31. int sign;
  32. int    SCount;
  33. int OfsTable[32768000];
  34. };
  35. typedef xRLCTable* RLCTable; 
  36. typedef RLCTable* lpRLCTable;
  37. struct RLCFont
  38. {
  39. int    FirstSymbol;
  40. int LastSymbol;
  41. RLCTable RLC;
  42. };
  43. typedef RLCFont* lpRLCFont;
  44. void SetRLCWindow(int x,int y,int lx,int ly,int slx);
  45. void SetScreenPtr(void);
  46. int GetRLCWidth(RLCTable lpr,byte n);
  47. int GetRLCHeight(RLCTable lpr,byte n);
  48. /*      Showing the RLC picture
  49.  * 
  50.  *  This procedure needs window parameters to be initializated.
  51.  */
  52. void ShowRLC(int x,int y,void* PicPtr);
  53. //          Loading RLC file
  54. bool LoadRLC(LPCSTR lpFileName,RLCTable *RLCtbl);
  55. //       Showing RLC item
  56. void ShowRLCItem(int x,int y,lpRLCTable lprt,int n,byte nt);
  57. void ShowRLCItemShadow(int x,int y,lpRLCTable lprt,int n);
  58. void ClearScreen();
  59. void ShowString(int x,int y,LPCSTR lps,lpRLCFont lpf);
  60. void RegisterRLCFont(lpRLCFont lrf,RLCTable lpr,int fir);
  61. void LoadPalettes();
  62. /*
  63.  *                   Graphics routine
  64.  *                 RLC-format interface     
  65.  *
  66.  *RLC - description
  67.  *
  68.  *  unsigned int    Horisontal size of the picture
  69.  *  unsigned short  Vertical size of the sub-picture
  70.  *
  71.  *    byte          Number of RLE substrings
  72.  *    
  73.  *      byte        Length of the substring
  74.  *  
  75.  *  byte[...]       Colors table
  76.  */