render.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. // This is the actual 3d engine. It is resposible for triangle rendering with effects.
  19. // It understands NOTHING of higher level structures -> that is controlled in
  20. // pipeline.h, which brings all the low level containers together into a
  21. // low level engine
  22. //
  23. #ifndef RENDER_H
  24. #define RENDER_H
  25. //==================================================
  26. #include "Blue.h"
  27. #ifdef PATHS_IN_INCLUDES
  28. #include "GREEN/BLiT/BLIT.H" // for rspLine
  29. #include "GREEN/3D/zbuffer.h" // for rspLine
  30. #include "ORANGE/color/colormatch.h"
  31. #include "ORANGE/QuickMath/VectorMath.h"
  32. #include "ORANGE/QuickMath/FixedPoint.h"
  33. #else
  34. #include "BLIT.H" // for rspLine
  35. #include "zbuffer.h" // for rspLine
  36. #include "colormatch.h"
  37. #include "vectormath.h"
  38. #include "fixedpoint.h"
  39. #endif
  40. //==================================================
  41. // all render effects on!
  42. // Offset pFog to line up with the location of the object.
  43. // Note that a unique fog table is needed for each
  44. // triangle color!
  45. //
  46. extern void DrawTri_ZColorFog(UCHAR* pDst,long lDstP,
  47. RP3d* p1,RP3d* p2,RP3d* p3,
  48. RZBuffer* pZB,UCHAR* pFog,
  49. short sOffsetX = 0, // In: 2D offset for pZB.
  50. short sOffsetY = 0); // In: 2D offset for pZB.
  51. //==================================================
  52. // For debugging:
  53. extern void DrawTri_wire(RImage* pimDst,short sX,short sY,
  54. RP3d* p1,RP3d* p2,RP3d* p3,UCHAR ucColor);
  55. extern void DrawTri_ZColor(UCHAR* pDst,long lDstP,
  56. RP3d* p1,RP3d* p2,RP3d* p3,
  57. RZBuffer* pZB,UCHAR pFlatColor,
  58. short sOffsetX = 0, // In: 2D offset for pZB.
  59. short sOffsetY = 0); // In: 2D offset for pZB.
  60. //==================================================
  61. //==================================================
  62. // FLAT SHADED!
  63. // sX and sY are additional offsets into pimDst
  64. // There is NO Z_BUFFER here! It is JUST a polygon drawer
  65. //
  66. extern void DrawTri(UCHAR* pDstOffset,long lDstP,
  67. RP3d* p1,RP3d* p2,RP3d* p3,
  68. UCHAR ucFlatColor);
  69. //==================================================
  70. #endif