1 #ifndef _HIGHSCORE_H_ 2 #define _HIGHSCORE_H_ 3 4 /* 5 * XBoing - An X11 blockout style computer game 6 * 7 * (c) Copyright 1993, 1994, 1995, Justin C. Kibell, All Rights Reserved 8 * 9 * The X Consortium, and any party obtaining a copy of these files from 10 * the X Consortium, directly or indirectly, is granted, free of charge, a 11 * full and unrestricted irrevocable, world-wide, paid up, royalty-free, 12 * nonexclusive right and license to deal in this software and 13 * documentation files (the "Software"), including without limitation the 14 * rights to use, copy, modify, merge, publish, distribute, sublicense, 15 * and/or sell copies of the Software, and to permit persons who receive 16 * copies from any such party to do so. This license includes without 17 * limitation a license to do the foregoing actions under any patents of 18 * the party supplying this software to the X Consortium. 19 * 20 * In no event shall the author be liable to any party for direct, indirect, 21 * special, incidental, or consequential damages arising out of the use of 22 * this software and its documentation, even if the author has been advised 23 * of the possibility of such damage. 24 * 25 * The author specifically disclaims any warranties, including, but not limited 26 * to, the implied warranties of merchantability and fitness for a particular 27 * purpose. The software provided hereunder is on an "AS IS" basis, and the 28 * author has no obligation to provide maintenance, support, updates, 29 * enhancements, or modifications. 30 */ 31 32 /* 33 * ========================================================================= 34 * 35 * $Id: highscore.h,v 1.1.1.1 1994/12/16 01:36:51 jck Exp $ 36 * $Source: /usr5/legends/jck/xb/master/xboing/include/highscore.h,v $ 37 * $Revision: 1.1.1.1 $ 38 * $Date: 1994/12/16 01:36:51 $ 39 * 40 * $Log: highscore.h,v $ 41 * Revision 1.1.1.1 1994/12/16 01:36:51 jck 42 * The XBoing distribution requires configuration management. This is why the 43 * cvs utility is being used. This is the initial import of all source etc.. 44 * 45 * 46 * ========================================================================= 47 */ 48 49 /* 50 * Dependencies on other include files: 51 */ 52 53 #include <X11/Xlib.h> 54 #include <sys/time.h> 55 #include <sys/types.h> 56 57 /* 58 * Constants and macros: 59 */ 60 61 #define PERSONAL 1 62 #define GLOBAL 2 63 64 #define SCORE_VERSION 2 65 66 /* 67 * Type declarations: 68 */ 69 70 enum HighScoreStates 71 { 72 HIGHSCORE_TITLE, 73 HIGHSCORE_SHOW, 74 HIGHSCORE_WAIT, 75 HIGHSCORE_SPARKLE, 76 HIGHSCORE_FINISH 77 }; 78 79 typedef struct 80 { 81 u_long version; /* Highscore File version */ 82 char masterText[80]; /* Boing Masters words of wisdom */ 83 } highScoreHeader; 84 85 typedef struct 86 { 87 u_long score; /* Score */ 88 u_long level; /* delta Level reached */ 89 time_t gameTime; /* Time taken to complete game */ 90 time_t time; /* Date when played */ 91 char name[40]; /* Full user name */ 92 uid_t userId; /* Real user id of player */ 93 } highScoreEntry; 94 95 /* 96 * Function prototypes: 97 */ 98 99 #if NeedFunctionPrototypes 100 void SetUpHighScore(Display *display, Window window, Colormap colormap); 101 void HighScore(Display *display, Window window); 102 void RedrawHighScore(Display *display, Window window); 103 void FreeHighScore(Display *display); 104 void ResetHighScore(int type); 105 int ReadHighScoreTable(int type); 106 int WriteHighScoreTable(int type); 107 int CheckAndAddScoreToHighScore(u_long score, u_long level, time_t gameTime, 108 int type, char *message); 109 int GetHighScoreRanking(u_long score); 110 void CommandlineHighscorePrint(void); 111 void SetNickName(char *nick); 112 char *GetNickName(void); 113 void SetBoingMasterText(char *message); 114 #else 115 void SetBoingMasterText(); 116 char *GetNickName(); 117 void SetNickName(); 118 void CommandlineHighscorePrint(); 119 void SetUpHighScore(); 120 void HighScore(); 121 void RedrawHighScore(); 122 void FreeHighScore(); 123 void ResetHighScore(); 124 int ReadHighScoreTable(); 125 int WriteHighScoreTable(); 126 int CheckAndAddScoreToHighScore(); 127 int GetHighScoreRanking(); 128 #endif 129 130 extern enum HighScoreStates HighScoreState; 131 132 #endif 133