Browse Source

additive blending and other exotic blend modes

David Rose 17 years ago
parent
commit
203b7f1a89

+ 4 - 2
panda/src/tinydisplay/Sources.pp

@@ -34,8 +34,10 @@
     specbuf.cxx \
     specbuf.cxx \
     texture.cxx vertex.cxx \
     texture.cxx vertex.cxx \
     zbuffer.cxx zbuffer.h zdither.cxx zfeatures.h zgl.h zline.cxx \
     zbuffer.cxx zbuffer.h zdither.cxx zfeatures.h zgl.h zline.cxx \
-    zline.h zmath.cxx zmath.h ztriangle.cxx ztriangle.h ztriangle_two.h \
-    ztriangle_code.h ztriangle_table.h 
+    zline.h zmath.cxx zmath.h \
+    ztriangle.cxx ztriangle.h ztriangle_two.h \
+    ztriangle_code.h ztriangle_table.h \
+    store_pixel.cxx store_pixel.h store_pixel_code.h store_pixel_table.h
 
 
 #end lib_target
 #end lib_target
 
 

+ 28 - 0
panda/src/tinydisplay/store_pixel.cxx

@@ -0,0 +1,28 @@
+// Filename: store_pixel.cxx
+// Created by:  drose (12May08)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://etc.cmu.edu/panda3d/docs/license/ .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "zbuffer.h"
+
+/* Pick up all of the generated code references to store_pixel.h. */
+
+#define STORE_PIX_CLAMP(x) (min((x), (unsigned int)0xffff))
+
+#include "store_pixel_table.h"
+#include "store_pixel_code.h"

+ 42 - 0
panda/src/tinydisplay/store_pixel.h

@@ -0,0 +1,42 @@
+// Filename: store_pixel.h
+// Created by:  drose (12May08)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://etc.cmu.edu/panda3d/docs/license/ .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+/* Definition of a function to store a pixel in the framebuffer, using
+   user-specified color blending. */
+
+/* This file generates lots of "template" variations, using #define
+   and #include, similar to the way ztriangle.h works. */
+
+static void 
+FNAME(store_pixel) (ZBuffer *zb, PIXEL &result, int r, int g, int b, int a) {
+  unsigned int fr = PIXEL_R(result);
+  unsigned int fg = PIXEL_G(result);
+  unsigned int fb = PIXEL_B(result);
+  unsigned int fa = PIXEL_A(result);
+
+  r = STORE_PIX_CLAMP(((unsigned int)r * OP_A(fr, r) >> 16) + ((unsigned int)fr * OP_B(fr, r) >> 16));
+  g = STORE_PIX_CLAMP(((unsigned int)g * OP_A(fg, g) >> 16) + ((unsigned int)fg * OP_B(fg, g) >> 16));
+  b = STORE_PIX_CLAMP(((unsigned int)b * OP_A(fb, b) >> 16) + ((unsigned int)fb * OP_B(fb, b) >> 16));
+  a = STORE_PIX_CLAMP(((unsigned int)a * OP_A(fa, a) >> 16) + ((unsigned int)fa * OP_B(fa, a) >> 16));
+  result = RGBA_TO_PIXEL(r, g, b, a);
+}
+
+
+#undef FNAME  
+#undef OP_A
+#undef OP_B

+ 75 - 0
panda/src/tinydisplay/store_pixel.py

