[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-users] PG_Application::SetBackground(...)
From: |
H. C. |
Subject: |
[paragui-users] PG_Application::SetBackground(...) |
Date: |
Sun, 9 Feb 2003 03:20:51 +0100 |
Hi, what about adding a common third background mode, BKMODE_CENTER ?
The only things to be additionally added:
bool PG_Application::SetBackground(const char* filename, int mode) {
...
if (mode == BKMODE_CENTER)
RedrawBackground(PG_Rect((screen->w - my_background->w) / 2,
(screen->h - my_background->h) / 2, my_background->w, my_background->h));
else
RedrawBackground(PG_Rect(0,0,screen->w,screen->h));
...
}
bool PG_Application::SetBackground(SDL_Surface* surface, int mode) {
...
if (mode == BKMODE_CENTER)
RedrawBackground(PG_Rect((screen->w - my_background->w) / 2,
(screen->h - my_background->h) / 2, my_background->w, my_background->h));
else
RedrawBackground(PG_Rect(0,0,screen->w,screen->h));
...
}
void PG_Application::RedrawBackground(const PG_Rect& rect) {
...
} else if (my_backmode == BKMODE_CENTER) {
PG_Draw::DrawTile(screen, rect, rect, my_background);
} else {
PG_Draw::DrawTile(screen, screenrect, rect, my_background);
}
}
By the way, please answer my last message :|
Looking forward to "hearing" from you!
- [paragui-users] PG_Application::SetBackground(...),
H. C. <=