QuadBlitter_scanning.inl File Reference
Go to the source code of this file.
Defines | |
| #define | SETUP_SECOND_UV |
| #define | SET_UV(uv0u, uv0v, uv1u, uv1v) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define | SET_UV_TWO(uv0u, uv0v, uv1u, uv1v, uv0ub, uv0vb, uv1ub, uv1vb) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define | INT_SETUP_UV |
| #define | INT_UPDATE_UV |
| #define | INT_ASSIGN_UV |
| #define | INTERPOLATE_EDGE_XMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | INTERPOLATE_EDGE_YMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | EGDE_INTERPOLATION(XP0, YP0, XP1, YP1) |
| #define | ScanEdge(x1, y1, x2, y2, edgeBufferPtr) |
| #define | ScanTwoEdges(x1a, y1a, x2a, y2a, x1b, y1b, x2b, y2b, edgeBufferPtr) |
| #define | SETUP_SECOND_UV |
| #define | SETUP_SECOND_UV u0=u0b;v0=v0b;u1=u1b;v1=v1b; |
| #define | SET_UV(uv0u, uv0v, uv1u, uv1v) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define | SET_UV_TWO(uv0u, uv0v, uv1u, uv1v, uv0ub, uv0vb, uv1ub, uv1vb) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define | INT_SETUP_UV |
| #define | INT_SETUP_UV |
| #define | INT_UPDATE_UV |
| #define | INT_UPDATE_UV |
| #define | INT_ASSIGN_UV |
| #define | INT_ASSIGN_UV |
| #define | INTERPOLATE_EDGE_XMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | INTERPOLATE_EDGE_YMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | EGDE_INTERPOLATION(XP0, YP0, XP1, YP1) |
| #define | ScanEdge(x1, y1, x2, y2, edgeBufferPtr) |
| #define | ScanTwoEdges(x1a, y1a, x2a, y2a, x1b, y1b, x2b, y2b, edgeBufferPtr) |
| #define | SETUP_SECOND_UV |
| #define | SETUP_SECOND_UV u0=u0b;v0=v0b;u1=u1b;v1=v1b; |
| #define | SET_UV(uv0u, uv0v, uv1u, uv1v) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define | SET_UV_TWO(uv0u, uv0v, uv1u, uv1v, uv0ub, uv0vb, uv1ub, uv1vb) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define | INT_SETUP_UV |
| #define | INT_SETUP_UV |
| #define | INT_UPDATE_UV |
| #define | INT_UPDATE_UV |
| #define | INT_ASSIGN_UV |
| #define | INT_ASSIGN_UV |
| #define | INTERPOLATE_EDGE_XMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | INTERPOLATE_EDGE_YMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | EGDE_INTERPOLATION(XP0, YP0, XP1, YP1) |
| #define | ScanEdge(x1, y1, x2, y2, edgeBufferPtr) |
| #define | ScanTwoEdges(x1a, y1a, x2a, y2a, x1b, y1b, x2b, y2b, edgeBufferPtr) |
| #define | SETUP_SECOND_UV |
| #define | SETUP_SECOND_UV u0=u0b;v0=v0b;u1=u1b;v1=v1b; |
| #define | SET_UV(uv0u, uv0v, uv1u, uv1v) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define | SET_UV_TWO(uv0u, uv0v, uv1u, uv1v, uv0ub, uv0vb, uv1ub, uv1vb) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define | INT_SETUP_UV |
| #define | INT_SETUP_UV |
| #define | INT_UPDATE_UV |
| #define | INT_UPDATE_UV |
| #define | INT_ASSIGN_UV |
| #define | INT_ASSIGN_UV |
| #define | INTERPOLATE_EDGE_XMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | INTERPOLATE_EDGE_YMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | EGDE_INTERPOLATION(XP0, YP0, XP1, YP1) |
| #define | ScanEdge(x1, y1, x2, y2, edgeBufferPtr) |
| #define | ScanTwoEdges(x1a, y1a, x2a, y2a, x1b, y1b, x2b, y2b, edgeBufferPtr) |
| #define | SETUP_SECOND_UV |
| #define | SET_UV(uv0u, uv0v, uv1u, uv1v) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define | SET_UV_TWO(uv0u, uv0v, uv1u, uv1v, uv0ub, uv0vb, uv1ub, uv1vb) u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define | INT_SETUP_UV |
| #define | INT_UPDATE_UV |
| #define | INT_ASSIGN_UV |
| #define | INTERPOLATE_EDGE_XMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | INTERPOLATE_EDGE_YMAJOR(X0, Y0, DeltaX, DeltaY, XDirection) |
| #define | EGDE_INTERPOLATION(XP0, YP0, XP1, YP1) |
| #define | ScanEdge(x1, y1, x2, y2, edgeBufferPtr) |
| #define | ScanTwoEdges(x1a, y1a, x2a, y2a, x1b, y1b, x2b, y2b, edgeBufferPtr) |
Functions | |
| if (p1y< p0y) | |
| Assert (p0y<=p1y &&p1y<=p2y &&p2y<=p3y,"Sort order error") | |
| edgeBuffer_ | SetMinSize (sizeof(EDGE_TYPE)*2 *(p3y-p0y+1)) |
| if (p0y==p1y &&p2y==p3y) | |
| else | if (p2y==p3y) |
Variables | |
| int | p0x = targetX1 |
| int | p0y = targetY1 |
| int | p1x = targetX2 |
| int | p1y = targetY2 |
| int | p2x = targetX3 |
| int | p2y = targetY3 |
| int | p3x = targetX4 |
| int | p3y = targetY4 |
| EDGE_TYPE * | edgeBuffer = static_cast<EDGE_TYPE*>(edgeBuffer_.buffer_) |
Define Documentation
| #define SETUP_SECOND_UV |
| #define SET_UV | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define SET_UV_TWO | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v, | |||||
| uv0ub, | |||||
| uv0vb, | |||||
| uv1ub, | |||||
| uv1vb | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define INT_SETUP_UV |
| #define INT_UPDATE_UV |
| #define INT_ASSIGN_UV |
| #define INTERPOLATE_EDGE_XMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
int XMajorAdvanceAmt=(DeltaX/DeltaY)*XDirection;\
int ErrorTermAdvance=DeltaX%DeltaY;\
int ErrorTerm=0;\
int height=DeltaY;\
if (XDirection<0)\
{\
ErrorTerm = -DeltaY + 1; \
}\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- )\
{\
INT_UPDATE_UV\
X0 += XMajorAdvanceAmt; \
ErrorTerm += ErrorTermAdvance;\
if (ErrorTerm > 0) \
{\
X0 += XDirection; \
ErrorTerm -= height; \
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define INTERPOLATE_EDGE_YMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
/* Set up initial error term and values used inside drawing loop */\
int DeltaXx2 = DeltaX + DeltaX;\
int DeltaXx2MinusDeltaYx2 = DeltaXx2 - ( DeltaY + DeltaY );\
int ErrorTerm = DeltaXx2 - DeltaY;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- ) \
{\
INT_UPDATE_UV\
/* See if it's time to advance the X coordinate */\
if ( ErrorTerm >= 0 ) \
{\
/* Advance the X coordinate & adjust the error term back down */\
X0 += XDirection;\
ErrorTerm += DeltaXx2MinusDeltaYx2;\
} \
else \
{\
/* Add to the error term */\
ErrorTerm += DeltaXx2;\
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define EGDE_INTERPOLATION | ( | XP0, | |||
| YP0, | |||||
| XP1, | |||||
| YP1 | ) |
| #define ScanEdge | ( | x1, | |||
| y1, | |||||
| x2, | |||||
| y2, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1=x1;\
int tempY1=y1;\
int tempX2=x2;\
int tempY2=y2;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1,tempY1,tempX2,tempY2); \
}\
| #define ScanTwoEdges | ( | x1a, | |||
| y1a, | |||||
| x2a, | |||||
| y2a, | |||||
| x1b, | |||||
| y1b, | |||||
| x2b, | |||||
| y2b, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1a=x1a;\
int tempY1a=y1a;\
int tempX2a=x2a;\
int tempY2a=y2a;\
int tempX1b=x1b;\
int tempY1b=y1b;\
int tempX2b=x2b;\
int tempY2b=y2b;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1a,tempY1a,tempX2a,tempY2a); \
SETUP_SECOND_UV\
EGDE_INTERPOLATION(tempX1b,tempY1b,tempX2b,tempY2b); \
}\
| #define SETUP_SECOND_UV |
| #define SETUP_SECOND_UV u0=u0b;v0=v0b;u1=u1b;v1=v1b; |
| #define SET_UV | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define SET_UV_TWO | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v, | |||||
| uv0ub, | |||||
| uv0vb, | |||||
| uv1ub, | |||||
| uv1vb | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define INT_SETUP_UV |
| #define INT_SETUP_UV |
Value:
int stepU=(u1-u0)/(DeltaY);\ int stepV=(v1-v0)/(DeltaY);\
| #define INT_UPDATE_UV |
| #define INT_UPDATE_UV |
Value:
u0+=stepU;\
v0+=stepV;\
| #define INT_ASSIGN_UV |
| #define INT_ASSIGN_UV |
Value:
(*tempBuffer).u=u0; \
(*tempBuffer).v=v0; \
| #define INTERPOLATE_EDGE_XMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
int XMajorAdvanceAmt=(DeltaX/DeltaY)*XDirection;\
int ErrorTermAdvance=DeltaX%DeltaY;\
int ErrorTerm=0;\
int height=DeltaY;\
if (XDirection<0)\
{\
ErrorTerm = -DeltaY + 1; \
}\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- )\
{\
INT_UPDATE_UV\
X0 += XMajorAdvanceAmt; \
ErrorTerm += ErrorTermAdvance;\
if (ErrorTerm > 0) \
{\
X0 += XDirection; \
ErrorTerm -= height; \
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define INTERPOLATE_EDGE_YMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
/* Set up initial error term and values used inside drawing loop */\
int DeltaXx2 = DeltaX + DeltaX;\
int DeltaXx2MinusDeltaYx2 = DeltaXx2 - ( DeltaY + DeltaY );\
int ErrorTerm = DeltaXx2 - DeltaY;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- ) \
{\
INT_UPDATE_UV\
/* See if it's time to advance the X coordinate */\
if ( ErrorTerm >= 0 ) \
{\
/* Advance the X coordinate & adjust the error term back down */\
X0 += XDirection;\
ErrorTerm += DeltaXx2MinusDeltaYx2;\
} \
else \
{\
/* Add to the error term */\
ErrorTerm += DeltaXx2;\
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define EGDE_INTERPOLATION | ( | XP0, | |||
| YP0, | |||||
| XP1, | |||||
| YP1 | ) |
| #define ScanEdge | ( | x1, | |||
| y1, | |||||
| x2, | |||||
| y2, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1=x1;\
int tempY1=y1;\
int tempX2=x2;\
int tempY2=y2;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1,tempY1,tempX2,tempY2); \
}\
| #define ScanTwoEdges | ( | x1a, | |||
| y1a, | |||||
| x2a, | |||||
| y2a, | |||||
| x1b, | |||||
| y1b, | |||||
| x2b, | |||||
| y2b, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1a=x1a;\
int tempY1a=y1a;\
int tempX2a=x2a;\
int tempY2a=y2a;\
int tempX1b=x1b;\
int tempY1b=y1b;\
int tempX2b=x2b;\
int tempY2b=y2b;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1a,tempY1a,tempX2a,tempY2a); \
SETUP_SECOND_UV\
EGDE_INTERPOLATION(tempX1b,tempY1b,tempX2b,tempY2b); \
}\
| #define SETUP_SECOND_UV |
| #define SETUP_SECOND_UV u0=u0b;v0=v0b;u1=u1b;v1=v1b; |
| #define SET_UV | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define SET_UV_TWO | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v, | |||||
| uv0ub, | |||||
| uv0vb, | |||||
| uv1ub, | |||||
| uv1vb | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define INT_SETUP_UV |
| #define INT_SETUP_UV |
Value:
int stepU=(u1-u0)/(DeltaY);\ int stepV=(v1-v0)/(DeltaY);\
| #define INT_UPDATE_UV |
| #define INT_UPDATE_UV |
Value:
u0+=stepU;\
v0+=stepV;\
| #define INT_ASSIGN_UV |
| #define INT_ASSIGN_UV |
Value:
(*tempBuffer).u=u0; \
(*tempBuffer).v=v0; \
| #define INTERPOLATE_EDGE_XMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
int XMajorAdvanceAmt=(DeltaX/DeltaY)*XDirection;\
int ErrorTermAdvance=DeltaX%DeltaY;\
int ErrorTerm=0;\
int height=DeltaY;\
if (XDirection<0)\
{\
ErrorTerm = -DeltaY + 1; \
}\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- )\
{\
INT_UPDATE_UV\
X0 += XMajorAdvanceAmt; \
ErrorTerm += ErrorTermAdvance;\
if (ErrorTerm > 0) \
{\
X0 += XDirection; \
ErrorTerm -= height; \
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define INTERPOLATE_EDGE_YMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
/* Set up initial error term and values used inside drawing loop */\
int DeltaXx2 = DeltaX + DeltaX;\
int DeltaXx2MinusDeltaYx2 = DeltaXx2 - ( DeltaY + DeltaY );\
int ErrorTerm = DeltaXx2 - DeltaY;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- ) \
{\
INT_UPDATE_UV\
/* See if it's time to advance the X coordinate */\
if ( ErrorTerm >= 0 ) \
{\
/* Advance the X coordinate & adjust the error term back down */\
X0 += XDirection;\
ErrorTerm += DeltaXx2MinusDeltaYx2;\
} \
else \
{\
/* Add to the error term */\
ErrorTerm += DeltaXx2;\
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define EGDE_INTERPOLATION | ( | XP0, | |||
| YP0, | |||||
| XP1, | |||||
| YP1 | ) |
| #define ScanEdge | ( | x1, | |||
| y1, | |||||
| x2, | |||||
| y2, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1=x1;\
int tempY1=y1;\
int tempX2=x2;\
int tempY2=y2;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1,tempY1,tempX2,tempY2); \
}\
| #define ScanTwoEdges | ( | x1a, | |||
| y1a, | |||||
| x2a, | |||||
| y2a, | |||||
| x1b, | |||||
| y1b, | |||||
| x2b, | |||||
| y2b, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1a=x1a;\
int tempY1a=y1a;\
int tempX2a=x2a;\
int tempY2a=y2a;\
int tempX1b=x1b;\
int tempY1b=y1b;\
int tempX2b=x2b;\
int tempY2b=y2b;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1a,tempY1a,tempX2a,tempY2a); \
SETUP_SECOND_UV\
EGDE_INTERPOLATION(tempX1b,tempY1b,tempX2b,tempY2b); \
}\
| #define SETUP_SECOND_UV |
| #define SETUP_SECOND_UV u0=u0b;v0=v0b;u1=u1b;v1=v1b; |
| #define SET_UV | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
| #define SET_UV_TWO | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v, | |||||
| uv0ub, | |||||
| uv0vb, | |||||
| uv1ub, | |||||
| uv1vb | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
| #define INT_SETUP_UV |
| #define INT_SETUP_UV |
Value:
int stepU=(u1-u0)/(DeltaY);\ int stepV=(v1-v0)/(DeltaY);\
| #define INT_UPDATE_UV |
| #define INT_UPDATE_UV |
Value:
u0+=stepU;\
v0+=stepV;\
| #define INT_ASSIGN_UV |
| #define INT_ASSIGN_UV |
Value:
(*tempBuffer).u=u0; \
(*tempBuffer).v=v0; \
| #define INTERPOLATE_EDGE_XMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
int XMajorAdvanceAmt=(DeltaX/DeltaY)*XDirection;\
int ErrorTermAdvance=DeltaX%DeltaY;\
int ErrorTerm=0;\
int height=DeltaY;\
if (XDirection<0)\
{\
ErrorTerm = -DeltaY + 1; \
}\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- )\
{\
INT_UPDATE_UV\
X0 += XMajorAdvanceAmt; \
ErrorTerm += ErrorTermAdvance;\
if (ErrorTerm > 0) \
{\
X0 += XDirection; \
ErrorTerm -= height; \
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define INTERPOLATE_EDGE_YMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
/* Set up initial error term and values used inside drawing loop */\
int DeltaXx2 = DeltaX + DeltaX;\
int DeltaXx2MinusDeltaYx2 = DeltaXx2 - ( DeltaY + DeltaY );\
int ErrorTerm = DeltaXx2 - DeltaY;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- ) \
{\
INT_UPDATE_UV\
/* See if it's time to advance the X coordinate */\
if ( ErrorTerm >= 0 ) \
{\
/* Advance the X coordinate & adjust the error term back down */\
X0 += XDirection;\
ErrorTerm += DeltaXx2MinusDeltaYx2;\
} \
else \
{\
/* Add to the error term */\
ErrorTerm += DeltaXx2;\
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
| #define EGDE_INTERPOLATION | ( | XP0, | |||
| YP0, | |||||
| XP1, | |||||
| YP1 | ) |
| #define ScanEdge | ( | x1, | |||
| y1, | |||||
| x2, | |||||
| y2, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1=x1;\
int tempY1=y1;\
int tempX2=x2;\
int tempY2=y2;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1,tempY1,tempX2,tempY2); \
}\
| #define ScanTwoEdges | ( | x1a, | |||
| y1a, | |||||
| x2a, | |||||
| y2a, | |||||
| x1b, | |||||
| y1b, | |||||
| x2b, | |||||
| y2b, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1a=x1a;\
int tempY1a=y1a;\
int tempX2a=x2a;\
int tempY2a=y2a;\
int tempX1b=x1b;\
int tempY1b=y1b;\
int tempX2b=x2b;\
int tempY2b=y2b;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1a,tempY1a,tempX2a,tempY2a); \
SETUP_SECOND_UV\
EGDE_INTERPOLATION(tempX1b,tempY1b,tempX2b,tempY2b); \
}\
| #define SETUP_SECOND_UV |
Definition at line 1 of file QuadBlitter_scanning.inl.
| #define SET_UV | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; |
Definition at line 7 of file QuadBlitter_scanning.inl.
| #define SET_UV_TWO | ( | uv0u, | |||
| uv0v, | |||||
| uv1u, | |||||
| uv1v, | |||||
| uv0ub, | |||||
| uv0vb, | |||||
| uv1ub, | |||||
| uv1vb | ) | u0=uv0u;v0=uv0v;u1=uv1u;v1=uv1v; u0b=uv0ub;v0b=uv0vb;u1b=uv1ub;v1b=uv1vb; |
Definition at line 10 of file QuadBlitter_scanning.inl.
| #define INT_SETUP_UV |
Definition at line 12 of file QuadBlitter_scanning.inl.
| #define INT_UPDATE_UV |
Definition at line 21 of file QuadBlitter_scanning.inl.
| #define INT_ASSIGN_UV |
Definition at line 30 of file QuadBlitter_scanning.inl.
| #define INTERPOLATE_EDGE_XMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
int XMajorAdvanceAmt=(DeltaX/DeltaY)*XDirection;\
int ErrorTermAdvance=DeltaX%DeltaY;\
int ErrorTerm=0;\
int height=DeltaY;\
if (XDirection<0)\
{\
ErrorTerm = -DeltaY + 1; \
}\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- )\
{\
INT_UPDATE_UV\
X0 += XMajorAdvanceAmt; \
ErrorTerm += ErrorTermAdvance;\
if (ErrorTerm > 0) \
{\
X0 += XDirection; \
ErrorTerm -= height; \
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
Definition at line 39 of file QuadBlitter_scanning.inl.
| #define INTERPOLATE_EDGE_YMAJOR | ( | X0, | |||
| Y0, | |||||
| DeltaX, | |||||
| DeltaY, | |||||
| XDirection | ) |
Value:
{\
INT_SETUP_UV\
/* Set up initial error term and values used inside drawing loop */\
int DeltaXx2 = DeltaX + DeltaX;\
int DeltaXx2MinusDeltaYx2 = DeltaXx2 - ( DeltaY + DeltaY );\
int ErrorTerm = DeltaXx2 - DeltaY;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
while ( DeltaY-- ) \
{\
INT_UPDATE_UV\
/* See if it's time to advance the X coordinate */\
if ( ErrorTerm >= 0 ) \
{\
/* Advance the X coordinate & adjust the error term back down */\
X0 += XDirection;\
ErrorTerm += DeltaXx2MinusDeltaYx2;\
} \
else \
{\
/* Add to the error term */\
ErrorTerm += DeltaXx2;\
}\
tempBuffer+=2;\
(*tempBuffer).x=(unsigned short)X0; \
INT_ASSIGN_UV\
}\
}\
Definition at line 70 of file QuadBlitter_scanning.inl.
| #define EGDE_INTERPOLATION | ( | XP0, | |||
| YP0, | |||||
| XP1, | |||||
| YP1 | ) |
Definition at line 102 of file QuadBlitter_scanning.inl.
| #define ScanEdge | ( | x1, | |||
| y1, | |||||
| x2, | |||||
| y2, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1=x1;\
int tempY1=y1;\
int tempX2=x2;\
int tempY2=y2;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1,tempY1,tempX2,tempY2); \
}\
Definition at line 140 of file QuadBlitter_scanning.inl.
| #define ScanTwoEdges | ( | x1a, | |||
| y1a, | |||||
| x2a, | |||||
| y2a, | |||||
| x1b, | |||||
| y1b, | |||||
| x2b, | |||||
| y2b, | |||||
| edgeBufferPtr | ) |
Value:
{ \
int tempX1a=x1a;\
int tempY1a=y1a;\
int tempX2a=x2a;\
int tempY2a=y2a;\
int tempX1b=x1b;\
int tempY1b=y1b;\
int tempX2b=x2b;\
int tempY2b=y2b;\
EDGE_TYPE* tempBuffer=edgeBufferPtr;\
EGDE_INTERPOLATION(tempX1a,tempY1a,tempX2a,tempY2a); \
SETUP_SECOND_UV\
EGDE_INTERPOLATION(tempX1b,tempY1b,tempX2b,tempY2b); \
}\
Definition at line 151 of file QuadBlitter_scanning.inl.
Function Documentation
| if | ( | ) |
Definition at line 192 of file QuadBlitter_scanning.inl.
Definition at line 361 of file QuadBlitter_scanning.inl.
Variable Documentation
| int p0x = targetX1 |
Definition at line 171 of file QuadBlitter_scanning.inl.
| int p0y = targetY1 |
Definition at line 172 of file QuadBlitter_scanning.inl.
| int p1x = targetX2 |
Definition at line 173 of file QuadBlitter_scanning.inl.
| int p1y = targetY2 |
Definition at line 174 of file QuadBlitter_scanning.inl.
| int p2x = targetX3 |
Definition at line 175 of file QuadBlitter_scanning.inl.
| int p2y = targetY3 |
Definition at line 176 of file QuadBlitter_scanning.inl.
| int p3x = targetX4 |
Definition at line 177 of file QuadBlitter_scanning.inl.
| int p3y = targetY4 |
Definition at line 178 of file QuadBlitter_scanning.inl.
| EDGE_TYPE* edgeBuffer = static_cast<EDGE_TYPE*>(edgeBuffer_.buffer_) |
Definition at line 251 of file QuadBlitter_scanning.inl.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
