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

Function GetAutomapType

Source/automap.cpp:506–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506WORD GetAutomapType(int x, int y, BOOL view)
507{
508 WORD rv;
509
510 if (view && x == -1 && y >= 0 && y < DMAXY && automapview[0][y]) {
511 if (GetAutomapType(0, y, FALSE) & (MAPFLAG_DIRT << 8)) {
512 return 0;
513 } else {
514 return MAPFLAG_DIRT << 8;
515 }
516 }
517
518 if (view && y == -1 && x >= 0 && x < DMAXY && automapview[x][0]) {
519 if (GetAutomapType(x, 0, FALSE) & (MAPFLAG_DIRT << 8)) {
520 return 0;
521 } else {
522 return MAPFLAG_DIRT << 8;
523 }
524 }
525
526 if (x < 0 || x >= DMAXX) {
527 return 0;
528 }
529 if (y < 0 || y >= DMAXX) {
530 return 0;
531 }
532 if (!automapview[x][y] && view) {
533 return 0;
534 }
535
536 rv = automaptype[(BYTE)dungeon[x][y]];
537 if (rv == 7) {
538 if ((GetAutomapType(x - 1, y, FALSE) >> 8) & MAPFLAG_HORZARCH) {
539 if ((GetAutomapType(x, y - 1, FALSE) >> 8) & MAPFLAG_VERTARCH) {
540 rv = 1;
541 }
542 }
543 }
544 return rv;
545}
546
547void DrawAutomapText()
548{

Callers 2

DrawAutomapFunction · 0.85
SetAutomapViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected