projects
/
ccbs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9af970
)
Make my_draw_text() clip horizontally.
author
Steinar H. Gunderson
<sgunderson@bigfoot.com>
Sat, 19 Feb 2005 19:16:03 +0000
(19:16 +0000)
committer
Steinar H. Gunderson
<sgunderson@bigfoot.com>
Sat, 19 Feb 2005 19:16:03 +0000
(19:16 +0000)
bigscreen/fonts.cpp
patch
|
blob
|
history
diff --git
a/bigscreen/fonts.cpp
b/bigscreen/fonts.cpp
index
e65e356
..
a2ac91b
100644
(file)
--- a/
bigscreen/fonts.cpp
+++ b/
bigscreen/fonts.cpp
@@
-68,7
+68,9
@@
unsigned my_draw_text(const widestring &str, unsigned char *buf, double size, in
unsigned char *dst = buf + dsty * 800*4 + (x + xpos + slot->bitmap_left)*4;
unsigned char *src = bm->buffer + y * bm->width;
- for (xx = 0; xx < bm->width; xx++) {
+
+ int width = (x + xpos + slot->bitmap_left + bm->width >= 800) ? (799 - x - xpos - slot->bitmap_left) : bm->width;
+ for (xx = 0; xx < width; xx++) {
*dst = (*dst * (256-*src) + r * *src) >> 8;
*dst++;
*dst = (*dst * (256-*src) + g * *src) >> 8;