MCPcopy Create free account
hub / github.com/diasurgical/devilution / LoadMapObjects

Function LoadMapObjects

Source/objects.cpp:543–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541}
542
543void LoadMapObjects(BYTE *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx)
544{
545 int rw, rh, i, j, oi;
546 BYTE *lm;
547 long mapoff;
548
549 InitObjFlag = TRUE;
550
551 lm = pMap + 2;
552 rw = pMap[0];
553 rh = *lm;
554 mapoff = (rw * rh + 1) * 2;
555 rw <<= 1;
556 rh <<= 1;
557 mapoff += rw * 2 * rh * 2;
558 lm += mapoff;
559
560 for (j = 0; j < rh; j++) {
561 for (i = 0; i < rw; i++) {
562 if (*lm) {
563 AddObject(ObjTypeConv[*lm], startx + 16 + i, starty + 16 + j);
564 oi = ObjIndex(startx + 16 + i, starty + 16 + j);
565 SetObjMapRange(oi, x1, y1, x1 + w, y1 + h, leveridx);
566 }
567 lm += 2;
568 }
569 }
570 InitObjFlag = FALSE;
571}
572
573void LoadMapObjs(BYTE *pMap, int startx, int starty)
574{

Callers 1

AddDiabObjsFunction · 0.85

Calls 3

AddObjectFunction · 0.85
ObjIndexFunction · 0.85
SetObjMapRangeFunction · 0.85

Tested by

no test coverage detected