@@ -0,0 +1,75 @@
+""" This simple Python script can be run to generate
+store_pixel_code.h and store_pixel_table.h, which are a poor man's
+form of generated code to cover the explosion of different blending
+options when storing a pixel into the framebuffer.
+
+Each different combination of options is compiled to a different
+inner-loop store function.  The code in tinyGraphicsStateGuardian.cxx
+will select the appropriate function pointer at draw time. """
+
+Operands = [
+    'zero', 'one',
+    'icolor', 'micolor',
+    'fcolor', 'mfcolor',
+    'ialpha', 'mialpha',
+    'falpha', 'mfalpha',
+    'ccolor', 'mccolor',
+    'calpha', 'mcalpha',
+]
+
+CodeTable = {
+    'zero' : '0',
+    'one' : '0x10000',
+    'icolor' : 'i',
+    'micolor' : '0xffff - i',
+    'fcolor' : 'f',
+    'mfcolor' : '0xffff - f',
+    'ialpha' : 'a',
+    'mialpha' : '0xffff - a',
+    'falpha' : 'fa',
+    'mfalpha' : '0xffff - fa',
+    'ccolor' : 'zb->blend_ ## i',
+    'mccolor' : '0xffff - zb->blend_ ## i',
+    'calpha' : 'zb->blend_a',
+    'mcalpha' : '0xffff - zb->blend_a',
+}    
+
+def getFname(op_a, op_b):
+    return 'store_pixel_%s_%s' % (op_a, op_b)
+
+# We write the code that actually instantiates the various
+# pixel-storing functions to store_pixel_code.h.
+code = open('store_pixel_code.h', 'wb')
+print >> code, '/* This file is generated code--do not edit.  See store_pixel.py. */'
+print >> code, ''
+
+# The external reference for the table containing the above function
+# pointers gets written here.
+table = open('store_pixel_table.h', 'wb')
+print >> table, '/* This file is generated code--do not edit.  See store_pixel.py. */'
+print >> table, ''
+
+for op_a in Operands:
+    for op_b in Operands:
+        fname = getFname(op_a, op_b)
+        print >> code, '#define FNAME(name) %s' % (fname)
+        print >> code, '#define OP_A(f, i) ((unsigned int)(%s))' % (CodeTable[op_a])
+        print >> code, '#define OP_B(f, i) ((unsigned int)(%s))' % (CodeTable[op_eb])
+        print >> code, '#include "store_pixel.h"'
+        print >> code, ''
+        
+
+# Now, generate the table of function pointers.
+arraySize = '[%s][%s]' % (len(Operands), len(Operands))
+
+print >> table, 'extern const ZB_storePixelFunc store_pixel_funcs%s;' % (arraySize)
+print >> code, 'const ZB_storePixelFunc store_pixel_funcs%s = {' % (arraySize)
+
+for op_a in Operands:
+    print >> code, '  {'
+    for op_b in Operands:
+        fname = getFname(op_a, op_b)
+        print >> code, '    %s,' % (fname)
+    print >> code, '  },'
+print >> code, '};'
+

+ 1208 - 0
panda/src/tinydisplay/store_pixel_code.h

