Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dev.display.tileData('microTiles') #7438

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading