Skip to content

Commit

Permalink
Add dev.display.tileData('microTiles')
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Sep 27, 2024
1 parent 67f822f commit c4d9416
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,26 @@ bool GetDebugGridText(Point dungeonCoords, char *debugGridTextBuffer)
}
break;
}
case DebugGridTextItem::microTiles: {
std::string result;
const MICROS &micros = DPieceMicros[dPiece[dungeonCoords.x][dungeonCoords.y]];
for (const LevelCelBlock tile : micros.mt) {
if (!tile.hasValue()) break;
if (!result.empty()) result += '\n';
StrAppend(result, tile.frame(), " ");
switch (tile.type()) {
case TileType::Square: StrAppend(result, "S"); break;
case TileType::TransparentSquare: StrAppend(result, "T"); break;
case TileType::LeftTriangle: StrAppend(result, "<"); break;
case TileType::RightTriangle: StrAppend(result, ">"); break;
case TileType::LeftTrapezoid: StrAppend(result, "\\"); break;
case TileType::RightTrapezoid: StrAppend(result, "/"); break;
}
}
if (result.empty()) return false;
*BufCopy(debugGridTextBuffer, result) = '\0';
return true;
} break;
case DebugGridTextItem::dPiece:
info = dPiece[dungeonCoords.x][dungeonCoords.y];
break;
Expand Down
1 change: 1 addition & 0 deletions Source/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extern uint32_t glEndSeed[NUMLEVELS];

enum class DebugGridTextItem : uint16_t {
None,
microTiles,
dPiece,
dTransVal,
dLight,
Expand Down
3 changes: 2 additions & 1 deletion Source/lua/modules/dev/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ std::string DebugCmdFullbright(std::optional<bool> on)

std::string DebugCmdShowTileData(std::optional<std::string_view> dataType)
{
static const std::array<std::string_view, 21> DataTypes {
static const std::array<std::string_view, 22> DataTypes {
"microTiles",
"dPiece",
"dTransVal",
"dLight",
Expand Down

0 comments on commit c4d9416

Please sign in to comment.