1 /*
2 * IceBreaker
3 * Copyright (c) 2000-2002 Matthew Miller <mattdm@mattdm.org> and
4 *   Enrico Tassi <gareuselesinge@infinito.it>
5 *
6 * <http://www.mattdm.org/icebreaker/>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc., 59
20 * Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23 
24 #include <SDL.h>
25 #include "icebreaker.h"
26 #include "globals.h"
27 #include "options.h"
28 #include "laundry.h"
29 #include "text.h"
30 #include "fullscreen.h"
31 
32 #define CAPTIONSIZE 3
33 #define TITLEBORDER 5
34 
drawtitlebar(const char * title)35 void drawtitlebar(const char *title)
36 {
37 	SDL_Rect titlebar;
38 
39 	if (gameflags.isfullscreen)
40 	{
41 		titlebar.h=CHARHEIGHT*CAPTIONSIZE+TITLEBORDER*2;
42 		titlebar.w=WIDTH; // gettextwidth(CAPTIONSIZE,title)+TITLEBORDER*2;
43 		titlebar.x=(FULLWIDTH - WIDTH)/2;
44 		titlebar.y=FULLTOPMARGIN - titlebar.h - TITLEBORDER*3;
45 
46 		SDL_FillRect(fullscreen,&titlebar,SDL_MapRGB(screen->format,0,0,0));
47 		sputtext(fullscreen,titlebar.x+TITLEBORDER, titlebar.y+TITLEBORDER, CAPTIONSIZE,SDL_MapRGB(screen->format,192,192,192),(char*)title);
48 		soil(titlebar);
49 	}
50 
51 	SDL_WM_SetCaption(title,"IceBreaker");
52 }
53