@@ -0,0 +1,1208 @@
+/* This file is generated code--do not edit.  See store_pixel.py. */
+
+#define FNAME(name) store_pixel_zero_zero
+#define OP_A(f, i) 0
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_one
+#define OP_A(f, i) 0
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_icolor
+#define OP_A(f, i) 0
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_micolor
+#define OP_A(f, i) 0
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_fcolor
+#define OP_A(f, i) 0
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_mfcolor
+#define OP_A(f, i) 0
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_ialpha
+#define OP_A(f, i) 0
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_mialpha
+#define OP_A(f, i) 0
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_falpha
+#define OP_A(f, i) 0
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_mfalpha
+#define OP_A(f, i) 0
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_ccolor
+#define OP_A(f, i) 0
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_mccolor
+#define OP_A(f, i) 0
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_calpha
+#define OP_A(f, i) 0
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_zero_mcalpha
+#define OP_A(f, i) 0
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_zero
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_one
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_icolor
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_micolor
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_fcolor
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_mfcolor
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_ialpha
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_mialpha
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_falpha
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_mfalpha
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_ccolor
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_mccolor
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_calpha
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_one_mcalpha
+#define OP_A(f, i) 0x10000
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_zero
+#define OP_A(f, i) i
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_one
+#define OP_A(f, i) i
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_icolor
+#define OP_A(f, i) i
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_micolor
+#define OP_A(f, i) i
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_fcolor
+#define OP_A(f, i) i
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_mfcolor
+#define OP_A(f, i) i
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_ialpha
+#define OP_A(f, i) i
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_mialpha
+#define OP_A(f, i) i
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_falpha
+#define OP_A(f, i) i
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_mfalpha
+#define OP_A(f, i) i
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_ccolor
+#define OP_A(f, i) i
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_mccolor
+#define OP_A(f, i) i
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_calpha
+#define OP_A(f, i) i
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_icolor_mcalpha
+#define OP_A(f, i) i
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_zero
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_one
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_icolor
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_micolor
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_fcolor
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_mfcolor
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_ialpha
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_mialpha
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_falpha
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_mfalpha
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_ccolor
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_mccolor
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_calpha
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_micolor_mcalpha
+#define OP_A(f, i) (0xffff - i)
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_zero
+#define OP_A(f, i) f
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_one
+#define OP_A(f, i) f
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_icolor
+#define OP_A(f, i) f
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_micolor
+#define OP_A(f, i) f
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_fcolor
+#define OP_A(f, i) f
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_mfcolor
+#define OP_A(f, i) f
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_ialpha
+#define OP_A(f, i) f
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_mialpha
+#define OP_A(f, i) f
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_falpha
+#define OP_A(f, i) f
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_mfalpha
+#define OP_A(f, i) f
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_ccolor
+#define OP_A(f, i) f
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_mccolor
+#define OP_A(f, i) f
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_calpha
+#define OP_A(f, i) f
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_fcolor_mcalpha
+#define OP_A(f, i) f
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_zero
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_one
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_icolor
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_micolor
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_fcolor
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_mfcolor
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_ialpha
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_mialpha
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_falpha
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_mfalpha
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_ccolor
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_mccolor
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_calpha
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfcolor_mcalpha
+#define OP_A(f, i) (0xffff - f)
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_zero
+#define OP_A(f, i) a
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_one
+#define OP_A(f, i) a
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_icolor
+#define OP_A(f, i) a
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_micolor
+#define OP_A(f, i) a
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_fcolor
+#define OP_A(f, i) a
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_mfcolor
+#define OP_A(f, i) a
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_ialpha
+#define OP_A(f, i) a
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_mialpha
+#define OP_A(f, i) a
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_falpha
+#define OP_A(f, i) a
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_mfalpha
+#define OP_A(f, i) a
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_ccolor
+#define OP_A(f, i) a
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_mccolor
+#define OP_A(f, i) a
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_calpha
+#define OP_A(f, i) a
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ialpha_mcalpha
+#define OP_A(f, i) a
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_zero
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_one
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_icolor
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_micolor
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_fcolor
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_mfcolor
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_ialpha
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_mialpha
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_falpha
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_mfalpha
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_ccolor
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_mccolor
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_calpha
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mialpha_mcalpha
+#define OP_A(f, i) (0xffff - a)
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_zero
+#define OP_A(f, i) fa
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_one
+#define OP_A(f, i) fa
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_icolor
+#define OP_A(f, i) fa
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_micolor
+#define OP_A(f, i) fa
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_fcolor
+#define OP_A(f, i) fa
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_mfcolor
+#define OP_A(f, i) fa
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_ialpha
+#define OP_A(f, i) fa
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_mialpha
+#define OP_A(f, i) fa
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_falpha
+#define OP_A(f, i) fa
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_mfalpha
+#define OP_A(f, i) fa
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_ccolor
+#define OP_A(f, i) fa
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_mccolor
+#define OP_A(f, i) fa
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_calpha
+#define OP_A(f, i) fa
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_falpha_mcalpha
+#define OP_A(f, i) fa
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_zero
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_one
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_icolor
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_micolor
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_fcolor
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_mfcolor
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_ialpha
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_mialpha
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_falpha
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_mfalpha
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_ccolor
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_mccolor
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_calpha
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mfalpha_mcalpha
+#define OP_A(f, i) (0xffff - fa)
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_zero
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_one
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_icolor
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_micolor
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_fcolor
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_mfcolor
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_ialpha
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_mialpha
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_falpha
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_mfalpha
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_ccolor
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_mccolor
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_calpha
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_ccolor_mcalpha
+#define OP_A(f, i) zb->blend_ ## i
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_zero
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_one
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_icolor
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_micolor
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_fcolor
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_mfcolor
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_ialpha
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_mialpha
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_falpha
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_mfalpha
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_ccolor
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_mccolor
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_calpha
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mccolor_mcalpha
+#define OP_A(f, i) (0xffff - zb->blend_ ## i)
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_zero
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_one
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_icolor
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_micolor
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_fcolor
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_mfcolor
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_ialpha
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_mialpha
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_falpha
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_mfalpha
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_ccolor
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_mccolor
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_calpha
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_calpha_mcalpha
+#define OP_A(f, i) zb->blend_a
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_zero
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) 0
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_one
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) 0x10000
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_icolor
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_micolor
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) (0xffff - i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_fcolor
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) f
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_mfcolor
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) (0xffff - f)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_ialpha
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_mialpha
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) (0xffff - a)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_falpha
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) fa
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_mfalpha
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) (0xffff - fa)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_ccolor
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) zb->blend_ ## i
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_mccolor
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) (0xffff - zb->blend_ ## i)
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_calpha
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) zb->blend_a
+#include "store_pixel.h"
+
+#define FNAME(name) store_pixel_mcalpha_mcalpha
+#define OP_A(f, i) (0xffff - zb->blend_a)
+#define OP_B(f, i) (0xffff - zb->blend_a)
+#include "store_pixel.h"
+
+const ZB_storePixelFunc store_pixel_funcs[14][14] = {
+  {
+    store_pixel_zero_zero,
+    store_pixel_zero_one,
+    store_pixel_zero_icolor,
+    store_pixel_zero_micolor,
+    store_pixel_zero_fcolor,
+    store_pixel_zero_mfcolor,
+    store_pixel_zero_ialpha,
+    store_pixel_zero_mialpha,
+    store_pixel_zero_falpha,
+    store_pixel_zero_mfalpha,
+    store_pixel_zero_ccolor,
+    store_pixel_zero_mccolor,
+    store_pixel_zero_calpha,
+    store_pixel_zero_mcalpha,
+  },
+  {
+    store_pixel_one_zero,
+    store_pixel_one_one,
+    store_pixel_one_icolor,
+    store_pixel_one_micolor,
+    store_pixel_one_fcolor,
+    store_pixel_one_mfcolor,
+    store_pixel_one_ialpha,
+    store_pixel_one_mialpha,
+    store_pixel_one_falpha,
+    store_pixel_one_mfalpha,
+    store_pixel_one_ccolor,
+    store_pixel_one_mccolor,
+    store_pixel_one_calpha,
+    store_pixel_one_mcalpha,
+  },
+  {
+    store_pixel_icolor_zero,
+    store_pixel_icolor_one,
+    store_pixel_icolor_icolor,
+    store_pixel_icolor_micolor,
+    store_pixel_icolor_fcolor,
+    store_pixel_icolor_mfcolor,
+    store_pixel_icolor_ialpha,
+    store_pixel_icolor_mialpha,
+    store_pixel_icolor_falpha,
+    store_pixel_icolor_mfalpha,
+    store_pixel_icolor_ccolor,
+    store_pixel_icolor_mccolor,
+    store_pixel_icolor_calpha,
+    store_pixel_icolor_mcalpha,
+  },
+  {
+    store_pixel_micolor_zero,
+    store_pixel_micolor_one,
+    store_pixel_micolor_icolor,
+    store_pixel_micolor_micolor,
+    store_pixel_micolor_fcolor,
+    store_pixel_micolor_mfcolor,
+    store_pixel_micolor_ialpha,
+    store_pixel_micolor_mialpha,
+    store_pixel_micolor_falpha,
+    store_pixel_micolor_mfalpha,
+    store_pixel_micolor_ccolor,
+    store_pixel_micolor_mccolor,
+    store_pixel_micolor_calpha,
+    store_pixel_micolor_mcalpha,
+  },
+  {
+    store_pixel_fcolor_zero,
+    store_pixel_fcolor_one,
+    store_pixel_fcolor_icolor,
+    store_pixel_fcolor_micolor,
+    store_pixel_fcolor_fcolor,
+    store_pixel_fcolor_mfcolor,
+    store_pixel_fcolor_ialpha,
+    store_pixel_fcolor_mialpha,
+    store_pixel_fcolor_falpha,
+    store_pixel_fcolor_mfalpha,
+    store_pixel_fcolor_ccolor,
+    store_pixel_fcolor_mccolor,
+    store_pixel_fcolor_calpha,
+    store_pixel_fcolor_mcalpha,
+  },
+  {
+    store_pixel_mfcolor_zero,
+    store_pixel_mfcolor_one,
+    store_pixel_mfcolor_icolor,
+    store_pixel_mfcolor_micolor,
+    store_pixel_mfcolor_fcolor,
+    store_pixel_mfcolor_mfcolor,
+    store_pixel_mfcolor_ialpha,
+    store_pixel_mfcolor_mialpha,
+    store_pixel_mfcolor_falpha,
+    store_pixel_mfcolor_mfalpha,
+    store_pixel_mfcolor_ccolor,
+    store_pixel_mfcolor_mccolor,
+    store_pixel_mfcolor_calpha,
+    store_pixel_mfcolor_mcalpha,
+  },
+  {
+    store_pixel_ialpha_zero,
+    store_pixel_ialpha_one,
+    store_pixel_ialpha_icolor,
+    store_pixel_ialpha_micolor,
+    store_pixel_ialpha_fcolor,
+    store_pixel_ialpha_mfcolor,
+    store_pixel_ialpha_ialpha,
+    store_pixel_ialpha_mialpha,
+    store_pixel_ialpha_falpha,
+    store_pixel_ialpha_mfalpha,
+    store_pixel_ialpha_ccolor,
+    store_pixel_ialpha_mccolor,
+    store_pixel_ialpha_calpha,
+    store_pixel_ialpha_mcalpha,
+  },
+  {
+    store_pixel_mialpha_zero,
+    store_pixel_mialpha_one,
+    store_pixel_mialpha_icolor,
+    store_pixel_mialpha_micolor,
+    store_pixel_mialpha_fcolor,
+    store_pixel_mialpha_mfcolor,
+    store_pixel_mialpha_ialpha,
+    store_pixel_mialpha_mialpha,
+    store_pixel_mialpha_falpha,
+    store_pixel_mialpha_mfalpha,
+    store_pixel_mialpha_ccolor,
+    store_pixel_mialpha_mccolor,
+    store_pixel_mialpha_calpha,
+    store_pixel_mialpha_mcalpha,
+  },
+  {
+    store_pixel_falpha_zero,
+    store_pixel_falpha_one,
+    store_pixel_falpha_icolor,
+    store_pixel_falpha_micolor,
+    store_pixel_falpha_fcolor,
+    store_pixel_falpha_mfcolor,
+    store_pixel_falpha_ialpha,
+    store_pixel_falpha_mialpha,
+    store_pixel_falpha_falpha,
+    store_pixel_falpha_mfalpha,
+    store_pixel_falpha_ccolor,
+    store_pixel_falpha_mccolor,
+    store_pixel_falpha_calpha,
+    store_pixel_falpha_mcalpha,
+  },
+  {
+    store_pixel_mfalpha_zero,
+    store_pixel_mfalpha_one,
+    store_pixel_mfalpha_icolor,
+    store_pixel_mfalpha_micolor,
+    store_pixel_mfalpha_fcolor,
+    store_pixel_mfalpha_mfcolor,
+    store_pixel_mfalpha_ialpha,
+    store_pixel_mfalpha_mialpha,
+    store_pixel_mfalpha_falpha,
+    store_pixel_mfalpha_mfalpha,
+    store_pixel_mfalpha_ccolor,
+    store_pixel_mfalpha_mccolor,
+    store_pixel_mfalpha_calpha,
+    store_pixel_mfalpha_mcalpha,
+  },
+  {
+    store_pixel_ccolor_zero,
+    store_pixel_ccolor_one,
+    store_pixel_ccolor_icolor,
+    store_pixel_ccolor_micolor,
+    store_pixel_ccolor_fcolor,
+    store_pixel_ccolor_mfcolor,
+    store_pixel_ccolor_ialpha,
+    store_pixel_ccolor_mialpha,
+    store_pixel_ccolor_falpha,
+    store_pixel_ccolor_mfalpha,
+    store_pixel_ccolor_ccolor,
+    store_pixel_ccolor_mccolor,
+    store_pixel_ccolor_calpha,
+    store_pixel_ccolor_mcalpha,
+  },
+  {
+    store_pixel_mccolor_zero,
+    store_pixel_mccolor_one,
+    store_pixel_mccolor_icolor,
+    store_pixel_mccolor_micolor,
+    store_pixel_mccolor_fcolor,
+    store_pixel_mccolor_mfcolor,
+    store_pixel_mccolor_ialpha,
+    store_pixel_mccolor_mialpha,
+    store_pixel_mccolor_falpha,
+    store_pixel_mccolor_mfalpha,
+    store_pixel_mccolor_ccolor,
+    store_pixel_mccolor_mccolor,
+    store_pixel_mccolor_calpha,
+    store_pixel_mccolor_mcalpha,
+  },
+  {
+    store_pixel_calpha_zero,
+    store_pixel_calpha_one,
+    store_pixel_calpha_icolor,
+    store_pixel_calpha_micolor,
+    store_pixel_calpha_fcolor,
+    store_pixel_calpha_mfcolor,
+    store_pixel_calpha_ialpha,
+    store_pixel_calpha_mialpha,
+    store_pixel_calpha_falpha,
+    store_pixel_calpha_mfalpha,
+    store_pixel_calpha_ccolor,
+    store_pixel_calpha_mccolor,
+    store_pixel_calpha_calpha,
+    store_pixel_calpha_mcalpha,
+  },
+  {
+    store_pixel_mcalpha_zero,
+    store_pixel_mcalpha_one,
+    store_pixel_mcalpha_icolor,
+    store_pixel_mcalpha_micolor,
+    store_pixel_mcalpha_fcolor,
+    store_pixel_mcalpha_mfcolor,
+    store_pixel_mcalpha_ialpha,
+    store_pixel_mcalpha_mialpha,
+    store_pixel_mcalpha_falpha,
+    store_pixel_mcalpha_mfalpha,
+    store_pixel_mcalpha_ccolor,
+    store_pixel_mcalpha_mccolor,
+    store_pixel_mcalpha_calpha,
+    store_pixel_mcalpha_mcalpha,
+  },
+};

