QDENGINE: Added debug output for text rendering

This commit is contained in:
Eugene Sandulenko 2024-09-28 23:43:19 +02:00
parent c69b520163
commit b668795f34
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
4 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,7 @@ static const DebugChannelDef debugFlagList[] = {
{ QDEngine::kDebugTemp, "temp", "Enable temporary tracing" },
{ QDEngine::kDebugQuant, "quant", "Enable quant tracing"},
{ QDEngine::kDebugMinigames, "minigames", "Enable minigames tracing"},
{ QDEngine::kDebugText, "text", "Enable text tracing"},
DEBUG_CHANNEL_END
};

View File

@ -20,6 +20,7 @@
*/
#include "common/stream.h"
#include "common/debug.h"
#include "qdengine/qd_fwd.h"
#include "qdengine/xmath.h"
@ -164,6 +165,8 @@ void qdScreenText::redraw(const Vect2i &owner_pos) const {
const grFont *font = qdGameDispatcher::get_dispatcher()->find_font(_text_format.font_type());
debugC(1, kDebugText, "qdScreenText::redraw([%d, %d]): '%s'", x, y, transCyrillic(data()));
grDispatcher::instance()->drawAlignedText(x, y, _size.x, _size.y, col, data(), grTextAlign(_text_format.alignment()), 0, 0, font);
if (g_engine->_debugDraw)
grDispatcher::instance()->rectangle(x, y, _size.x, _size.y, col, 0, GR_OUTLINED);

View File

@ -55,7 +55,8 @@ enum QDEngineDebugChannels {
kDebugTemp,
kDebugQuant,
kDebugMinigames,
kDebugMovement
kDebugMovement,
kDebugText,
};
class QDEngineEngine : public Engine {

View File

@ -901,6 +901,8 @@ bool grDispatcher::drawAlignedText(int x, int y, int sx, int sy, uint32 color, c
if (!font || !font->alpha_buffer())
return false;
debugC(4, kDebugText, "grDispatcher::drawAlignedText([%d, %d], [%d, %d], color: %d, '%s', align: %d, ...", x, y, sx, sy, color, transCyrillic(str), align);
const byte *str_buf = reinterpret_cast<const byte *>(str);
if (!sx)