mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
build on linux
This commit is contained in:
parent
1277a58742
commit
e0f3f85f60
@ -2,7 +2,7 @@ void FNAME(ZB_fillTriangleFlat) (ZBuffer *zb,
|
|||||||
ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2)
|
ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2)
|
||||||
{
|
{
|
||||||
int color;
|
int color;
|
||||||
int or, og, ob, oa;
|
int or0, og0, ob0, oa0;
|
||||||
|
|
||||||
#define INTERP_Z
|
#define INTERP_Z
|
||||||
|
|
||||||
@ -15,18 +15,18 @@ void FNAME(ZB_fillTriangleFlat) (ZBuffer *zb,
|
|||||||
if (!ACMP(zb, p2->a)) { \
|
if (!ACMP(zb, p2->a)) { \
|
||||||
return; \
|
return; \
|
||||||
} \
|
} \
|
||||||
or = p2->r; \
|
or0 = p2->r; \
|
||||||
og = p2->g; \
|
og0 = p2->g; \
|
||||||
ob = p2->b; \
|
ob0 = p2->b; \
|
||||||
oa = p2->a; \
|
oa0 = p2->a; \
|
||||||
color=RGBA_TO_PIXEL(or, og, ob, oa); \
|
color=RGBA_TO_PIXEL(or0, og0, ob0, oa0); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PUT_PIXEL(_a) \
|
#define PUT_PIXEL(_a) \
|
||||||
{ \
|
{ \
|
||||||
zz=z >> ZB_POINT_Z_FRAC_BITS; \
|
zz=z >> ZB_POINT_Z_FRAC_BITS; \
|
||||||
if (ZCMP(pz[_a], zz)) { \
|
if (ZCMP(pz[_a], zz)) { \
|
||||||
STORE_PIX(pp[_a], color, or, og, ob, oa); \
|
STORE_PIX(pp[_a], color, or0, og0, ob0, oa0); \
|
||||||
STORE_Z(pz[_a], zz); \
|
STORE_Z(pz[_a], zz); \
|
||||||
} \
|
} \
|
||||||
z+=dzdx; \
|
z+=dzdx; \
|
||||||
@ -121,7 +121,7 @@ void FNAME(ZB_fillTriangleMappingFlat) (ZBuffer *zb,
|
|||||||
ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2)
|
ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2)
|
||||||
{
|
{
|
||||||
ZTexture *texture;
|
ZTexture *texture;
|
||||||
int or, og, ob, oa;
|
int or0, og0, ob0, oa0;
|
||||||
|
|
||||||
#define INTERP_Z
|
#define INTERP_Z
|
||||||
#define INTERP_ST
|
#define INTERP_ST
|
||||||
@ -133,10 +133,10 @@ void FNAME(ZB_fillTriangleMappingFlat) (ZBuffer *zb,
|
|||||||
#define DRAW_INIT() \
|
#define DRAW_INIT() \
|
||||||
{ \
|
{ \
|
||||||
texture = &zb->current_texture; \
|
texture = &zb->current_texture; \
|
||||||
or = p2->r; \
|
or0 = p2->r; \
|
||||||
og = p2->g; \
|
og0 = p2->g; \
|
||||||
ob = p2->b; \
|
ob0 = p2->b; \
|
||||||
oa = p2->a; \
|
oa0 = p2->a; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PUT_PIXEL(_a) \
|
#define PUT_PIXEL(_a) \
|
||||||
@ -144,16 +144,16 @@ void FNAME(ZB_fillTriangleMappingFlat) (ZBuffer *zb,
|
|||||||
zz=z >> ZB_POINT_Z_FRAC_BITS; \
|
zz=z >> ZB_POINT_Z_FRAC_BITS; \
|
||||||
if (ZCMP(pz[_a], zz)) { \
|
if (ZCMP(pz[_a], zz)) { \
|
||||||
tmp = ZB_LOOKUP_TEXTURE(texture, s, t); \
|
tmp = ZB_LOOKUP_TEXTURE(texture, s, t); \
|
||||||
int a = oa * PIXEL_A(tmp) >> 16; \
|
int a = oa0 * PIXEL_A(tmp) >> 16; \
|
||||||
if (ACMP(zb, a)) { \
|
if (ACMP(zb, a)) { \
|
||||||
STORE_PIX(pp[_a], \
|
STORE_PIX(pp[_a], \
|
||||||
RGBA_TO_PIXEL(or * PIXEL_R(tmp) >> 16, \
|
RGBA_TO_PIXEL(or0 * PIXEL_R(tmp) >> 16, \
|
||||||
og * PIXEL_G(tmp) >> 16, \
|
og0 * PIXEL_G(tmp) >> 16, \
|
||||||
ob * PIXEL_B(tmp) >> 16, \
|
ob0 * PIXEL_B(tmp) >> 16, \
|
||||||
a), \
|
a), \
|
||||||
or * PIXEL_R(tmp) >> 16, \
|
or0 * PIXEL_R(tmp) >> 16, \
|
||||||
og * PIXEL_G(tmp) >> 16, \
|
og0 * PIXEL_G(tmp) >> 16, \
|
||||||
ob * PIXEL_B(tmp) >> 16, \
|
ob0 * PIXEL_B(tmp) >> 16, \
|
||||||
a); \
|
a); \
|
||||||
STORE_Z(pz[_a], zz); \
|
STORE_Z(pz[_a], zz); \
|
||||||
} \
|
} \
|
||||||
@ -344,7 +344,7 @@ void FNAME(ZB_fillTriangleMappingPerspectiveFlat) (ZBuffer *zb,
|
|||||||
{
|
{
|
||||||
ZTexture *texture;
|
ZTexture *texture;
|
||||||
float fdzdx,fndzdx,ndszdx,ndtzdx;
|
float fdzdx,fndzdx,ndszdx,ndtzdx;
|
||||||
int or, og, ob, oa;
|
int or0, og0, ob0, oa0;
|
||||||
|
|
||||||
#define INTERP_Z
|
#define INTERP_Z
|
||||||
#define INTERP_STZ
|
#define INTERP_STZ
|
||||||
@ -362,10 +362,10 @@ void FNAME(ZB_fillTriangleMappingPerspectiveFlat) (ZBuffer *zb,
|
|||||||
fndzdx=NB_INTERP * fdzdx; \
|
fndzdx=NB_INTERP * fdzdx; \
|
||||||
ndszdx=NB_INTERP * dszdx; \
|
ndszdx=NB_INTERP * dszdx; \
|
||||||
ndtzdx=NB_INTERP * dtzdx; \
|
ndtzdx=NB_INTERP * dtzdx; \
|
||||||
or = p2->r; \
|
or0 = p2->r; \
|
||||||
og = p2->g; \
|
og0 = p2->g; \
|
||||||
ob = p2->b; \
|
ob0 = p2->b; \
|
||||||
oa = p2->a; \
|
oa0 = p2->a; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PUT_PIXEL(_a) \
|
#define PUT_PIXEL(_a) \
|
||||||
@ -373,16 +373,16 @@ void FNAME(ZB_fillTriangleMappingPerspectiveFlat) (ZBuffer *zb,
|
|||||||
zz=z >> ZB_POINT_Z_FRAC_BITS; \
|
zz=z >> ZB_POINT_Z_FRAC_BITS; \
|
||||||
if (ZCMP(pz[_a], zz)) { \
|
if (ZCMP(pz[_a], zz)) { \
|
||||||
tmp = ZB_LOOKUP_TEXTURE(texture, s, t); \
|
tmp = ZB_LOOKUP_TEXTURE(texture, s, t); \
|
||||||
int a = oa * PIXEL_A(tmp) >> 16; \
|
int a = oa0 * PIXEL_A(tmp) >> 16; \
|
||||||
if (ACMP(zb, a)) { \
|
if (ACMP(zb, a)) { \
|
||||||
STORE_PIX(pp[_a], \
|
STORE_PIX(pp[_a], \
|
||||||
RGBA_TO_PIXEL(or * PIXEL_R(tmp) >> 16, \
|
RGBA_TO_PIXEL(or0 * PIXEL_R(tmp) >> 16, \
|
||||||
og * PIXEL_G(tmp) >> 16, \
|
og0 * PIXEL_G(tmp) >> 16, \
|
||||||
ob * PIXEL_B(tmp) >> 16, \
|
ob0 * PIXEL_B(tmp) >> 16, \
|
||||||
a), \
|
a), \
|
||||||
or * PIXEL_R(tmp) >> 16, \
|
or0 * PIXEL_R(tmp) >> 16, \
|
||||||
og * PIXEL_G(tmp) >> 16, \
|
og0 * PIXEL_G(tmp) >> 16, \
|
||||||
ob * PIXEL_B(tmp) >> 16, \
|
ob0 * PIXEL_B(tmp) >> 16, \
|
||||||
a); \
|
a); \
|
||||||
STORE_Z(pz[_a], zz); \
|
STORE_Z(pz[_a], zz); \
|
||||||
} \
|
} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user