+ 3 - 0
panda/src/tinydisplay/store_pixel_table.h

@@ -0,0 +1,3 @@
+/* This file is generated code--do not edit.  See store_pixel.py. */
+
+extern const ZB_storePixelFunc store_pixel_funcs[14][14];

+ 75 - 5
panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx

@@ -30,6 +30,7 @@
 #include "zgl.h"
 #include "zgl.h"
 #include "zmath.h"
 #include "zmath.h"
 #include "ztriangle_table.h"
 #include "ztriangle_table.h"
+#include "store_pixel_table.h"
 
 
 TypeHandle TinyGraphicsStateGuardian::_type_handle;
 TypeHandle TinyGraphicsStateGuardian::_type_handle;
 
 
@@ -680,21 +681,36 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader,
     depth_write_state = 1;  // zoff
     depth_write_state = 1;  // zoff
   }
   }
 
 
-  int color_write_state = 0;  // noblend
+  int color_write_state = 0;  // cstore
   switch (_target._transparency->get_mode()) {
   switch (_target._transparency->get_mode()) {
   case TransparencyAttrib::M_alpha:
   case TransparencyAttrib::M_alpha:
   case TransparencyAttrib::M_dual:
   case TransparencyAttrib::M_dual:
-    color_write_state = 1;    // blend
+    color_write_state = 1;    // cblend
     break;
     break;
 
 
   default:
   default:
     break;
     break;
   }
   }
 
 
+  if (_target._color_blend->get_mode() == ColorBlendAttrib::M_add) {
+    // If we have a color blend set that we can support, it overrides
+    // the transparency set.
+    int op_a = get_color_blend_op(_target._color_blend->get_operand_a());
+    int op_b = get_color_blend_op(_target._color_blend->get_operand_b());
+    _c->zb->store_pix_func = store_pixel_funcs[op_a][op_b];
+    Colorf c = _target._color_blend->get_color();
+    _c->zb->blend_r = (int)(c[0] * ZB_POINT_RED_MAX);
+    _c->zb->blend_g = (int)(c[1] * ZB_POINT_GREEN_MAX);
+    _c->zb->blend_b = (int)(c[2] * ZB_POINT_BLUE_MAX);
+    _c->zb->blend_a = (int)(c[3] * ZB_POINT_ALPHA_MAX);
+
+    color_write_state = 2;     // cgeneral
+  }
+
   unsigned int color_channels =
   unsigned int color_channels =
     _target._color_write->get_channels() & _color_write_mask;
     _target._color_write->get_channels() & _color_write_mask;
   if (color_channels == ColorWriteAttrib::C_off) {
   if (color_channels == ColorWriteAttrib::C_off) {
-    color_write_state = 2;    // nocolor
+    color_write_state = 3;    // coff
   }
   }
 
 
   int alpha_test_state = 0;   // anone
   int alpha_test_state = 0;   // anone
