Permalink
Browse files

XEEN: Further fixes for map rendering

  • Loading branch information...
dreammaster committed Dec 7, 2017
1 parent e06d649 commit e400695ae6fad722add9c8054913919f8734e2e1
Showing with 67 additions and 69 deletions.
  1. +30 −30 engines/xeen/dialogs_map.cpp
  2. +37 −39 engines/xeen/interface_minimap.cpp
@@ -318,45 +318,45 @@ void MapDialog::drawIndoors() {
v = map.mazeLookup(Common::Point(xDiff, yDiff), 12);
switch (v) {
case SURFTYPE_DIRT:
case 1:
frame = 18;
break;
case SURFTYPE_GRASS:
case 2:
frame = 34;
break;
case SURFTYPE_SNOW:
case 3:
frame = 22;
break;
case SURFTYPE_SWAMP:
case SURFTYPE_CLOUD:
case 4:
case 13:
frame = 16;
break;
case SURFTYPE_LAVA:
case SURFTYPE_DWATER:
case 5:
case 8:
frame = 2;
break;
case SURFTYPE_DESERT:
case 6:
frame = 30;
break;
case SURFTYPE_ROAD:
case 7:
frame = 32;
break;
case SURFTYPE_TFLR:
case 9:
frame = 20;
break;
case SURFTYPE_SKY:
case 10:
frame = 28;
break;
case SURFTYPE_CROAD:
case 11:
frame = 14;
break;
case SURFTYPE_SEWER:
case 12:
frame = frame2 + 4;
break;
case SURFTYPE_SCORCH:
case 14:
frame = 24;
break;
case SURFTYPE_SPACE:
case 15:
frame = 26;
break;
default:
@@ -369,45 +369,45 @@ void MapDialog::drawIndoors() {
v = map.mazeLookup(Common::Point(xDiff, yDiff), 0);
switch (v) {
case SURFTYPE_DIRT:
case 1:
frame = 19;
break;
case SURFTYPE_GRASS:
case 2:
frame = 35;
break;
case SURFTYPE_SNOW:
case 3:
frame = 23;
break;
case SURFTYPE_SWAMP:
case SURFTYPE_CLOUD:
case 4:
case 13:
frame = 17;
break;
case SURFTYPE_LAVA:
case SURFTYPE_DWATER:
case 5:
case 8:
frame = 3;
break;
case SURFTYPE_DESERT:
case 6:
frame = 31;
break;
case SURFTYPE_ROAD:
case 7:
frame = 33;
break;
case SURFTYPE_TFLR:
case 9:
frame = 21;
break;
case SURFTYPE_SKY:
case 10:
frame = 29;
break;
case SURFTYPE_CROAD:
case 11:
frame = 15;
break;
case SURFTYPE_SEWER:
case 12:
frame = frame2 + 5;
break;
case SURFTYPE_SCORCH:
case 14:
frame = 25;
break;
case SURFTYPE_SPACE:
case 15:
frame = 27;
break;
default:
@@ -174,11 +174,9 @@ void InterfaceMinimap::drawIndoorsMinimap() {
}
// Handle drawing surface sprites partially clipped at the top edge
for (int colNum = 0, xp = MINIMAP_YSTART + (TILE_HEIGHT / 2), xDiff = -3;
colNum < MINIMAP_SIZE; ++colNum, ++xDiff, xp += TILE_WIDTH) {
v = map.mazeLookup(
Common::Point(party._mazePosition.x + xDiff, party._mazePosition.y + 4),
0, 0xffff);
for (int xp = MINIMAP_XSTART + (TILE_WIDTH / 2), mazeX = pt.x - MINIMAP_DIFF;
mazeX <= (pt.x + MINIMAP_DIFF); xp += TILE_WIDTH, ++mazeX) {
v = map.mazeLookup(Common::Point(mazeX, pt.y + MINIMAP_DIFF + 1), 0, 0xffff);
if (v != INVALID_CELL && map._currentSurfaceId &&
(map._currentSteppedOn || party._wizardEyeActive)) {
@@ -306,50 +304,51 @@ void InterfaceMinimap::drawIndoorsMinimap() {
if (mazeX == pt.x && mazeY == pt.y) {
// Center of the minimap. Draw the direction arrow
res._globalSprites.draw(1, party._mazeDirection + 1,
Common::Point(272, 40));
Common::Point(MINIMAP_XSTART + (TILE_WIDTH * 3) + (TILE_WIDTH / 2),
MINIMAP_YSTART + (TILE_HEIGHT * 3) + (TILE_HEIGHT / 2)));
}
v = map.mazeLookup(Common::Point(mazeX, mazeY), 12, 0xffff);
switch (v) {
case SURFTYPE_DIRT:
case 1:
frame = 18;
break;
case SURFTYPE_GRASS:
case 2:
frame = 34;
break;
case SURFTYPE_SNOW:
case 3:
frame = 22;
break;
case SURFTYPE_SWAMP:
case SURFTYPE_CLOUD:
case 4:
case 13:
frame = 16;
break;
case SURFTYPE_LAVA:
case SURFTYPE_DWATER:
case 5:
case 8:
frame = 2;
break;
case SURFTYPE_DESERT:
case 6:
frame = 30;
break;
case SURFTYPE_ROAD:
case 7:
frame = 32;
break;
case SURFTYPE_TFLR:
case 9:
frame = 20;
break;
case SURFTYPE_SKY:
case 10:
frame = 28;
break;
case SURFTYPE_CROAD:
case 11:
frame = 14;
break;
case SURFTYPE_SEWER:
case 12:
frame = frame2 + 4;
break;
case SURFTYPE_SCORCH:
case 14:
frame = 24;
break;
case SURFTYPE_SPACE:
case 15:
frame = 26;
break;
default:
@@ -363,55 +362,54 @@ void InterfaceMinimap::drawIndoorsMinimap() {
v = map.mazeLookup(Common::Point(mazeX, mazeY), 0);
switch (v) {
case SURFTYPE_DIRT:
case 1:
frame = 19;
break;
case SURFTYPE_GRASS:
case 2:
frame = 35;
break;
case SURFTYPE_SNOW:
case 3:
frame = 23;
break;
case SURFTYPE_SWAMP:
case SURFTYPE_CLOUD:
case 4:
case 13:
frame = 17;
break;
case SURFTYPE_LAVA:
case SURFTYPE_DWATER:
case 5:
case 8:
frame = 3;
break;
case SURFTYPE_DESERT:
case 6:
frame = 31;
break;
case SURFTYPE_ROAD:
case 7:
frame = 33;
break;
case SURFTYPE_TFLR:
case 9:
frame = 21;
break;
case SURFTYPE_SKY:
case 10:
frame = 29;
break;
case SURFTYPE_CROAD:
case 11:
frame = 15;
break;
case SURFTYPE_SEWER:
case 12:
frame = frame2 + 5;
break;
case SURFTYPE_SCORCH:
case 14:
frame = 25;
break;
case SURFTYPE_SPACE:
case 15:
frame = 27;
break;
default:
frame = -1;
break;
}
if (v == -1 && (map._currentSteppedOn || party._wizardEyeActive)) {
map._tileSprites.draw(1, frame, Common::Point(xp, yp));
}
if (frame != -1 && (map._currentSteppedOn || party._wizardEyeActive))
map._tileSprites.draw(0, frame, Common::Point(xp, yp));
}
}

0 comments on commit e400695

Please sign in to comment.