1 /*
2 * IceBreaker
3 * Copyright (c) 2000-2002 Matthew Miller <mattdm@mattdm.org>
4 *
5 * <http://www.mattdm.org/icebreaker/>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc., 59
19 * Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22 
23 #include <SDL.h>
24 
25 #include "icebreaker.h"
26 #include "text.h"
27 #include "globals.h"
28 #include "hiscore.h"
29 #include "laundry.h"
30 #include "status.h"
31 #include "themes.h"
32 
updatestatuslives(int lives)33 void updatestatuslives(int lives)
34 {
35 	SDL_Rect tmprect;
36 	char tmptext[30]; // should be plenty big.
37 
38 	tmprect.h=CHARHEIGHT*2; tmprect.w=LIVESW;
39 	tmprect.x=LIVESX; tmprect.y=STATUSY;
40 
41 	SDL_FillRect(screen,&tmprect,color.background);
42 
43 	snprintf(tmptext,30,"LIVES: %d",lives);
44 	puttext(LIVESX,STATUSY,2,color.normaltext,tmptext);
45 
46 	soil(tmprect);
47 
48 }
49 
updatestatuscleared(int clear)50 void updatestatuscleared(int clear)
51 {
52 	SDL_Rect tmprect;
53 	char tmptext[30]; // should be plenty big.
54 
55 	tmprect.h=CHARHEIGHT*2; tmprect.w=CLEAREDW;
56 	tmprect.x=CLEAREDX; tmprect.y=STATUSY;
57 
58 
59 	SDL_FillRect(screen,&tmprect,color.background);
60 
61 	snprintf(tmptext,30, "CLEARED: %d%%",clear);
62 	puttext(CLEAREDX,STATUSY,2,color.normaltext,tmptext);
63 
64 	soil(tmprect);
65 
66 }
67 
updatestatusscore(long score)68 void updatestatusscore(long score)
69 {
70 	SDL_Rect tmprect;
71 	char tmptext[30]; // should be plenty big.
72 
73 	tmprect.h=CHARHEIGHT*2; tmprect.w=SCOREW;
74 	tmprect.x=SCOREX; tmprect.y=STATUSY;
75 
76 	SDL_FillRect(screen,&tmprect,color.background);
77 
78 	snprintf(tmptext,30, "SCORE: %ld",score);
79 	puttext(SCOREX,STATUSY,2,color.normaltext,tmptext);
80 
81 	soil(tmprect);
82 }
83 
84 
85 
updatehiscorebox()86 extern void updatehiscorebox()
87 {
88 	SDL_Rect tmprect;
89 
90 	char tmptext[40]; // should be plenty big.
91 
92 	tmprect.x=LIVESX; tmprect.y=BOTTOMSTATUSY;
93 	tmprect.h=CHARHEIGHT*3;; tmprect.w=WIDTH-(CHARWIDTH*2*4)-MARGINRIGHT-4-LIVESX-2;
94 
95 
96 	SDL_FillRect(screen,&tmprect,color.background);
97 
98 	snprintf(tmptext,40,"HIGH SCORE: %ld (%s)",hiscoreval[0],hiscorename[0]);
99 	puttext(tmprect.x,tmprect.y+3,2,color.normaltext,tmptext);
100 
101 	soil(tmprect);
102 }
103