home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Amiga / Jeux / demos / crystalPPC.lha / scan.h < prev    next >
C/C++ Source or Header  |  1998-01-15  |  3KB  |  91 lines

  1. #ifndef SCAN_H
  2. #define SCAN_H
  3.  
  4. #define INTERPOL_STEP 16
  5.  
  6. class Camera;
  7. class Texture;
  8. class Textures;
  9. class Filter;
  10. class Polygon3D;
  11. class Graphics;
  12. class PolyTexture;
  13.  
  14. struct SegmentInfo
  15. {
  16.   float x1, y1, z1;    // Left side
  17.   float x2, y2, z2;    // Right side
  18.   float x_left, x_right;
  19. };
  20.  
  21. // This structure is used to put information for the scanline drawer in a global
  22. // structure (for efficiency).
  23. class Scan
  24. {
  25. public:
  26.   // All global variables
  27.   static Graphics* g;
  28.   static Camera* c;
  29.   static Texture* texture;
  30.   static Textures* textures;
  31.   static unsigned char* tmap;
  32.   static int texnr;
  33.   static int tw;
  34.   static int th;
  35.   static int shf_w, and_w;
  36.   static int shf_h, and_h;
  37.   static float t11, t12, t13;    // Texture transform matrix
  38.   static float t21, t22, t23;
  39.   static float t31, t32, t33;
  40.   static float tx, ty, tz;
  41.   static SegmentInfo sinfo;
  42.   static unsigned long* z_buffer;
  43.  
  44.   static unsigned char* tmap2;
  45.   static int tw2;
  46.   static int th2;
  47.   static float fdu, fdv;
  48.   static int shf_u;
  49.  
  50.   // Draw one horizontal scanline for one polygon.
  51.   static void draw_scanline_flat (int xx, unsigned char* d, unsigned long* z_buf,
  52.                 float inv_z, float u_div_z, float v_div_z,
  53.               float M, float J1, float K1);
  54.   static void draw_scanline_z_buf_flat (int xx, unsigned char* d, unsigned long* z_buf,
  55.                 float inv_z, float u_div_z, float v_div_z,
  56.               float M, float J1, float K1);
  57.   static void draw_scanline (int xx, unsigned char* d, unsigned long* z_buf,
  58.                 float inv_z, float u_div_z, float v_div_z,
  59.               float M, float J1, float K1);
  60.   static void draw_scanline_map (int xx, unsigned char* d, unsigned long* z_buf,
  61.               float inv_z, float u_div_z, float v_div_z,
  62.               float M, float J1, float K1);
  63.   static void draw_scanline_transp (int xx, unsigned char* d, unsigned long* z_buf,
  64.               float inv_z, float u_div_z, float v_div_z,
  65.               float M, float J1, float K1);
  66.   static void draw_scanline_filtered (int xx, unsigned char* d, unsigned long* z_buf,
  67.               float inv_z, float u_div_z, float v_div_z,
  68.               float M, float J1, float K1);
  69.   static void draw_scanline_z_buf (int xx, unsigned char* d, unsigned long* z_buf,
  70.               float inv_z, float u_div_z, float v_div_z,
  71.               float M, float J1, float K1);
  72.   static void draw_scanline_z_buf_map (int xx, unsigned char* d, unsigned long* z_buf,
  73.               float inv_z, float u_div_z, float v_div_z,
  74.               float M, float J1, float K1);
  75.  
  76. #if 0
  77.   // Light one horizontal scanline for one polygon.
  78.   static void light_scanline (int xx,
  79.                   int uu, int vv,
  80.                   unsigned char* d,
  81.                   float d1, float d2, float dd1, float dd2,
  82.                   float dd_u, float da_u, float dd_v, float da_v,
  83.                   int lu, int lv, int sq_rad);
  84. #endif
  85.  
  86.   static void init_draw (Polygon3D* p, PolyTexture* tex);
  87. };
  88.  
  89. #endif /*SCAN_H*/
  90.  
  91.