home *** CD-ROM | disk | FTP | other *** search
/ Cutting-Edge 3D Game Programming with C++ / CE3DC++.ISO / BOOK / CHAP12 / PALETTE.HPP < prev    next >
C/C++ Source or Header  |  1996-04-19  |  752b  |  38 lines

  1. //
  2. // File name: Palette.HPP
  3. //
  4. // Description: A palette setting inline function.
  5. //
  6. // Author: John De Goes
  7. //
  8. // Project: Cutting Edge 3D Game Programming
  9. //
  10. // Target: 32-bit OS
  11. //
  12.  
  13. #ifndef PALETTEHPP
  14. #define PALETTEHPP
  15.  
  16. void inline SetPalReg ( long Index, char Red, char Green, char Blue )
  17.    {
  18.    REGS Regs;
  19.    Regs.w.ax  = 0x1010;
  20.    Regs.x.ebx = Index;
  21.    Regs.h.ch  = Red;
  22.    Regs.h.cl  = Green;
  23.    Regs.h.dh  = Blue;
  24.    int386 ( 0x10, &Regs, &Regs );
  25.    }
  26.  
  27. void inline setpalreg ( long Index, char Red, char Green, char Blue )
  28.    {
  29.    REGS Regs;
  30.    Regs.w.ax  = 0x1010;
  31.    Regs.x.ebx = Index;
  32.    Regs.h.ch  = Red;
  33.    Regs.h.cl  = Green;
  34.    Regs.h.dh  = Blue;
  35.    int386 ( 0x10, &Regs, &Regs );
  36.    }
  37.  
  38. #endif