0

我已经在我的机器(版本 1.5.1)中构建了 libtocd dll,但是当我使用 win32 控制台项目运行 samples_cpp.cpp 时。一些混乱字体显示为附图。有谁知道为什么会这样?非常感谢您的回复。

我发现如果我在 main 函数中注释这段代码,结果会很好。但我不知道根本原因。以前的:

int fontFlags=TCOD_FONT_TYPE_GREYSCALE|TCOD_FONT_LAYOUT_TCOD, fontNewFlags=0; 

====>

较新:

int fontFlags=TCOD_FONT_TYPE_GREYSCALE/*|TCOD_FONT_LAYOUT_TCOD*/, fontNewFlags=0;

结果img如下: 在此处输入链接描述

抱歉,使用图片 URL 来发布图片的信誉少于 10 个。

PS:构建libtcod dll时的另一个问题:使用zlib-1.2.3时,在头文件zconf.h中,我需要更改如下,原:

#if 1           /* HAVE_UNISTD_H -- this line is updated by ./configure */

====>

较新:

#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */

否则,编译器输出头文件 unistd.h 找不到。

4

1 回答 1

0

The font that Samples.cpp is using has a different layout than other fonts.

'|TCOD_FONT_LAYOUT_TCOD' tells the computer how to read the file and get the correct characters, so by commenting that part out, it uses the wrong layout for that file.

Out of curiosity, why are you building libtcod.dll? if you're just using libtcod itself, you shouldn't need to recompile the whole thing.

于 2013-11-11T23:31:54.943 回答