| 382 | } |
| 383 | |
| 384 | void blockpaste(const block &b, int bx, int by, bool light, uchar *texmap) // slow version, editmode only |
| 385 | { |
| 386 | const sqr *q = (const sqr *)((&b)+1); |
| 387 | sqr *dest = 0; |
| 388 | uchar tr, tg, tb; |
| 389 | |
| 390 | for(int y = by; y<b.ys+by; y++) |
| 391 | for(int x = bx; x<b.xs+bx; x++) |
| 392 | { |
| 393 | dest = S(x,y); |
| 394 | |
| 395 | // retain light info for edit mode paste |
| 396 | tr = dest->r; |
| 397 | tg = dest->g; |
| 398 | tb = dest->b; |
| 399 | |
| 400 | *dest = *q; |
| 401 | |
| 402 | if(texmap) |
| 403 | { // translate texture slot numbers |
| 404 | dest->wtex = texmap[q->wtex]; |
| 405 | dest->ctex = texmap[q->ctex]; |
| 406 | dest->ftex = texmap[q->ftex]; |
| 407 | dest->utex = texmap[q->utex]; |
| 408 | } |
| 409 | |
| 410 | if (light) //edit mode paste |
| 411 | { |
| 412 | dest->r = tr; |
| 413 | dest->g = tg; |
| 414 | dest->b = tb; |
| 415 | } |
| 416 | q++; |
| 417 | } |
| 418 | block bb = { bx, by, b.xs, b.ys }; |
| 419 | remipmore(bb); |
| 420 | } |
| 421 | |
| 422 | void blockpaste(const block &b) // fast version, used by dynlight |
| 423 | { |
no test coverage detected