summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-01-18 14:14:13 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-01-18 14:14:13 +0000
commitcdf69c700c4a3e5a50a8b9b30c497eb05b7155d8 (patch)
tree26d65e5305906f32ba26223c8816db648cd3e1cc /src
parente7fdf567fe53e45c00564dc1b5244e81686e89e6 (diff)
downloadmana-cdf69c700c4a3e5a50a8b9b30c497eb05b7155d8.tar.gz
mana-cdf69c700c4a3e5a50a8b9b30c497eb05b7155d8.tar.bz2
mana-cdf69c700c4a3e5a50a8b9b30c497eb05b7155d8.tar.xz
mana-cdf69c700c4a3e5a50a8b9b30c497eb05b7155d8.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/gui/chat.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 8c08b545..4f2655a2 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -95,11 +95,20 @@ void ChatBox::draw(gcn::Graphics *graphics)
graphics->drawRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
getAbsolutePosition(x, y);
- //set_trans_blender(0, 0, 0, 100);
- //drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0);
- //rectfill(buffer, x, y, x + getWidth(), y + getHeight(),
- // makecol(255, 255, 255));
- //drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0);
+
+ SDL_Rect SourceRect, ScreenRect;
+ SourceRect.x = SourceRect.y = 0;
+ SourceRect.w = ScreenRect.w = getWidth();
+ SourceRect.h = ScreenRect.h = getHeight();
+ ScreenRect.x = x;
+ ScreenRect.y = y;
+ SDL_Surface *ChatBoxBackground = SDL_AllocSurface(SDL_HWSURFACE, getWidth(),getHeight(), (screen->format->BytesPerPixel*8), 0, 0, 0, 0);
+ Uint32 Color = SDL_MapRGB(screen->format, 255, 255, 255);
+ SDL_FillRect(ChatBoxBackground, &SourceRect, Color);
+ SDL_SetAlpha(ChatBoxBackground, SDL_SRCALPHA, 120);
+ SDL_BlitSurface(ChatBoxBackground, &SourceRect, screen, &ScreenRect);
+ SDL_FreeSurface(ChatBoxBackground);
+ //delete ChatBoxBackground;
for (iter = chatlog.begin(); iter != chatlog.end(); iter++) {
line = *iter;