MCPcopy Create free account
hub / github.com/assaultcube/AC / blockpaste

Function blockpaste

source/src/worldlight.cpp:384–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384void 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
422void blockpaste(const block &b) // fast version, used by dynlight
423{

Callers 8

empty_worldFunction · 0.85
loopvrevFunction · 0.85
undodynlightsFunction · 0.85
netblockpastexyFunction · 0.85
editundoFunction · 0.85
editredoFunction · 0.85
loopvjFunction · 0.85
movemapFunction · 0.85

Calls 2

remipmoreFunction · 0.85
loopirevFunction · 0.70

Tested by

no test coverage detected