@@ -710,13 +726,13 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader,
   case AlphaTestAttrib::M_less:
   case AlphaTestAttrib::M_less:
   case AlphaTestAttrib::M_less_equal:
   case AlphaTestAttrib::M_less_equal:
     alpha_test_state = 1;    // aless
     alpha_test_state = 1;    // aless
-    _c->zb->reference_alpha = (unsigned int)_target._alpha_test->get_reference_alpha() * 0xff00;
+    _c->zb->reference_alpha = (int)_target._alpha_test->get_reference_alpha() * ZB_POINT_ALPHA_MAX;
     break;
     break;
 
 
   case AlphaTestAttrib::M_greater:
   case AlphaTestAttrib::M_greater:
   case AlphaTestAttrib::M_greater_equal:
   case AlphaTestAttrib::M_greater_equal:
     alpha_test_state = 2;    // amore
     alpha_test_state = 2;    // amore
-    _c->zb->reference_alpha = (unsigned int)_target._alpha_test->get_reference_alpha() * 0xff00;
+    _c->zb->reference_alpha = (int)_target._alpha_test->get_reference_alpha() * ZB_POINT_ALPHA_MAX;
     break;
     break;
   }
   }
 
 
@@ -2141,3 +2157,57 @@ load_matrix(M4 *matrix, const TransformState *transform) {
     matrix->m[3][i] = pm.get_cell(i, 3);
     matrix->m[3][i] = pm.get_cell(i, 3);
   }
   }
 }
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: TinyGraphicsStateGuardian::get_color_blend_op
+//       Access: Private, Static
+//  Description: Returns the integer element of store_pixel_funcs (as
+//               defined by store_pixel.py) that corresponds to the
+//               indicated ColorBlendAttrib operand code.
+////////////////////////////////////////////////////////////////////
+int TinyGraphicsStateGuardian::
+get_color_blend_op(ColorBlendAttrib::Operand operand) {
+  switch (operand) {
+  case ColorBlendAttrib::O_zero:
+    return 0;
+  case ColorBlendAttrib::O_one:
+    return 1;
+  case ColorBlendAttrib::O_incoming_color:
+    return 2;
+  case ColorBlendAttrib::O_one_minus_incoming_color:
+    return 3;
+  case ColorBlendAttrib::O_fbuffer_color:
+    return 4;
+  case ColorBlendAttrib::O_one_minus_fbuffer_color:
+    return 5;
+  case ColorBlendAttrib::O_incoming_alpha:
+    return 6;
+  case ColorBlendAttrib::O_one_minus_incoming_alpha:
+    return 7;
+  case ColorBlendAttrib::O_fbuffer_alpha:
+    return 8;
+  case ColorBlendAttrib::O_one_minus_fbuffer_alpha:
+    return 9;
+  case ColorBlendAttrib::O_constant_color:
+    return 10;
+  case ColorBlendAttrib::O_one_minus_constant_color:
+    return 11;
+  case ColorBlendAttrib::O_constant_alpha:
+    return 12;
+  case ColorBlendAttrib::O_one_minus_constant_alpha:
+    return 13;
+
+  case ColorBlendAttrib::O_incoming_color_saturate:
+    return 1;
+
+  case ColorBlendAttrib::O_color_scale:
+    return 10;
+  case ColorBlendAttrib::O_one_minus_color_scale:
+    return 11;
+  case ColorBlendAttrib::O_alpha_scale:
+    return 12;
+  case ColorBlendAttrib::O_one_minus_alpha_scale:
+    return 13;
+  }
+  return 0;
+}

