Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void TileCopy(TileDataStuff* src, TileDataStuff* dst){
- int srcForm=0;
- int dstForm=0;
- int dstX;
- int dstY;
- int srcX;
- int srcY;
- MyRect CheckRect;
- for(dstX=0; dstX<dst->Width();dstX++ ){
- for(dstY=0; dstY<dst->Height();dstY++ ){
- for(srcX =0; srcX<src->Width();srcX++){
- for(srcY =0; srcY<src->Height();srcY++){
- //Form a new rect to make sure it doesn't go out of bounds
- int FinalSrcX=src->X()+srcX;
- int FinalSrcY=src->Y()+srcY;
- int FinalDstX=dst->X()+srcX+dstX;
- int FinalDstY=dst->Y()+srcY+dstY;
- if(FinalDstY<0 || FinalDstY> dst->Y() + dst->Height()) break;
- if(FinalDstX<0 || FinalDstX> dst->X() + dst->Width()) break;
- dstForm=()*TILEWIDTH + (dst->Y()+srcY+dstY);
- srcForm=(FinalSrcX)*TILEWIDTH+FinalSrcY;
- dst[dstForm]=src[srcForm];
- }
- }
- dstX+=src->Width();
- dstY+=src->Height();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement