1 /***************************************************************************
4 begin : Mon Sep 24 2001
5 copyright : (C) 2001 by Michael Speck
6 email : kulkanie@gmx.net
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
19 ====================================================================
21 ====================================================================
27 int new_entry
; /* newly entered the highscore */
30 ====================================================================
31 Levelset highscore chart.
32 ====================================================================
34 enum { CHART_ENTRY_COUNT
= 10 };
36 Chart_Entry entries
[CHART_ENTRY_COUNT
+ 1]; /* last entry is space holder for new entry */
41 ====================================================================
42 Load highscore. If it doesn't exist try to create it in HI_DIR if
43 this fails fall back to ~/.lbreakout and create highscore there.
44 ====================================================================
48 ====================================================================
50 ====================================================================
54 ====================================================================
55 Save chart in directory it was loaded from.
56 ====================================================================
60 ====================================================================
61 Check if this player entered the highscore chart and update it.
62 ====================================================================
64 void chart_add( Set_Chart
*chart
, char *name
, int level
, int score
);
66 ====================================================================
67 Sort chart with stable algorithm (bubble sort's ok) by wanted
69 ====================================================================
71 enum { SORT_BY_LEVEL
= 0, SORT_BY_SCORE
};
72 void chart_sort( Set_Chart
*chart
, int type
);
74 ====================================================================
75 Draw highscores centered in regio x,y,w,h
76 ====================================================================
78 void chart_show( Set_Chart
*chart
, int x
, int y
, int w
, int h
);
80 ====================================================================
81 Draw highscores centered in regio x,y,w,h but in a more compact way
82 (no title). Also don't use chart_pos (except for x).
83 ====================================================================
85 void chart_show_compact( Set_Chart
*chart
, int x
, int y
, int w
, int h
);
87 ====================================================================
88 Clear all new_entry flags (done before new players are added
89 to chart when game over).
90 ====================================================================
92 void chart_clear_new_entries();
94 ====================================================================
95 Query set chart by this name or if not found create a new one
97 ====================================================================
99 Set_Chart
* chart_set_query( const char *name
);
101 ====================================================================
102 Query chart by id. If id is invalid return 0.
103 ====================================================================
105 Set_Chart
* chart_set_query_id( int id
);