00001
00007 #ifndef OPC_ITERATOR_H
00008 #define OPC_ITERATOR_H
00009
00010
00011
00012
00013
00014
00015
00016
00024 #define OPC_foreach( PIXEL, opc, pixel ) \
00025 uint8* pixel##_edge = (uint8*)OPC_NAMING(Ptr)( (opc), (opc)->clip.left, (opc)->clip.top );\
00026 int pixel##_wide = RectWide((opc)->clip);\
00027 int pixel##_high = RectHigh((opc)->clip);\
00028 int pixel##_y,pixel##_x;\
00029 PIXEL* pixel;\
00030 for( pixel##_y = 0; pixel##_y < pixel##_high; ++pixel##_y, pixel##_edge += (opc)->pitch )\
00031 for( pixel##_x = 0, pixel = (PIXEL*)pixel##_edge; pixel##_x < pixel##_wide; ++pixel##_x, ++pixel )
00032
00040 #define OPC_foreach_mirror( PIXEL, opc, pixel ) \
00041 uint8* pixel##_edge = (uint8*)OPC_NAMING(Ptr)( (opc), (opc)->clip.right-1, (opc)->clip.top );\
00042 int pixel##_wide = RectWide((opc)->clip);\
00043 int pixel##_high = RectHigh((opc)->clip);\
00044 int pixel##_y,pixel##_x;\
00045 PIXEL* pixel;\
00046 for( pixel##_y = 0; pixel##_y < pixel##_high; ++pixel##_y, pixel##_edge += (opc)->pitch )\
00047 for( pixel##_x = pixel##_wide, pixel = (PIXEL*)pixel##_edge; pixel##_x--; --pixel )
00048
00056 #define OPC_foreach_flip( PIXEL, opc, pixel ) \
00057 uint8* pixel##_edge = (uint8*)OPC_NAMING(Ptr)( (opc), (opc)->clip.left, (opc)->clip.bottom-1 );\
00058 int pixel##_wide = RectWide((opc)->clip);\
00059 int pixel##_y,pixel##_x;\
00060 PIXEL* pixel;\
00061 for( pixel##_y = RectHigh((opc)->clip); pixel##_y--; pixel##_edge -= (opc)->pitch )\
00062 for( pixel##_x = 0, pixel = (PIXEL*)pixel##_edge; pixel##_x < pixel##_wide; ++pixel##_x, ++pixel )
00063
00071 #define OPC_foreach_mirror_flip( PIXEL, opc, pixel ) \
00072 uint8* pixel##_edge = (uint8*)OPC_NAMING(Ptr)( (opc), (opc)->clip.right-1, (opc)->clip.bottom-1 );\
00073 int pixel##_y,pixel##_x;\
00074 PIXEL* pixel;\
00075 for( pixel##_y = RectWide((opc)->clip); pixel##_y--; pixel##_edge -= (opc)->pitch )\
00076 for( pixel##_x = RectHigh((opc)->clip), pixel = (PIXEL*)pixel##_edge; pixel##_x--; --pixel )
00077
00088 #define OPC_translate_foreach( PIXEL, opcdst, opcsrc, pixel_dst, pixel_src ) \
00089 const uint8* edge_src = (uint8*)OPC_NAMING(Ptr)( (opcsrc), (opcsrc)->clip.left, (opcsrc)->clip.top );\
00090 uint8* edge_dst = (uint8*)OPC_NAMING(Ptr)( (opcdst), (opcdst)->clip.left, (opcdst)->clip.top );\
00091 int pixel_wide = min( RectWide((opcsrc)->clip), RectWide((opcdst)->clip) );\
00092 int pixel_high = min( RectHigh((opcsrc)->clip), RectHigh((opcdst)->clip) );\
00093 int pixel_y,pixel_x;\
00094 const PIXEL* pixel_src;\
00095 PIXEL* pixel_dst;\
00096 for( pixel_y = 0; pixel_y < pixel_high; ++pixel_y, edge_src += (opcsrc)->pitch, edge_dst += (opcdst)->pitch )\
00097 for( pixel_x = 0, pixel_dst = (PIXEL*)edge_dst, pixel_src = (const PIXEL*)edge_src; pixel_x < pixel_wide; ++pixel_x, ++pixel_dst, ++pixel_src )
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00113 #define IncLine(label)\
00114 int ppConcat(label,_x1);\
00115 int ppConcat(label,_y1);\
00116 int ppConcat(label,_x2);\
00117 int ppConcat(label,_y2);\
00118 int ppConcat(label,_x);\
00119 int ppConcat(label,_y);\
00120 int ppConcat(label,_dx);\
00121 int ppConcat(label,_dy);\
00122 int ppConcat(label,_remain);\
00123
00124
00131 #define IncLine_Init_Step(ilabel, x1,y1, x2,y2 ) \
00132 {\
00133 ppConcat(ilabel,_x1) = (x1);\
00134 ppConcat(ilabel,_y1) = (y1);\
00135 ppConcat(ilabel,_x2) = (x2);\
00136 ppConcat(ilabel,_y2) = (y2);\
00137 ppConcat(ilabel,_y) = ppConcat(ilabel,_y1)<<16;\
00138 ppConcat(ilabel,_x) = ppConcat(ilabel,_x1)<<16;\
00139 ppConcat(ilabel,_dx) = ppConcat(ilabel,_x2) - ppConcat(ilabel,_x1);\
00140 ppConcat(ilabel,_dy) = ppConcat(ilabel,_y2) - ppConcat(ilabel,_y1);\
00141 ppConcat(ilabel,_dx) = further(ppConcat(ilabel,_dx),1);\
00142 ppConcat(ilabel,_dy) = further(ppConcat(ilabel,_dy),1);\
00143 ppConcat(ilabel,_remain) = max(abs(ppConcat(ilabel,_dx)),abs(ppConcat(ilabel,_dy)));\
00144 ppConcat(ilabel,_dx) = (ppConcat(ilabel,_dx)<<16)/ppConcat(ilabel,_remain);\
00145 ppConcat(ilabel,_dy) = (ppConcat(ilabel,_dy)<<16)/ppConcat(ilabel,_remain);\
00146 }
00147
00154 #define IncLine_Init_Span(ilabel, x1, y1, x2, y2 ) \
00155 {\
00156 ppConcat(ilabel,_x1) = (x1);\
00157 ppConcat(ilabel,_y1) = (y1);\
00158 ppConcat(ilabel,_x2) = (x2);\
00159 ppConcat(ilabel,_y2) = (y2);\
00160 ppConcat(ilabel,_y) = ppConcat(ilabel,_y1)<<16;\
00161 ppConcat(ilabel,_x) = ppConcat(ilabel,_x1)<<16;\
00162 ppConcat(ilabel,_dx) = ppConcat(ilabel,_x2) - ppConcat(ilabel,_x1);\
00163 ppConcat(ilabel,_dy) = ppConcat(ilabel,_y2) - ppConcat(ilabel,_y1);\
00164 ppConcat(ilabel,_dx) = further(ppConcat(ilabel,_dx),1);\
00165 ppConcat(ilabel,_dy) = further(ppConcat(ilabel,_dy),1);\
00166 ppConcat(ilabel,_remain) = min(abs(ppConcat(ilabel,_dx)),abs(ppConcat(ilabel,_dy)));\
00167 ppConcat(ilabel,_dx) = (ppConcat(ilabel,_dx)<<16)/ppConcat(ilabel,_remain);\
00168 ppConcat(ilabel,_dy) = (ppConcat(ilabel,_dy)<<16)/ppConcat(ilabel,_remain);\
00169 }
00170 #define IncLine_Spans_X(ilabel) (abs(ppConcat(ilabel,_dx)) >= abs(ppConcat(ilabel,_dy)))
00171 #define IncLine_Spans_Y(ilabel) (abs(ppConcat(ilabel,_dx)) < abs(ppConcat(ilabel,_dy)))
00172
00180 #define IncLine_Init_Count(ilabel, x1, y1, x2, y2, nSamples ) \
00181 {\
00182 ppConcat(ilabel,_x1) = (x1);\
00183 ppConcat(ilabel,_y1) = (y1);\
00184 ppConcat(ilabel,_x2) = (x2);\
00185 ppConcat(ilabel,_y2) = (y2);\
00186 ppConcat(ilabel,_y) = ppConcat(ilabel,_y1)<<16;\
00187 ppConcat(ilabel,_x) = ppConcat(ilabel,_x1)<<16;\
00188 ppConcat(ilabel,_dx) = ppConcat(ilabel,_x2) - ppConcat(ilabel,_x1);\
00189 ppConcat(ilabel,_dy) = ppConcat(ilabel,_y2) - ppConcat(ilabel,_y1);\
00190 ppConcat(ilabel,_dx) = further(ppConcat(ilabel,_dx),1);\
00191 ppConcat(ilabel,_dy) = further(ppConcat(ilabel,_dy),1);\
00192 ppConcat(ilabel,_remain) = (nSamples);\
00193 ppConcat(ilabel,_dx) = (ppConcat(ilabel,_dx)<<16)/ppConcat(ilabel,_remain);\
00194 ppConcat(ilabel,_dy) = (ppConcat(ilabel,_dy)<<16)/ppConcat(ilabel,_remain);\
00195 }
00196
00201 #define IncLine_Step(ilabel)\
00202 {\
00203 if( ppConcat(ilabel,_remain) > 0 )\
00204 {\
00205 ppConcat(ilabel,_x) += ppConcat(ilabel,_dx);\
00206 ppConcat(ilabel,_y) += ppConcat(ilabel,_dy);\
00207 ppConcat(ilabel,_remain)--;\
00208 }\
00209 }
00210
00217 #define IncLine_nStep(ilabel,count)\
00218 {\
00219 int nSkip = (count);\
00220 if( nSkip >= ppConcat(ilabel,_remain) )\
00221 {\
00222 ppConcat(ilabel,_x) = ppConcat(ilabel,_x2)<<16;\
00223 ppConcat(ilabel,_y) = ppConcat(ilabel,_y2)<<16;\
00224 } \
00225 else \
00226 {\
00227 ppConcat(ilabel,_x) += ppConcat(ilabel,_dx) * nSkip;\
00228 ppConcat(ilabel,_y) += ppConcat(ilabel,_dy) * nSkip;\
00229 ppConcat(ilabel,_remain) -= nSkip;\
00230 }\
00231 }
00232
00238 #define IncLine_Remains(ilabel) ( ppConcat(ilabel,_remain) > 0 )
00239
00246 #define IncLine_XY(ilabel,x,y)\
00247 {\
00248 (x) = ppConcat(ilabel,_x)>>16;\
00249 (y) = ppConcat(ilabel,_y)>>16;\
00250 }
00251
00258 #define IncLine_NextXY(ilabel,x,y)\
00259 {\
00260 if( ppConcat(ilabel,_remain) )\
00261 {\
00262 (x) = (ppConcat(ilabel,_x)+ppConcat(ilabel,_dx))>>16;\
00263 (y) = (ppConcat(ilabel,_y)+ppConcat(ilabel,_dy))>>16;\
00264 }\
00265 else\
00266 {\
00267 (x) = ppConcat(ilabel,_x2);\
00268 (y) = ppConcat(ilabel,_y2);\
00269 }\
00270 }
00271
00278 #define IncLine_foreach(ilabel, iteratorx, iteratory ) \
00279 int iteratorx = ppConcat(ilabel,_x1);\
00280 int iteratory = ppConcat(ilabel,_y1);\
00281 for( ; ppConcat(ilabel,_remain)--; iteratorx = (ppConcat(ilabel,_x) += ppConcat(ilabel,_dx))>>16, iteratory = (ppConcat(ilabel,_y) += ppConcat(ilabel,_dy))>>16 )
00282
00291 #define IncLine_foreach_spans(ilabel, iteratorx, iteratory, iteratornx, iteratorny ) \
00292 int iteratorx = ppConcat(ilabel,_x1);\
00293 int iteratory = ppConcat(ilabel,_y1);\
00294 int iteratornx, iteratorny;\
00295 IncLine_Step(ilabel);\
00296 IncLine_XY(ilabel, iteratornx, iteratorny);\
00297 for( ; ppConcat(ilabel,_remain)--; iteratorx = iteratornx, iteratory = iteratorny, \
00298 iteratornx = (ppConcat(ilabel,_x) += ppConcat(ilabel,_dx))>>16, \
00299 iteratorny = (ppConcat(ilabel,_y) += ppConcat(ilabel,_dy))>>16 )
00300
00301
00302
00307 #define IncLine3D(label)\
00308 int ppConcat(label,_x1);\
00309 int ppConcat(label,_y1);\
00310 int ppConcat(label,_z1);\
00311 int ppConcat(label,_x2);\
00312 int ppConcat(label,_y2);\
00313 int ppConcat(label,_z2);\
00314 int ppConcat(label,_x);\
00315 int ppConcat(label,_y);\
00316 int ppConcat(label,_z);\
00317 int ppConcat(label,_dx);\
00318 int ppConcat(label,_dy);\
00319 int ppConcat(label,_dz);\
00320 int ppConcat(label,_remain);\
00321
00322
00329 #define IncLine3D_Init_Step(ilabel, x1,y1, x2,y2 ) \
00330 {\
00331 ppConcat(ilabel,_x1) = (x1);\
00332 ppConcat(ilabel,_y1) = (y1);\
00333 ppConcat(ilabel,_z1) = (z1);\
00334 ppConcat(ilabel,_x2) = (x2);\
00335 ppConcat(ilabel,_y2) = (y2);\
00336 ppConcat(ilabel,_z2) = (z2);\
00337 ppConcat(ilabel,_x) = ppConcat(ilabel,_x1)<<16;\
00338 ppConcat(ilabel,_y) = ppConcat(ilabel,_y1)<<16;\
00339 ppConcat(ilabel,_z) = ppConcat(ilabel,_z1)<<16;\
00340 ppConcat(ilabel,_dx) = ppConcat(ilabel,_x2) - ppConcat(ilabel,_x1);\
00341 ppConcat(ilabel,_dy) = ppConcat(ilabel,_y2) - ppConcat(ilabel,_y1);\
00342 ppConcat(ilabel,_dz) = ppConcat(ilabel,_z2) - ppConcat(ilabel,_z1);\
00343 ppConcat(ilabel,_dx) = further(ppConcat(ilabel,_dx),1);\
00344 ppConcat(ilabel,_dy) = further(ppConcat(ilabel,_dy),1);\
00345 ppConcat(ilabel,_dz) = further(ppConcat(ilabel,_dz),1);\
00346 ppConcat(ilabel,_remain) = max(abs(ppConcat(ilabel,_dx)),abs(ppConcat(ilabel,_dy)));\
00347 ppConcat(ilabel,_remain) = max(ppConcat(ilabel,_remain),abs(ppConcat(ilabel,_dz)));\
00348 ppConcat(ilabel,_dx) = (ppConcat(ilabel,_dx)<<16)/ppConcat(ilabel,_remain);\
00349 ppConcat(ilabel,_dy) = (ppConcat(ilabel,_dy)<<16)/ppConcat(ilabel,_remain);\
00350 ppConcat(ilabel,_dz) = (ppConcat(ilabel,_dz)<<16)/ppConcat(ilabel,_remain);\
00351 }
00352
00359 #define IncLine3D_Init_Span(ilabel, x1, y1, x2, y2 ) \
00360 {\
00361 ppConcat(ilabel,_x1) = (x1);\
00362 ppConcat(ilabel,_y1) = (y1);\
00363 ppConcat(ilabel,_z1) = (z1);\
00364 ppConcat(ilabel,_x2) = (x2);\
00365 ppConcat(ilabel,_y2) = (y2);\
00366 ppConcat(ilabel,_z2) = (z2);\
00367 ppConcat(ilabel,_x) = ppConcat(ilabel,_x1)<<16;\
00368 ppConcat(ilabel,_y) = ppConcat(ilabel,_y1)<<16;\
00369 ppConcat(ilabel,_z) = ppConcat(ilabel,_z1)<<16;\
00370 ppConcat(ilabel,_dx) = ppConcat(ilabel,_x2) - ppConcat(ilabel,_x1);\
00371 ppConcat(ilabel,_dy) = ppConcat(ilabel,_y2) - ppConcat(ilabel,_y1);\
00372 ppConcat(ilabel,_dz) = ppConcat(ilabel,_z2) - ppConcat(ilabel,_z1);\
00373 ppConcat(ilabel,_dx) = further(ppConcat(ilabel,_dx),1);\
00374 ppConcat(ilabel,_dy) = further(ppConcat(ilabel,_dy),1);\
00375 ppConcat(ilabel,_dz) = further(ppConcat(ilabel,_dz),1);\
00376 ppConcat(ilabel,_remain) = min(abs(ppConcat(ilabel,_dx)),abs(ppConcat(ilabel,_dy)));\
00377 ppConcat(ilabel,_remain) = min(ppConcat(ilabel,_remain),abs(ppConcat(ilabel,_dz)));\
00378 ppConcat(ilabel,_dx) = (ppConcat(ilabel,_dx)<<16)/ppConcat(ilabel,_remain);\
00379 ppConcat(ilabel,_dy) = (ppConcat(ilabel,_dy)<<16)/ppConcat(ilabel,_remain);\
00380 ppConcat(ilabel,_dz) = (ppConcat(ilabel,_dz)<<16)/ppConcat(ilabel,_remain);\
00381 }
00382 #define IncLine3D_Spans_X(ilabel) (abs(ppConcat(ilabel,_dx)) >= abs(ppConcat(ilabel,_dy)) && abs(ppConcat(ilabel,_dx)) >= abs(ppConcat(ilabel,_dz)))
00383 #define IncLine3D_Spans_Y(ilabel) (abs(ppConcat(ilabel,_dy)) > abs(ppConcat(ilabel,_dx)) && abs(ppConcat(ilabel,_dy)) >= abs(ppConcat(ilabel,_dz)))
00384 #define IncLine3D_Spans_Z(ilabel) (abs(ppConcat(ilabel,_dz)) > abs(ppConcat(ilabel,_dx)) && abs(ppConcat(ilabel,_dz)) >= abs(ppConcat(ilabel,_dy)))
00385
00393 #define IncLine3D_Init_Count(ilabel, x1, y1, x2, y2, nSamples ) \
00394 {\
00395 ppConcat(ilabel,_x1) = (x1);\
00396 ppConcat(ilabel,_y1) = (y1);\
00397 ppConcat(ilabel,_z1) = (z1);\
00398 ppConcat(ilabel,_x2) = (x2);\
00399 ppConcat(ilabel,_y2) = (y2);\
00400 ppConcat(ilabel,_z2) = (z2);\
00401 ppConcat(ilabel,_x) = ppConcat(ilabel,_x1)<<16;\
00402 ppConcat(ilabel,_y) = ppConcat(ilabel,_y1)<<16;\
00403 ppConcat(ilabel,_z) = ppConcat(ilabel,_z1)<<16;\
00404 ppConcat(ilabel,_dx) = ppConcat(ilabel,_x2) - ppConcat(ilabel,_x1);\
00405 ppConcat(ilabel,_dy) = ppConcat(ilabel,_y2) - ppConcat(ilabel,_y1);\
00406 ppConcat(ilabel,_dz) = ppConcat(ilabel,_z2) - ppConcat(ilabel,_z1);\
00407 ppConcat(ilabel,_dx) = further(ppConcat(ilabel,_dx),1);\
00408 ppConcat(ilabel,_dy) = further(ppConcat(ilabel,_dy),1);\
00409 ppConcat(ilabel,_dz) = further(ppConcat(ilabel,_dz),1);\
00410 ppConcat(ilabel,_remain) = (nSamples);\
00411 ppConcat(ilabel,_dx) = (ppConcat(ilabel,_dx)<<16)/ppConcat(ilabel,_remain);\
00412 ppConcat(ilabel,_dy) = (ppConcat(ilabel,_dy)<<16)/ppConcat(ilabel,_remain);\
00413 ppConcat(ilabel,_dz) = (ppConcat(ilabel,_dz)<<16)/ppConcat(ilabel,_remain);\
00414 }
00415
00420 #define IncLine3D_Step(ilabel)\
00421 {\
00422 if( ppConcat(ilabel,_remain) > 0 )\
00423 {\
00424 ppConcat(ilabel,_x) += ppConcat(ilabel,_dx);\
00425 ppConcat(ilabel,_y) += ppConcat(ilabel,_dy);\
00426 ppConcat(ilabel,_z) += ppConcat(ilabel,_dz);\
00427 ppConcat(ilabel,_remain)--;\
00428 }\
00429 }
00430
00437 #define IncLine3D_nStep(ilabel,count)\
00438 {\
00439 int nSkip = (count);\
00440 if( nSkip >= ppConcat(ilabel,_remain) )\
00441 {\
00442 ppConcat(ilabel,_x) = ppConcat(ilabel,_x2)<<16;\
00443 ppConcat(ilabel,_y) = ppConcat(ilabel,_y2)<<16;\
00444 ppConcat(ilabel,_z) = ppConcat(ilabel,_z2)<<16;\
00445 } \
00446 else \
00447 {\
00448 ppConcat(ilabel,_x) += ppConcat(ilabel,_dx) * nSkip;\
00449 ppConcat(ilabel,_y) += ppConcat(ilabel,_dy) * nSkip;\
00450 ppConcat(ilabel,_z) += ppConcat(ilabel,_dz) * nSkip;\
00451 ppConcat(ilabel,_remain) -= nSkip;\
00452 }\
00453 }
00454
00460 #define IncLine3D_Remains(ilabel) ( ppConcat(ilabel,_remain) > 0 )
00461
00469 #define IncLine3D_XYZ(ilabel,x,y,z)\
00470 {\
00471 (x) = ppConcat(ilabel,_x)>>16;\
00472 (y) = ppConcat(ilabel,_y)>>16;\
00473 (z) = ppConcat(ilabel,_z)>>16;\
00474 }
00475
00483 #define IncLine3D_NextXYZ(ilabel,x,y,z)\
00484 {\
00485 if( ppConcat(ilabel,_remain) )\
00486 {\
00487 (x) = (ppConcat(ilabel,_x)+ppConcat(ilabel,_dx))>>16;\
00488 (y) = (ppConcat(ilabel,_y)+ppConcat(ilabel,_dy))>>16;\
00489 (z) = (ppConcat(ilabel,_z)+ppConcat(ilabel,_dz))>>16;\
00490 }\
00491 else\
00492 {\
00493 (x) = ppConcat(ilabel,_x2);\
00494 (y) = ppConcat(ilabel,_y2);\
00495 (z) = ppConcat(ilabel,_z2);\
00496 }\
00497 }
00498
00506 #define IncLine3D_foreach(ilabel, iteratorx, iteratory, iteratorz ) \
00507 int iteratorx = ppConcat(ilabel,_x1);\
00508 int iteratory = ppConcat(ilabel,_y1);\
00509 int iteratorz = ppConcat(ilabel,_z1);\
00510 for( ; ppConcat(ilabel,_remain)--; iteratorx = (ppConcat(ilabel,_x) += ppConcat(ilabel,_dx))>>16, iteratory = (ppConcat(ilabel,_y) += ppConcat(ilabel,_dy))>>16, iteratorz = (ppConcat(ilabel,_z) += ppConcat(ilabel,_dz))>>16 )
00511
00522 #define IncLine3D_foreach_spans(ilabel, iteratorx, iteratory, iteratorz, iteratornx, iteratorny, iteratornz ) \
00523 int iteratorx = ppConcat(ilabel,_x1);\
00524 int iteratory = ppConcat(ilabel,_y1);\
00525 int iteratorz = ppConcat(ilabel,_z1);\
00526 int iteratornx, iteratorny, iteratornz;\
00527 IncLine3D_Step(ilabel);\
00528 IncLine3D_XYZ(ilabel, iteratornx, iteratorny, iteratornz );\
00529 for( ; ppConcat(ilabel,_remain)--; iteratorx = iteratornx, iteratory = iteratorny, iteratorz = iteratornz, \
00530 iteratornx = (ppConcat(ilabel,_x) += ppConcat(ilabel,_dx))>>16, \
00531 iteratorny = (ppConcat(ilabel,_y) += ppConcat(ilabel,_dy))>>16, \
00532 iteratornz = (ppConcat(ilabel,_z) += ppConcat(ilabel,_dz))>>16 )
00533
00534
00535
00539 typedef struct LinePath
00540 {
00541 int x1,y1,z1;
00542 unsigned begin;
00543 int x2,y2,z2;
00544 unsigned end;
00545 } LinePath;
00546 void LinePath_init( LinePath* self, int x1,int y1,int z1, unsigned msBegin, int x2,int y2,int z2, unsigned msFinish );
00547 void LinePath_setpos( LinePath* self, int x,int y,int z, unsigned msCurrent );
00548 void LinePath_moveto( LinePath* self, int x,int y,int z, unsigned msCurrent, unsigned msArrive );
00549 bool LinePath_curr( const LinePath* self, int *x,int *y,int *z, unsigned msCurrent );
00550
00554 typedef enum
00555 {
00556 an_Stop,
00557 an_ForwardOneshot,
00558 an_BackwardOneshot,
00559 an_ForwardLoop,
00560 an_BackwardLoop,
00561 an_ForwardPingPong,
00562 an_BackwardPingPong,
00563 an_Random,
00564 } Animator_Dir;
00565
00569 typedef struct Animator
00570 {
00571 int firstFrame;
00572 int iFrame;
00573 int lastFrame;
00574 Animator_Dir aDir;
00575 unsigned msframe;
00576 unsigned msprev;
00577 } Animator;
00578 int Animator_init( Animator* self, int firstFrame, int lastFrame, Animator_Dir dir, unsigned msPerFrame );
00579 int Animator_set( Animator* self, int frame );
00580 bool Animator_curr( Animator* self, int* frame, unsigned msCurrent );
00581 bool Animator_pending( const Animator* self );
00582
00583 #endif