00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pent_include.h"
00020 #include "XFormBlend.h"
00021 #include "Texture.h"
00022
00023 const uint8 U8XFormPal[1024] = {
00024 0, 0, 0, 0,
00025 0, 0, 0, 0,
00026 0, 0, 0, 0,
00027 0, 0, 0, 0,
00028 0, 0, 0, 0,
00029 0, 0, 0, 0,
00030 0, 0, 0, 0,
00031 0, 0, 0, 0,
00032 48, 48, 48, 80,
00033 24, 24, 24, 80,
00034 64, 64, 24, 64,
00035 80, 80, 80, 80,
00036 180,90, 0, 80,
00037 0, 0, 252,40,
00038 0, 0, 104,40,
00039 0, 0, 0, 0
00040 };
00041
00042 #if 0
00043
00044
00045
00046
00047
00048
00049 #define XFORM_BLEND_FUNC(ra,ga,ba,a) { \
00050 r*=255-a; \
00051 g*=255-a; \
00052 b*=255-a; \
00053 r+=ra*255; \
00054 g+=ga*255; \
00055 b+=ba*255; }
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 uint32 P_FASTCALL U8xformCol8 (uint32 col)
00068 {
00069 static uint32 r, g, b;
00070 UNPACK_RGB8(col,r,g,b);
00071 XFORM_BLEND_FUNC(48,48,48,80);
00072 return PACK_RGB16(r,g,b);
00073 }
00074
00075
00076
00077
00078
00079
00080 uint32 P_FASTCALL U8xformCol9 (uint32 col)
00081 {
00082 static uint32 r, g, b;
00083 UNPACK_RGB8(col,r,g,b);
00084 XFORM_BLEND_FUNC(24,24,24,80);
00085 return PACK_RGB16(r,g,b);
00086 }
00087
00088
00089
00090
00091
00092
00093 uint32 P_FASTCALL U8xformCol10 (uint32 col)
00094 {
00095 static uint32 r, g, b;
00096 UNPACK_RGB8(col,r,g,b);
00097 XFORM_BLEND_FUNC(64,64,24,64);
00098 return PACK_RGB16(r,g,b);
00099 }
00100
00101
00102
00103
00104
00105
00106 uint32 P_FASTCALL U8xformCol11 (uint32 col)
00107 {
00108 static uint32 r, g, b;
00109 UNPACK_RGB8(col,r,g,b);
00110 XFORM_BLEND_FUNC(80,80,80,80);
00111 return PACK_RGB16(r,g,b);
00112 }
00113
00114
00115
00116
00117
00118
00119 uint32 P_FASTCALL U8xformCol12 (uint32 col)
00120 {
00121 static uint32 r, g, b;
00122 UNPACK_RGB8(col,r,g,b);
00123 XFORM_BLEND_FUNC(180,90,0,80);
00124 if (r>65535) r = 65535;
00125 if (g>65535) g = 65535;
00126 return PACK_RGB16(r,g,b);
00127 }
00128
00129
00130
00131
00132
00133
00134 uint32 P_FASTCALL U8xformCol13 (uint32 col)
00135 {
00136 static uint32 r, g, b;
00137 UNPACK_RGB8(col,r,g,b);
00138 XFORM_BLEND_FUNC(0,0,252,40);
00139 if (b>65535) b = 65535;
00140 return PACK_RGB16(r,g,b);
00141 }
00142
00143
00144
00145
00146
00147
00148 uint32 P_FASTCALL U8xformCol14 (uint32 col)
00149 {
00150 static uint32 r, g, b;
00151 UNPACK_RGB8(col,r,g,b);
00152 XFORM_BLEND_FUNC(0,0,104,40);
00153 if (b>65535) b = 65535;
00154 return PACK_RGB16(r,g,b);
00155 }
00156
00157 const xformBlendFuncType U8XFormFuncs[256] = {
00158 0,
00159 0,
00160 0,
00161 0,
00162 0,
00163 0,
00164 0,
00165 0,
00166 static_cast<xformBlendFuncType>(&U8xformCol8),
00167 static_cast<xformBlendFuncType>(&U8xformCol9),
00168 static_cast<xformBlendFuncType>(&U8xformCol10),
00169 static_cast<xformBlendFuncType>(&U8xformCol11),
00170 static_cast<xformBlendFuncType>(&U8xformCol12),
00171 static_cast<xformBlendFuncType>(&U8xformCol13),
00172 static_cast<xformBlendFuncType>(&U8xformCol14),
00173 0
00174 };
00175
00176 #endif
00177