diff options
author | Johannes Schickel | 2008-12-29 14:37:51 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-12-29 14:37:51 +0000 |
commit | 8ea422f415f30fc5e996f09815c0cd395151267a (patch) | |
tree | d4ebe34b757180772f44e48b1f01859d23dfb78f /engines/kyra/screen_lol.cpp | |
parent | 28a5a18a217aaa649b8f89f580b293f0fe34de63 (diff) | |
download | scummvm-rg350-8ea422f415f30fc5e996f09815c0cd395151267a.tar.gz scummvm-rg350-8ea422f415f30fc5e996f09815c0cd395151267a.tar.bz2 scummvm-rg350-8ea422f415f30fc5e996f09815c0cd395151267a.zip |
- Cleanup
- Implemented Screen_LoL::fprintString
svn-id: r35608
Diffstat (limited to 'engines/kyra/screen_lol.cpp')
-rw-r--r-- | engines/kyra/screen_lol.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index c6b47a9ca9..1698c54bbf 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -43,13 +43,43 @@ const ScreenDim *Screen_LoL::getScreenDim(int dim) { return &_screenDimTable[dim]; } +void Screen_LoL::fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint16 flags, ...) { + debugC(9, kDebugLevelScreen, "Screen_LoL::fprintString('%s', %d, %d, %d, %d, %d, ...)", format, x, y, col1, col2, flags); + if (!format) + return; + + char string[240]; + va_list vaList; + va_start(vaList, flags); + vsnprintf(string, sizeof(string), format, vaList); + va_end(vaList); + + if (flags & 1) + x -= getTextWidth(string) >> 1; + + if (flags & 2) + x -= getTextWidth(string); + + if (flags & 4) { + printText(string, x - 1, y, 1, col2); + printText(string, x, y + 1, 1, col2); + } + + if (flags & 8) { + printText(string, x - 1, y, 227, col2); + printText(string, x, y + 1, 227, col2); + } + + printText(string, x, y, col1, col2); +} + void Screen_LoL::fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint16 flags, ...) { debugC(9, kDebugLevelScreen, "Screen_LoL::fprintStringIntro('%s', %d, %d, %d, %d, %d, %d, ...)", format, x, y, c1, c2, c3, flags); char buffer[400]; va_list args; va_start(args, flags); - vsprintf(buffer, format, args); + vsnprintf(buffer, sizeof(buffer), format, args); va_end(args); if ((flags & 0x0F00) == 0x100) |