+ 2 - 1
panda/src/tinydisplay/tinyGraphicsStateGuardian.h

@@ -22,7 +22,7 @@
 #include "pandabase.h"
 #include "pandabase.h"
 
 
 #include "graphicsStateGuardian.h"
 #include "graphicsStateGuardian.h"
-#include "tinySDLGraphicsPipe.h"
+#include "colorBlendAttrib.h"
 #include "simpleLru.h"
 #include "simpleLru.h"
 #include "zmath.h"
 #include "zmath.h"
 #include "zbuffer.h"
 #include "zbuffer.h"
@@ -118,6 +118,7 @@ private:
 
 
   void setup_material(GLMaterial *gl_material, const Material *material);
   void setup_material(GLMaterial *gl_material, const Material *material);
   static void load_matrix(M4 *matrix, const TransformState *transform);
   static void load_matrix(M4 *matrix, const TransformState *transform);
+  static int get_color_blend_op(ColorBlendAttrib::Operand operand);
 
 
 public:
 public:
   // Filled in by the Tiny*GraphicsWindow at begin_frame().
   // Filled in by the Tiny*GraphicsWindow at begin_frame().

+ 15 - 694
panda/src/tinydisplay/zbuffer.h

@@ -100,7 +100,15 @@ typedef struct {
   unsigned int s_mask, t_mask, t_shift;
   unsigned int s_mask, t_mask, t_shift;
 } ZTextureLevel;
 } ZTextureLevel;
 
 
-typedef struct {
+typedef struct ZBuffer ZBuffer;
+typedef struct ZBufferPoint ZBufferPoint;
+
+typedef void (*ZB_fillTriangleFunc)(ZBuffer  *,
+                                    ZBufferPoint *,ZBufferPoint *,ZBufferPoint *);
+
+typedef void (*ZB_storePixelFunc) (ZBuffer *zb, PIXEL &result, int r, int g, int b, int a);
+
+struct ZBuffer {
   int xsize,ysize;
   int xsize,ysize;
   int linesize; /* line size, in bytes */
   int linesize; /* line size, in bytes */
   int mode;
   int mode;
@@ -113,16 +121,18 @@ typedef struct {
   unsigned char *dctable;
   unsigned char *dctable;
   int *ctable;
   int *ctable;
   ZTextureLevel *current_texture;  // This is actually an array of texture levels.
   ZTextureLevel *current_texture;  // This is actually an array of texture levels.
-  unsigned int reference_alpha;
-} ZBuffer;
+  int reference_alpha;
+  int blend_r, blend_g, blend_b, blend_a;
+  ZB_storePixelFunc store_pix_func;
+};
 
 
-typedef struct {
+struct ZBufferPoint {
   int x,y,z;     /* integer coordinates in the zbuffer */
   int x,y,z;     /* integer coordinates in the zbuffer */
   int s,t;       /* coordinates for the mapping */
   int s,t;       /* coordinates for the mapping */
   int r,g,b,a;     /* color indexes */
   int r,g,b,a;     /* color indexes */
   
   
   float sz,tz;   /* temporary coordinates for mapping */
   float sz,tz;   /* temporary coordinates for mapping */
-} ZBufferPoint;
+};
 
 
 /* zbuffer.c */
 /* zbuffer.c */
 
 
@@ -161,695 +171,6 @@ void ZB_plot(ZBuffer *zb,ZBufferPoint *p);
 void ZB_line(ZBuffer *zb,ZBufferPoint *p1,ZBufferPoint *p2);
 void ZB_line(ZBuffer *zb,ZBufferPoint *p1,ZBufferPoint *p2);
 void ZB_line_z(ZBuffer * zb, ZBufferPoint * p1, ZBufferPoint * p2);
 void ZB_line_z(ZBuffer * zb, ZBufferPoint * p1, ZBufferPoint * p2);
 
 
-/* ztriangle.c */
-
-void ZB_fillTriangleFlat_xx_zon_noblend_anone_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_noblend_anone_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_noblend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_noblend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_noblend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_noblend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_noblend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_noblend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_noblend_anone_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_noblend_anone_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_noblend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_noblend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_noblend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_noblend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_noblend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_noblend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_noblend_aless_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_noblend_aless_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_noblend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_noblend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_noblend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_noblend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_noblend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_noblend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_noblend_aless_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_noblend_aless_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_noblend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_noblend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_noblend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_noblend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_noblend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_noblend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_noblend_amore_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_noblend_amore_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_noblend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_noblend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_noblend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_noblend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_noblend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_noblend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_noblend_amore_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_noblend_amore_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_noblend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_noblend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_noblend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_noblend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_noblend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_noblend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_blend_anone_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_blend_anone_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_blend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_blend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_blend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_blend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_blend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_blend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_blend_anone_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_blend_anone_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_blend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_blend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_blend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_blend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_blend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_blend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_blend_aless_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_blend_aless_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_blend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_blend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_blend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_blend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_blend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_blend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_blend_aless_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_blend_aless_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_blend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_blend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_blend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_blend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_blend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_blend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_blend_amore_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_blend_amore_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_blend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_blend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_blend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_blend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_blend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_blend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_blend_amore_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_blend_amore_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_blend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_blend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_blend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_blend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_blend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_blend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_nocolor_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_nocolor_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_nocolor_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_nocolor_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_nocolor_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zon_nocolor_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_noblend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_noblend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_noblend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_noblend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_noblend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_noblend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_blend_anone_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_blend_anone_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_blend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_blend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_blend_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_blend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_blend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_blend_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_blend_anone_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_blend_anone_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_blend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_blend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_blend_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_blend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_blend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_blend_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_blend_aless_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_blend_aless_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_blend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_blend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_blend_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_blend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_blend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_blend_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_blend_aless_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_blend_aless_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_blend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_blend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_blend_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_blend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_blend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_blend_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_blend_amore_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_blend_amore_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_blend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_blend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_blend_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_blend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_blend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_blend_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_blend_amore_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_blend_amore_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_blend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_blend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_blend_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_blend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_blend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_blend_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_nocolor_anone_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_nocolor_anone_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_nocolor_aless_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_nocolor_aless_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_nocolor_amore_znone(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-void ZB_fillTriangleFlat_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-		 ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleSmooth_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-		   ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMapping_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingFlat_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-void ZB_fillTriangleMappingSmooth_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-		    ZBufferPoint *p1,ZBufferPoint *p2,ZBufferPoint *p3);
-
-void ZB_fillTriangleMappingPerspective_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveFlat_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-void ZB_fillTriangleMappingPerspectiveSmooth_xx_zoff_nocolor_amore_zless(ZBuffer *zb,
-                    ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2);
-
-
-typedef void (*ZB_fillTriangleFunc)(ZBuffer  *,
-	    ZBufferPoint *,ZBufferPoint *,ZBufferPoint *);
 
 
 /* memory.c */
 /* memory.c */
 void gl_free(void *p);
 void gl_free(void *p);

+ 5 - 4
panda/src/tinydisplay/ztriangle.py

@@ -15,7 +15,7 @@ Options = [
     [ 'zon', 'zoff' ],
     [ 'zon', 'zoff' ],
 
 
     # color write
     # color write
-    [ 'noblend', 'blend', 'nocolor' ],
+    [ 'cstore', 'cblend', 'cgeneral', 'coff' ],
 
 
     # alpha test
     # alpha test
     [ 'anone', 'aless', 'amore' ],
     [ 'anone', 'aless', 'amore' ],
@@ -45,9 +45,10 @@ CodeTable = {
     'zoff' : '#define STORE_Z(zpix, z)',
     'zoff' : '#define STORE_Z(zpix, z)',
 
 
     # color write
     # color write
-    'noblend' : '#define STORE_PIX(pix, rgb, r, g, b, a) (pix) = (rgb)',
-    'blend' : '#define STORE_PIX(pix, rgb, r, g, b, a) (pix) = PIXEL_BLEND_RGB(pix, r, g, b, a)',
-    'nocolor' : '#define STORE_PIX(pix, rgb, r, g, b, a)',
+    'cstore' : '#define STORE_PIX(pix, rgb, r, g, b, a) (pix) = (rgb)',
+    'cblend' : '#define STORE_PIX(pix, rgb, r, g, b, a) (pix) = PIXEL_BLEND_RGB(pix, r, g, b, a)',
+    'cgeneral' : '#define STORE_PIX(pix, rgb, r, g, b, a) zb->store_pix_func(zb, pix, r, g, b, a)',
+    'coff' : '#define STORE_PIX(pix, rgb, r, g, b, a)',
 
 
     # alpha test
     # alpha test
     'anone' : '#define ACMP(zb, a) 1',
     'anone' : '#define ACMP(zb, a) 1',

File diff suppressed because it is too large
+ 561 - 109
panda/src/tinydisplay/ztriangle_code.h


+ 1 - 1
panda/src/tinydisplay/ztriangle_table.h

@@ -1,3 +1,3 @@
 /* This file is generated code--do not edit.  See ztriangle.py. */
 /* This file is generated code--do not edit.  See ztriangle.py. */
 
 
-extern const ZB_fillTriangleFunc fill_tri_funcs[2][3][3][2][2][3][3];
+extern const ZB_fillTriangleFunc fill_tri_funcs[2][4][3][2][2][3][3];

Some files were not shown because too many files changed in this diff