dnl --------------------------------------------------------------------------- dnl dnl This file contains ramp bead structure creating macros and produces dnl the structures themselves. dnl dnl Copyright (C) Microsoft Corporation, 1997. dnl dnl --------------------------------------------------------------------------- dnl define(`d_SpecializedRampRenderSpansBeads', `d_RepStr(`d_RepStr(`$1', `$2', AAAA)', AAAA, Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Flat_NoTex, Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Flat_NoTex, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_NoTex, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_NoTex, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_NoTex, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_NoTex, Spans_8_ZTest_ZWrite_Dither_NoTrans_Flat_NoTex, Spans_16_ZTest_ZWrite_Dither_NoTrans_Flat_NoTex, Spans_8_ZTest_ZWrite_Dither_NoTrans_Gouraud_NoTex, Spans_16_ZTest_ZWrite_Dither_NoTrans_Gouraud_NoTex, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_NoTex, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_NoTex, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_NoTex, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_NoTex, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4ColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4ColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_8_ZTest_NoZWrite_Dither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_16_ZTest_NoZWrite_Dither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_8_ZTest_NoZWrite_Dither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_16_ZTest_NoZWrite_Dither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette4NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette4NoColorKey, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey, Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey, Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey, Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey, Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey, Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4ColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4ColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4ColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4ColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspCopyPalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspCopyPalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspCopyPalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspCopyPalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8ColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8ColorKey, Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8ColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8ColorKey, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey, Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey, Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8ColorKey, Spans_16_NoZTest_NoZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8ColorKey, Spans_16_NoZTest_NoZWrite_NoDither_Trans_Flat_TexPerspModulatePalette8NoColorKey )')dnl dnl define(`d_RRSBFormat', `ifelse(eval(d_index($1, `_8') >= 0), `1', `0', eval(d_index($1, `_16') >= 0), `1', `1')')dnl define(`d_RRSBZTest', `ifelse(eval(d_index($1, `NoZTest') >= 0), `1', `0', `1')')dnl define(`d_RRSBZWrite', `ifelse(eval(d_index($1, `NoZWrite') >= 0), `1', `0', `1')')dnl define(`d_RRSBDither', `ifelse(eval(d_index($1, `NoDither') >= 0), `1', `0', `1')')dnl define(`d_RRSBTrans', `ifelse(eval(d_index($1, `NoTrans') >= 0), `1', `0', `1')')dnl define(`d_RRSBShade', `ifelse(eval(d_index($1, `Flat') >= 0), `1', `0', `1')')dnl define(`d_RRSBTexIdx', `eval(ifelse(eval(d_index($1, `Palette8') >= 0), `1', `1', `0') + ifelse(eval(d_index($1, `NoColorKey') < 0), `1', `2', `0') + ifelse(eval(d_index($1, `Copy') >= 0), `1', `4', `0') + ifelse(eval(d_index($1, `NoPersp') < 0), `1', `8', `0'))')dnl define(`d_RRSBTex', `ifelse(eval(d_index($1, `NoTex') >= 0), `1', `0', incr(d_RRSBTexIdx($1)))')dnl define(`d_RampRenderSpansBeadIndex', `eval(d_RRSBFormat($1) + d_RRSBZTest($1) * 2 + d_RRSBZWrite($1) * 4 + d_RRSBDither($1) * 8 + d_RRSBTrans($1) * 16 + d_RRSBShade($1) * 32 + d_RRSBTex($1) * 64)')dnl dnl define(`d_RampBeginBeads', `d_RepStr(`$1', `$2', Loop_Any)')dnl dnl define(`d_RampMonoBeads', `d_RepStr(`d_RepStr(`$1', `$2', Mono_AAAA)', AAAA, Modulate, Copy_8, Copy_16)')dnl dnl define(`d_RampTexReadBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TexRead_AAAA_BBBB_CCCC)', AAAA, Palette4, Palette8, 16)', BBBB, NoColorKey, ColorKey)', CCCC, Modulate, Copy)')dnl dnl dnl dnl ifelse(`d_BeadMacrosOnly', d_BeadMacrosOnly, ` // Indices used to access elements of the RenderSpans ramp bead table. #define RAMPFORMAT_NUM 2 #define RAMPZTEST_NUM 2 #define RAMPZWRITE_NUM 2 #define RAMPDITHER_NUM 2 #define RAMPTRANS_NUM 2 #define RAMPSHADEMODE_NUM 2 #define RAMPTEXTURE_NUM 17 // Mono beads. #define RAMPMONOTEXTURECOPY_NUM 3 // TexRead. #define RAMPTEXTURECOPY_NUM 2 #define RAMPTEXTUREFORMAT_NUM 3 #define RAMPCOLORKEY_NUM 2 dnl // structures for bead organization dnl define(`d_MakeBeadStruct', ` typedef struct tagRAMP`'d_UpCase(`$1')`'BEADS { $3 pfn`'$1`'$2; } RAMP`'d_UpCase(`$1')`'BEADS, *PRAMP`'d_UpCase(`$1')`'BEADS;')dnl dnl d_MakeBeadStruct(RenderSpans, [RAMPTEXTURE_NUM][RAMPSHADEMODE_NUM][RAMPTRANS_NUM][RAMPDITHER_NUM][RAMPZWRITE_NUM][RAMPZTEST_NUM][RAMPFORMAT_NUM], PFNRENDERSPANS) d_MakeBeadStruct(Begin, [1], PFNSPANLAYER) d_MakeBeadStruct(Mono, [RAMPMONOTEXTURECOPY_NUM], PFNSPANLAYER) d_MakeBeadStruct(TexRead, [RAMPTEXTURECOPY_NUM][RAMPCOLORKEY_NUM][RAMPTEXTUREFORMAT_NUM], PFNTEXREAD) // Root structure needed for state validation. Contains pointers to function pointer // tables typedef struct tagRAMPBEADTABLE { PFNRENDERSPANS pfnRenderSpansAny; PRAMPRENDERSPANSBEADS pRenderSpansBeads; PRAMPBEGINBEADS pBeginBeads; PRAMPMONOBEADS pMonoBeads; PRAMPTEXREADBEADS pTexReadBeads; } RAMPBEADTABLE, *PRAMPBEADTABLE; ')dnl