diff options
author | Alan Hourihane <[email protected]> | 2004-04-26 10:10:22 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2004-04-26 10:10:22 +0000 |
commit | 462183fe4cb6df6d90632d9e2cee881c8d26b1cb (patch) | |
tree | 0fb5d1c17d80026bec0fe3c2e0449fe30ea9e69e /src/mesa/drivers/dri/tdfx/tdfx_span.c | |
parent | 08fa6de85035c428d77cb88b11a4638b706794b5 (diff) |
bring over build fixes from stable branch
Diffstat (limited to 'src/mesa/drivers/dri/tdfx/tdfx_span.c')
-rw-r--r-- | src/mesa/drivers/dri/tdfx/tdfx_span.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index 43fcb90fd23..0d2bc811e04 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -572,14 +572,6 @@ GetFbParams(tdfxContextPtr fxMesa, * * Recall that x and y are screen coordinates. */ -#define GET_FB_DATA(ReadParamsp, type, x, y) \ - (((x) < (ReadParamsp)->firstWrappedX) \ - ? (((type *)((ReadParamsp)->lfbPtr)) \ - [(y) * ((ReadParamsp)->LFBStrideInElts) \ - + (x)]) \ - : (((type *)((ReadParamsp)->lfbWrapPtr)) \ - [((y)) * ((ReadParamsp)->LFBStrideInElts) \ - + ((x) - (ReadParamsp)->firstWrappedX)])) #define GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \ (((type *)((ReadParamsp)->lfbPtr)) \ [(y) * ((ReadParamsp)->LFBStrideInElts) \ @@ -588,12 +580,21 @@ GetFbParams(tdfxContextPtr fxMesa, (((type *)((ReadParamsp)->lfbWrapPtr)) \ [((y)) * ((ReadParamsp)->LFBStrideInElts) \ + ((x) - (ReadParamsp)->firstWrappedX)]) -#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \ - (GET_FB_DATA(ReadParamsp, type, x, y) = (type)(value)) +#define GET_FB_DATA(ReadParamsp, type, x, y) \ + (((x) < (ReadParamsp)->firstWrappedX) \ + ? GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \ + : GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y)) #define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \ (GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) = (type)(value)) #define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value) \ (GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) = (type)(value)) +#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \ + do { \ + if ((x) < (ReadParamsp)->firstWrappedX) \ + PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value); \ + else \ + PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value); \ + } while (0) static void tdfxDDWriteDepthSpan(GLcontext * ctx, |