home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / sprites / demosrc / smscores.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-25  |  2.1 KB  |  55 lines

  1. /**********************************************************************
  2. * smscores.h
  3. * Hi-score handling module for the StarMines
  4. **********************************************************************
  5.                     This file is part of
  6.  
  7.           STK -- The sprite toolkit -- version 1.1
  8.  
  9.               Copyright (C) Jari Karjala 1991
  10.  
  11. The sprite toolkit (STK) is a FreeWare toolkit for creating high
  12. resolution sprite graphics with PCompatible hardware. This toolkit 
  13. is provided as is without any warranty or such thing. See the file
  14. COPYING for further information.
  15.  
  16. **********************************************************************
  17. **********************************************************************/
  18.  
  19. #define SCORE_COUNT         5
  20. #define SCORE_MAX_NAME_LEN  20
  21. #define SCORE_FILE          "sm      .scr"
  22.  
  23. typedef struct {
  24.     char name[SCORE_MAX_NAME_LEN];
  25.     long score;
  26. } SCORE_ENTRY;
  27.  
  28. /**********************************************************************
  29. * Initialize the hiscores. Read them from file, if file found.
  30. **********************************************************************/
  31. void smscores_init(void);
  32.  
  33. /**********************************************************************
  34. * Check whether the score if high enough
  35. * Return: The place in the hall of fame (1..MAX)
  36. **********************************************************************/
  37. int smscores_check(long score);
  38.  
  39. /**********************************************************************
  40. * Add the given entry to the list, if it is high enough.
  41. * Return: 0 if success, -1 if score was too low.
  42. **********************************************************************/
  43. int smscores_add(SCORE_ENTRY *entry);
  44.  
  45. /**********************************************************************
  46. * Return the highest score.
  47. **********************************************************************/
  48. SCORE_ENTRY *smscores_get_first(void);
  49.  
  50. /**********************************************************************
  51. * Return the next scores.
  52. **********************************************************************/
  53. SCORE_ENTRY *smscores_get_next(void);
  54.