| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
map or set.count() can test the presence of a given key and return 0 or 1
outright.
|
|
|
|
|
|
| |
This stops the tons of warnings, while allowing building for both old
and new C++ standards. And if we wanted to use shared_ptr or something,
now we can without being ambiguous.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
|
|
|
|
|
|
|
| |
This worked for DejaVu Sans, but failed on a number of other fonts.
(cherry picked from commit e0ba98f9c56185d8bc650df4df9d49b4bb428e4b)
[commit message rewritten -- 1KB]
|
|\
| |
| |
| |
| |
| | |
It lacks an actual font yet, but I realized we need to check if drivers
people use actually support sub-textures -- and if not, there'll be some
rethinking needed.
|
| | |
|
| |
| |
| |
| |
| | |
While ucs_t happens to be "unsigned int" inside, labelling some random
indices this way is likely to introduce errors in the future.
|
| |
| |
| |
| | |
It got unmanageably large.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
GCC seems to handle values above 255, but let's better play it safe.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
printf("%c", 191) is an undefined operation, and won't work on any modern
system. Better to just write what was requested.
Using "%lc" may not work in non-Unicode locales, but hey, it's a debugging
thing.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The maximum number of glyphs is fixed at 256, (which is enough for languages
with latin-like characters), but is easily increased via some constants in
fontwrapper-ft.cc, with a memory trade-off.
Features of this code:
- any character in the font can be rendered
- if crawl tries to render more than the max number of glyphs, it will crash
- if crawl tries to render a glyph not in the font, an upside-down question
mark will be printed instead
- for each fontwrapper instance (font face, size and attributes), this keeps
an array of pixels and an equivalent texture in memory for 256 possible
glyphs. This is why increasing the number of available glyphs pushes
memory use up
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
| |
Conflicts:
crawl-ref/source/startup.cc
|
|
|
|
|
|
|
|
|
| |
It looks worse to me, but that's a matter of taste. Preferably, we'd use
system settings, but that'd require using fontconfig (needed for full
Unicode support anyway) and can't be done on Windows since system settings
there are not applicable to FreeType. We'd be able to at most switch
between sub-pixel and grayscale hinting, not "light" hinting as in this
option.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to its documentation, FT_New_Face() expects the file's name in
UTF-8 regardless of the system locale. Too bad, there's a bug where
sometimes on Windows an 8 bit code page is used instead:
http://www.mail-archive.com/freetype@nongnu.org/msg00939.html
Since we don't know if the version we're talking to is fixed or not,
it's safer to load the font file ourselves.
This fixes cases where zipped (not installed) builds were put into
a directory with a non-ASCII name.
|
|
|
|
|
| |
There's no stderr there for graphical programs, except for cygwin which adds
it as a part of Unix emulation.
|
|
|
|
|
|
|
| |
The code for menu icons removing the hotkey header is ugly like hell :(
Not rewriting this sanely for now, but it needs to be killed with fire,
and the header stored separately.
|
|\ |
|
| |
| |
| |
| |
| | |
This makes it less likely that the tooltip information covers the
message area.
|
| | |
|
|/
|
|
|
|
| |
now.
Word wrapping is yet to be corrected, just like in other UIs.
|
|
|
|
|
|
|
|
|
|
| |
'malloc.h' is missing on Mac OS X, but is needed to define alloca() on
platforms such as MinGW.
The easiest solution is to simply use a function other than alloca()
for this task.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
|
|
|
|
|
| |
Not having malloc.h included caused a linker error (undefined reference
to alloca) for me on mingw.
|
|
|
|
|
|
|
| |
Remove any non-const-reference parameters. Change const pointer
parameters to const reference parameters. Change all draw(NULL, NULL)
calls to just draw(). Also, refactor to remove pretranslate and prescale
parameters from draw calls.
|
| |
|
|
|
|
|
|
| |
Storing member variable pointers to data, even const ones, is sketchy.
Better to depend on compiler optimizations to eliminate redundant
variable copies.
|
|
|
|
|
| |
This simplifies code that was setting and unsetting the global current
colour manually.
|
|
|
|
|
| |
This avoids weird global state setting and then querying in the next
function.
|
| |
|
|
|
|
| |
Applying standards, simplifying code, removing redundant comments.
|
|
|
|
| |
State should always be set prior to drawing, so no need to restore it.
|
|
|
|
| |
Don't alloc/delete every time a string is drawn.
|
|
|
|
|
| |
It's not really used anywhere at this point, and it's better to call
clear explicitly when the draw buffer needs to be refilled.
|
|
|
|
|
|
| |
This will force all drawing to be done through VertBuffer.
Signed-off-by: Enne Walker <enne.walker@gmail.com>
|
|
|
|
| |
Signed-off-by: Enne Walker <enne.walker@gmail.com>
|
|
|
|
|
| |
This was done by pushing ImageManager to tiletex.h, where it better
belongs.
|
| |
|
|
|
|
|
|
|
| |
glwrapper-ogl.cc, windowmanager-sdl.cc, and fontwrapper-ft.cc now contain
the static functions for their parent class's factory create. This
allows new implementations to be added without requiring modification of
the generic file (with #ifdefs).
|
|
|
|
|
|
| |
No spaces on parens. Line up function params. Sort includes more
rationally. Put curly braces on their own line. Don't C-style typedef
enum and structs. Put if-clauses on their own line.
|